Xinu7/man/man3/string.doc




STRING(3)           Xinu Programmer's Manual            STRING(3)



NAME
     strcat, strncat, strcmp, strncmp, strcpy, strncpy, strlen,
     index, rindex - string operations

SYNOPSIS
     char *strcat(s1, s2)
     char *s1, *s2;

     char *strncat(s1, s2, n)
     char *s1, *s2;

     strcmp(s1, s2)
     char *s1, *s2;

     strncmp(s1, s2, n)
     char *s1, *s2;

     char *strcpy(s1, s2)
     char *s1, *s2;

     char *strncpy(s1, s2, n)
     char *s1, *s2;

     strlen(s)
     char *s;

     char *index(s, c)
     char *s, c;

     char *rindex(s, c)
     char *s, c;

DESCRIPTION
     These functions operate on null-terminated strings.  They do
     not check for overflow of any receiving string.

     _S_t_r_c_a_t appends a copy of string _s_2 to the end of string _s_1.
     _S_t_r_n_c_a_t copies at most _n characters.  Both return a pointer
     to the null-terminated result.

     _S_t_r_c_m_p compares its arguments and returns an integer greater
     than, equal to, or less than 0, according as _s_1 is lexico-
     graphically greater than, equal to, or less than _s_2.
     _S_t_r_n_c_m_p makes the same comparison but examines at most _n
     characters.

     _S_t_r_c_p_y copies string _s_2 to _s_1, stopping after the null char-
     acter has been moved.  _S_t_r_n_c_p_y copies exactly _n characters,
     truncating or null-padding _s_2; the target may not be null-
     terminated if the length of _s_2 is _n or more.  Both return
     _s_1.




Version 6b               Printed 1/12/87                        1






STRING(3)           Xinu Programmer's Manual            STRING(3)



     _S_t_r_l_e_n returns the number of non-null characters in _s.

     _I_n_d_e_x (_r_i_n_d_e_x) returns a pointer to the first (last)
     occurrence of character _c in string _s, or zero if _c does not
     occur in  the string.


















































Version 6b               Printed 1/12/87                        2