view common/strhelp.h @ 71:f22a99f7cb69

Add certificatelist to install as member. Look for updates on startup
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 19 Mar 2014 11:32:25 +0000
parents 6acb1dae6185
children 80ab2168760f
line wrap: on
line source
#ifndef STRHELP_H
#define STRHELP_H
/* @file Helper functions for c strings and memory management
 *
 * strhelp contains terminating memory allocation functions and
 * some conveniance functions to work with c strings or arrays
 * of c strings.
 */
void *xmalloc( size_t n );
void *xrealloc( void *a, size_t n );
void *xcalloc( size_t n, size_t m );
char *xstrndup( const char *string, const size_t len );

/**
 * strv_length:
 * @str_array: a %NULL-terminated array of strings
 *
 * Returns the length of the given %NULL-terminated
 * string array @str_array.
 *
 * Return value: length of @str_array.
 *
 */
unsigned int strv_length (char **str_array);

/* @brief append a string to a NULL terminated array of strings.
 *
 * @param[inout] array pointer to the NULL terminated list of string pointers.
 * @param[in] string pointer to the string to append to the list.
 * @param[in] len length of the string to append to the list
 * */
void array_append_str(char ***pArray, const char *string, const size_t len);

/* @brief append a string to another string.
 *
 * @param[inout] pDst pointer to the string to be extended.
 * @param[in] appendage pointer to the string to append.
 * @param[in] len length of the string to append.
 * */
void str_append_str(char **pDst, const char *appendage, const size_t len);

void strfreev (char **str_array);
#endif

http://wald.intevation.org/projects/trustbridge/