Logo Search packages:      
Sourcecode: bglibs version File versions

int str_cat6s ( str s,
const char *  a,
const char *  b,
const char *  c,
const char *  d,
const char *  e,
const char *  f 
)

Append 6 C strings

Definition at line 22 of file cat6s.c.

References len, s, and str_realloc.

{
  char* ptr;
  unsigned alen = strlen(a);
  unsigned blen = strlen(b);
  unsigned clen = strlen(c);
  unsigned dlen = strlen(d);
  unsigned elen = strlen(e);
  unsigned flen = strlen(f);
  if (!str_realloc(s, s->len+alen+blen+clen+dlen+elen+flen)) return 0;
  ptr = s->s + s->len;
  s->len += alen+blen+clen+dlen+elen+flen;
  memcpy(ptr, a, alen); ptr += alen;
  memcpy(ptr, b, blen); ptr += blen;
  memcpy(ptr, c, clen); ptr += clen;
  memcpy(ptr, d, dlen); ptr += dlen;
  memcpy(ptr, e, elen); ptr += elen;
  memcpy(ptr, f, flen); ptr += flen;
  *ptr = 0;
  return 1;
}


Generated by  Doxygen 1.6.0   Back to index