Home | History | Annotate | Download | only in talloc

Lines Matching refs:str

337 char * hieralloc_strndup(const void * ctx, const char * str, unsigned len)
339 if (!str)
342 const char *p = (const char *)memchr(str, '\0', len);
343 len = (p ? p - str : len);
344 char * ret = (char *)hieralloc_allocate(ctx, len + 1, str);
347 memcpy(ret, str, len);
354 char * hieralloc_strdup(const void * ctx, const char * str)
356 if (!str)
358 return hieralloc_strndup(ctx, str, strlen(str));
361 static char * _hieralloc_strlendup_append(char * str, unsigned len,
364 //char * ret = hieralloc_allocate(str, sizeof(char) * (len + appendLen + 1), str);
365 //memcpy(ret, str, len);
366 hieralloc_header_t * header = get_header(str);
367 char * ret = (char *)hieralloc_reallocate(header->parent + 1, str, sizeof(char) * (len + appendLen + 1), str);
377 char * hieralloc_strdup_append(char * str, const char * append)
379 if (!str)
382 return str;
383 return _hieralloc_strlendup_append(str, strlen(str), append, strlen(append));
387 char * hieralloc_strndup_append(char * str, const char * append, unsigned len)
389 if (!str)
392 return str;
395 return _hieralloc_strlendup_append(str, strlen(str), append, len);
434 char * hieralloc_vasprintf_append(char * str, const char * fmt, va_list va)
436 if (!str)
439 int len = strlen(str);
448 return str;
449 str = (char *)hieralloc_reallocate(NULL, str, sizeof(char) * (len + appendLen + 1), str);
450 if (!str)
454 vsnprintf(str + len, appendLen + 1, fmt, va2);
457 get_header(str)->name = str;
458 return str;
462 char * hieralloc_asprintf_append(char * str, const char * fmt, ...)
466 str = hieralloc_vasprintf_append(str, fmt, va);
468 return str;