summaryrefslogtreecommitdiff
path: root/PACE/pace/win32/string.c
blob: f7f79cc7fab3eb09904797201d71c32b19cf9a84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* $Id$

 * =============================================================================
 *
 * = LIBRARY
 *    pace
 *
 * = FILENAME
 *    pace/win32/string.c
 *
 * = AUTHOR
 *    Luther Baker
 *
 * ============================================================================= */

#include "pace/string.h"

#if !defined (PACE_HAS_INLINE)
# include "pace/win32/string.inl"
#endif /* ! PACE_HAS_INLINE */

#if (PACE_HAS_POSIX_CLSR_UOF)
char *
strtok_r (char * s, const char * sep, char ** lasts)
{
  int l_org;
  int l_sub;

  if (s == 0)
    s = *lasts;
  else
    *lasts = s;
  if (*s == 0)                  // We have reached the end
    return 0;
  l_org = pace_strlen (s);
  l_sub = pace_strlen (s = pace_strtok (s, sep));
  *lasts = s + l_sub;
  if (l_sub != l_org)
    *lasts += 1;
  return s ;
}
#endif /* PACE_HAS_POSIX_CLSR_UOF */