chiark / gitweb /
url: Support form-urlencoding functions.
[mLib-python] / defs.pxi
index 69f4adb6214184caa14c99016b11da603fc13e7f..2de0ab9c6dae25e538382b1af4827a784e8f82aa 100644 (file)
--- a/defs.pxi
+++ b/defs.pxi
@@ -162,6 +162,23 @@ cdef extern from 'mLib/str.h':
   int str_match(char *p, char *s)
   void str_sanitize(char *d, char *p, size_t sz)
 
+#----- Form-urlencoding functions -------------------------------------------
+
+cdef extern from 'mLib/url.h':
+  struct url_ectx:
+    unsigned f
+  struct url_dctx:
+    char *p
+    unsigned f
+  enum:
+    URLF_STRICT
+    URLF_LAX
+    URLF_SEMI
+  void url_initenc(url_ectx *ctx)
+  void url_enc(url_ectx *ctx, dstr *d, char *name, char *value)
+  void url_initdec(url_dctx *ctx, char *p)
+  int url_dec(url_dctx *ctx, dstr *n, dstr *v)
+
 #----- Atom stuff -----------------------------------------------------------
 
 # --- Atoms ---