diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-12 13:12:56 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2019-07-12 13:14:24 +0200 |
commit | 709897c2a574c8f946c12b90989a3ba464b535cf (patch) | |
tree | 6b63e391aaba389b122caeb13ae555a3dd8b6ed8 /TSRM | |
parent | 94d37a5dd7bc493de0842f8f704706bf13b57918 (diff) | |
download | php-git-709897c2a574c8f946c12b90989a3ba464b535cf.tar.gz |
Remove unused tsrm_strtok_r() function
There is also a php_strtok_r() function, which is actually used,
but nothing uses the tsrm_strtok_r() variant...
Diffstat (limited to 'TSRM')
-rw-r--r-- | TSRM/config.w32 | 2 | ||||
-rw-r--r-- | TSRM/tsrm_strtok_r.c | 63 | ||||
-rw-r--r-- | TSRM/tsrm_strtok_r.h | 8 |
3 files changed, 1 insertions, 72 deletions
diff --git a/TSRM/config.w32 b/TSRM/config.w32 index c65a91cc97..fa7145ae4d 100644 --- a/TSRM/config.w32 +++ b/TSRM/config.w32 @@ -1,4 +1,4 @@ // vim:ft=javascript -ADD_SOURCES("TSRM", "TSRM.c tsrm_strtok_r.c tsrm_win32.c"); +ADD_SOURCES("TSRM", "TSRM.c tsrm_win32.c"); ADD_FLAG("CFLAGS_BD_TSRM", "/D ZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); diff --git a/TSRM/tsrm_strtok_r.c b/TSRM/tsrm_strtok_r.c deleted file mode 100644 index 472105b43e..0000000000 --- a/TSRM/tsrm_strtok_r.c +++ /dev/null @@ -1,63 +0,0 @@ -#include <stdio.h> - -#include "tsrm_config_common.h" -#include "tsrm_strtok_r.h" - -static inline int in_character_class(char ch, const char *delim) -{/*{{{*/ - while (*delim) { - if (*delim == ch) { - return 1; - } - delim++; - } - return 0; -}/*}}}*/ - -TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last) -{/*{{{*/ - char *token; - - if (s == NULL) { - s = *last; - } - - while (*s && in_character_class(*s, delim)) { - s++; - } - if (!*s) { - return NULL; - } - - token = s; - - while (*s && !in_character_class(*s, delim)) { - s++; - } - if (!*s) { - *last = s; - } else { - *s = '\0'; - *last = s + 1; - } - return token; -}/*}}}*/ - -#if 0 - -main() -{ - char foo[] = "/foo/bar//\\barbara"; - char *last; - char *token; - - token = tsrm_strtok_r(foo, "/\\", &last); - while (token) { - printf ("Token = '%s'\n", token); - token = tsrm_strtok_r(NULL, "/\\", &last); - } - - return 0; -} - -#endif diff --git a/TSRM/tsrm_strtok_r.h b/TSRM/tsrm_strtok_r.h deleted file mode 100644 index 323b401d99..0000000000 --- a/TSRM/tsrm_strtok_r.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef TSRM_STRTOK_R -#define TSRM_STRTOK_R - -#include "TSRM.h" - -TSRM_API char *tsrm_strtok_r(char *s, const char *delim, char **last); - -#endif |