summaryrefslogtreecommitdiff
path: root/pbstream.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2009-02-24 10:36:34 -0800
committerJoshua Haberman <joshua@reverberate.org>2009-02-24 10:36:34 -0800
commitecd855279d0984b3c0191ce1e60f0b4690af2f39 (patch)
treeb2e4b93bc9f3d30a55f25d35f135e4c45a7b4231 /pbstream.h
parent7fefc5c8756fc7568371cffe66cbc0136c6eb31b (diff)
Removed CALLBACK() macro and struct of callbacks.
Diffstat (limited to 'pbstream.h')
-rw-r--r--pbstream.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/pbstream.h b/pbstream.h
index a8e623a..36658c5 100644
--- a/pbstream.h
+++ b/pbstream.h
@@ -168,11 +168,9 @@ typedef enum pbstream_status {
// A field was encoded with the wrong wire type.
PBSTREAM_ERROR_MISMATCHED_TYPE,
} pbstream_status_t;
-typedef void (*pbstream_error_callback_t)(pbstream_status_t error);
-
-struct pbstream_callbacks {
- pbstream_error_callback_t error_callback;
-};
+struct pbstream_parse_state;
+typedef void (*pbstream_error_callback_t)(struct pbstream_parse_state *s,
+ pbstream_status_t error);
struct pbstream_parse_stack_frame {
struct pbstream_message_descriptor *message_descriptor;
@@ -184,7 +182,7 @@ struct pbstream_parse_stack_frame {
/* The stream parser's state. */
struct pbstream_parse_state {
- struct pbstream_callbacks callbacks;
+ pbstream_error_callback_t error_callback;
size_t offset;
bool ignore_nonfatal_errors;
void *user_data;
@@ -197,7 +195,6 @@ struct pbstream_parse_state {
void pbstream_init_parser(
struct pbstream_parse_state *state,
struct pbstream_message_descriptor *message_descriptor,
- struct pbstream_callbacks *callbacks,
void *user_data);
/* Call this to parse as much of buf as possible, calling callbacks as
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback