Logo Search packages:      
Sourcecode: blender version File versions

void BLI_dynstr_append ( DynStr ds,
char *  cstr 
)

Append a c-string to a DynStr.

Parameters:
ds The DynStr to append to.
cstr The c-string to append.

Definition at line 69 of file BLI_dynstr.c.

References BLI_dynstr_append().

Referenced by BLI_dynstr_append().

                                               {
      DynStrElem *dse= malloc(sizeof(*dse));
      int cstrlen= strlen(cstr);
      
      dse->str= malloc(cstrlen+1);
      memcpy(dse->str, cstr, cstrlen+1);
      dse->next= NULL;
      
      if (!ds->last)
            ds->last= ds->elems= dse;
      else
            ds->last= ds->last->next= dse;

      ds->curlen+= cstrlen;
}


Generated by  Doxygen 1.6.0   Back to index