466
|
1 <refentry id="findstr">
|
|
2 <refnamediv>
|
555
|
3 <refname>Findstr</refname>
|
|
4 <refname>Findnstr</refname>
|
|
5 <refpurpose>string search</refpurpose>
|
466
|
6 </refnamediv>
|
|
7
|
|
8 <refsynopsisdiv>
|
|
9 <funcsynopsis>
|
|
10 <funcprototype>
|
|
11 <funcdef><function>findstr</function></funcdef>
|
555
|
12 <paramdef>int <parameter>pos</parameter></paramdef>
|
|
13 <paramdef>char *<parameter>string</parameter></paramdef>
|
|
14 <paramdef>char *<parameter>pattern</parameter></paramdef>
|
|
15 </funcprototype>
|
|
16
|
|
17 <funcprototype>
|
|
18 <funcdef><function>findnstr</function></funcdef>
|
|
19 <paramdef>int <parameter>pos</parameter></paramdef>
|
|
20 <paramdef>char *<parameter>string</parameter></paramdef>
|
|
21 <paramdef>char *<parameter>pattern</parameter></paramdef>
|
|
22 <paramdef>int <parameter>size</parameter></paramdef>
|
466
|
23 </funcprototype>
|
|
24 </funcsynopsis>
|
|
25
|
|
26 </refsynopsisdiv>
|
|
27
|
|
28 <refsect1><title>Description</title>
|
|
29 <para>
|
555
|
30 These functions search the string pointed to by "string" for
|
|
31 the first instance of the pattern pointed to by "pattern"
|
|
32 starting at position "pos" (where the first position is 1 not
|
|
33 0). The returned value is the position of the first matched
|
|
34 character of the pattern in the string or zero if a match is
|
|
35 not found.
|
|
36 </para>
|
|
37 <para>
|
|
38 Findstr stops searching the string when a null byte is found in
|
|
39 "string".
|
|
40 </para>
|
|
41 <para>
|
|
42 Findnstr only stops searching at position "pos" + "len" so it may
|
|
43 continue past null bytes.
|
|
44 </para>
|
|
45 </refsect1>
|
|
46
|
|
47 <refsect1><title>Caveats</title>
|
|
48 <para>
|
|
49 The current implementation does not use the most efficient
|
|
50 algorithm for pattern matching so that use on very long strings
|
|
51 is likely to be somewhat slower than it might be.
|
466
|
52 </para>
|
|
53 </refsect1>
|
542
|
54
|
|
55 <refsect1><title>See Also</title>
|
|
56 <para>
|
|
57 <link linkend="strcat">index(), rindex()</link>
|
|
58 </para>
|
|
59 </refsect1>
|
|
60
|
466
|
61 </refentry>
|