libexplain  1.4.D001
Functions
libexplain/string_list.c File Reference
#include <libexplain/ac/ctype.h>
#include <libexplain/ac/stdlib.h>
#include <libexplain/ac/string.h>
#include <libexplain/malloc.h>
#include <libexplain/string_list.h>
#include <libexplain/strndup.h>

Go to the source code of this file.

Functions

void explain_string_list_constructor (explain_string_list_t *slp)
void explain_string_list_destructor (explain_string_list_t *slp)
static int explain_string_list_member (const explain_string_list_t *slp, const char *text)
void explain_string_list_append_unique (explain_string_list_t *slp, const char *text)
void explain_string_list_append (explain_string_list_t *slp, const char *text)
void explain_string_list_append_n (explain_string_list_t *slp, const char *text, size_t text_size)
void explain_string_list_split (explain_string_list_t *result, const char *text)
static int cmp (const void *a, const void *b)
void explain_string_list_sort (explain_string_list_t *slp)

Function Documentation

static int cmp ( const void *  a,
const void *  b 
) [static]

Definition at line 133 of file string_list.c.

void explain_string_list_append ( explain_string_list_t slp,
const char *  text 
)

The explain_string_list_append function is used to add another string to the end of the list. The string is *always* copied.

Parameters:
slpThe string list to operate on.
textThe string to be appended.

Definition at line 79 of file string_list.c.

void explain_string_list_append_n ( explain_string_list_t slp,
const char *  text,
size_t  tsize 
)

The explain_string_list_append_n function is used to add another string to the end of the list. The string is *always* copied.

Parameters:
slpThe string list to operate on.
textThe string to be appended.
tsizeThe length of the string to be appended.

Definition at line 86 of file string_list.c.

void explain_string_list_append_unique ( explain_string_list_t slp,
const char *  text 
)

The explain_string_list_append_unique function is used to add another string to the end of the list, provided that the string is not already in the list. The string is *always* copied if it is used.

Parameters:
slpThe string list to operate on.
textThe string to be appended.

Definition at line 71 of file string_list.c.

The explain_string_list_constructor function is used to prepare a string list for use.

Parameters:
slpThe string list to operate on.

Definition at line 30 of file string_list.c.

The explain_string_list_destruct function is used to release the resources held by a string list, when you are done with it.

Parameters:
slpThe string list to operate on.

Definition at line 39 of file string_list.c.

static int explain_string_list_member ( const explain_string_list_t slp,
const char *  text 
) [static]

Definition at line 59 of file string_list.c.

The explain_string_list_sort function is used to sort a string list into ascending lexicographical order.

Parameters:
slpThe string list to operate on.

Definition at line 140 of file string_list.c.

void explain_string_list_split ( explain_string_list_t result,
const char *  text 
)

The explain_string_list_split function may be used to break a string to to several string in a string_list_t. The parts are separated by white space.

Parameters:
resultWhere to put the strings.
textThe text to be split into words.

Definition at line 107 of file string_list.c.