From 709897c2a574c8f946c12b90989a3ba464b535cf Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 12 Jul 2019 13:12:56 +0200 Subject: 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... --- TSRM/config.w32 | 2 +- TSRM/tsrm_strtok_r.c | 63 ---------------------------------------------------- TSRM/tsrm_strtok_r.h | 8 ------- 3 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 TSRM/tsrm_strtok_r.c delete mode 100644 TSRM/tsrm_strtok_r.h (limited to 'TSRM') 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 - -#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 -- cgit v1.2.1