ekg2  GIT master
Struktury danych | Definicje | Definicje typów | Funkcje
Dokumentacja pliku dynstuff.h
Ten wykres pokazuje, które pliki bezpośrednio lub pośrednio załączają ten plik:

Idź do kodu źródłowego tego pliku.

Struktury danych

struct  list
 
struct  string
 
struct  private_data_s
 

Definicje

#define LIST_ADD_COMPARE(x, type)   int x(const type data1, const type data2)
 
#define LIST_ADD_SORTED2(list, data, comp)   list_add_sorted3((list_t *) (void *) list, (list_t) data, (void *) comp)
 
#define LIST_ADD_BEGINNING2(list, data)   list_add_beginning3((list_t *) (void *) list, (list_t) data)
 
#define LIST_ADD2(list, data)   list_add3((list_t *) (void *) list, (list_t) data)
 
#define LIST_COUNT2(list)   list_count((list_t) list)
 
#define LIST_REMOVE2(list, elem, func)   list_remove3((list_t *) (void *) list, (list_t) elem, (void *) func)
 
#define LIST_UNLINK2(list, elem)   list_unlink3((list_t *) (void *) list, (list_t) elem)
 
#define LIST_FREE_ITEM(x, type)   void x(type data)
 
#define LIST_DESTROY2(list, func)   list_destroy3((list_t) list, (void *) func)
 

Definicje typów

typedef struct listlist_t
 
typedef struct stringstring_t
 
typedef struct private_data_s private_data_t
 

Funkcje

void * list_add_beginning (list_t *list, void *data)
 
void * list_add3 (list_t *list, list_t new)
 
void * list_add_sorted3 (list_t *list, list_t new, int(*comparision)(void *, void *))
 
void list_add_beginning3 (list_t *list, list_t new)
 
void * list_remove3 (list_t *list, list_t elem, void(*func)(list_t))
 
void * list_remove3i (list_t *list, list_t elem, void(*func)(list_t data))
 
void * list_unlink3 (list_t *list, list_t elem)
 
int list_destroy (list_t list)
 
int list_destroy3 (list_t list, void(*func)(void *))
 
void list_cleanup (list_t *list)
 
int list_remove_safe (list_t *list, void *data)
 
string_t string_init (const char *str)
 
int string_append (string_t s, const char *str)
 
int string_append_n (string_t s, const char *str, int count)
 
int string_append_c (string_t s, char ch)
 
int string_append_raw (string_t s, const char *str, int count)
 
void string_remove (string_t s, int count)
 
char * string_free (string_t s, int free_string)
 
char ** array_make (const char *string, const char *sep, int max, int trim, int quotes)
 
char * array_join (char **array, const char *sep)
 
int array_add (char ***array, char *string)
 
int array_add_check (char ***array, char *string, int casesensitive)
 
int array_count (char **array)
 
int array_item_contains (char **array, const char *string, int casesensitive)
 
void array_free (char **array)
 
const char * ekg_itoa (long int i)
 
void private_item_set (private_data_t **data, const char *item_name, const char *value)
 
int private_item_get_int (private_data_t **data, const char *item_name)
 
void private_items_destroy (private_data_t **data)
 

Dokumentacja definicji

◆ LIST_ADD2

#define LIST_ADD2 (   list,
  data 
)    list_add3((list_t *) (void *) list, (list_t) data)

◆ LIST_ADD_BEGINNING2

#define LIST_ADD_BEGINNING2 (   list,
  data 
)    list_add_beginning3((list_t *) (void *) list, (list_t) data)

◆ LIST_ADD_COMPARE

#define LIST_ADD_COMPARE (   x,
  type 
)    int x(const type data1, const type data2)

◆ LIST_ADD_SORTED2

#define LIST_ADD_SORTED2 (   list,
  data,
  comp 
)    list_add_sorted3((list_t *) (void *) list, (list_t) data, (void *) comp)

◆ LIST_COUNT2

#define LIST_COUNT2 (   list)    list_count((list_t) list)

◆ LIST_DESTROY2

#define LIST_DESTROY2 (   list,
  func 
)    list_destroy3((list_t) list, (void *) func)

◆ LIST_FREE_ITEM

#define LIST_FREE_ITEM (   x,
  type 
)    void x(type data)

◆ LIST_REMOVE2

#define LIST_REMOVE2 (   list,
  elem,
  func 
)    list_remove3((list_t *) (void *) list, (list_t) elem, (void *) func)

◆ LIST_UNLINK2

#define LIST_UNLINK2 (   list,
  elem 
)    list_unlink3((list_t *) (void *) list, (list_t) elem)

Dokumentacja definicji typów

◆ list_t

typedef struct list* list_t

◆ private_data_t

◆ string_t

typedef struct string* string_t

