Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
string_arr.h File Reference

Go to the source code of this file.

Typedefs

typedef char ** ksnet_stringArr
 

Functions

ksnet_stringArr ksnet_stringArrCreate ()
 Create empty c string array. More...
 
ksnet_stringArr ksnet_stringArrAdd (ksnet_stringArr *arr, const char *str)
 Add c string to string array. More...
 
int ksnet_stringArrLength (ksnet_stringArr arr)
 Get length of string array. More...
 
ksnet_stringArr ksnet_stringArrFree (ksnet_stringArr *arr)
 Free string array. More...
 
ksnet_stringArr ksnet_stringArrSplit (const char *string, const char *separators, int with_empty, int max_parts)
 Split string by separators into words. More...
 
char * ksnet_stringArrCombine (ksnet_stringArr arr, const char *separator)
 Combine string array to string. More...
 
int ksnet_stringArrMoveTo (ksnet_stringArr arr, unsigned int fromIdx, unsigned int toIdx)
 

Typedef Documentation

typedef char** ksnet_stringArr

Function Documentation

ksnet_stringArr ksnet_stringArrAdd ( ksnet_stringArr arr,
const char *  str 
)

Add c string to string array.

Parameters
str
arr
Returns

References ksnet_stringArrLength(), teo_malloc(), and teo_realloc().

Referenced by teo::StringArray::add(), getIPs(), and ksnTDBkeyList().

char* ksnet_stringArrCombine ( ksnet_stringArr  arr,
const char *  separator 
)

Combine string array to string.

Parameters
arrString array
separator
Returns
Combined string, should be free after use

References malloc().

Referenced by test_3_5().

ksnet_stringArr ksnet_stringArrCreate ( )

Create empty c string array.

Returns

Referenced by getIPs(), and test_3_5().

ksnet_stringArr ksnet_stringArrFree ( ksnet_stringArr arr)

Free string array.

Parameters
arr

References free().

Referenced by createCmdConnectRPacketUdp(), event_cb(), open_local_port(), and test_3_5().

int ksnet_stringArrLength ( ksnet_stringArr  arr)

Get length of string array.

Parameters
arr
Returns

Referenced by createCmdConnectRPacketUdp(), ksnet_stringArrAdd(), ksnet_stringArrMoveTo(), open_local_port(), teo::StringArray::size(), and test_3_5().

int ksnet_stringArrMoveTo ( ksnet_stringArr  arr,
unsigned int  fromIdx,
unsigned int  toIdx 
)
ksnet_stringArr ksnet_stringArrSplit ( const char *  string,
const char *  separators,
int  with_empty,
int  max_parts 
)

Split string by separators into words.

Parameters
string
separators
with_empty
max_partsNumber of parts. if max_parts == 0 then there isn't parts limit
Returns
String array. Should be free with free_string_array after using

References arr_inc_size, arr_realloc, malloc(), MAX_STRING_LEN, and result.

Referenced by ksnetEvMgrRestart().