aboutsummaryrefslogtreecommitdiff
path: root/man/magi_urlenc.3
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2020-07-18 07:56:11 +0300
committerAleksey Veresov <aleksey@veresov.pro>2020-07-18 07:56:11 +0300
commit36dda991898ce621a0b0f7103f763690e73fa0ff (patch)
treecee197e13a1c42a5ee3ea67465d1151a9c0cc12a /man/magi_urlenc.3
parent4d77e4bb69a47daf23ad4a902b300bf1aa7d5597 (diff)
downloadmagi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar
magi-36dda991898ce621a0b0f7103f763690e73fa0ff.tar.xz
magi-36dda991898ce621a0b0f7103f763690e73fa0ff.zip
Docs were extended, consts were added.
Diffstat (limited to 'man/magi_urlenc.3')
-rw-r--r--man/magi_urlenc.351
1 files changed, 0 insertions, 51 deletions
diff --git a/man/magi_urlenc.3 b/man/magi_urlenc.3
deleted file mode 100644
index ed919eb..0000000
--- a/man/magi_urlenc.3
+++ /dev/null
@@ -1,51 +0,0 @@
-.TH MAGI 3 2020-05-02 v0.0.1 "Library Manual"
-.SH NAME
-.B magi_urlenc
-\- implementation of url encoding
-.SH SYNOPSYS
-.B #include <magi.h>
-.P
-int
-.BR magi_urlenc_size "(const char *" plain );
-.P
-void
-.BR magi_urlenc "(const char *" plain ", char *" code );
-.SH DESCRIPTION
-Can be helpful in forming urls in response. Use
-.B magi_urlenc_size
-to find what the size of code will be and then call
-.B magi_urlenc
-for encoding itself.
-.P
-URL encoding is described in
-.IR "RFC 3986" .
-Briefly it is replacement of every space into plus sign and every not
-alpha-numerical or not one of "~-._" character into percent sign
-followed by hexademical representation of given character byte.
-.P
-.B code
-passed to
-.B magi_urlenc
-should be at least size of
-.BR magi_urlenc_size ( plain ).
-.SH RETURN VALUES
-.BR magi_urlenc_size :
-size of url encoding of
-.BR plain .
-.SH EXAMPLES
-The following forms URL to search in DuckDuckGo for provided
-.RB "char *" query
-in
-.RB "char *" url .
-.P
-.RS
-.nf
-const char *prefix = "http://duckduckgo.com/?q=";
-const int prelen = strlen(prefix);
-const int urlencsize = magi_urlenc_size(query);
-url = malloc(prelen + urlencsize + 1);
-strcpy(url, prefix);
-magi_urlenc(query, url + prelen);
-url[prelen + urlencsize] = 0;
-.fi
-.RE