cynapses libc string functions
[cynapses libc API (internal)]

Collaboration diagram for cynapses libc string functions:


Data Structures

struct  c_strlist_s
 Structure for a stringlist. More...

Typedefs

typedef struct c_strlist_s c_strlist_t

Functions

char * c_lowercase (const char *str)
int c_streq (const char *a, const char *b)
int c_strlist_add (c_strlist_t *strlist, const char *string)
void c_strlist_destroy (c_strlist_t *strlist)
c_strlist_tc_strlist_expand (c_strlist_t *strlist, size_t size)
c_strlist_tc_strlist_new (size_t size)
char * c_strreplace (char *src, const char *pattern, const char *repl)
char * c_uppercase (const char *str)

Variables

size_t c_strlist_s::count
size_t c_strlist_s::size


Typedef Documentation

typedef struct c_strlist_s c_strlist_t

Definition at line 36 of file c_string.h.


Function Documentation

char* c_lowercase ( const char *  str  ) 

Lowercase a string.

Parameters:
str The String to lowercase.
Returns:
The malloced lowered string or NULL on error.

int c_streq ( const char *  a,
const char *  b 
)

Compare to strings if they are equal.

Parameters:
a First string to compare.
b Second string to compare.
Returns:
1 if they are equal, 0 if not.

int c_strlist_add ( c_strlist_t strlist,
const char *  string 
)

Add a string to the stringlist.

Duplicates the string and stores it in the stringlist.

Parameters:
strlist Stringlist to add the string.
string String to add.
Returns:
0 on success, less than 0 and errno set if an error occured. ENOBUFS if the list is full.

void c_strlist_destroy ( c_strlist_t strlist  ) 

Destroy the memory of the stringlist.

Frees the strings and the stringlist.

Parameters:
strlist Stringlist to destroy

c_strlist_t* c_strlist_expand ( c_strlist_t strlist,
size_t  size 
)

Expand the stringlist.

Parameters:
strlist Stringlist to expand
size New size of the strlinglist to expand
Returns:
Pointer to the expanded stringlist. NULL if an error occured.

c_strlist_t* c_strlist_new ( size_t  size  ) 

Create a new stringlist.

Parameters:
size Size to allocate.
Returns:
Pointer to the newly allocated stringlist. NULL if an error occured.

char* c_strreplace ( char *  src,
const char *  pattern,
const char *  repl 
)

Replace a string with another string in a source string.

Parameters:
src String to search for pattern.
pattern Pattern to search for in the source string.
repl The string which which should replace pattern if found.
Returns:
Return a pointer to the source string.

char* c_uppercase ( const char *  str  ) 

Uppercase a string.

Parameters:
str The String to uppercase.
Returns:
The malloced uppered string or NULL on error.


Variable Documentation

size_t c_strlist_s::count [inherited]

The count of the strings saved in the vector.

Definition at line 53 of file c_string.h.

size_t c_strlist_s::size [inherited]

Size of strings allocated.

Definition at line 55 of file c_string.h.


Generated on Mon May 4 17:43:41 2009 for doc by  doxygen 1.5.6