You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
405 B
C
23 lines
405 B
C
#include <stdarg.h>
|
|
#include "stralloc.h"
|
|
|
|
int stralloc_catm_internal(stralloc* sa, ...) {
|
|
va_list a;
|
|
const char* s;
|
|
size_t n=0;
|
|
va_start(a,sa);
|
|
while ((s=va_arg(a,const char*)))
|
|
n += strlen(s);
|
|
va_end(a);
|
|
stralloc_readyplus(sa,n);
|
|
|
|
va_start(a,sa);
|
|
while ((s=va_arg(a,const char*)))
|
|
if (stralloc_cats(sa,s)==0) {
|
|
va_end(a);
|
|
return 0;
|
|
}
|
|
va_end(a);
|
|
return 1;
|
|
}
|