Dokumentacja funkcji

◆ array_add()

int array_add ( char ***  array,
char *  string 
)

◆ array_add_check()

int array_add_check ( char ***  array,
char *  string,
int  casesensitive 
)

◆ array_count()

int array_count ( char **  array)

◆ array_free()

void array_free ( char **  array)

◆ array_item_contains()

int array_item_contains ( char **  array,
const char *  string,
int  casesensitive 
)

◆ array_join()

char* array_join ( char **  array,
const char *  sep 
)

◆ array_make()

char** array_make ( const char *  string,
const char *  sep,
int  max,
int  trim,
int  quotes 
)

◆ ekg_itoa()

const char* ekg_itoa ( long int  i)

◆ list_add3()

void* list_add3 ( list_t list,
list_t  new 
)

◆ list_add_beginning()

void* list_add_beginning ( list_t list,
void *  data 
)

list_add_beginning()

Add item data to the begining of the list
(Once again), item will be added at begining of the list - as first item

Zobacz również
list_add()
list_remove()

◆ list_add_beginning3()

void list_add_beginning3 ( list_t list,
list_t  new 
)

◆ list_add_sorted3()

void* list_add_sorted3 ( list_t list,
list_t  new,
int(*)(void *, void *)  comparision 
)

◆ list_cleanup()

void list_cleanup ( list_t list)

list_cleanup()

Remove from list_t all items with l->data set to NULL.
Use with list_remove_safe() after list is not in use.

◆ list_destroy()

int list_destroy ( list_t  list)

◆ list_destroy3()

int list_destroy3 ( list_t  list,
void(*)(void *)  func 
)

◆ list_remove3()

void* list_remove3 ( list_t list,
list_t  elem,
void(*)(list_t func 
)

◆ list_remove3i()

void* list_remove3i ( list_t list,
list_t  elem,
void(*)(list_t data)  func 
)

◆ list_remove_safe()

int list_remove_safe ( list_t list,
void *  data 
)

◆ list_unlink3()

void* list_unlink3 ( list_t list,
list_t  elem 
)

◆ private_item_get_int()

int private_item_get_int ( private_data_t **  data,
const char *  item_name 
)

◆ private_item_set()

void private_item_set ( private_data_t **  data,
const char *  item_name,
const char *  value 
)

◆ private_items_destroy()

void private_items_destroy ( private_data_t **  data)

◆ string_append()

int string_append ( string_t  s,
const char *  str 
)

string_append()

Append to string_t s, NUL terminated string pointed by str
Wrapper to:string_append_n(s, str, -1)

Zobacz również
string_append_n()

◆ string_append_c()

int string_append_c ( string_t  s,
char  c 
)

string_append_c()

Append to string_t s char c.

Parametry
s- string_t
c- char to append
Zwraca
0 on success
-1 and errno set to EFAULT if input params were wrong (s == NULL || format == NULL)

◆ string_append_n()

int string_append_n ( string_t  s,
const char *  str,
int  count 
)

string_append_n()

Append to string_t s, first count chars, from str

Parametry
s- string_t
str- buffer to append.
count- how many chars copy copy from str, or -1 to copy whole.
Do zrobienia:
We append here NUL terminated string, so maybe let's always do count = xstrnlen(str, count);?
Because now programmer can pass negative value, and it'll possible do SIGSEGV
Also we can allocate less memory for string, when for example str[count-3] was NUL char.
Zwraca
0 on success
-1 and errno set to EFAULT if input params were wrong (s == NULL || str == NULL)

◆ string_append_raw()

int string_append_raw ( string_t  s,
const char *  str,
int  count 
)

string_append_raw()

Append to string_t s, count bytes from memory pointed by str

Zobacz również
string_append_n() - If you want to append NUL terminated (C-like) String
Do zrobienia:
XXX Protect from negative count (and less than -1) ?

◆ string_free()

char* string_free ( string_t  s,
int  free_string 
)

string_free()

Cleanup memory after string_t s, and perhaps (if free_string set) cleanup memory after char buffer.

Parametry
s- string_t which we want to free.
free_string- do we want to free memory after char buffer?
Zobacz również
string_clear() - if you just want to clear saved char buffer, and you don't want to free internal string_t struct.
Zwraca
if free_string != 0 always NULL
else returns saved char buffer, which need be free()'d after use by xfree()

◆ string_init()

string_t string_init ( const char *  value)

string_init()

init string_t struct, allocating memory for string passed by value, and setting internal string_t data.

Parametry
value- if NULL char buffer will be inited with "", otherwise with given value.
Zobacz również
string_free() - to free memory used by string_t
Zwraca
pointer to allocated string_t struct.

◆ string_remove()

void string_remove ( string_t  s,
int  count 
)

string_remove()

Remove first count chars from string.