summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Stoeckmann <tobias@stoeckmann.org>2022-01-11 21:34:47 +0100
committerBenBE <BenBE@geshi.org>2022-01-11 21:42:57 +0100
commita133ffd8295302ea5fb0ba6f609e811adc7d1d9d (patch)
tree8d019e4f59e33e2417baa70084d148a0f4f1bcf8
parentfde12434432f51ed773957824aa9460f5cc99e85 (diff)
Removed unused String_getToken function
Since String_getToken is not used anymore and currently only supports a 50 char token, simply remove it for now.
-rw-r--r--XUtils.c29
-rw-r--r--XUtils.h2
2 files changed, 0 insertions, 31 deletions
diff --git a/XUtils.c b/XUtils.c
index 96e93cbb..827fa950 100644
--- a/XUtils.c
+++ b/XUtils.c
@@ -161,35 +161,6 @@ void String_freeArray(char** s) {
free(s);
}
-char* String_getToken(const char* line, const unsigned short int numMatch) {
- const size_t len = strlen(line);
- char inWord = 0;
- unsigned short int count = 0;
- char match[50];
-
- size_t foundCount = 0;
-
- for (size_t i = 0; i < len; i++) {
- char lastState = inWord;
- inWord = line[i] == ' ' ? 0 : 1;
-
- if (lastState == 0 && inWord == 1)
- count++;
-
- if (inWord == 1) {
- if (count == numMatch && line[i] != ' ' && line[i] != '\0' && line[i] != '\n' && line[i] != (char)EOF) {
- if (foundCount == sizeof(match) / sizeof(match[0]) - 1)
- break;
- match[foundCount] = line[i];
- foundCount++;
- }
- }
- }
-
- match[foundCount] = '\0';
- return xStrdup(match);
-}
-
char* String_readLine(FILE* fd) {
const size_t step = 1024;
size_t bufSize = step;
diff --git a/XUtils.h b/XUtils.h
index eeb214d1..6c096df4 100644
--- a/XUtils.h
+++ b/XUtils.h
@@ -54,8 +54,6 @@ char** String_split(const char* s, char sep, size_t* n);
void String_freeArray(char** s);
-char* String_getToken(const char* line, unsigned short int numMatch) ATTR_MALLOC;
-
char* String_readLine(FILE* fd) ATTR_MALLOC;
/* Always null-terminates dest. Caller must pass a strictly positive size. */

© 2014-2024 Faster IT GmbH | imprint | privacy policy