NCBI C++ ToolKit
strtok_r.c
Go to the documentation of this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

Go to the SVN repository for this file.

1 /*
2  * strtok_r(3)
3  * 20020927 entropy@tappedin.com
4  * public domain. no warranty. use at your own risk. have a nice day.
5  */
6 
7 #include <config.h>
8 
9 #include <stdarg.h>
10 #include <stdio.h>
11 
12 #if HAVE_STRING_H
13 #include <string.h>
14 #endif /* HAVE_STRING_H */
15 
16 #include <freetds/sysdep_private.h>
17 #include "replacements.h"
18 
19 char *
20 tds_strtok_r(char *str, const char *sep, char **lasts)
21 {
22  char *p;
23 
24  if (str == NULL) {
25  str = *lasts;
26  }
27  if (str == NULL) {
28  return NULL;
29  }
30  str += strspn(str, sep); /* skip any separators */
31  if ((p = strpbrk(str, sep)) != NULL) {
32  *lasts = p + 1;
33  *p = '\0';
34  } else {
35  if (!*str)
36  str = NULL;
37  *lasts = NULL;
38  }
39  return str;
40 }
41 
#define NULL
Definition: ncbistd.hpp:225
char * tds_strtok_r(char *str, const char *sep, char **lasts)
Definition: strtok_r.c:20
static const char * str(char *buf, int n)
Definition: stats.c:84
Modified on Tue Apr 09 07:56:29 2024 by modify_doxy.py rev. 669887
Modified on Wed Apr 10 07:31:55 2024 by modify_doxy.py rev. 669887
Modified on Thu Apr 11 15:03:52 2024 by modify_doxy.py rev. 669887
Modified on Fri Apr 12 17:15:53 2024 by modify_doxy.py rev. 669887
Modified on Sat Apr 13 11:44:19 2024 by modify_doxy.py rev. 669887
Modified on Sun Apr 14 05:25:09 2024 by modify_doxy.py rev. 669887