Data Structures | |
struct | string |
Defines | |
#define | STP_STRING_SIZE 2048 |
Maximum string size allowed in Strings. | |
#define | _stp_string_cat(str1, str2) |
ConCATenate (append) a String or C string to a String. | |
Typedefs | |
typedef string * | String |
Functions | |
String | _stp_string_init (int num) |
Initialize a String for our use. | |
void | _stp_sprintf (String str, const char *fmt,...) |
Sprintf into a String. | |
void | _stp_vsprintf (String str, const char *fmt, va_list args) |
Vsprintf into a String Use this if your function already has a va_list. | |
void | _stp_string_cat_cstr (String str1, const char *str2) |
ConCATenate (append) a C string to a String. | |
void | _stp_string_cat_string (String str1, String str2) |
ConCATenate (append) a String to a String. | |
char * | _stp_string_ptr (String str) |
Get a pointer to String's buffer For rare cases when a C string is needed and you have a String. |
It is also not a good idea to dynamically allocate space for strings with kmalloc(). That leaves us with statically allocated space for strings. This is what is implemented in the String module. Strings use preallocated per-cpu buffers and are safe to use (unlike C strings).
|
Value: ({ \ if (__builtin_types_compatible_p (typeof (str2), char[])) { \ char *x = (char *)str2; \ _str_string_cat_cstr(str1,x); \ } else { \ String x = (String)str2; \ _str_string_cat_string(str1,x); \ } \ }) This macro selects the proper function to call.
|
|
Sprintf into a String. Like printf, except output goes into a String. Safe because overflowing the buffer is not allowed. Size is limited by length of String, STP_STRING_SIZE.
Definition at line 77 of file string.c. References STP_STRING_SIZE. Referenced by _stp_symbol_sprint(). |
|
ConCATenate (append) a C string to a String. Like strcat().
Definition at line 106 of file string.c. References STP_STRING_SIZE. |
|
ConCATenate (append) a String to a String. Like strcat().
Definition at line 121 of file string.c. References STP_STRING_SIZE. |
|
Initialize a String for our use. This grabs one of the global Strings for our use.
Definition at line 42 of file string.c. References _stp_log(). |
|
Get a pointer to String's buffer For rare cases when a C string is needed and you have a String. One example is when you want to print a String with _stp_printf().
|
|
Vsprintf into a String Use this if your function already has a va_list. You probably want _stp_sprintf(). Definition at line 92 of file string.c. References STP_STRING_SIZE. |