summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2010-04-05 18:36:50 +0000
committerKim Woelders <kim@woelders.dk>2010-04-05 18:36:50 +0000
commitd3bdadd6233043a2c67e38ff34c58c52c9371369 (patch)
tree29091120641f5d8b418ed602dbb29f4806a5d322
parent3eb65fa228b2a40f528f463a661dcffc03837ee0 (diff)
downloadimlib2-d3bdadd6233043a2c67e38ff34c58c52c9371369.tar.gz
Remove unused __imlib_FileField functions.
SVN revision: 47773
-rw-r--r--src/lib/file.c106
-rw-r--r--src/lib/file.h1
2 files changed, 0 insertions, 107 deletions
diff --git a/src/lib/file.c b/src/lib/file.c
index d693048..6a485e4 100644
--- a/src/lib/file.c
+++ b/src/lib/file.c
@@ -13,8 +13,6 @@
#include <pwd.h>
#include "file.h"
-static void __imlib_FileFieldWord(char *s, int num, char *wd);
-
char *
__imlib_FileKey(const char *file)
{
@@ -400,107 +398,3 @@ __imlib_FileHomeDir(int uid)
#endif
return NULL;
}
-
-/* gets word number [num] in the string [s] and copies it into [wd] */
-/* wd is NULL terminated. If word [num] does not exist wd = "" */
-/* NB: this function now handles quotes so for a line: */
-/* Hello to "Welcome sir - may I Help" Shub Foo */
-/* Word 1 = Hello */
-/* Word 2 = to */
-/* Word 3 = Welcome sir - may I Help */
-/* Word 4 = Shub */
-/* word 5 = Foo */
-
-char *
-__imlib_FileField(char *s, int field)
-{
- char buf[4096];
-
- buf[0] = 0;
- __imlib_FileFieldWord(s, field + 1, buf);
- if (buf[0])
- {
- if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)")))
- return (NULL);
- return (strdup(buf));
- }
- return (NULL);
-}
-
-static void
-__imlib_FileFieldWord(char *s, int num, char *wd)
-{
- char *cur, *start, *end;
- int count, inword, inquote, len;
-
- if (!s)
- return;
- if (!wd)
- return;
- *wd = 0;
- if (num <= 0)
- return;
- cur = s;
- count = 0;
- inword = 0;
- inquote = 0;
- start = NULL;
- end = NULL;
- while ((*cur) && (count < num))
- {
- if (inword)
- {
- if (inquote)
- {
- if (*cur == '"')
- {
- inquote = 0;
- inword = 0;
- end = cur;
- count++;
- }
- }
- else
- {
- if (isspace(*cur))
- {
- end = cur;
- inword = 0;
- count++;
- }
- }
- }
- else
- {
- if (!isspace(*cur))
- {
- if (*cur == '"')
- {
- inquote = 1;
- start = cur + 1;
- }
- else
- start = cur;
- inword = 1;
- }
- }
- if (count == num)
- break;
- cur++;
- }
- if (!start)
- return;
- if (!end)
- end = cur;
- if (end <= start)
- return;
- len = (int)(end - start);
- if (len > 4000)
- len = 4000;
- if (len > 0)
- {
- strncpy(wd, start, len);
- wd[len] = 0;
- }
- return;
-}
diff --git a/src/lib/file.h b/src/lib/file.h
index 6211eef..2ba6958 100644
--- a/src/lib/file.h
+++ b/src/lib/file.h
@@ -12,7 +12,6 @@ __hidden void __imlib_FileFreeDirList(char **l, int num);
__hidden void __imlib_FileDel(char *s);
__hidden time_t __imlib_FileModDate(const char *s);
__hidden char *__imlib_FileHomeDir(int uid);
-__hidden char *__imlib_FileField(char *s, int field);
__hidden int __imlib_FilePermissions(const char *s);
__hidden int __imlib_FileCanRead(const char *s);
__hidden int __imlib_IsRealFile(const char *s);