KHTTP_URLDECODE(3)

πŸ“¦ version 1.0.1, in alpine 3.24

πŸ’… 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 in dst.
  • in khttp_urldecode_inplace(), the input string src is 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() and kutil_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 for khttp_urldecode(). 😭
  • KCGI_FORM β€” malformed input, or NULL src or dst arguments. input said "no <3". πŸ™ˆ
⚠️ and here's the caveat, bestie, listen up: if khttp_urldecode() returns an error, it always sets dst to NULL. but khttp_urldecode_inplace(), however, may leave a partially-decoded string in src. so like... vibe check your src after, 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms