diff options
author | Ben Pfaff <blp@nicira.com> | 2010-01-27 11:25:20 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-01-27 13:51:52 -0800 |
commit | 1bc6ff291822a37ac95659f347e8edba125cd09c (patch) | |
tree | 3f09540cc81acc739cbef9b25ec1a8e79be155a4 /lib/ovsdb-data.h | |
parent | c611c9d011111eeb2767faa1e8f02958fd36aeac (diff) |
ovs-vsctl: Make parsing functions return error instead of aborting.
The upcoming "remove" command for ovs-vsctl wants to try parsing an
argument two different ways. This doesn't work if a parse error always
aborts immediately. This commit fixes the problem, by making a parsing
failure pass up an error for higher layers to deal with instead of aborting
immediately.
This commit should have no user-visible effect.
Diffstat (limited to 'lib/ovsdb-data.h')
-rw-r--r-- | lib/ovsdb-data.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/ovsdb-data.h b/lib/ovsdb-data.h index 70dfd0f6..0638fa1b 100644 --- a/lib/ovsdb-data.h +++ b/lib/ovsdb-data.h @@ -74,8 +74,9 @@ struct ovsdb_error *ovsdb_atom_from_json(union ovsdb_atom *, struct json *ovsdb_atom_to_json(const union ovsdb_atom *, enum ovsdb_atomic_type); -void ovsdb_atom_from_string(union ovsdb_atom *, enum ovsdb_atomic_type, - const char *); +char *ovsdb_atom_from_string(union ovsdb_atom *, enum ovsdb_atomic_type, + const char *) + WARN_UNUSED_RESULT; void ovsdb_atom_to_string(const union ovsdb_atom *, enum ovsdb_atomic_type, struct ds *); @@ -128,8 +129,9 @@ struct ovsdb_error *ovsdb_datum_from_json(struct ovsdb_datum *, struct json *ovsdb_datum_to_json(const struct ovsdb_datum *, const struct ovsdb_type *); -void ovsdb_datum_from_string(struct ovsdb_datum *, - const struct ovsdb_type *, const char *); +char *ovsdb_datum_from_string(struct ovsdb_datum *, + const struct ovsdb_type *, const char *) + WARN_UNUSED_RESULT; void ovsdb_datum_to_string(const struct ovsdb_datum *, const struct ovsdb_type *, struct ds *); @@ -204,7 +206,7 @@ void ovsdb_symbol_table_put(struct ovsdb_symbol_table *, const char *name, * * Used by ovsdb_atom_from_string() and ovsdb_datum_from_string(). */ -const char *ovsdb_token_parse(const char *, char **outp); +char *ovsdb_token_parse(const char **, char **outp) WARN_UNUSED_RESULT; bool ovsdb_token_is_delim(unsigned char); #endif /* ovsdb-data.h */ |