X-Git-Url: https://git.distorted.org.uk/~mdw/mLib-python/blobdiff_plain/579d01693c86259110fe7a2c2a6f005f1bdbad5b..95920c4fcd363969a497f6fe1fe35e0b95ca082b:/defs.pxi diff --git a/defs.pxi b/defs.pxi index 10502f7..4b1ecde 100644 --- a/defs.pxi +++ b/defs.pxi @@ -42,6 +42,7 @@ cdef extern from 'stddef.h': cdef extern from 'string.h': void memcpy(void *p, void *q, size_t n) char *strerror(int err) + size_t strlen(char *p) #----- Unix interface ------------------------------------------------------- @@ -151,6 +152,34 @@ cdef extern from 'mLib/sym.h': void sym_mkiter(sym_iter *i, sym_table *t) void *sym_next(sym_iter *i) +#----- String utilities ----------------------------------------------------- + +cdef extern from 'mLib/str.h': + enum: + STRF_QUOTE + STRF_PREFIX + char *str_qword(char **pp, unsigned f) + size_t str_qsplit(char *p, char **v, size_t c, char **rest, unsigned f) + int str_matchx(char *p, char *s, unsigned f) + 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 ---