Mercurial > trustbridge
comparison common/strhelp.h @ 319:4077eff1dd39
Added terminateing version of asprintf.
author | Sascha Wilde <wilde@intevation.de> |
---|---|
date | Fri, 04 Apr 2014 17:58:14 +0200 |
parents | c596568fa45b |
children | 17e1c8f37d72 |
comparison
equal
deleted
inserted
replaced
318:6ccaf25219fd | 319:4077eff1dd39 |
---|---|
19 void *xmalloc( size_t n ); | 19 void *xmalloc( size_t n ); |
20 void *xrealloc( void *a, size_t n ); | 20 void *xrealloc( void *a, size_t n ); |
21 void *xcalloc( size_t n, size_t m ); | 21 void *xcalloc( size_t n, size_t m ); |
22 char *xstrndup( const char *string, const size_t len ); | 22 char *xstrndup( const char *string, const size_t len ); |
23 void xfree ( void *p ); | 23 void xfree ( void *p ); |
24 | |
25 /** | |
26 * @brief Terminating variant of asprintf | |
27 * | |
28 * This function behaves exactly like asprintf(3) but will terminate | |
29 * when an error occures (usally that means that memoy allocation | |
30 * failed). | |
31 */ | |
32 int xasprintf (char **strp, const char *fmt, ...); | |
24 | 33 |
25 /** | 34 /** |
26 * @brief Returns the length of the given %NULL-terminated | 35 * @brief Returns the length of the given %NULL-terminated |
27 * string array str_array. | 36 * string array str_array. |
28 * @param[in] str_array a %NULL-terminated array of strings | 37 * @param[in] str_array a %NULL-terminated array of strings |