Implementation of the functions for working with the SplitList structure that is used for splitting a string based on one or more delimiters. More...

Go to the source code of this file.
Functions | |
| void | SplitList_Initialize (SplitList *list) |
| Initialize the given SplitList object. | |
| void | SplitList_Clear (SplitList *list) |
| Clear the given SplitList object so it can be reused again. Releases the list of sub-strings (but does not delete the sub-strings themselves, which are assumed to be pointers into an existing string). | |
| void | SplitList_AddString (SplitList *list, const char *s) |
| Add a string to the given SplitList object. The string is not duplicated but instead is just copied into the list. | |
| void | split (char *s, const char *splitChars, SplitList *components) |
| Split the given path into multiple strings based on the given delimiter. The pointers to each string are returned in the given StringList object. | |
Implementation of the functions for working with the SplitList structure that is used for splitting a string based on one or more delimiters.
Definition in file split.c.
| void split | ( | char * | s, |
| const char * | splitChars, | ||
| SplitList * | components | ||
| ) |
Split the given path into multiple strings based on the given delimiter. The pointers to each string are returned in the given StringList object.
| s | String to split into components. Will be altered. |
| splitChars | A list of one or more characters on which to split the string. If NULL or empty, defaults to a single space. |
| components | A SplitList object that will be updated with pointers to the sub-strings and the count of sub-strings. This object is cleared of any previous strings before being filled up again. |
Definition at line 72 of file split.c.
References SplitList_AddString(), and SplitList_Clear().
Referenced by _FindEntry(), _State_DisplayText(), and getcursorposition().
| void SplitList_AddString | ( | SplitList * | list, |
| const char * | s | ||
| ) |
Add a string to the given SplitList object. The string is not duplicated but instead is just copied into the list.
Definition at line 46 of file split.c.
References SplitList::strings, and SplitList::strings_count.
Referenced by split().
| void SplitList_Clear | ( | SplitList * | list | ) |
Clear the given SplitList object so it can be reused again. Releases the list of sub-strings (but does not delete the sub-strings themselves, which are assumed to be pointers into an existing string).
| list | A SplitList object to clear. |
Definition at line 30 of file split.c.
References SplitList::strings, and SplitList::strings_count.
Referenced by _FindEntry(), getcursorposition(), and split().
| void SplitList_Initialize | ( | SplitList * | list | ) |
Initialize the given SplitList object.
| list | A SplitList object to initialize. |
Definition at line 15 of file split.c.
References SplitList::strings, and SplitList::strings_count.