Logo Search packages:      
Sourcecode: bglibs version File versions

int str_copy4s ( str s,
const char *  a,
const char *  b,
const char *  c,
const char *  d 
)

Copy in the concatenation of 4 C strings

Definition at line 22 of file copy4s.c.

References len, s, and str_ready.

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


Generated by  Doxygen 1.6.0   Back to index