extern char *ul_strfconcat(const char *s, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
-extern int strappend(char **a, const char *b);
+extern int ul_strappend(char **a, const char *b);
extern int strfappend(char **a, const char *format, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
-extern int strvfappend(char **a, const char *format, va_list ap)
+extern int ul_strvfappend(char **a, const char *format, va_list ap)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern const char *split(const char **state, size_t *l, const char *separator, int quoted);
static inline void xstrappend(char **a, const char *b)
{
- if (strappend(a, b) < 0)
+ if (ul_strappend(a, b) < 0)
err(XALLOC_EXIT_CODE, "cannot allocate string");
}
__attribute__((__format__(printf, 2, 0)))
int xstrvfappend(char **a, const char *format, va_list ap)
{
- int ret = strvfappend(a, format, ap);
+ int ret = ul_strvfappend(a, format, ap);
if (ret < 0)
err(XALLOC_EXIT_CODE, "cannot allocate string");
return res;
}
-int strappend(char **a, const char *b)
+int ul_strappend(char **a, const char *b)
{
size_t al, bl;
char *tmp;
int res;
va_start(ap, format);
- res = strvfappend(a, format, ap);
+ res = ul_strvfappend(a, format, ap);
va_end(ap);
return res;
}
-extern int strvfappend(char **a, const char *format, va_list ap)
+extern int ul_strvfappend(char **a, const char *format, va_list ap)
{
char *val;
int sz;
if (sz < 0)
return -errno;
- res = strappend(a, val);
+ res = ul_strappend(a, val);
free(val);
return res;
}
if (!fs)
return -EINVAL;
- return strappend(&fs->comment, comm);
+ return ul_strappend(&fs->comment, comm);
}
/**
{
if (!tb)
return -EINVAL;
- return strappend(&tb->comm_intro, comm);
+ return ul_strappend(&tb->comm_intro, comm);
}
/**
{
if (!tb)
return -EINVAL;
- return strappend(&tb->comm_tail, comm);
+ return ul_strappend(&tb->comm_tail, comm);
}
/**