KHTTP_URLDECODE(3)
π KHTTP_URLDECODE(3) β like, the whole manual, bestie
okay so first things first: this is page KHTTP_URLDECODE(3) from the Library Functions Manual, and literally the whole vibe is URL decoding for kcgi. two functions, one job, let's go β¨
π LIBRARY π
the library is βlibkcgiβ β yes girl, that one. π
π¦ SYNOPSIS π¦
like, here's the exact spell you gotta cast:
#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <kcgi.h>
enum kcgi_err
khttp_urldecode(const char *src, char **dst);
enum kcgi_err
khttp_urldecode_inplace(char *src);
πΈ DESCRIPTION πΈ
so the assignment is: decode the percent-encoded string src. that's it. that's the whole thing. π«Ά
- in
khttp_urldecode(), the result gets placed indst. - in
khttp_urldecode_inplace(), the input stringsrcis overwritten with the result, and the result will be the same length or shorter. no cap. β¨
these accept uppercase and lowercase percent encoding β for example, "%A0" or "%a0", respectively. both slay equally, iykyk. π
β οΈ okay important: the deprecated form of these functions,kutil_urldecode()andkutil_urldecode_inplace(), should no longer be used. like, they're giving expired milk. please don't. π
π₯ RETURN VALUES π₯
both functions return an error code, and here's the whole menu:
KCGI_OKβ success! not an error. we love her. πKCGI_ENOMEMβ memory failure. and note: this is only forkhttp_urldecode(). πKCGI_FORMβ malformed input, orNULLsrcordstarguments. input said "no <3". π
β οΈ and here's the caveat, bestie, listen up: ifkhttp_urldecode()returns an error, it always setsdsttoNULL. butkhttp_urldecode_inplace(), however, may leave a partially-decoded string insrc. so like... vibe check yoursrcafter, fr fr. π
π AUTHORS π
written by Kristaps Dzonsons <kristaps@bsd.lv> β an absolute icon, periodt. π
and that's the whole thing, babe π¦π β this cutie came from Debian, version $Mdocdate$, and we're closing out at KHTTP_URLDECODE(3). mwah πβ¨π
π¦ where this page comes from
- alpine 3.24: kcgi-doc 1.0.1-r0 Β· ISC
- Copyright (c) 2014, 2017, 2020 Kristaps Dzonsons <kristaps@bsd.lv>
- Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms