OpenCBM
|
Some functions for string handling. More...
#include <stddef.h>
Go to the source code of this file.
Functions | |
char * | cbmlibmisc_stralloc (unsigned int Length) |
allocate memory for a string of a given size More... | |
char * | cbmlibmisc_strdup (const char *const OldString) |
Duplicate a given string. More... | |
char * | cbmlibmisc_strndup (const char *const OldString, size_t Length) |
Duplicate a prefix of a given string. More... | |
void | cbmlibmisc_strfree (const char *String) |
Free a string. More... | |
char * | cbmlibmisc_strcat (const char *first, const char *second) |
Concatenate two strings. More... | |
char * | cbmlibmisc_format_error_message (unsigned int ErrorNumber) |
Format a returned error code into a string. More... | |
char* cbmlibmisc_format_error_message | ( | unsigned int | ErrorNumber | ) |
Format a returned error code into a string.
This function formats a returned error code into a string.
Error | The error number to be formatted. |
Definition at line 35 of file formaterrormessage.c.
Referenced by CbmInstall(), CbmRemove(), and plugin_load().
char* cbmlibmisc_stralloc | ( | unsigned int | Length | ) |
allocate memory for a string of a given size
This function allocates memory for a string with a given size.
Length | The size of the string. The trailing zero does not count, that is, extra space for an additional zero is allocated. |
Definition at line 41 of file libstring.c.
char* cbmlibmisc_strcat | ( | const char * | First, |
const char * | Second | ||
) |
Concatenate two strings.
This function concatenates two strings and returns the result in a malloc()ed memory region.
First | The first string to concatenate. If this pointer is NULL, an empty string is assumed. |
Second | The second string to concatenate. If this pointer is NULL, an empty string is assumed. |
Definition at line 202 of file libstring.c.
Referenced by cbm_get_debugging_flags(), configuration_get_default_filename(), opencbm_configuration_open(), and opencbm_plugin_install_do_install().
char* cbmlibmisc_strdup | ( | const char *const | OldString | ) |
Duplicate a given string.
This function allocates memory for a string. This string is initialised with a copy of the given parameter string.
OldString | The string to duplicate. Can also be NULL. |
Definition at line 84 of file libstring.c.
Referenced by cbm_get_debugging_flags(), cbm_get_driver_name_ex(), cbmlibmisc_strndup(), configuration_get_default_filename(), opencbm_configuration_get_data(), opencbm_configuration_open(), and opencbm_configuration_set_data().
void cbmlibmisc_strfree | ( | const char * | String | ) |
Free a string.
This function frees a string which has been previously allocated by any of the functions in this file.
String | A pointer to the string to be freed. |
Definition at line 172 of file libstring.c.
Referenced by cbm_driver_open_ex(), cbm_get_debugging_flags(), cbm_get_driver_name_ex(), get_all_plugins(), opencbm_configuration_open(), opencbm_configuration_set_data(), opencbm_plugin_get_all_plugin_names(), opencbm_plugin_install_do_install(), opencbm_plugin_install_generic(), opencbm_plugin_install_plugin_data(), and plugin_is_active().
char* cbmlibmisc_strndup | ( | const char *const | OldString, |
size_t | Length | ||
) |
Duplicate a prefix of a given string.
This function allocates memory for a string. This string is initialised with a copy of a prefix of the given parameter string.
OldString | The string to duplicate. Can also be NULL. |
Length | The size of the prefix to copy. |
If the OldString has less than Length characters, a full copy of OldString is returned.
Definition at line 136 of file libstring.c.
References cbmlibmisc_strdup().