view docs/ccguide/findstr.refentry @ 2772:0a3f4d8ea6d5

Found ENDC in wrong location in dwread.asm and dwwrite.asm. Corrected. Moved the native 6309 code in dwread.asm and dwwrite.asm into the H6309 labeled area and changed IFEQ H6309 to IFNE H6309. Also moved the 57600bps 6809 code to the default location. This change had been done in the old dwread.asm and dwwrite.asm files to make it easier to follow. Though these two files were overwritten from the HDBDOS project dwread.asm and dwwrite.asm files. So this conversion needed to be done again so it made the source easier to follow.
author drencor-xeen
date Wed, 23 Jan 2013 12:36:55 -0600
parents d14042385d24
children
line wrap: on
line source

<refentry id="findstr">
<refnamediv>
<refname>Findstr</refname>
<refname>Findnstr</refname>
<refpurpose>string search</refpurpose>
</refnamediv>

<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
  <funcdef><function>findstr</function></funcdef>
  <paramdef>int <parameter>pos</parameter></paramdef>
  <paramdef>char *<parameter>string</parameter></paramdef>
  <paramdef>char *<parameter>pattern</parameter></paramdef>
</funcprototype>

<funcprototype>
  <funcdef><function>findnstr</function></funcdef>
  <paramdef>int <parameter>pos</parameter></paramdef>
  <paramdef>char *<parameter>string</parameter></paramdef>
  <paramdef>char *<parameter>pattern</parameter></paramdef>
  <paramdef>int <parameter>size</parameter></paramdef>
</funcprototype>
</funcsynopsis>

</refsynopsisdiv>

<refsect1><title>Description</title>
<para>
These functions search the string pointed to by "string" for
the first instance of the pattern pointed to by "pattern"
starting at position "pos" (where the first position is 1 not
0). The returned value is the position of the first matched
character of the pattern in the string or zero if a match is
not found.
</para>
<para>
Findstr stops searching the string when a null byte is found in
"string".
</para>
<para>
Findnstr only stops searching at position "pos" + "len" so it may
continue past null bytes.
</para>
</refsect1>

<refsect1><title>Caveats</title>
<para>
The current implementation does not use the most efficient
algorithm for pattern matching so that use on very long strings
is likely to be somewhat slower than it might be.
</para>
</refsect1>

<refsect1><title>See Also</title>
<para>
<link linkend="strcat">index(), rindex()</link>
</para>
</refsect1>

</refentry>