home *** CD-ROM | disk | FTP | other *** search
/ rtsi.com / 2014.01.www.rtsi.com.tar / www.rtsi.com / OS9 / OSK / LIB / unix.zoo / strchr.c < prev    next >
Text File  |  2009-11-06  |  2KB  |  45 lines

  1.  
  2. /***************************************************************************/
  3. /*                                                                         */
  4. /* strchr() : Unix library (OS9/68000)                                     */
  5. /* ========                                                                */
  6. /*                                                                         */
  7. /* Author:     K. Schmitt                                                  */
  8. /* Compiler:   Microware C Vers. 3.0                                       */
  9. /* OS:         OS9/68000 Vers. 2.2                                         */
  10. /*                                                                         */
  11. /* Edition History                                                         */
  12. /* ===============                                                         */
  13. /*                                                                         */
  14. /* Ed. 0.00  Date 11/15/88                                                 */
  15. /*           First version                                                 */
  16. /*                                                                         */
  17. /***************************************************************************/
  18. /*                                                                         */
  19. /* Description                                                             */
  20. /*                                                                         */
  21. /*
  22.  
  23.           char *strchr (s, c)  
  24.           char *s, c;  
  25.  
  26.           Strchr (strrchr) returns a pointer to the first (last)
  27.           occurrence of character c in string s, or NULL if c does not 
  28.           occur in the string.  The null character terminating a
  29.           string is considered to be part of the string.
  30.  
  31. */
  32.  
  33. char *strchr (s, c)
  34.      register char *s, c;
  35.      {
  36.  
  37.      while (*s && (*s != c)) s++;
  38.  
  39.      if (*s == c) return (s);
  40.  
  41.      return ((char *) 0);
  42.  
  43.      } /* end of strchr */
  44.  
  45.