# stringlist.h File Reference

`#include <gwenhywfar/gwenhywfarapi.h>`

Go to the source code of this file.

## Typedefs

typedef GWEN_STRINGLISTSTRUCT | GWEN_STRINGLIST
typedef GWEN_STRINGLISTENTRYSTRUCT | GWEN_STRINGLISTENTRY

## Functions

GWENHYWFAR_API void | GWEN_StringList_AppendEntry (GWEN_STRINGLIST *sl, GWEN_STRINGLISTENTRY *se)
GWENHYWFAR_API int | GWEN_StringList_AppendString (GWEN_STRINGLIST *sl, const char *s, int take, int checkDouble)
GWENHYWFAR_API void | GWEN_StringList_Clear (GWEN_STRINGLIST *sl)
GWENHYWFAR_API unsigned int | GWEN_StringList_Count (const GWEN_STRINGLIST *sl)
GWENHYWFAR_API GWEN_STRINGLIST * | GWEN_StringList_dup (const GWEN_STRINGLIST *sl)
GWENHYWFAR_API GWEN_STRINGLISTENTRY * | GWEN_StringList_FirstEntry (const GWEN_STRINGLIST *sl)
GWENHYWFAR_API const char * | GWEN_StringList_FirstString (const GWEN_STRINGLIST *l)
GWENHYWFAR_API void * | GWEN_StringList_ForEach (const GWEN_STRINGLIST *l, void *(*func)(const char *s, void *u), void *user_data)
GWENHYWFAR_API void | GWEN_StringList_free (GWEN_STRINGLIST *sl)
GWENHYWFAR_API int | GWEN_StringList_HasString (const GWEN_STRINGLIST *sl, const char *s)
GWENHYWFAR_API int | GWEN_StringList_InsertString (GWEN_STRINGLIST *sl, const char *s, int take, int checkDouble)
GWENHYWFAR_API GWEN_STRINGLIST * | GWEN_StringList_new ()
GWENHYWFAR_API void | GWEN_StringList_RemoveEntry (GWEN_STRINGLIST *sl, GWEN_STRINGLISTENTRY *se)
GWENHYWFAR_API int | GWEN_StringList_RemoveString (GWEN_STRINGLIST *sl, const char *s)
void | GWEN_StringList_SetIgnoreRefCount (GWEN_STRINGLIST *sl, int i)
void | GWEN_StringList_SetSenseCase (GWEN_STRINGLIST *sl, int i)
GWENHYWFAR_API const char * | GWEN_StringListEntry_Data (const GWEN_STRINGLISTENTRY *se)
GWENHYWFAR_API void | GWEN_StringListEntry_free (GWEN_STRINGLISTENTRY *sl)
GWENHYWFAR_API GWEN_STRINGLISTENTRY * | GWEN_StringListEntry_new (const char *s, int take)
GWENHYWFAR_API GWEN_STRINGLISTENTRY * | GWEN_StringListEntry_Next (const GWEN_STRINGLISTENTRY *se)
GWENHYWFAR_API void | GWEN_StringListEntry_ReplaceString (GWEN_STRINGLISTENTRY *e, const char *s, int take)

## Typedef Documentation

typedef struct GWEN_STRINGLISTSTRUCT GWEN_STRINGLIST

typedef struct GWEN_STRINGLISTENTRYSTRUCT GWEN_STRINGLISTENTRY

## Function Documentation

GWENHYWFAR_API void GWEN_StringList_AppendEntry | ( | GWEN_STRINGLIST * | sl,
|  | GWEN_STRINGLISTENTRY * | se
| ) |

GWENHYWFAR_API int GWEN_StringList_AppendString | ( | GWEN_STRINGLIST * | sl,
|  | const char * | s,
|  | int | take,
|  | int | checkDouble
| ) |

Appends a string.

Returns:
  0 if not appended, !=0 if appended

Parameters:

  | take | if true then the StringList takes over ownership of the string
  | checkDouble | if true the the string will only be appended if it does not already exist

GWENHYWFAR_API void GWEN_StringList_Clear | ( | GWEN_STRINGLIST * | sl | ) |

