From b5eeb621520d9c0c2647bfa1bfb53045a75a8b6e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 1 May 2018 14:34:42 +0200 Subject: Remove syntax assumptions from SerdEnv implementation --- src/env.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'src/env.c') diff --git a/src/env.c b/src/env.c index fb1fd31d..81a8362b 100644 --- a/src/env.c +++ b/src/env.c @@ -20,7 +20,6 @@ #include #include "node.h" -#include "string_utils.h" typedef struct { SerdNode* name; @@ -168,27 +167,6 @@ serd_env_set_prefix_from_strings(SerdEnv* env, return st; } -static inline bool -is_nameChar(const char c) -{ - return is_alpha(c) || is_digit(c) || c == '_'; -} - -/** - Return true iff `buf` is a valid prefixed name suffix. - TODO: This is more strict than it should be. -*/ -static inline bool -is_name(const char* buf, size_t len) -{ - for (size_t i = 0; i < len; ++i) { - if (!is_nameChar(buf[i])) { - return false; - } - } - return true; -} - SERD_API bool serd_env_qualify(const SerdEnv* env, @@ -206,9 +184,7 @@ serd_env_qualify(const SerdEnv* env, *prefix = env->prefixes[i].name; suffix->buf = uri_str + prefix_uri->n_bytes; suffix->len = uri->n_bytes - prefix_uri->n_bytes; - if (is_name(suffix->buf, suffix->len)) { - return true; - } + return true; } } } -- cgit v1.2.1