From 25831cdef94b4b86d12e3eec134dd029c37c479e Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Wed, 27 Sep 2017 17:07:21 +0200 Subject: src: ct: remove unused functions since commit b0c2606ed02fed828ab7c34227e355f5542bc925 ("parser_bison: use keywords in ct expression") we no longer abuse string for this, so there are no users of these helpers anymore. Signed-off-by: Florian Westphal --- src/ct.c | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) (limited to 'src/ct.c') diff --git a/src/ct.c b/src/ct.c index d64f4672..2b0e2a09 100644 --- a/src/ct.c +++ b/src/ct.c @@ -334,56 +334,6 @@ static const struct expr_ops ct_expr_ops = { .pctx_update = ct_expr_pctx_update, }; -struct error_record *ct_dir_parse(const struct location *loc, const char *str, - int8_t *direction) -{ - const struct symbolic_constant *s; - - for (s = ct_dir_tbl.symbols; s->identifier != NULL; s++) { - if (!strcmp(str, s->identifier)) { - *direction = s->value; - return NULL; - } - } - - return error(loc, "Could not parse direction %s", str); -} - -struct error_record *ct_key_parse(const struct location *loc, const char *str, - unsigned int *key) -{ - int ret, len, offset = 0; - const char *sep = ""; - unsigned int i; - char buf[1024]; - size_t size; - - for (i = 0; i < array_size(ct_templates); i++) { - if (!ct_templates[i].token || strcmp(ct_templates[i].token, str)) - continue; - - *key = i; - return NULL; - } - - len = (int)sizeof(buf); - size = sizeof(buf); - - for (i = 0; i < array_size(ct_templates); i++) { - if (!ct_templates[i].token) - continue; - - if (offset) - sep = ", "; - - ret = snprintf(buf+offset, len, "%s%s", sep, ct_templates[i].token); - SNPRINTF_BUFFER_SIZE(ret, size, len, offset); - assert(offset < (int)sizeof(buf)); - } - - return error(loc, "syntax error, unexpected %s, known keys are %s", str, buf); -} - struct error_record *ct_objtype_parse(const struct location *loc, const char *str, int *type) { if (strcmp(str, "helper") == 0) { -- cgit v1.2.3