@@@ tvec error return
[mLib] / struct / dstr.3
index 1cc866d..1aadd35 100644 (file)
@@ -53,6 +53,9 @@ dstr \- a simple dynamic string type
 .nf
 .B "#include <mLib/dstr.h>"
 
 .nf
 .B "#include <mLib/dstr.h>"
 
+.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 );
 .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 "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 );
 .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
 .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
 The
 .B buf
 member points to the actual character data in the string.  The data may
@@ -330,10 +324,10 @@ and
 .BR sprintf (3)
 because the former has to do most of its work itself.  In particular,
 .B dstr_putf
 .BR sprintf (3)
 because the former has to do most of its work itself.  In particular,
 .B dstr_putf
-doesn't (and probably never will) understand the
+understands the POSIX
 .RB ` n$ '
 .RB ` n$ '
-positional parameter notation accepted by many Unix C libraries.  There
-is no macro equivalent of
+positional parameter notation accepted by many Unix C libraries, even if
+the underlying C library does not.  There is no macro equivalent of
 .BR dstr_putf .
 .PP
 The function
 .BR dstr_putf .
 .PP
 The function