GWENHYWFAR_API unsigned int GWEN_StringList_Count | ( | const GWEN_STRINGLIST * | sl | ) |

GWENHYWFAR_API GWEN_STRINGLIST* GWEN_StringList_dup | ( | const GWEN_STRINGLIST * | sl | ) |

GWENHYWFAR_API GWEN_STRINGLISTENTRY* GWEN_StringList_FirstEntry | ( | const GWEN_STRINGLIST * | sl | ) |

GWENHYWFAR_API const char* GWEN_StringList_FirstString | ( | const GWEN_STRINGLIST * | l | ) |

GWENHYWFAR_API void* GWEN_StringList_ForEach | ( | const GWEN_STRINGLIST * | l,
|  | void *(*)(const char *s, void *u) | func,
|  | void * | user_data
| ) |

Traverses the list, calling the callback function 'func' on each list element. Traversal will stop when 'func' returns a non-NULL value, and the routine will return with that value. Otherwise the routine will return NULL.

Parameters:

  | l | The list to traverse.
  | func | The function to be called with each list element.
  | user_data | A pointer passed on to the function 'func'.

Returns:
  The non-NULL pointer returned by 'func' as soon as it returns one. Otherwise (i.e. 'func' always returns NULL) returns NULL.

GWENHYWFAR_API void GWEN_StringList_free | ( | GWEN_STRINGLIST * | sl | ) |

GWENHYWFAR_API int GWEN_StringList_HasString | ( | const GWEN_STRINGLIST * | sl,
|  | const char * | s
| ) |

Checks whether the given string already exists within in the string list.

Returns:
  !=0 if found, 0 otherwise

GWENHYWFAR_API int GWEN_StringList_InsertString | ( | GWEN_STRINGLIST * | sl,
|  | const char * | s,
|  | int | take,
|  | int | checkDouble
| ) |

Inserts a string.

Returns:
  0 if not inserted, !=0 if inserted

Parameters:

  | take | if true then the StringList takes over ownership of the string
  | checkDouble | if true the the string will only be appended if it does not already exist

GWENHYWFAR_API GWEN_STRINGLIST* GWEN_StringList_new | ( |  | ) |

GWENHYWFAR_API void GWEN_StringList_RemoveEntry | ( | GWEN_STRINGLIST * | sl,
|  | GWEN_STRINGLISTENTRY * | se
| ) |

GWENHYWFAR_API int GWEN_StringList_RemoveString | ( | GWEN_STRINGLIST * | sl,
|  | const char * | s
| ) |

Removes a given string from the stringlist.

Returns:
  0 if not found, !=0 if found and removed

void GWEN_StringList_SetIgnoreRefCount | ( | GWEN_STRINGLIST * | sl,
|  | int | i
| ) |

Normally this group of functions ignores reference counters on stringlist entries when removing a string via GWEN_StringList_RemoveString. You can change this behaviour here.

Parameters:

  | sl | string list
  | i | if 0 then reference counters are honoured

void GWEN_StringList_SetSenseCase | ( | GWEN_STRINGLIST * | sl,
|  | int | i
| ) |

Normally this group of functions ignores cases when comparing two strings. You can change this behaviour here.

Parameters:

  | sl | string list
  | i | if 0 then cases are ignored

GWENHYWFAR_API const char* GWEN_StringListEntry_Data | ( | const GWEN_STRINGLISTENTRY * | se | ) |

GWENHYWFAR_API void GWEN_StringListEntry_free | ( | GWEN_STRINGLISTENTRY * | sl | ) |

GWENHYWFAR_API GWEN_STRINGLISTENTRY* GWEN_StringListEntry_new | ( | const char * | s,
|  | int | take
| ) |

GWENHYWFAR_API GWEN_STRINGLISTENTRY* GWEN_StringListEntry_Next | ( | const GWEN_STRINGLISTENTRY * | se | ) |

GWENHYWFAR_API void GWEN_StringListEntry_ReplaceString | ( | GWEN_STRINGLISTENTRY * | e,
|  | const char * | s,
|  | int | take
| ) |