aboutsummaryrefslogtreecommitdiffstats
path: root/src/reader.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-09-09 07:38:57 +0000
committerDavid Robillard <d@drobilla.net>2012-09-09 07:38:57 +0000
commita70c8c2b121dc00973f8184cd982cbba00b1529f (patch)
tree7b0d798edde820d4e2454861dabe50c6935e3ee6 /src/reader.c
parent1a7358211eefa6e3ffd8f53efc0e71f1ffd62169 (diff)
downloadserd-a70c8c2b121dc00973f8184cd982cbba00b1529f.tar.gz
serd-a70c8c2b121dc00973f8184cd982cbba00b1529f.tar.bz2
serd-a70c8c2b121dc00973f8184cd982cbba00b1529f.zip
Fix clashing symbol "error" in amalgamation build.
git-svn-id: http://svn.drobilla.net/serd/trunk@384 490d8e77-9747-427b-9fa3-0b8f29cee8a0
Diffstat (limited to 'src/reader.c')
-rw-r--r--src/reader.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/reader.c b/src/reader.c
index d17b80a5..c97228d3 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -92,7 +92,7 @@ struct SerdReaderImpl {
};
static int
-error(SerdReader* reader, SerdStatus st, const char* fmt, ...)
+r_err(SerdReader* reader, SerdStatus st, const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -152,7 +152,7 @@ eat_byte_check(SerdReader* reader, const uint8_t byte)
{
const uint8_t c = peek_byte(reader);
if (c != byte) {
- return error(reader, SERD_ERR_BAD_SYNTAX,
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
"expected `%c', not `%c'\n", byte, c);
}
return eat_byte_safe(reader, byte);
@@ -275,7 +275,7 @@ read_hex(SerdReader* reader)
if (in_range(c, 0x30, 0x39) || in_range(c, 0x41, 0x46)) {
return eat_byte_safe(reader, c);
} else {
- return error(reader, SERD_ERR_BAD_SYNTAX,
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid hexadecimal digit `%c'\n", c);
}
}
@@ -303,7 +303,7 @@ read_hex_escape(SerdReader* reader, unsigned length, Ref dest)
} else if (c < 0x00110000) {
size = 4;
} else {
- error(reader, SERD_ERR_BAD_SYNTAX,
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
"unicode character 0x%X out of range\n", c);
push_replacement(reader, dest);
return true;
@@ -404,7 +404,7 @@ read_ucharacter_escape(SerdReader* reader, Ref dest)
static inline SerdStatus
bad_char(SerdReader* reader, Ref dest, const char* fmt, uint8_t c)
{
- error(reader, SERD_ERR_BAD_SYNTAX, fmt, c);
+ r_err(reader, SERD_ERR_BAD_SYNTAX, fmt, c);
push_replacement(reader, dest);
// Skip bytes until the next start byte
@@ -460,7 +460,7 @@ read_character(SerdReader* reader, Ref dest)
const uint8_t c = peek_byte(reader);
assert(c != '\\'); // Only called from methods that handle escapes first
if (c == '\0') {
- error(reader, SERD_ERR_BAD_SYNTAX, "unexpected end of input\n", c);
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected end of input\n", c);
return SERD_ERR_BAD_SYNTAX;
} else if (c < 0x20) {
return bad_char(reader, dest,
@@ -499,7 +499,7 @@ read_lcharacter(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
if (read_scharacter_escape(reader, dest, flags)) {
return SERD_SUCCESS;
} else {
- error(reader, SERD_ERR_BAD_SYNTAX,
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid escape `\\%c'\n", peek_byte(reader));
return SERD_ERR_BAD_SYNTAX;
}
@@ -524,7 +524,7 @@ read_scharacter(SerdReader* reader, Ref dest, SerdNodeFlags* flags)
if (read_scharacter_escape(reader, dest, flags)) {
return SERD_SUCCESS;
} else {
- error(reader, SERD_ERR_BAD_SYNTAX,
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid escape `\\%c'\n", peek_byte(reader));
return SERD_ERR_BAD_SYNTAX;
}
@@ -547,7 +547,7 @@ read_ucharacter(SerdReader* reader, Ref dest)
if (read_ucharacter_escape(reader, dest)) {
return SERD_SUCCESS;
} else {
- error(reader, SERD_ERR_BAD_SYNTAX,
+ r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid escape `\\%c'\n", peek_byte(reader));
return SERD_FAILURE;
}
@@ -716,7 +716,7 @@ read_prefixName(SerdReader* reader, Ref dest)
{
uint8_t c = peek_byte(reader);
if (c == '_') {
- error(reader, SERD_ERR_BAD_SYNTAX, "unexpected `_'\n");
+ r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `_'\n");
return pop_node(reader, dest);
}
TRY_RET(c = read_nameStartChar(reader));
@@ -750,7 +750,7 @@ read_language(SerdReader* reader)
{
uint8_t c = peek_byte(reader);
if (!in_range(c, 'a', 'z')) {
- return error(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c);
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "unexpected `%c'\n", c);
}
Ref ref = push_node(reader, SERD_LITERAL, "", 0);
push_byte(reader, ref, eat_byte_safe(reader, c));
@@ -804,7 +804,7 @@ read_0_9(SerdReader* reader, Ref str, bool at_least_one)
uint8_t c;
if (at_least_one) {
if (!is_digit((c = peek_byte(reader)))) {
- return error(reader, SERD_ERR_BAD_SYNTAX, "expected digit\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "expected digit\n");
}
push_byte(reader, str, eat_byte_safe(reader, c));
}
@@ -966,7 +966,7 @@ read_nodeID(SerdReader* reader)
reader->bprefix ? (char*)reader->bprefix : "",
reader->bprefix_len);
if (!read_name(reader, ref)) {
- return error(reader, SERD_ERR_BAD_SYNTAX,
+ return r_err(reader, SERD_ERR_BAD_SYNTAX,
"invalid character at start of name\n");
}
if (reader->syntax == SERD_TURTLE) {
@@ -975,7 +975,7 @@ read_nodeID(SerdReader* reader)
memcpy((char*)buf, "docid", 5); // Prevent clash
reader->seen_genid = true;
} else if (reader->seen_genid && !strncmp(buf, "docid", 5)) {
- error(reader, SERD_ERR_ID_CLASH,
+ r_err(reader, SERD_ERR_ID_CLASH,
"found both `genid' and `docid' IDs, prefix required\n");
return pop_node(reader, ref);
}
@@ -1049,7 +1049,7 @@ read_blank(SerdReader* reader, ReadContext ctx, bool subject, Ref* dest)
case '(':
return read_collection(reader, ctx, dest);
default:
- return error(reader, SERD_ERR_BAD_SYNTAX, "invalid blank node\n");
+ return r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid blank node\n");
}
}
@@ -1321,7 +1321,7 @@ read_directive(SerdReader* reader)
switch (peek_byte(reader)) {
case 'b': return read_base(reader);
case 'p': return read_prefixID(reader);
- default: return error(reader, SERD_ERR_BAD_SYNTAX, "invalid directive\n");
+ default: return r_err(reader, SERD_ERR_BAD_SYNTAX, "invalid directive\n");
}
}