aboutsummaryrefslogtreecommitdiffstats
path: root/src/env.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-01 14:34:42 +0200
committerDavid Robillard <d@drobilla.net>2018-06-10 17:19:53 +0000
commit480744aab736a669c548cb5ced68866c3ebffb4e (patch)
tree6b2508b197bc74a7ea4747bfc7efe98cdee271a8 /src/env.c
parenta9efdc83455ccd27a505a29802277e7ef02dd120 (diff)
downloadserd-480744aab736a669c548cb5ced68866c3ebffb4e.tar.gz
serd-480744aab736a669c548cb5ced68866c3ebffb4e.tar.bz2
serd-480744aab736a669c548cb5ced68866c3ebffb4e.zip
Remove syntax assumptions from SerdEnv implementation
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/env.c b/src/env.c
index d969d3df..e3cba79d 100644
--- a/src/env.c
+++ b/src/env.c
@@ -160,27 +160,6 @@ serd_env_set_prefix_from_strings(SerdEnv* env,
return serd_env_set_prefix(env, &name_node, &uri_node);
}
-static inline bool
-is_nameChar(const uint8_t 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 uint8_t* 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,
@@ -197,9 +176,7 @@ serd_env_qualify(const SerdEnv* env,
*prefix = env->prefixes[i].name;
suffix->buf = uri->buf + prefix_uri->n_bytes;
suffix->len = uri->n_bytes - prefix_uri->n_bytes;
- if (is_name(suffix->buf, suffix->len)) {
- return true;
- }
+ return true;
}
}
}