modules/ims_qos: added patch for flow-description bug when request originates from...
[sip-router] / src / lib / cds / doc / str_other.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
4    "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5
6 <refentry id="str_other">
7
8 <refmeta><refentrytitle>helper functions</refentrytitle>
9 <manvolnum>3</manvolnum></refmeta>
10
11 <refnamediv>
12 <refname>zt2str</refname>
13 <refname>is_str_empty</refname>
14 <refname>zt_strdup</refname>
15 <refname>str_prefix</refname>
16 <refname>str_strchr</refname>
17 <refpurpose>various string helper functions</refpurpose>
18 </refnamediv>
19
20 <refsynopsisdiv><funcsynopsis>
21
22 <funcsynopsisinfo>
23 #include &lt;cds/sstr.h&gt;
24 </funcsynopsisinfo>
25
26 <funcprototype>
27   <funcdef>str_t <function>zt2str</function></funcdef>
28   <paramdef>char *<parameter>s</parameter></paramdef>
29 </funcprototype>
30
31 <funcprototype>
32   <funcdef>int <function>is_str_empty</function></funcdef>
33   <paramdef>const str_t *<parameter>s</parameter></paramdef>
34 </funcprototype>
35
36 <funcprototype>
37   <funcdef>char *<function>zt_strdup</function></funcdef>
38   <paramdef>const char *<parameter>src</parameter></paramdef>
39 </funcprototype>
40
41 <funcprototype>
42   <funcdef>int <function>str_prefix</function></funcdef>
43   <paramdef>const str_t *<parameter>a</parameter></paramdef>
44   <paramdef>const str_t *<parameter>b</parameter></paramdef>
45 </funcprototype>
46
47 <funcprototype>
48   <funcdef>char *<function>str_strchr</function></funcdef>
49   <paramdef>const str_t *<parameter>s</parameter></paramdef>
50   <paramdef>char <parameter>c</parameter></paramdef>
51 </funcprototype>
52
53 </funcsynopsis></refsynopsisdiv>
54
55 <refsect1><title>Description</title>
56 <para><function>zt2str</function> converts zero terminated string to
57 <structname>str_t</structname>. It doesn't copy data - both strings use the same
58 buffer!
59 </para>
60
61 <para><function>is_str_empty</function> returns 1 if given string is empty (NULL
62 pointer or length &lt; 1 or NULL pointer to string data)
63 </para>
64
65 <para><function>zt_strdup</function> duplicates given zero terminated string to
66 another zero terminated string using cds_malloc function
67 </para>
68
69 <para><function>str_prefix</function> returns 0 if string
70 <parameter>b</parameter> is prefix of <parameter>a</parameter>, nonzero
71 otherwise (deprecated)
72 </para>
73
74 <para><function>str_strchr</function> searches for given character. It returns
75 pointer to it in the string or NULL if not found.
76 </para>
77 </refsect1>
78
79 <refsect1><title>See Also</title>
80 <para><xref linkend="str_t"/></para>
81 </refsect1>
82
83 </refentry> 
84