#include "config.h"
#include <string.h>
#include "sofia-sip/su_alloc.h"
Include dependency graph for su_strdup.c:
Functions | |
char * | su_strdup (su_home_t *home, char const *s) |
Duplicate a string, allocate memory from home. | |
char * | su_strcat (su_home_t *home, char const *s1, char const *s2) |
Concate two strings, allocate memory for result from home. | |
char * | su_strcat_all (su_home_t *home,...) |
Concate multiple strings, allocate memory for result from home. | |
char * | su_strndup (su_home_t *home, char const *s, int n) |
Duplicate a string with given size, allocate memory from home. |
char* su_strcat | ( | su_home_t * | home, | |
char const * | s1, | |||
char const * | s2 | |||
) |
Concate two strings, allocate memory for result from home.
Concatenate the strings s1 and s2. The strlen(s1)+strlen
(s2)+1 bytes is allocated from home, the contents of s1 and s2 is copied to the newly allocated memory area, and pointer to the concatenated string is returned.
home | pointer to memory home | |
s1 | string to be first string | |
s2 | string to be first string |
NULL
upon an error. char* su_strcat_all | ( | su_home_t * | home, | |
... | ||||
) |
Concate multiple strings, allocate memory for result from home.
Concatenate the strings in list. The lenght of result is calculate, result is allocated from home, the contents of strings is copied to the newly allocated memory arex, and pointer to the concatenated string is returned.
home | pointer to memory home | |
... | NULL-terminated list of strings to be concatenated |
NULL
upon an error. char* su_strdup | ( | su_home_t * | home, | |
char const * | s | |||
) |
Duplicate a string, allocate memory from home.
The function su_strdup() duplicates the string s. It allocates strlen(s)+1
bytes from home, copies the contents of s to the newly allocated memory, and returns pointer to the duplicated string.
home | pointer to memory home | |
s | string to be duplicated |
NULL
upon an error. char* su_strndup | ( | su_home_t * | home, | |
char const * | s, | |||
int | n | |||
) |
Duplicate a string with given size, allocate memory from home.
The function su_strndup() duplicates the string s. It allocates n+1
bytes from home, copies the contents of s to the newly allocated memory, and returns pointer to the duplicated string. The duplicated string is always NUL-terminated.
home | pointer to memory home | |
s | string to be duplicated | |
n | size of the resulting string |
NULL
upon an error.