#include "SYS_API.h"#include <ctype.h>#include <string.h>Go to the source code of this file.
Functions | |
| char * | SYSstrtok (char *string, const char *delimit, char **context) |
| size_t | SYSstrlcpy (char *dest, const char *src, size_t size) |
| size_t | SYSstrlcat (char *dest, const char *src, size_t size) |
| bool | SYSisspace (char c) |
| bool | SYSisspace (unsigned char c) |
| bool | SYSisspace (int c) |
| bool SYSisspace | ( | int | c | ) | [inline] |
Definition at line 193 of file SYS_String.h.
| bool SYSisspace | ( | unsigned char | c | ) | [inline] |
Definition at line 187 of file SYS_String.h.
| bool SYSisspace | ( | char | c | ) | [inline] |
Definition at line 179 of file SYS_String.h.
| size_t SYSstrlcat | ( | char * | dest, | |
| const char * | src, | |||
| size_t | size | |||
| ) | [inline] |
The following implements the strlcpy() function from OpenBSD. The differences between strlcpy() and strncpy() are:
Definition at line 154 of file SYS_String.h.
| size_t SYSstrlcpy | ( | char * | dest, | |
| const char * | src, | |||
| size_t | size | |||
| ) | [inline] |
The semantics for strncpy() leave a little to be desired
Definition at line 128 of file SYS_String.h.
| char* SYSstrtok | ( | char * | string, | |
| const char * | delimit, | |||
| char ** | context | |||
| ) | [inline] |
A standard name for a strtok that doesn't maintain state between calls. This version is thus both reentrant and threadsafe. SYSstrtok parses a string into a sequence of tokens. On the first call to SYSstrtok, the string to be parsed must be specified as the parameter 'string'. This parameter *will be modified* (destroying your copy). 'delimit' specifies an array of single characters that will be used as delimiters. 'context' is a char * variable used internally by SYSstrtok to maintain context between calls. Subsequent calls must specify the same unchanged context variable as the first call. To use SYSstrtok, on the first call first pass in your string as the parameter 'string'; on subsequent calls, pass it in as NULL. SYSstrtok returns non-empty strings pointing to the first non-delimiter character of each token, or NULL if no further tokens are available. Example:
char *string = strdup(getString()); char *strptr = string; char *context; char *token = SYSstrtok(string, MY_DELIMITERS, &context); while (token) { do_some_stuff(); SYSstrtok(NULL, MY_DELIMITERS, &context); } free(strptr);
Definition at line 70 of file SYS_String.h.
1.5.9