kutil_urlencode man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

KUTIL_URLENCODE(3)	 BSD Library Functions Manual	    KUTIL_URLENCODE(3)

NAME
     kutil_urlabs, kutil_urlpart, kutil_urlpartx, kutil_urlencode — URL func‐
     tions for kcgi

LIBRARY
     library “libkcgi”

SYNOPSIS
     #include <stdint.h>
     #include <kcgi.h>

     char *
     kutil_urlabs(enum kscheme scheme, const char *host, uint16_t port,
	 const char *path);

     char *
     kutil_urlpart(struct kreq *req, const char *path, const char *suffix,
	 const char *page, ...);

     char *
     kutil_urlpartx(struct kreq *req, const char *path, const char *suffix,
	 const char *page, ...);

     char *
     kutil_urlencode(const char *cp);

DESCRIPTION
     The kutil_urlpart, and kutil_urlpartx functions format a partial HTTP URL
     from the path, suffix, page, and variable-length query string keys and
     values.  If the suffix part is NULL, it is not formatted as part of the
     URL.  The kutil_urlabs forms an absolute URL from a scheme, domain, and
     path component.  The kutil_urlencode function encodes a string for embed‐
     ding in a URL.  All functions return newly-allocated string of the
     encoded contents.

     kutil_urlpart and kutil_urlpartx accept variable-length arguments termi‐
     nated with a NULL value.  kutil_urlpart accepts key-value string pairs.
     kutil_urlpartx accepts string keys, then a enum kattrx of the value type,
     then a pointer to the value corresponding to that type: KATTRX_STRING for
     strings, KATTRX_INT for int64_t 64-bit signed integers, and KATTRX_DOUBLE
     for double double-precision floating-point numbers.  kutil_urlpart, thus,
     is as if kutil_urlpartx were invoked with KATTRX_STRING for all values.

     kutil_urlabs formats schema, host, port, and path component into a URL.
     This is not URL-encoded in any way, so make sure to use kutil_urlpart(),
     kutil_urlpartx(), or just kutil_urlencode() for the sensitive parts.

RETURN VALUES
     kutil_urlabs, kutil_urlpart, kutil_urlpartx, and kutil_urlencode return a
     newly-allocated string that must be freed with free(3).  kutil_urlencode
     will return NULL if its input argument is NULL or if allocation fails.

AUTHORS
     The kutil_urlabs library was written by Kristaps Dzonsons
     ⟨kristaps@bsd.lv⟩.

CAVEATS
     The kutil_urlabs function accepts schemas via enum kscheme that aren't
     URLs.

     Also, the fact that kutil_urlencode will return NULL on allocation fail‐
     ure but kutil_urlabs, kutil_urlpart, and kutil_urlpartx will abort is
     wrong.

BSD				April 29, 2024				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net