diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-06-06 07:21:43 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-06-06 08:24:28 +0300 |
commit | b220b5a367469c571358c34ea0df813522e99485 (patch) | |
tree | 600e8f26555a359b9d5297b1d566717a1ec78182 /lib | |
parent | 44efb0cda486e2614603e6dd78b0c93407f63c3b (diff) | |
download | pies-b220b5a367469c571358c34ea0df813522e99485.tar.gz pies-b220b5a367469c571358c34ea0df813522e99485.tar.bz2 |
Update the grecs submodule
* configure.ac (GRECS_SETUP): Request the tree-api
* grecs: Pull a0c096190f
* lib/envop.c (environ_set): Call wordsplit_free unconditionally.
* lib/grecsasrt.c (assert_grecs_value_type)
(assert_scalar_stmt): Remove.
(conf_callback_url): Switch to tree-api.
* lib/grecsasrt.h: Likewise.
* src/acl.c: Rewrite grecs callbacks in the tree API style.
Use grecs assertions.
* src/acl.h: Likewise.
* src/meta1parse.c: Likewise.
* src/pies.c: Likewise.
* src/piesctl.c: Likewise.
* src/comp.c (component_finish): Check whether the "command" statement
was used.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/envop.c | 3 | ||||
-rw-r--r-- | lib/grecsasrt.c | 40 | ||||
-rw-r--r-- | lib/grecsasrt.h | 7 |
3 files changed, 8 insertions, 42 deletions
diff --git a/lib/envop.c b/lib/envop.c index 80a8b6c..ce24b92 100644 --- a/lib/envop.c +++ b/lib/envop.c @@ -186,8 +186,7 @@ environ_set (environ_t *env, char const *name, char const *value) | WRDSF_PATHEXPAND)) { int ec = errno; - if (ws.ws_errno != WRDSE_USAGE) /* FIXME */ - wordsplit_free (&ws); + wordsplit_free (&ws); errno = ec; return -1; } diff --git a/lib/grecsasrt.c b/lib/grecsasrt.c index 8ebd581..c217cec 100644 --- a/lib/grecsasrt.c +++ b/lib/grecsasrt.c @@ -23,45 +23,15 @@ #include "grecsasrt.h" int -assert_grecs_value_type (grecs_locus_t *locus, - const grecs_value_t *value, int type) -{ - if (GRECS_VALUE_EMPTY_P (value)) - { - grecs_error (locus, 0, _("expected %s"), - grecs_data_type_string (type)); - return 1; - } - if (value->type != type) - { - grecs_error (locus, 0, _("expected %s, but found %s"), - grecs_data_type_string (type), - grecs_data_type_string (value->type)); - return 1; - } - return 0; -} - -int -assert_scalar_stmt (grecs_locus_t *locus, enum grecs_callback_command cmd) -{ - if (cmd != grecs_callback_set_value) - { - grecs_error (locus, 0, _("unexpected block statement")); - return 1; - } - return 0; -} - -int conf_callback_url (enum grecs_callback_command cmd, - grecs_locus_t *locus, - void *varptr, grecs_value_t *value, void *cb_data) + grecs_node_t *node, + void *varptr, void *cb_data) { + grecs_locus_t *locus = &node->locus; + grecs_value_t *value = node->v.value; struct pies_url *url; - if (assert_scalar_stmt (locus, cmd) - || assert_grecs_value_type (locus, value, GRECS_TYPE_STRING)) + if (grecs_assert_node_value_type (cmd, node, GRECS_TYPE_STRING)) return 1; if (pies_url_create (&url, value->v.string)) { diff --git a/lib/grecsasrt.h b/lib/grecsasrt.h index 4b3d2d6..f9fe432 100644 --- a/lib/grecsasrt.h +++ b/lib/grecsasrt.h @@ -14,9 +14,6 @@ You should have received a copy of the GNU General Public License along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. */ -int assert_grecs_value_type (grecs_locus_t *locus, - const grecs_value_t *value, int type); -int assert_scalar_stmt (grecs_locus_t *locus, enum grecs_callback_command cmd); int conf_callback_url (enum grecs_callback_command cmd, - grecs_locus_t *locus, - void *varptr, grecs_value_t *value, void *cb_data); + grecs_node_t *node, + void *varptr, void *cb_data); |