changeset 529:871ccf549428

Finished these entries
author roug
date Fri, 11 Oct 2002 19:11:01 +0000
parents 85f6bd08ee7e
children c43b678c0055
files docs/ccguide/strcat.refentry docs/ccguide/system.refentry
diffstat 2 files changed, 129 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/docs/ccguide/strcat.refentry	Fri Oct 11 19:11:01 2002 +0000
+++ b/docs/ccguide/strcat.refentry	Fri Oct 11 19:11:01 2002 +0000
@@ -1,14 +1,80 @@
 <refentry id="strcat">
 <refnamediv>
-<refname>strcat</refname>
-<refpurpose>Placeholder</refpurpose>
+<refname>Strcat</refname>
+<refname>Strncat</refname>
+<refname>Strcmp</refname>
+<refname>Strncmp</refname>
+<refname>Strcpy</refname>
+<refname>Strhcpy</refname>
+<refname>Strncpy</refname>
+<refname>Strlen</refname>
+<refname>Index</refname>
+<refname>Rindex</refname>
+<refpurpose>string functions</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
 <funcsynopsis>
 <funcprototype>
-  <funcdef><function>strcat</function></funcdef>
-  <paramdef>type <parameter>arg1</parameter></paramdef>
+  <funcdef>char *<function>strcat</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>strncat</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+  <paramdef>int <parameter>n</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>int <function>strcmp</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>strhcpy</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>int <function>strncmp</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+  <paramdef>int <parameter>n</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>strcpy</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>strncpy</function></funcdef>
+  <paramdef>char *<parameter>s1</parameter></paramdef>
+  <paramdef>char *<parameter>s2</parameter></paramdef>
+  <paramdef>int <parameter>n</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>int <function>strlen</function></funcdef>
+  <paramdef>char *<parameter>s</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>index</function></funcdef>
+  <paramdef>char *<parameter>s</parameter></paramdef>
+  <paramdef>char <parameter>ch</parameter></paramdef>
+</funcprototype>
+
+<funcprototype>
+  <funcdef>char *<function>rindex</function></funcdef>
+  <paramdef>char *<parameter>s</parameter></paramdef>
+  <paramdef>char<parameter>ch</parameter></paramdef>
 </funcprototype>
 </funcsynopsis>
 
@@ -16,7 +82,52 @@
 
 <refsect1><title>Description</title>
 <para>
-Placeholder
+All strings passed to these functions are assumed null-terminated.
+</para>
+<para>
+Strcat appends a copy of the string pointed to by "s2" to the
+end of the string pointed to by "s1". Strncat copies at most
+"n" characters. Both return the first argument.
+</para>
+<para>
+Strcmp compares strings "s1" and "s2" for lexicographic order
+and returns an integer less than, equal to or greater than 0
+where, respectively, "s1" is less than, equal to or greater
+than "s2". Strncmp compares at most "n" characters.
+</para>
+<para>
+Strcpy copies characters from "s2" to the space pointed to by
+"s1" up to and including the null byte. Strncpy copies exactly
+"n" characters. If the string "s2" is too short, the "s1" will
+be padded with null bytes to make up the difference. If "s2"
+is too long, "s1" may not be null-terminated. Both functions
+return the first argument.
+</para>
+<para>
+Strhcpy copies string with sign bit terminator.
+</para>
+<para>
+Strlen returns the number of non-null characters in "s".
+</para>
+<para>
+Index returns a pointer to the first occurrence of "ch" in "s"
+or NULL if not found.
+</para>
+<para>
+Rindex returns a pointer to the last occurrence of "ch" in "s"
+or NULL if not found.
+</para>
+</refsect1>
+<refsect1><title>Caveats</title>
+<para>
+Strcat and strcpy have no means of checking that the space
+provided is large enough. It is the user's responsibility to
+ensure that string space does not overflow.
+</para>
+</refsect1>
+<refsect1><title>See Also</title>
+<para>
+Findstr().
 </para>
 </refsect1>
 </refentry>
--- a/docs/ccguide/system.refentry	Fri Oct 11 19:11:01 2002 +0000
+++ b/docs/ccguide/system.refentry	Fri Oct 11 19:11:01 2002 +0000
@@ -1,14 +1,14 @@
 <refentry id="system">
 <refnamediv>
-<refname>system</refname>
-<refpurpose>Placeholder</refpurpose>
+<refname>System</refname>
+<refpurpose>shell command interpreter</refpurpose>
 </refnamediv>
 
 <refsynopsisdiv>
 <funcsynopsis>
 <funcprototype>
   <funcdef><function>system</function></funcdef>
-  <paramdef>type <parameter>arg1</parameter></paramdef>
+  <paramdef>char *<parameter>string</parameter></paramdef>
 </funcprototype>
 </funcsynopsis>
 
@@ -16,7 +16,16 @@
 
 <refsect1><title>Description</title>
 <para>
-Placeholder
+System passes its argument to "shell" which executes it as a
+command line. The task is suspended until the shell command
+is completed and system returns the shell's exit status. The
+maximum length of string is 80 characters. If a longer string
+is needed, use os9fork.
+</para>
+</refsect1>
+<refsect1><title>See Also</title>
+<para>
+System calls "os9fork()","wait()".
 </para>
 </refsect1>
 </refentry>