aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevine Lu Linvega <aliceffekt@gmail.com>2020-09-14 15:24:33 -0700
committerDevine Lu Linvega <aliceffekt@gmail.com>2020-09-14 15:24:33 -0700
commitbcf8c0c32f176eaebd1c1ac031835f375b388b8d (patch)
tree129fcbaca4ac96786f33795339f69cf25224bf1e
parentafb04a529e8351ba7dd517a58b343c65157751d2 (diff)
*
-rw-r--r--tools/themes.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/tools/themes.c b/tools/themes.c
index 7866286..69145c3 100644
--- a/tools/themes.c
+++ b/tools/themes.c
@@ -59,54 +59,6 @@ error(char* name)
}
int
-scmp(char* a, char* b)
-{
- int i, l = slen(a);
- if(l != slen(b))
- return 0;
- for(i = 0; i < l; ++i)
- if(a[i] != b[i])
- return 0;
- return 1;
-}
-
-char*
-scat(char* dest, const char* src)
-{
- char* ptr = dest + slen(dest);
- while(*src != '\0')
- *ptr++ = *src++;
- *ptr = '\0';
- return dest;
-}
-
-int
-parse2(FILE* f)
-{
- int i, id = 0, next = 0;
- long theme[9];
- char line[BUFLEN], hexs[BUFLEN], comb[1024];
- char* ptr;
- while(fgets(line, BUFLEN, f)) {
- scat(comb, line);
- }
-
- for(i = 0; i < slen(comb); ++i) {
- if(comb[i] != '#')
- continue;
- printf("%s ", sstr(comb, hexs, i, 7));
- id++;
- }
-
- if(id != 9)
- return error("Invalid theme");
- for(i = 0; i < 9; ++i) {
- printf("%ld ", theme[i]);
- }
- return 1;
-}
-
-int
parse(FILE* f)
{
int i, id = 0;
@@ -139,5 +91,5 @@ main(int argc, char* argv[])
return error("Invalid input.\n");
} else
input = stdin;
- return parse2(input);
+ return parse(input);
} \ No newline at end of file