|
libircbot
library providing a framework for implementing an IRC bot
|
collection of generic utility functions More...
Go to the source code of this file.
Functions | |
| void * | IB_xmalloc (size_t size) |
| Allocate memory. More... | |
| void * | IB_xrealloc (void *ptr, size_t size) |
| Reallocate memory. More... | |
| char * | IB_copystr (const char *src) |
| Copy a string. More... | |
| char * | IB_lowerstr (const char *src) |
| Convert string to lowercase. More... | |
| char * | IB_joinstr (const char *delim, char **strings) |
| Join an array of strings in a single one. More... | |
collection of generic utility functions
| char * IB_copystr | ( | const char * | src | ) |
Copy a string.
| src | the string to copy |
| char * IB_joinstr | ( | const char * | delim, |
| char ** | strings | ||
| ) |
Join an array of strings in a single one.
| delim | the delimiter to place between individual strings |
| strings | array of individual strings, terminated by a NULL pointer |
| char * IB_lowerstr | ( | const char * | src | ) |
Convert string to lowercase.
| src | the original string |
| void * IB_xmalloc | ( | size_t | size | ) |
Allocate memory.
This replaces malloc(), but always returns successful. On allocation error, a service panic is triggered instead.
| size | the size of the memory to allocate |
| void * IB_xrealloc | ( | void * | ptr, |
| size_t | size | ||
| ) |
Reallocate memory.
This replaces realloc() but always returns successful. On allocation error, a service panic is triggered instead.
| ptr | pointer to previously allocated memory |
| size | new size for the allocated memory |