From 23cb773630b85aac31f52184b233b2f6cad30601 Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Wed, 29 Dec 2010 18:34:09 -0500 Subject: [PATCH] Add sexp_read_atom() --- sexpio.c | 4 ++++ sexpio.h | 1 + 2 files changed, 5 insertions(+) diff --git a/sexpio.c b/sexpio.c index 150ef6a..6128ca6 100644 --- a/sexpio.c +++ b/sexpio.c @@ -55,6 +55,10 @@ static sexp_t *read_simple_string(IOHandle *h, cmsg_bytes_t buf) { } } +sexp_t *sexp_read_atom(IOHandle *h) { + return read_simple_string(h, EMPTY_BYTES); +} + #define CHECKH \ if (h->error_kind) goto error; diff --git a/sexpio.h b/sexpio.h index 256b88a..28b5955 100644 --- a/sexpio.h +++ b/sexpio.h @@ -4,6 +4,7 @@ #define SEXP_ERROR_OVERFLOW 0x8000 #define SEXP_ERROR_SYNTAX 0x8001 +extern sexp_t *sexp_read_atom(IOHandle *h); extern sexp_t *sexp_read(IOHandle *h); extern unsigned short sexp_write(IOHandle *h, sexp_t *x);