|
Functions | |
| static void * | memcpy (void *dest, const void *src, size_t n) |
| Copy memory area. | |
| static void * | memset (void *s, int c, size_t n) |
| Initialize memory area. | |
| static int | strcmp (const char *str1, const char *str2) |
| Compare two strings str1 and str2. | |
| static int | strncmp (const char *str1, const char *str2, size_t n) |
| Compare the first n characters of two strings str1 and str2. | |
| static size_t | strlen (const char *str) |
| Calculate the length of a string. | |
Generic String Implementation | |
For testing purposes, and for architectures which don't have or need optimized implementations of the standard string operations, a generic, non-optimized implementation is available for the all string operations. If you need access to these generic string operations, you need to set | |
| void * | generic_memcpy (void *dest, const void *src, size_t n) |
| void * | generic_memset (void *s, int c, size_t n) |
| size_t | generic_strlen (const char *str) |
| int | generic_strcmp (const char *str1, const char *str2) __nonnull(1 |
| int int | generic_strncmp (const char *str1, const char *str2, size_t n) __nonnull(1 |
String operations are standard functions for copying, initializing and searching memory. They tend to get used a lot, so they are usually highly optimized for each particular architecture or even CPU implementation.
| void* generic_memcpy | ( | void * | dest, | |
| const void * | src, | |||
| size_t | n | |||
| ) |
Copy memory area. Copy n bytes from src to dest.
| dest | Pointer to the destination memory area. | |
| src | Pointer to the source memory area. | |
| n | The number of bytes to copy. |
Definition at line 41 of file generic_memcpy.c.
Referenced by memcpy().
| void* generic_memset | ( | void * | s, | |
| int | c, | |||
| size_t | n | |||
| ) |
Initialize memory area. Fill the first n bytes of the memory area s with the constant byte value c.
| s | Pointer to the memory area to be filled. | |
| c | The byte value to use as fill value. | |
| n | The number of bytes to initialize. |
Definition at line 41 of file generic_memset.c.
Referenced by memset().
| int generic_strcmp | ( | const char * | str1, | |
| const char * | str2 | |||
| ) |
Compare two strings str1 and str2.
| str1 | A '\+'-terminated string | |
| str2 | A '\+'-terminated string |
| Negative | if str1 is smaller than str2 | |
| Zero | if str1 is equal to str2 | |
| Positive | if str1 is greater than str2 |
Referenced by strcmp().
| size_t generic_strlen | ( | const char * | str | ) |
Calculate the length of a string.
| str | A '\0'-terminated string |
Definition at line 41 of file generic_strlen.c.
Referenced by strlen().
| int int generic_strncmp | ( | const char * | str1, | |
| const char * | str2, | |||
| size_t | n | |||
| ) |
Compare the first n characters of two strings str1 and str2.
| str1 | A '\+'-terminated string | |
| str2 | A '\+'-terminated string | |
| n | Numbers of characters to compare |
| Negative | if str1 is smaller than str2 | |
| Zero | if str1 is equal to str2 | |
| Positive | if str1 is greater than str2 |
Referenced by strncmp().
| void * memcpy | ( | void * | dest, | |
| const void * | src, | |||
| size_t | n | |||
| ) | [inline, static] |
Copy memory area.
Copy n bytes from src to dest.
| dest | Pointer to the destination memory area. | |
| src | Pointer to the source memory area. | |
| n | The number of bytes to copy. |
Definition at line 43 of file string.h.
References generic_memcpy().
Referenced by stream_priv_write(), and tsfs_get_filename().
| void * memset | ( | void * | s, | |
| int | c, | |||
| size_t | n | |||
| ) | [inline, static] |
Initialize memory area.
Fill the first n bytes of the memory area s with the constant byte value c.
| s | Pointer to the memory area to be filled. | |
| c | The byte value to use as fill value. | |
| n | The number of bytes to initialize. |
Definition at line 48 of file string.h.
References generic_memset().
Referenced by snprintf(), sprintf(), and zalloc().
| int strcmp | ( | const char * | str1, | |
| const char * | str2 | |||
| ) | [inline, static] |
Compare two strings str1 and str2.
| str1 | A '\+'-terminated string | |
| str2 | A '\+'-terminated string |
| Negative | if str1 is smaller than str2 | |
| Zero | if str1 is equal to str2 | |
| Positive | if str1 is greater than str2 |
Definition at line 58 of file string.h.
References generic_strcmp().
| size_t strlen | ( | const char * | str | ) | [inline, static] |
Calculate the length of a string.
| str | A '\0'-terminated string |
Definition at line 53 of file string.h.
References generic_strlen().
Referenced by stream_priv_putstr(), wtk_button_create(), wtk_check_box_create(), wtk_frame_create(), wtk_label_change(), wtk_label_create(), and wtk_radio_button_create().
| int strncmp | ( | const char * | str1, | |
| const char * | str2, | |||
| size_t | n | |||
| ) | [inline, static] |
Compare the first n characters of two strings str1 and str2.
| str1 | A '\+'-terminated string | |
| str2 | A '\+'-terminated string | |
| n | Numbers of characters to compare |
| Negative | if str1 is smaller than str2 | |
| Zero | if str1 is equal to str2 | |
| Positive | if str1 is greater than str2 |
Definition at line 63 of file string.h.
References generic_strncmp().
1.6.3