diff options
Diffstat (limited to 'src/ntriples.h')
-rw-r--r-- | src/ntriples.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/ntriples.h b/src/ntriples.h new file mode 100644 index 00000000..566a8ddc --- /dev/null +++ b/src/ntriples.h @@ -0,0 +1,36 @@ +/* + Copyright 2011-2021 David Robillard <d@drobilla.net> + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted, provided that the above + copyright notice and this permission notice appear in all copies. + + THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +*/ + +#ifndef SERD_NTRIPLES_H +#define SERD_NTRIPLES_H + +#include "string_utils.h" + +#include <stdbool.h> + +static inline bool +is_PN_CHARS_BASE(const int c) +{ + return (is_alpha(c) || in_range(c, 0x000C0u, 0x000D6u) || + in_range(c, 0x000D8u, 0x000F6u) || in_range(c, 0x000F8u, 0x002FFu) || + in_range(c, 0x00370u, 0x0037Du) || in_range(c, 0x0037Fu, 0x01FFFu) || + in_range(c, 0x0200Cu, 0x0200Du) || in_range(c, 0x02070u, 0x0218Fu) || + in_range(c, 0x02C00u, 0x02FEFu) || in_range(c, 0x03001u, 0x0D7FFu) || + in_range(c, 0x0F900u, 0x0FDCFu) || in_range(c, 0x0FDF0u, 0x0FFFDu) || + in_range(c, 0x10000u, 0xEFFFFu)); +} + +#endif // SERD_NTRIPLES_H |