diff options
author | Ben Pfaff <blp@nicira.com> | 2010-01-11 13:30:15 -0800 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-01-11 13:30:15 -0800 |
commit | c7239c2f29ac9b288a48bff7458f8709ee4f7b4b (patch) | |
tree | eaab996f6246532a5c0a58e07685430ef0be8912 /lib/ovsdb-data.h | |
parent | c532bf9dd4e684bc583debc9618e3210334f8081 (diff) |
ovsdb: Improve comments.
Suggested by Justin Pettit.
Diffstat (limited to 'lib/ovsdb-data.h')
-rw-r--r-- | lib/ovsdb-data.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/ovsdb-data.h b/lib/ovsdb-data.h index 18b8841c..6ee5f9ac 100644 --- a/lib/ovsdb-data.h +++ b/lib/ovsdb-data.h @@ -73,7 +73,21 @@ struct ovsdb_error *ovsdb_atom_from_json(union ovsdb_atom *, struct json *ovsdb_atom_to_json(const union ovsdb_atom *, enum ovsdb_atomic_type); -/* One value of an OVSDB type (given by struct ovsdb_type). */ +/* An instance of an OVSDB type (given by struct ovsdb_type). + * + * 'n' is constrained by the ovsdb_type's 'n_min' and 'n_max'. + * + * If 'n' is nonzero, then 'keys' points to an array of 'n' atoms of the type + * specified by the ovsdb_type's 'key_type'. (Otherwise, 'keys' should be + * null.) + * + * If 'n' is nonzero and the ovsdb_type's 'value_type' is not OVSDB_TYPE_VOID, + * then 'values' points to an array of 'n' atoms of the type specified by the + * 'value_type'. (Otherwise, 'values' should be null.) + * + * Thus, for 'n' > 0, 'keys' will always be nonnull and 'values' will be + * nonnull only for "map" types. + */ struct ovsdb_datum { unsigned int n; /* Number of 'keys' and 'values'. */ union ovsdb_atom *keys; /* Each of the ovsdb_type's 'key_type'. */ |