X-Git-Url: https://git.distorted.org.uk/~mdw/mLib/blobdiff_plain/eff136f63977a5493525610bff64d363581154af..882a39c1c269818ed00b1b600180c1d22e8ee0d2:/struct/dstr.3 diff --git a/struct/dstr.3 b/struct/dstr.3 index e59f370..1aadd35 100644 --- a/struct/dstr.3 +++ b/struct/dstr.3 @@ -53,6 +53,9 @@ dstr \- a simple dynamic string type .nf .B "#include " +.B "typedef struct { ...\& } dstr;" +.B "#define DSTR_INIT ..." + .BI "void dstr_create(dstr *" d ); .BI "void dstr_destroy(dstr *" d ); .BI "void dstr_reset(dstr *" d ); @@ -70,7 +73,6 @@ dstr \- a simple dynamic string type .BI "int dstr_putline(dstr *" d ", FILE *" fp ); .BI "size_t dstr_write(const dstr *" d ", FILE *" fp ); -.BI "dstr " d " = DSTR_INIT;" .BI "void DCREATE(dstr *" d ); .BI "void DDESTROY(dstr *" d ); .BI "void DRESET(dstr *" d ); @@ -98,15 +100,7 @@ multiple times. .SS "Underlying type" A .B dstr -object is a small structure with the following members: -.VS -typedef struct dstr { - char *buf; /* Pointer to string buffer */ - size_t sz; /* Size of the buffer */ - size_t len; /* Length of the string */ - arena *a; /* Pointer to arena */ -} dstr; -.VE +object is a small structure with the following members. The .B buf member points to the actual character data in the string. The data may