group__urlendec.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.11"/>
  7. <title>libwebsockets: Urlencode and Urldecode</title>
  8. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  9. <script type="text/javascript" src="jquery.js"></script>
  10. <script type="text/javascript" src="dynsections.js"></script>
  11. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  12. <script type="text/javascript" src="resize.js"></script>
  13. <script type="text/javascript" src="navtreedata.js"></script>
  14. <script type="text/javascript" src="navtree.js"></script>
  15. <script type="text/javascript">
  16. $(document).ready(initResizable);
  17. $(window).load(resizeHeight);
  18. </script>
  19. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  20. </head>
  21. <body>
  22. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  23. <div id="titlearea">
  24. <table cellspacing="0" cellpadding="0">
  25. <tbody>
  26. <tr style="height: 56px;">
  27. <td id="projectlogo"><img alt="Logo" src="libwebsockets.org-logo.png"/></td>
  28. <td id="projectalign" style="padding-left: 0.5em;">
  29. <div id="projectname">libwebsockets
  30. </div>
  31. <div id="projectbrief">Lightweight C library for HTML5 websockets</div>
  32. </td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. </div>
  37. <!-- end header part -->
  38. <!-- Generated by Doxygen 1.8.11 -->
  39. <div id="navrow1" class="tabs">
  40. <ul class="tablist">
  41. <li><a href="index.html"><span>Main&#160;Page</span></a></li>
  42. <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
  43. <li class="current"><a href="modules.html"><span>Modules</span></a></li>
  44. <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
  45. <li><a href="files.html"><span>Files</span></a></li>
  46. </ul>
  47. </div>
  48. </div><!-- top -->
  49. <div id="side-nav" class="ui-resizable side-nav-resizable">
  50. <div id="nav-tree">
  51. <div id="nav-tree-contents">
  52. <div id="nav-sync" class="sync"></div>
  53. </div>
  54. </div>
  55. <div id="splitbar" style="-moz-user-select:none;"
  56. class="ui-resizable-handle">
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. $(document).ready(function(){initNavTree('group__urlendec.html','');});
  61. </script>
  62. <div id="doc-content">
  63. <div class="header">
  64. <div class="summary">
  65. <a href="#func-members">Functions</a> </div>
  66. <div class="headertitle">
  67. <div class="title">Urlencode and Urldecode<div class="ingroups"><a class="el" href="group__http.html">HTTP</a></div></div> </div>
  68. </div><!--header-->
  69. <div class="contents">
  70. <table class="memberdecls">
  71. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
  72. Functions</h2></td></tr>
  73. <tr class="memitem:gabc2888476e50e001c875c1a8abf455b7"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN const char *&#160;</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>
  74. <tr class="separator:gabc2888476e50e001c875c1a8abf455b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  75. <tr class="memitem:gaa373a9c16acdd96c395af61ab915ece3"><td class="memItemLeft" align="right" valign="top">LWS_VISIBLE LWS_EXTERN int&#160;</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>
  76. <tr class="separator:gaa373a9c16acdd96c395af61ab915ece3"><td class="memSeparator" colspan="2">&#160;</td></tr>
  77. </table>
  78. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  79. <h2>HTML chunked Substitution</h2>
  80. <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>
  81. <h2 class="groupheader">Function Documentation</h2>
  82. <a class="anchor" id="gaa373a9c16acdd96c395af61ab915ece3"></a>
  83. <div class="memitem">
  84. <div class="memproto">
  85. <table class="memname">
  86. <tr>
  87. <td class="memname">LWS_VISIBLE LWS_EXTERN int lws_urldecode </td>
  88. <td>(</td>
  89. <td class="paramtype">char *&#160;</td>
  90. <td class="paramname"><em>string</em>, </td>
  91. </tr>
  92. <tr>
  93. <td class="paramkey"></td>
  94. <td></td>
  95. <td class="paramtype">const char *&#160;</td>
  96. <td class="paramname"><em>escaped</em>, </td>
  97. </tr>
  98. <tr>
  99. <td class="paramkey"></td>
  100. <td></td>
  101. <td class="paramtype">int&#160;</td>
  102. <td class="paramname"><em>len</em>&#160;</td>
  103. </tr>
  104. <tr>
  105. <td></td>
  106. <td>)</td>
  107. <td></td><td></td>
  108. </tr>
  109. </table>
  110. </div><div class="memdoc">
  111. <p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
  112. <p><a class="el" href="group__urlendec.html#gaa373a9c16acdd96c395af61ab915ece3">lws_urldecode()</a> - like strncpy but with urldecoding</p>
  113. <dl class="params"><dt>Parameters</dt><dd>
  114. <table class="params">
  115. <tr><td class="paramname">string</td><td>output buffer </td></tr>
  116. <tr><td class="paramname">escaped</td><td>input buffer ('\0' terminated) </td></tr>
  117. <tr><td class="paramname">len</td><td>output buffer max length</td></tr>
  118. </table>
  119. </dd>
  120. </dl>
  121. <p>This is only useful for '\0' terminated strings</p>
  122. <p>Since urldecoding only shrinks the output string, it is possible to do it in-place, ie, string == escaped </p>
  123. </div>
  124. </div>
  125. <a class="anchor" id="gabc2888476e50e001c875c1a8abf455b7"></a>
  126. <div class="memitem">
  127. <div class="memproto">
  128. <table class="memname">
  129. <tr>
  130. <td class="memname">LWS_VISIBLE LWS_EXTERN const char* lws_urlencode </td>
  131. <td>(</td>
  132. <td class="paramtype">char *&#160;</td>
  133. <td class="paramname"><em>escaped</em>, </td>
  134. </tr>
  135. <tr>
  136. <td class="paramkey"></td>
  137. <td></td>
  138. <td class="paramtype">const char *&#160;</td>
  139. <td class="paramname"><em>string</em>, </td>
  140. </tr>
  141. <tr>
  142. <td class="paramkey"></td>
  143. <td></td>
  144. <td class="paramtype">int&#160;</td>
  145. <td class="paramname"><em>len</em>&#160;</td>
  146. </tr>
  147. <tr>
  148. <td></td>
  149. <td>)</td>
  150. <td></td><td></td>
  151. </tr>
  152. </table>
  153. </div><div class="memdoc">
  154. <p><code>#include &lt;<a class="el" href="libwebsockets_8h.html">lib/libwebsockets.h</a>&gt;</code></p>
  155. <p><a class="el" href="group__urlendec.html#gabc2888476e50e001c875c1a8abf455b7">lws_urlencode()</a> - like strncpy but with urlencoding</p>
  156. <dl class="params"><dt>Parameters</dt><dd>
  157. <table class="params">
  158. <tr><td class="paramname">escaped</td><td>output buffer </td></tr>
  159. <tr><td class="paramname">string</td><td>input buffer ('/0' terminated) </td></tr>
  160. <tr><td class="paramname">len</td><td>output buffer max length</td></tr>
  161. </table>
  162. </dd>
  163. </dl>
  164. <p>Because urlencoding expands the output string, it's not possible to do it in-place, ie, with escaped == string </p>
  165. </div>
  166. </div>
  167. </div><!-- contents -->
  168. </div><!-- doc-content -->
  169. <!-- start footer part -->
  170. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  171. <ul>
  172. <li class="footer">Generated by
  173. <a href="http://www.doxygen.org/index.html">
  174. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  175. </ul>
  176. </div>
  177. </body>
  178. </html>