Subject | Hash | Author | Date (UTC) |
---|---|---|---|
Added parser_core files/functions. | 222c9be2ac2362f5502d2382dcd1d114b761aa25 | Catalin(ux) M. BOIE | 2010-07-06 14:45:21 |
Bumped up the version to 0.0.91. | b96da42bcc0a0781a695824fdb6ca3423fa716db | Catalin(ux) M. BOIE | 2010-07-05 14:39:21 |
Duilder updates. | cc0c7ff25ea3c51ad69bb71698f49532ea3b6578 | Catalin(ux) M. BOIE | 2010-07-05 14:38:50 |
Some paths need to be created. | 27932b9737b77f0ea9fedd8eb3d8326f04e6aa73 | Catalin(ux) M. BOIE | 2010-07-05 14:38:24 |
Improved paths and macros. | b6119ea638711c26e8499528faf8024163e24f2f | Catalin(ux) M. BOIE | 2010-07-05 14:37:59 |
Corrected wrong path to config file. | bcdc293ccb699c20ce3639f16c2812374b3dff88 | Catalin(ux) M. BOIE | 2010-07-05 14:37:21 |
Tests if the file exists before getting mtime. | 43044a8d442884e20ba866f0f92bf655bc02b131 | Catalin(ux) M. BOIE | 2010-07-05 14:36:51 |
Initial version (0.0.90). | 5807f4955d446127a7b873f5f3918f408ab93fff | Catalin(ux) M. BOIE | 2010-07-01 15:39:22 |
File | Lines added | Lines deleted |
---|---|---|
Makefile.in | 4 | 3 |
parser.c | 1 | 15 |
parser.h | 0 | 2 |
parser_core.c | 35 | 0 |
parser_core.h | 7 | 0 |
parser_text.c | 1 | 0 |
File Makefile.in changed (mode: 100644) (index 29c7317..5fee70f) | |||
... | ... | export CC := gcc | |
2 | 2 | export INCS += -I. | export INCS += -I. |
3 | 3 | export LIBS += | export LIBS += |
4 | 4 | export CFLAGS += -ggdb3 -Wall -Wextra -pedantic -Wno-long-long -pipe $(INCS) | export CFLAGS += -ggdb3 -Wall -Wextra -pedantic -Wno-long-long -pipe $(INCS) |
5 | export OBJS += i_util.o parser_text.o parser_ip2location.o parser.o i_conf.o | ||
5 | export OBJS += i_util.o parser_text.o parser_ip2location.o parser.o i_conf.o \ | ||
6 | parser_core.o | ||
6 | 7 | ||
7 | 8 | .PHONY: all | .PHONY: all |
8 | 9 | all: ip2clued ip2clue | all: ip2clued ip2clue |
... | ... | ip2clue: $(OBJS) ip2clue.c | |
16 | 17 | i_util.o: i_util.c i_util.h i_types.h i_config.h | i_util.o: i_util.c i_util.h i_types.h i_config.h |
17 | 18 | $(CC) $(CFLAGS) -c $< | $(CC) $(CFLAGS) -c $< |
18 | 19 | ||
19 | parser_text.o: parser_text.c parser_text.h i_util.o | ||
20 | parser_text.o: parser_text.c parser_text.h i_util.o parser_core.o | ||
20 | 21 | $(CC) $(CFLAGS) -c $< | $(CC) $(CFLAGS) -c $< |
21 | 22 | ||
22 | 23 | parser_ip2location.o: parser_ip2location.c i_util.o | parser_ip2location.o: parser_ip2location.c i_util.o |
23 | 24 | $(CC) $(CFLAGS) -c $< | $(CC) $(CFLAGS) -c $< |
24 | 25 | ||
25 | parser.o: parser.c parser.h parser_text.o parser_ip2location.o | ||
26 | parser.o: parser.c parser.h parser_text.o parser_ip2location.o parser_core.o | ||
26 | 27 | $(CC) $(CFLAGS) -c $< | $(CC) $(CFLAGS) -c $< |
27 | 28 | ||
28 | 29 | i_conf.o: i_conf.c i_conf.h i_config.h | i_conf.o: i_conf.c i_conf.h i_config.h |
File parser.c changed (mode: 100644) (index 2f42074..e6d8fb9) | |||
13 | 13 | #include <unistd.h> | #include <unistd.h> |
14 | 14 | ||
15 | 15 | #include <i_util.h> | #include <i_util.h> |
16 | #include <parser_core.h> | ||
16 | 17 | #include <parser_text.h> | #include <parser_text.h> |
17 | 18 | #include <parser_ip2location.h> | #include <parser_ip2location.h> |
18 | 19 | ||
... | ... | int ip2clue_parse_file(struct ip2clue_db *db, const char *file_name, | |
71 | 72 | return 0; | return 0; |
72 | 73 | } | } |
73 | 74 | ||
74 | /* | ||
75 | * Returns the format based on code | ||
76 | */ | ||
77 | char *ip2clue_format(enum ip2clue_format f) | ||
78 | { | ||
79 | switch (f) { | ||
80 | case IP2CLUE_FORMAT_WEBHOSTING: return "webhosting"; | ||
81 | case IP2CLUE_FORMAT_MAXMIND: return "maxmind"; | ||
82 | case IP2CLUE_FORMAT_MAXMIND_V6: return "maxmind-v6"; | ||
83 | case IP2CLUE_FORMAT_SOFTWARE77: return "software77"; | ||
84 | case IP2CLUE_FORMAT_IP2LOCATION: return "ip2location"; | ||
85 | default: return "unknown"; | ||
86 | } | ||
87 | } | ||
88 | |||
89 | 75 | /* | /* |
90 | 76 | * Init a list of databases | * Init a list of databases |
91 | 77 | */ | */ |
File parser.h changed (mode: 100644) (index 21dceeb..bb3bd11) | |||
... | ... | extern int ip2clue_parse_file(struct ip2clue_db *db, | |
9 | 9 | const char *file_name, | const char *file_name, |
10 | 10 | const char *format); | const char *format); |
11 | 11 | ||
12 | extern char *ip2clue_format(enum ip2clue_format f); | ||
13 | |||
14 | 12 | extern void ip2clue_list_init(struct ip2clue_list *list); | extern void ip2clue_list_init(struct ip2clue_list *list); |
15 | 13 | extern void ip2clue_list_destroy(struct ip2clue_list *db); | extern void ip2clue_list_destroy(struct ip2clue_list *db); |
16 | 14 |
File parser_core.c added (mode: 100644) (index 0000000..0f4c669) | |||
1 | /* | ||
2 | * Author: Catalin(ux) M. BOIE | ||
3 | * Description: parser for IP files | ||
4 | */ | ||
5 | |||
6 | #include <i_config.h> | ||
7 | |||
8 | /* | ||
9 | #include <sys/time.h> | ||
10 | #include <sys/types.h> | ||
11 | #include <sys/stat.h> | ||
12 | #include <stdio.h> | ||
13 | #include <string.h> | ||
14 | #include <unistd.h> | ||
15 | */ | ||
16 | |||
17 | #include <i_util.h> | ||
18 | #include <parser_core.h> | ||
19 | |||
20 | |||
21 | /* | ||
22 | * Returns the format based on code | ||
23 | */ | ||
24 | char *ip2clue_format(enum ip2clue_format f) | ||
25 | { | ||
26 | switch (f) { | ||
27 | case IP2CLUE_FORMAT_WEBHOSTING: return "webhosting"; | ||
28 | case IP2CLUE_FORMAT_MAXMIND: return "maxmind"; | ||
29 | case IP2CLUE_FORMAT_MAXMIND_V6: return "maxmind-v6"; | ||
30 | case IP2CLUE_FORMAT_SOFTWARE77: return "software77"; | ||
31 | case IP2CLUE_FORMAT_IP2LOCATION: return "ip2location"; | ||
32 | default: return "unknown"; | ||
33 | } | ||
34 | } | ||
35 |
File parser_core.h added (mode: 100644) (index 0000000..da4eb38) | |||
1 | #ifndef IP2CLUE_PARSER_CORE_H | ||
2 | #define IP2CLUE_PARSER_CORE_H 1 | ||
3 | |||
4 | extern char *ip2clue_format(enum ip2clue_format f); | ||
5 | |||
6 | |||
7 | #endif |
File parser_text.c changed (mode: 100644) (index bcf58bf..47ba7fb) | |||
12 | 12 | ||
13 | 13 | #include <i_types.h> | #include <i_types.h> |
14 | 14 | #include <i_util.h> | #include <i_util.h> |
15 | #include <parser_core.h> | ||
15 | 16 | #include <parser_text.h> | #include <parser_text.h> |
16 | 17 | #include <parser_ip2location.h> | #include <parser_ip2location.h> |
17 | 18 |