1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  */
   6: 
   7: /*
   8:  * Sys5 compat routine
   9:  */
  10: 
  11: #if defined(LIBC_SCCS) && !defined(lint)
  12: static char sccsid[] = "@(#)strtok.c	5.2 (Berkeley) 86/03/09";
  13: #endif
  14: 
  15: char *
  16: strtok(s, sep)
  17:     register char *s, *sep;
  18: {
  19:     register char *p;
  20:     register c;
  21:     static char *lasts;
  22: 
  23:     if (s == 0)
  24:         s = lasts;
  25:     if (s == 0)
  26:         return (0);
  27: 
  28:     while (c = *s) {
  29:         if (!index(sep, c))
  30:             break;
  31:         s++;
  32:     }
  33: 
  34:     if (c == '\0') {
  35:         lasts = 0;
  36:         return (0);
  37:     }
  38: 
  39:     for (p = s; c = *++p; )
  40:         if (index(sep, c))
  41:             break;
  42: 
  43:     if (c == '\0')
  44:         lasts = 0;
  45:     else {
  46:         *p++ = '\0';
  47:         lasts = p;
  48:     }
  49:     return (s);
  50: }

Defined functions

strtok defined in line 15; used 2 times

Defined variables

sccsid defined in line 12; never used
Last modified: 1986-03-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: ?E00
Valid CSS Valid XHTML 1.0 Strict