See Also: Tokenize(), Auxilary
A StringList is an array of pointers to strings. The last element is in the pointer is array is NULL. The array, and the strings pointed to are all allocated with HMalloc().
char **DuplicateStringList( list );
char **list;
The string list to be duplicated.
A new StringList is returned.
See Also: Tokenize(), DestroyStringList(), CountStringList()
A StringList is an array of pointers to strings. The last element is in the pointer is array is NULL. The array, and the strings pointed to are all allocated with HMalloc().
int CountStringList( list );
char **list;
The string list for which the string entries are
to be counted
A count of the number of strings in the passed string list is
returned.
See Also: Tokenize(), DestroyStringList(), DuplicateStringList()
int StringListsEqual( list1, list2 );
char **list1;
The first string lists to compare.
char **list2;
The second string list to compare.
TRUE is returned if the lists are equivelent.
See Also: DestroyStringList()
A StringList is an array of pointers to strings. The last element is in the pointer is array is NULL. The array, and the strings pointed to are all allocated with HMalloc().
void DestroyStringList( list );
char **list;
The string list to be destroyed.
See Also: Tokenize(), CountStringList(), DuplicateStringList(), AddStringList(), AddStringToList()
char **AddStringList( target_list, source_list );
char **target_list;
The StringList to which the source_list will
be added.
char **source_list;
The StringList to be added to the target_list.
The modified target_list is returned.
See Also: DestroyStringList(), AddStringToList()
char **AddStringToList( target_list, new_string );
char **target_list;
The StringList to which the new_string will
be added. A new string list will be created
when target_list == NULL.
char *new_string;
The new string to duplicate and add to the StringList.
The modified target_list is returned.
See Also: DestroyStringList(), AddStringList()
char ** DeleteStringListEntry( papszStringList, int nEntry );
char ** papszStringList;
The string list from which the entry should be removed.
int nEntry;
The entry in the string list array to be removed.
The return result is the modified string list.
int FindEntryInStringList( papszStringList, pszTarget );
char **papszStringList;
The StringList to search through.
const char *pszTarget;
The string to search for.
The index of the string is returned if it was found. Otherwise -1 is
returned.
See Also: DestroyStringList(), AddStringToList()
To search for subsequent occurances of the same string call FindRegexInStringList() again but add the index+1 of the previously found entry to papszStringList pointer.
int FindRegexInStringList( papszStringList, pszRegex );
char **papszStringList;
The StringList to search through.
const char *pszRegex;
A regular expression for the list entry being searched for.
The index of the matching string is returned if it was found.
Otherwise -1 is returned.
See Also: IMPRegex()
int ReplaceStringInList(char **target_list, const char *new_string,
int index);
char **target_list;
The StringList that need to be updated.
char *new_string;
The new string to add.
int index;
The index at which the new string will be added.
For a successful replacement, 0 is returned, else -1 is returned.
See Also: CountStringList(), AddStringList()
char **FileToStringList( pszFilename );
const char *pszFilename;
The name of the text file to read.
The return result of this function is a StringList, or NULL if the
file doesn't exist or can't be opened.
See Also: DKReadLine(), DKOpen(), DestroyStringList().
TBool StringListToFile( papszStringList, pszFilename );
char **papszStringList;
The list of strings to write to the file.
const char *pszFilename;
The file to write them to.
The function returns FALSE if it fails, or TRUE if it succeeds. The
file should not already exist, but if it does the function will fail
without altering the existing file.
See Also: DKOpen()
int InsertStringInList(char **target_list, const char *new_string,
int index, TBool bAfter);
char **target_list;
The StringList that need to be updated.
char *new_string;
The new string to add.
int index;
The index at which the new string will be added.
TBool bAfter;
If TRUE, the string will be added after the specified item,
or if FALSE, the string will be added before the sprecified item.
See Also: AddStringToList(), ReplaceStringInList()