/* -*-c-*-
*
- * $Id: dstr.c,v 1.6 1999/05/21 08:38:33 mdw Exp $
+ * $Id: dstr.c,v 1.7 1999/05/21 22:14:30 mdw Exp $
*
* Handle dynamically growing strings
*
/*----- Revision history --------------------------------------------------*
*
* $Log: dstr.c,v $
+ * Revision 1.7 1999/05/21 22:14:30 mdw
+ * Take advantage of the new dynamic string macros.
+ *
* Revision 1.6 1999/05/21 08:38:33 mdw
* Implement some more functions in terms of macros.
*
const char *q = p;
size_t n = d->len;
size_t sz;
+ dstr dd = DSTR_INIT;
while (*p) {
unsigned f;
int wd, prec;
- dstr dd;
enum {
f_short = 1,
/* --- Sort out the various silly flags and things --- */
- dstr_create(&dd);
DPUTC(&dd, '%');
f = 0;
sz = DSTR_PUTFSTEP;
}
formatted:
- dstr_destroy(&dd);
+ DRESET(&dd);
q = ++p;
}
DPUTM(d, q, p - q);
finished:
DPUTZ(d);
+ DDESTROY(&dd);
return (d->len - n);
}