@@@ man wip
[mLib] / codec / url.3
index 9e8e880..0756808 100644 (file)
 .sp 1
 .fi
 ..
+.ie t \{\
+.  de VP
+.    sp .4v
+..
+\}
+.el \{\
+.  de VP
+.    sp
+..
+\}
 .TH url 3 "20 June 1999" "Straylight/Edgeware" "mLib utilities library"
 .SH NAME
 url \- manipulation of form-urlencoded strings
@@ -21,27 +31,27 @@ url \- manipulation of form-urlencoded strings
 .SH SYNOPSIS
 .nf
 .B "#include <mLib/url.h>"
-
+.PP
 .ta 2n
 .B "typedef struct {"
 .B "   unsigned f;"
 .B "   ..."
 .B "} url_ectx;"
-
+.PP
 .B "typedef struct {"
 .B "   unsigned f;"
 .B "   ..."
 .B "} url_dctx;"
-
+.PP
 .B "#define URLF_STRICT ..."
 .B "#define URLF_LAX ..."
 .B "#define URLF_SEMI ..."
-
+.PP
 .BI "void url_initenc(url_ectx *" ctx );
 .ta \w'\fBvoid url_enc('u
 .BI "void url_enc(url_ectx *" ctx ", dstr *" d ,
 .BI "  const char *" name ", const char *" value );
-
+.PP
 .BI "void url_initdec(url_dctx *" ctx ", const char *" p );
 .BI "int url_dec(url_dctx *" ctx ", dstr *" n ", dstr *" v );
 .fi
@@ -150,19 +160,19 @@ and a urlencoded representation.  The code is untested.
 #include <mLib/dstr.h>
 #include <mLib/sym.h>
 #include <mLib/url.h>
-
+.VP
 typedef struct {
        sym_base _b;
        char *v;
 } val;
-
+.VP
 void decode(sym_table *t, const char *p)
 {
        url_dctx c;
        dstr n = DSTR_INIT, v = DSTR_INIT;
        val *vv;
        unsigned f;
-
+.VP
        for (url_initdec(&c, p); url_dec(&c, &n, &v); ) {
                vv = sym_find(t, n.buf, -1, sizeof(*vv), &f);
                if (f) free(vv->v);
@@ -172,13 +182,13 @@ void decode(sym_table *t, const char *p)
        }
        dstr_destroy(&n); dstr_destroy(&v);
 }
-
+.VP
 void encode(sym_table *t, dstr *d)
 {
        sym_iter i;
        url_ectx c;
        val *v;
-
+.VP
        url_initenc(&c);
        for (sym_mkiter(&i, t); (v = sym_next(&i)) != 0; )
                url_enc(&c, d, SYM_NAME(v), v->v);