diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-03-15 13:29:52 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2018-03-15 14:12:23 +0200 |
commit | 58a8936d30bbb18b8ad93fecfe3fe2210d1c18b2 (patch) | |
tree | 01fcd1416af582e2429f0ae8d120e2af39b8f9d9 | |
parent | 677473cdfc42b9fd83623902e80de946f108825c (diff) | |
download | eclat-58a8936d30bbb18b8ad93fecfe3fe2210d1c18b2.tar.gz eclat-58a8936d30bbb18b8ad93fecfe3fe2210d1c18b2.tar.bz2 |
Upgrade grecs
* grecs: pull
* configure.ac: Enable json
* lib/Makefile.am (AM_CPPFLAGS): Use @GRECS_INCLUDES@
(libeclat_a_SOURCES): Remove json sources.
* src/Makefile.am (AM_CPPFLAGS): Use @GRECS_INCLUDES@
* tests/Makefile.am: Likewise.
* lib/json.h: Remove.
* lib/jsongrm.y: Remove.
* lib/jsonlex.l: Remove.
* tests/tjson.c: Remove.
* src/config.c (eclat_kw): Mark statically initialized memory locations
as such.
* src/mktags.c (process_tags): Use wordsplit to process quoted arguments.
* lib/bidimap.c (bidimap_config): Fill allocated memory with 0's
* lib/filemap.c (filemap_config): Likewise.
* lib/gdbmmap.c (gdbm_map_config): Likewise.
* lib/seqmap.c (seqmap_config): Likewise.
-rw-r--r-- | configure.ac | 2 | ||||
m--------- | grecs | 0 | ||||
-rw-r--r-- | lib/Makefile.am | 11 | ||||
-rw-r--r-- | lib/bidimap.c | 4 | ||||
-rw-r--r-- | lib/filemap.c | 4 | ||||
-rw-r--r-- | lib/forlangrm.y | 4 | ||||
-rw-r--r-- | lib/forlanlex.l | 15 | ||||
-rw-r--r-- | lib/gdbmmap.c | 4 | ||||
-rw-r--r-- | lib/json.h | 66 | ||||
-rw-r--r-- | lib/jsongrm.y | 316 | ||||
-rw-r--r-- | lib/jsonlex.l | 183 | ||||
-rw-r--r-- | lib/map.c | 6 | ||||
-rw-r--r-- | lib/req2url.c | 6 | ||||
-rw-r--r-- | lib/reqcreat.c | 2 | ||||
-rw-r--r-- | lib/reqencode.c | 4 | ||||
-rw-r--r-- | lib/reqsign.c | 8 | ||||
-rw-r--r-- | lib/seqmap.c | 4 | ||||
-rw-r--r-- | src/.gitignore | 1 | ||||
-rw-r--r-- | src/Makefile.am | 6 | ||||
-rw-r--r-- | src/config.c | 7 | ||||
-rw-r--r-- | src/eclat.h | 2 | ||||
-rw-r--r-- | src/ispeek.c | 26 | ||||
-rw-r--r-- | src/mktags.c | 32 | ||||
-rw-r--r-- | src/util.c | 43 | ||||
-rw-r--r-- | tests/Makefile.am | 5 | ||||
-rw-r--r-- | tests/tjson.c | 116 |
26 files changed, 97 insertions, 780 deletions
diff --git a/configure.ac b/configure.ac index 1673dbb..72aee3e 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -114,7 +114,7 @@ AM_CONDITIONAL([COND_LDAP],[test $status_ldap = yes]) | |||
114 | 114 | ||
115 | # Grecs subsystem | 115 | # Grecs subsystem |
116 | 116 | ||
117 | GRECS_SETUP([grecs],[tests getopt git2chg]) | 117 | GRECS_SETUP([grecs],[tests getopt json git2chg]) |
118 | 118 | ||
119 | # | 119 | # |
120 | AC_ARG_ENABLE([split-format], | 120 | AC_ARG_ENABLE([split-format], |
diff --git a/grecs b/grecs | |||
Subproject 6331e7708f13efed852e6b85aa17ac21dc158ad | Subproject 27ca9f5819d0e44173a5f61a241cd066ad15713 | ||
diff --git a/lib/Makefile.am b/lib/Makefile.am index 711bc98..e1ed1c3 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am | |||
@@ -1,5 +1,5 @@ | |||
1 | # This file is part of Eclat | 1 | # This file is part of Eclat |
2 | # Copyright (C) 2012-2015 Sergey Poznyakoff | 2 | # Copyright (C) 2012-2018 Sergey Poznyakoff |
3 | # | 3 | # |
4 | # Eclat is free software; you can redistribute it and/or modify | 4 | # Eclat is free software; you can redistribute it and/or modify |
5 | # it under the terms of the GNU General Public License as published by | 5 | # it under the terms of the GNU General Public License as published by |
@@ -43,10 +43,6 @@ libeclat_a_SOURCES=\ | |||
43 | forlangrm.y\ | 43 | forlangrm.y\ |
44 | forlanlex.l\ | 44 | forlanlex.l\ |
45 | istore.c\ | 45 | istore.c\ |
46 | json.h\ | ||
47 | jsongrm.h\ | ||
48 | jsongrm.y\ | ||
49 | jsonlex.l\ | ||
50 | getans.c\ | 46 | getans.c\ |
51 | getyn.c\ | 47 | getyn.c\ |
52 | hmac_sha1.c\ | 48 | hmac_sha1.c\ |
@@ -71,14 +67,11 @@ libeclat_a_SOURCES=\ | |||
71 | $(maps) | 67 | $(maps) |
72 | 68 | ||
73 | AM_LDFLAGS = $(CURL_LIBS) | 69 | AM_LDFLAGS = $(CURL_LIBS) |
74 | AM_CPPFLAGS = -I$(top_srcdir)/grecs/src/ $(CURL_CFLAGS) | 70 | AM_CPPFLAGS = @GRECS_INCLUDES@ $(CURL_CFLAGS) |
75 | 71 | ||
76 | forlanlex.c: forlangrm.h | 72 | forlanlex.c: forlangrm.h |
77 | forlangrm.c forlangrm.h: forlangrm.y | 73 | forlangrm.c forlangrm.h: forlangrm.y |
78 | 74 | ||
79 | jsonlex.c: jsongrm.h | ||
80 | jsongrm.c jsongrm.h: jsongrm.y | ||
81 | |||
82 | AM_YFLAGS=-tdv | 75 | AM_YFLAGS=-tdv |
83 | AM_LFLAGS=-dp | 76 | AM_LFLAGS=-dp |
84 | 77 | ||
diff --git a/lib/bidimap.c b/lib/bidimap.c index fc601c8..aafc736 100644 --- a/lib/bidimap.c +++ b/lib/bidimap.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of Eclat. | 1 | /* This file is part of Eclat. |
2 | Copyright (C) 2012-2015 Sergey Poznyakoff. | 2 | Copyright (C) 2012-2018 Sergey Poznyakoff. |
3 | 3 | ||
4 | Eclat is free software; you can redistribute it and/or modify | 4 | Eclat is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
@@ -100,7 +100,7 @@ bidimap_config(int dbg, struct grecs_node *node, void *data) | |||
100 | struct bidimap *map, **return_map = data; | 100 | struct bidimap *map, **return_map = data; |
101 | int i; | 101 | int i; |
102 | 102 | ||
103 | map = grecs_malloc(sizeof(*map)); | 103 | map = grecs_zalloc(sizeof(*map)); |
104 | for (i = 0; bidimap_kw[i].ident; i++) | 104 | for (i = 0; bidimap_kw[i].ident; i++) |
105 | bidimap_kw[i].varptr = map; | 105 | bidimap_kw[i].varptr = map; |
106 | if (grecs_tree_process(node->down, bidimap_kw)) { | 106 | if (grecs_tree_process(node->down, bidimap_kw)) { |
diff --git a/lib/filemap.c b/lib/filemap.c index 6c5e286..26582ec 100644 --- a/lib/filemap.c +++ b/lib/filemap.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of Eclat. | 1 | /* This file is part of Eclat. |
2 | Copyright (C) 2012-2015 Sergey Poznyakoff. | 2 | Copyright (C) 2012-2018 Sergey Poznyakoff. |
3 | 3 | ||
4 | Eclat is free software; you can redistribute it and/or modify | 4 | Eclat is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
@@ -60,7 +60,7 @@ filemap_config(int dbg, struct grecs_node *node, void *data) | |||
60 | int i; | 60 | int i; |
61 | struct grecs_node *p; | 61 | struct grecs_node *p; |
62 | 62 | ||
63 | filemap = grecs_malloc(sizeof(*filemap)); | 63 | filemap = grecs_zalloc(sizeof(*filemap)); |
64 | for (i = 0; filemap_kw[i].ident; i++) | 64 | for (i = 0; filemap_kw[i].ident; i++) |
65 | filemap_kw[i].varptr = filemap; | 65 | filemap_kw[i].varptr = filemap; |
66 | if (grecs_tree_process(node->down, filemap_kw)) { | 66 | if (grecs_tree_process(node->down, filemap_kw)) { |
diff --git a/lib/forlangrm.y b/lib/forlangrm.y index ecfbf25..2db1274 100644 --- a/lib/forlangrm.y +++ b/lib/forlangrm.y | |||
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | /* This file is part of Eclat. | 2 | /* This file is part of Eclat. |
3 | Copyright (C) 2012-2015 Sergey Poznyakoff. | 3 | Copyright (C) 2012-2018 Sergey Poznyakoff. |
4 | 4 | ||
5 | Eclat is free software; you can redistribute it and/or modify | 5 | Eclat is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
@@ -17,7 +17,7 @@ | |||
17 | 17 | ||
18 | #include "libeclat.h" | 18 | #include "libeclat.h" |
19 | #include <grecs.h> | 19 | #include <grecs.h> |
20 | #include <grecs-locus.h> | 20 | #include <grecs/locus.h> |
21 | #include "forlangrm.h" | 21 | #include "forlangrm.h" |
22 | #include "forlan.h" | 22 | #include "forlan.h" |
23 | #include <string.h> | 23 | #include <string.h> |
diff --git a/lib/forlanlex.l b/lib/forlanlex.l index db893df..62265cb 100644 --- a/lib/forlanlex.l +++ b/lib/forlanlex.l | |||
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | /* This file is part of Eclat. | 2 | /* This file is part of Eclat. |
3 | Copyright (C) 2012-2015 Sergey Poznyakoff. | 3 | Copyright (C) 2012-2018 Sergey Poznyakoff. |
4 | 4 | ||
5 | Eclat is free software; you can redistribute it and/or modify | 5 | Eclat is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
@@ -19,7 +19,7 @@ | |||
19 | #include <sysexits.h> | 19 | #include <sysexits.h> |
20 | #include <ctype.h> | 20 | #include <ctype.h> |
21 | #include <grecs.h> | 21 | #include <grecs.h> |
22 | #include <grecs-locus.h> | 22 | #include <grecs/locus.h> |
23 | #include "forlangrm.h" | 23 | #include "forlangrm.h" |
24 | #include "forlan.h" | 24 | #include "forlan.h" |
25 | 25 | ||
@@ -100,15 +100,18 @@ continue return CONTINUE; | |||
100 | \"[^\\"\n]*\\\n { BEGIN(STR); | 100 | \"[^\\"\n]*\\\n { BEGIN(STR); |
101 | grecs_line_begin(); | 101 | grecs_line_begin(); |
102 | grecs_line_acc_grow_unescape_last(yytext + 1, | 102 | grecs_line_acc_grow_unescape_last(yytext + 1, |
103 | yyleng - 1); | 103 | yyleng - 1, |
104 | &yylloc); | ||
104 | grecs_locus_point_advance_line(grecs_current_locus_point); } | 105 | grecs_locus_point_advance_line(grecs_current_locus_point); } |
105 | \"[^\\"\n]*\\. { BEGIN(STR); | 106 | \"[^\\"\n]*\\. { BEGIN(STR); |
106 | grecs_line_begin(); | 107 | grecs_line_begin(); |
107 | grecs_line_acc_grow_unescape_last(yytext + 1, | 108 | grecs_line_acc_grow_unescape_last(yytext + 1, |
108 | yyleng - 1); } | 109 | yyleng - 1, |
109 | <STR>\"[^\\"\n]*\\\n { grecs_line_acc_grow_unescape_last(yytext, yyleng); | 110 | &yylloc); } |
111 | <STR>\"[^\\"\n]*\\\n { grecs_line_acc_grow_unescape_last(yytext, yyleng, | ||
112 | &yylloc); | ||
110 | grecs_locus_point_advance_line(grecs_current_locus_point); } | 113 | grecs_locus_point_advance_line(grecs_current_locus_point); } |
111 | <STR>[^\\"\n]*\\. { grecs_line_acc_grow_unescape_last(yytext, yyleng); } | 114 | <STR>[^\\"\n]*\\. { grecs_line_acc_grow_unescape_last(yytext, yyleng, &yylloc); } |
112 | <STR>[^\\"\n]*\" { BEGIN(INITIAL); | 115 | <STR>[^\\"\n]*\" { BEGIN(INITIAL); |
113 | if (yyleng > 1) | 116 | if (yyleng > 1) |
114 | grecs_line_add(yytext, yyleng - 1); | 117 | grecs_line_add(yytext, yyleng - 1); |
diff --git a/lib/gdbmmap.c b/lib/gdbmmap.c index dde6b02..a2887df 100644 --- a/lib/gdbmmap.c +++ b/lib/gdbmmap.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of Eclat. | 1 | /* This file is part of Eclat. |
2 | Copyright (C) 2012-2015 Sergey Poznyakoff. | 2 | Copyright (C) 2012-2018 Sergey Poznyakoff. |
3 | 3 | ||
4 | Eclat is free software; you can redistribute it and/or modify | 4 | Eclat is free software; you can redistribute it and/or modify |
5 | it under the terms of the GNU General Public License as published by | 5 | it under the terms of the GNU General Public License as published by |
@@ -69,7 +69,7 @@ gdbm_map_config(int dbg, struct grecs_node *node, void *data) | |||
69 | struct grecs_node *p; | 69 | struct grecs_node *p; |
70 | int i; | 70 | int i; |
71 | 71 | ||
72 | gdbm_map = grecs_malloc(sizeof(*gdbm_map)); | 72 | gdbm_map = grecs_zalloc(sizeof(*gdbm_map)); |
73 | for (i = 0; gdbm_map_kw[i].ident; i++) | 73 | for (i = 0; gdbm_map_kw[i].ident; i++) |
74 | gdbm_map_kw[i].varptr = gdbm_map; | 74 | gdbm_map_kw[i].varptr = gdbm_map; |
75 | if (grecs_tree_process(node->down, gdbm_map_kw)) { | 75 | if (grecs_tree_process(node->down, gdbm_map_kw)) { |
diff --git a/lib/json.h b/lib/json.h deleted file mode 100644 index 36ca243..0000000 --- a/lib/json.h +++ /dev/null | |||