param.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <refentry id="refparam">
  2. <refmeta>
  3. <refentrytitle>ne_strparam</refentrytitle>
  4. <manvolnum>3</manvolnum>
  5. </refmeta>
  6. <refnamediv>
  7. <refname id="ne_strparam">ne_strparam</refname>
  8. <refpurpose>HTTP extended parameter value encoding</refpurpose>
  9. </refnamediv>
  10. <refsynopsisdiv>
  11. <funcsynopsis>
  12. <funcsynopsisinfo>#include &lt;ne_string.h&gt;</funcsynopsisinfo>
  13. <funcprototype>
  14. <funcdef>char *<function>ne_strparam</function></funcdef>
  15. <paramdef>const char *<parameter>charset</parameter></paramdef>
  16. <paramdef>const char *<parameter>lang</parameter></paramdef>
  17. <paramdef>const char *<parameter>value</parameter></paramdef>
  18. </funcprototype>
  19. </funcsynopsis>
  20. </refsynopsisdiv>
  21. <refsect1>
  22. <title>Description</title>
  23. <para>The <function>ne_strparam</function> function can be
  24. used to encode an extended parameter value for an HTTP header,
  25. as defined in RFC 5987. The function takes as arguments the
  26. <parameter>value</parameter> to encode, using a given MIME
  27. <parameter>charset</parameter> character set, and
  28. <parameter>lang</parameter> language tag. The extended
  29. parameter encoding is used in HTTP protocol specifications to
  30. allow easily embedding special characters (such as quote
  31. marks, separators or non-ASCII) in header values.</para>
  32. <para>In accordance with RFC 5987, the
  33. <parameter>charset</parameter> argument must be either
  34. <constant>"UTF-8"</constant> or
  35. <constant>"IS0-8859-1"</constant>, but the
  36. <parameter>lang</parameter> argument may be &null;.</para>
  37. </refsect1>
  38. <refsect1>
  39. <title>Return value</title>
  40. <para>The return value is either:
  41. <variablelist>
  42. <varlistentry>
  43. <term>&null;</term>
  44. <listitem><simpara>if the value parameter is a "regular
  45. parameter" and does not need extended
  46. encoding</simpara></listitem> </varlistentry>
  47. <varlistentry>
  48. <term>non-&null;</term>
  49. <listitem><simpara>the encoding of the input value as an
  50. extended parameter as a NUL-terminated, malloc-allocated
  51. string</simpara></listitem>
  52. </varlistentry>
  53. </variablelist></para>
  54. </refsect1>
  55. <refsect1>
  56. <title>History</title>
  57. <para><function>ne_strparam</function> is
  58. available in &neon; 0.32.0 and later.</para>
  59. </refsect1>
  60. <refsect1>
  61. <title>See also</title>
  62. <para><ulink url="https://www.rfc-editor.org/rfc/rfc5987.html"/></para>
  63. </refsect1>
  64. </refentry>