Name
afc_stringnode_add -- Adds a new string in the StringNode list
Synopsis
char * afc_stringnode_add
( StringNode * sn, char * str, unsigned long mode );
Description
this function adds a new string to the StringNode.
Inputs
- sn
an handler to an already allocated StringNode structure.
- str
the string you wish to add.
- mode
Where the new string will be added to the list.
Possible values are:
- AFC_STRINGNODE_ADD_TAIL
Add the string to the end of the list.
- AFC_STRINGNODE_ADD_HEAD
Add the string as the first item in the list.
- AFC_STRINGNODE_ADD_HERE
Add the string right next the previous item in the list.
Note
The string will not be added directly to the list, but a copy of it will. So it is completely
safe to reuse the same buffer to add more than one single line to your StringNode. For the same
reason, also static char strings are wellcome.