/[gnats]/gnats/libiberty/strstr.c
ViewVC logotype

Diff of /gnats/libiberty/strstr.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by brendan, Thu Nov 5 19:54:16 1998 UTC revision 1.2 by chewie, Sat Nov 13 05:14:17 2004 UTC
# Line 3  Line 3 
3    
4  /*  /*
5    
6  NAME  @deftypefn Supplemental char* strstr (const char *@var{string}, const char *@var{sub})
7    
8          strstr -- locate first occurance of a substring  This function searches for the substring @var{sub} in the string
9    @var{string}, not including the terminating null characters.  A pointer
10    to the first occurrence of @var{sub} is returned, or @code{NULL} if the
11    substring is absent.  If @var{sub} points to a string with zero
12    length, the function returns @var{string}.
13    
14  SYNOPSIS  @end deftypefn
15    
         #include <string.h>  
   
         char *strstr (char *s1, char *s2)  
   
 DESCRIPTION  
   
         Locates the first occurance in the string pointed to by S1 of  
         the string pointed to by S2.  Returns a pointer to the substring  
         found, or a NULL pointer if not found.  If S2 points to a string  
         with zero length, the function returns S1.  
           
 BUGS  
16    
17  */  */
18    
# Line 35  strstr (s1, s2) Line 27  strstr (s1, s2)
27    register char *p = s1;    register char *p = s1;
28    extern char *strchr ();    extern char *strchr ();
29    extern int strncmp ();    extern int strncmp ();
30  #if __GNUC__==2  #if __GNUC__ >= 2
31    extern __SIZE_TYPE__ strlen ();    extern __SIZE_TYPE__ strlen (const char *);
32  #endif  #endif
33    register int len = strlen (s2);    register int len = strlen (s2);
34    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26