aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-01-25 05:25:08 +0000
committerDavid Robillard <d@drobilla.net>2011-01-25 05:25:08 +0000
commit799a828b02f201ff5de7fe59c8e66714e0e28d43 (patch)
tree10514bf7095027290246f7bf1f2af054402586dc
parent96409977963010ec345fe894d2c5e300d0876848 (diff)
downloadserd-799a828b02f201ff5de7fe59c8e66714e0e28d43.tar.gz
serd-799a828b02f201ff5de7fe59c8e66714e0e28d43.tar.bz2
serd-799a828b02f201ff5de7fe59c8e66714e0e28d43.zip
readahead => peek_string.
git-svn-id: http://svn.drobilla.net/serd/trunk@61 490d8e77-9747-427b-9fa3-0b8f29cee8a0
-rw-r--r--src/reader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/reader.c b/src/reader.c
index 5d4fc3c5..fb41af6b 100644
--- a/src/reader.c
+++ b/src/reader.c
@@ -134,7 +134,7 @@ page(SerdReader reader)
}
static inline bool
-readahead(SerdReader reader, uint8_t* pre, int n)
+peek_string(SerdReader reader, uint8_t* pre, int n)
{
uint8_t* ptr = reader->read_buf + reader->read_head;
for (int i = 0; i < n; ++i) {
@@ -508,7 +508,7 @@ read_lcharacter(SerdReader reader, Ref dest)
uint8_t pre[3];
switch (c) {
case '"':
- readahead(reader, pre, 3);
+ peek_string(reader, pre, 3);
if (pre[1] == '\"' && pre[2] == '\"') {
eat_byte(reader, '\"');
eat_byte(reader, '\"');
@@ -654,7 +654,7 @@ static Ref
read_quotedString(SerdReader reader)
{
uint8_t pre[3];
- readahead(reader, pre, 3);
+ peek_string(reader, pre, 3);
assert(pre[0] == '\"');
switch (pre[1]) {
case '\"':
@@ -943,7 +943,7 @@ static bool
read_verb(SerdReader reader, Node* dest)
{
uint8_t pre[2];
- readahead(reader, pre, 2);
+ peek_string(reader, pre, 2);
switch (pre[0]) {
case 'a':
switch (pre[1]) {
@@ -1077,7 +1077,7 @@ read_object(SerdReader reader, ReadContext ctx)
Unfortunately there is no way to distinguish these without
readahead, since `true' or `false' could be the start of a qname.
*/
- readahead(reader, pre, 6);
+ peek_string(reader, pre, 6);
if (!memcmp(pre, "true", 4) && is_object_end(pre[4])) {
eat_string(reader, "true", 4);
const Ref value = push_string(reader, "true", 5);
@@ -1363,7 +1363,7 @@ serd_reader_new(SerdSyntax syntax,
memset(reader->read_buf, '\0', READ_BUF_LEN * 2);
- /* Read into the second page of the buffer. Occasionally readahead
+ /* Read into the second page of the buffer. Occasionally peek_string
will move the read_head to before this point when readahead causes
a page fault.
*/