functions.xml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
  4. <section id="pdt.functions" xmlns:xi="http://www.w3.org/2001/XInclude">
  5. <sectioninfo>
  6. </sectioninfo>
  7. <title>Functions</title>
  8. <section id="prefix2domain">
  9. <title>
  10. <function>prefix2domain(mode)</function>
  11. </title>
  12. <para>
  13. Build a new URI if it is necessary. Returns 1 when the translation
  14. was made or there was nothing to translate (user part of the URI is
  15. empty, it does not match the prefix parameter or there is no domain
  16. associated with a possible prefix from user part). Returns -1 in
  17. error cases.
  18. </para>
  19. <para>
  20. The "mode" parameter specifies whether to strip or not the prefix
  21. from user part. If the parameter is missing or it has the value
  22. "0", then the prefix is removed along with the leading
  23. prefix. If the value is "1", only the leading prefix
  24. is removed. If the values is "2" the user part of the
  25. URI is not changed.
  26. </para>
  27. <example>
  28. <title><function>prefix2domain</function> usage</title>
  29. <programlisting>
  30. ...
  31. prefix2domain();
  32. ...
  33. prefix2domain("2");
  34. ...
  35. </programlisting>
  36. </example>
  37. </section>
  38. </section>