2016-06-20 17:05:31 +08:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< meta http-equiv = "Content-Type" content = "text/xhtml;charset=UTF-8" / >
< meta http-equiv = "X-UA-Compatible" content = "IE=9" / >
2016-11-14 18:12:31 +08:00
< meta name = "generator" content = "Doxygen 1.8.12" / >
< meta name = "viewport" content = "width=device-width, initial-scale=1" / >
2016-06-20 17:05:31 +08:00
< title > libwebsockets: Urlencode and Urldecode< / title >
< link href = "tabs.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
< link href = "navtree.css" rel = "stylesheet" type = "text/css" / >
< script type = "text/javascript" src = "resize.js" > < / script >
< script type = "text/javascript" src = "navtreedata.js" > < / script >
< script type = "text/javascript" src = "navtree.js" > < / script >
< script type = "text/javascript" >
$(document).ready(initResizable);
< / script >
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< / head >
< body >
< div id = "top" > <!-- do not remove this div, it is closed by doxygen! -->
< div id = "titlearea" >
< table cellspacing = "0" cellpadding = "0" >
< tbody >
< tr style = "height: 56px;" >
< td id = "projectlogo" > < img alt = "Logo" src = "libwebsockets.org-logo.png" / > < / td >
< td id = "projectalign" style = "padding-left: 0.5em;" >
< div id = "projectname" > libwebsockets
< / div >
< div id = "projectbrief" > Lightweight C library for HTML5 websockets< / div >
< / td >
< / tr >
< / tbody >
< / table >
< / div >
<!-- end header part -->
2016-11-14 18:12:31 +08:00
<!-- Generated by Doxygen 1.8.12 -->
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
< script type = "text/javascript" >
$(function() {
initMenu('',false,false,'search.php','Search');
});
< / script >
< div id = "main-nav" > < / div >
2016-06-20 17:05:31 +08:00
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
< / div >
< / div >
< script type = "text/javascript" >
$(document).ready(function(){initNavTree('group__urlendec.html','');});
< / script >
< div id = "doc-content" >
< div class = "header" >
< div class = "summary" >
< a href = "#func-members" > Functions< / a > < / div >
< div class = "headertitle" >
< div class = "title" > Urlencode and Urldecode< div class = "ingroups" > < a class = "el" href = "group__http.html" > HTTP< / a > < / div > < / div > < / div >
< / div > <!-- header -->
< div class = "contents" >
< table class = "memberdecls" >
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "func-members" > < / a >
Functions< / h2 > < / td > < / tr >
< tr class = "memitem:gabc2888476e50e001c875c1a8abf455b7" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN const char *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__urlendec.html#gabc2888476e50e001c875c1a8abf455b7" > lws_urlencode< / a > (char *escaped, const char *string, int len)< / td > < / tr >
< tr class = "separator:gabc2888476e50e001c875c1a8abf455b7" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:gaa373a9c16acdd96c395af61ab915ece3" > < td class = "memItemLeft" align = "right" valign = "top" > LWS_VISIBLE LWS_EXTERN int  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "group__urlendec.html#gaa373a9c16acdd96c395af61ab915ece3" > lws_urldecode< / a > (char *string, const char *escaped, int len)< / td > < / tr >
< tr class = "separator:gaa373a9c16acdd96c395af61ab915ece3" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< h2 > HTML chunked Substitution< / h2 >
< p > APIs for receiving chunks of text, replacing a set of variable names via a callback, and then prepending and appending HTML chunked encoding headers. < / p >
< h2 class = "groupheader" > Function Documentation< / h2 >
2016-11-14 18:12:31 +08:00
< a id = "gaa373a9c16acdd96c395af61ab915ece3" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gaa373a9c16acdd96c395af61ab915ece3" > § < / a > < / span > lws_urldecode()< / h2 >
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN int lws_urldecode < / td >
< td > (< / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > string< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > escaped< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > len< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > < a class = "el" href = "group__urlendec.html#gaa373a9c16acdd96c395af61ab915ece3" > lws_urldecode()< / a > - like strncpy but with urldecoding< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > string< / td > < td > output buffer < / td > < / tr >
< tr > < td class = "paramname" > escaped< / td > < td > input buffer ('\0' terminated) < / td > < / tr >
< tr > < td class = "paramname" > len< / td > < td > output buffer max length< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > This is only useful for '\0' terminated strings< / p >
< p > Since urldecoding only shrinks the output string, it is possible to do it in-place, ie, string == escaped < / p >
< / div >
< / div >
2016-11-14 18:12:31 +08:00
< a id = "gabc2888476e50e001c875c1a8abf455b7" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#gabc2888476e50e001c875c1a8abf455b7" > § < / a > < / span > lws_urlencode()< / h2 >
2016-06-20 17:05:31 +08:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "memname" >
< tr >
< td class = "memname" > LWS_VISIBLE LWS_EXTERN const char* lws_urlencode < / td >
< td > (< / td >
< td class = "paramtype" > char *  < / td >
< td class = "paramname" > < em > escaped< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > const char *  < / td >
< td class = "paramname" > < em > string< / em > , < / td >
< / tr >
< tr >
< td class = "paramkey" > < / td >
< td > < / td >
< td class = "paramtype" > int  < / td >
< td class = "paramname" > < em > len< / em >   < / td >
< / tr >
< tr >
< td > < / td >
< td > )< / td >
< td > < / td > < td > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p > < code > #include < < a class = "el" href = "libwebsockets_8h.html" > lib/libwebsockets.h< / a > > < / code > < / p >
< p > < a class = "el" href = "group__urlendec.html#gabc2888476e50e001c875c1a8abf455b7" > lws_urlencode()< / a > - like strncpy but with urlencoding< / p >
< dl class = "params" > < dt > Parameters< / dt > < dd >
< table class = "params" >
< tr > < td class = "paramname" > escaped< / td > < td > output buffer < / td > < / tr >
< tr > < td class = "paramname" > string< / td > < td > input buffer ('/0' terminated) < / td > < / tr >
< tr > < td class = "paramname" > len< / td > < td > output buffer max length< / td > < / tr >
< / table >
< / dd >
< / dl >
< p > Because urlencoding expands the output string, it's not possible to do it in-place, ie, with escaped == string < / p >
< / div >
< / div >
< / div > <!-- contents -->
< / div > <!-- doc - content -->
<!-- start footer part -->
< div id = "nav-path" class = "navpath" > <!-- id is needed for treeview function! -->
< ul >
< li class = "footer" > Generated by
< a href = "http://www.doxygen.org/index.html" >
2016-11-14 18:12:31 +08:00
< img class = "footer" src = "doxygen.png" alt = "doxygen" / > < / a > 1.8.12 < / li >
2016-06-20 17:05:31 +08:00
< / ul >
< / div >
< / body >
< / html >