summaryrefslogtreecommitdiff
path: root/src/upb.h
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2010-07-09 19:56:58 -0700
committerJoshua Haberman <joshua@reverberate.org>2010-07-09 19:56:58 -0700
commitb04ff41664f45c3c86eea62173a1223ff04d6ad7 (patch)
tree25e4c47ddcb8cb90c34b397ab1059f730e151100 /src/upb.h
parentbe5ddd8a645eaa949a8d500718257fb7cb71cf44 (diff)
Dynamically allocate string for error msg.
Diffstat (limited to 'src/upb.h')
-rw-r--r--src/upb.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/upb.h b/src/upb.h
index 6bf548c..6502dfc 100644
--- a/src/upb.h
+++ b/src/upb.h
@@ -281,23 +281,19 @@ enum upb_status_code {
UPB_ERROR_MAX_NESTING_EXCEEDED = -3
};
-#define UPB_ERRORMSG_MAXLEN 256
typedef struct {
enum upb_status_code code;
- char msg[UPB_ERRORMSG_MAXLEN];
+ upb_string *str;
} upb_status;
-#define UPB_STATUS_INIT {UPB_STATUS_OK, ""}
+#define UPB_STATUS_INIT {UPB_STATUS_OK, NULL}
+#define UPB_ERRORMSG_MAXLEN 256
INLINE bool upb_ok(upb_status *status) {
return status->code == UPB_STATUS_OK;
}
-INLINE void upb_reset(upb_status *status) {
- status->code = UPB_STATUS_OK;
- status->msg[0] = '\0';
-}
-
+void upb_reset(upb_status *status);
void upb_seterr(upb_status *status, enum upb_status_code code, const char *msg,
...);
void upb_copyerr(upb_status *to, upb_status *from);
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback