Sturk 1.0.2
Publish-subscribe C implementation.
|
String utilities. More...
Go to the source code of this file.
Functions | |
VX_LIST (struct StStrList, char *) | |
This is a macro definition of the struct StStrList type. | |
VX_CIRQ (struct StStrQ, char *) | |
This is a macro definition of the struct StStrQ type. | |
ST_DICT (struct StStrBag, union {int n;void *align;}) | |
This is a macro definition of the struct StStrBag type. | |
char * | st_newstr (const char *str) |
struct StStrList * | st_strlist_ins (struct StStrList *list, char *str) |
Insert a string into a list. | |
char * | st_strlist_rem (struct StStrList **listp) |
Remove a string from a list. | |
struct StStrQ * | st_strq_ins (struct StStrQ *q, char *str) |
Insert a string into a queue. | |
char * | st_strq_rem (struct StStrQ **qp) |
Remove a string from a queue. | |
struct StStrBag * | st_strbag_ins (struct StStrBag *bag, const char *str) |
Insert a string into a bag. | |
struct StStrBag * | st_strbag_rem (struct StStrBag *bag, const char *str) |
Remove a string from a bag. | |
int | st_strbag_count (const struct StStrBag *bag) |
For a bag entry, get the occurence count of its string. | |
void | st_strbag_destroy (struct StStrBag *bag) |
Destroy the whole bag of strings. | |
String utilities.
char * st_newstr | ( | const char * | str | ) |
int st_strbag_count | ( | const struct StStrBag * | bag | ) |
For a bag entry, get the occurence count of its string.
[in] | bag | The bag entry. |
void st_strbag_destroy | ( | struct StStrBag * | bag | ) |
Destroy the whole bag of strings.
[in,out] | bag | Any entry from the bag. |
Insert a string into a bag.
[in,out] | bag | The root of the bag. |
[in] | str | The string. |
This will increment the occurence count of the string.
Remove a string from a bag.
[in,out] | bag | The root of the bag. |
[in] | str | The string. |
This will decrement the occurence count of the string. Negative counts are supported.
Insert a string into a list.
[in,out] | list | The head of the list. |
[in] | str | The string. |
char * st_strlist_rem | ( | struct StStrList ** | listp | ) |
Remove a string from a list.
[in,out] | listp | A double pointer to the head fo the list. |
Insert a string into a queue.
[in,out] | q | The head of the queue. |
[in] | str | The string. |
char * st_strq_rem | ( | struct StStrQ ** | qp | ) |
Remove a string from a queue.
[in,out] | qp | A double pointer to the head of the queue. |