}
}
\f
-struct ovsdb_symbol_table {
- struct shash sh;
-};
-
struct ovsdb_symbol_table *
ovsdb_symbol_table_create(void)
{
}
return symbol;
}
-
-const char *
-ovsdb_symbol_table_find_uncreated(const struct ovsdb_symbol_table *symtab)
-{
- struct shash_node *node;
-
- SHASH_FOR_EACH (node, &symtab->sh) {
- struct ovsdb_symbol *symbol = node->data;
- if (!symbol->created) {
- return node->name;
- }
- }
-
- return NULL;
-}
\f
/* Extracts a token from the beginning of 's' and returns a pointer just after
* the token. Stores the token itself into '*outp', which the caller is
#include <stdlib.h>
#include "compiler.h"
#include "ovsdb-types.h"
+#include "shash.h"
struct ds;
struct ovsdb_symbol_table;
-struct shash;
/* One value of an atomic type (given by enum ovs_atomic_type). */
union ovsdb_atom {
/* A table mapping from names to data items. Currently the data items are
* always UUIDs; perhaps this will be expanded in the future. */
+struct ovsdb_symbol_table {
+ struct shash sh; /* Maps from name to struct ovsdb_symbol *. */
+};
+
struct ovsdb_symbol {
struct uuid uuid; /* The UUID that the symbol represents. */
bool created; /* Already used to create row? */
const struct uuid *, bool used);
struct ovsdb_symbol *ovsdb_symbol_table_insert(struct ovsdb_symbol_table *,
const char *name);
-const char *ovsdb_symbol_table_find_uncreated(
- const struct ovsdb_symbol_table *);
\f
/* Tokenization
*
const struct ovsrec_open_vswitch *ovs;
enum ovsdb_idl_txn_status status;
struct ovsdb_symbol_table *symtab;
- const char *uncreated;
struct vsctl_command *c;
+ struct shash_node *node;
int64_t next_cfg = 0;
char *error = NULL;
}
}
- uncreated = ovsdb_symbol_table_find_uncreated(symtab);
- if (uncreated) {
- vsctl_fatal("row id \"%s\" is referenced but never created (e.g. "
- "with \"-- --id=%s create ...\")", uncreated, uncreated);
+ SHASH_FOR_EACH (node, &symtab->sh) {
+ struct ovsdb_symbol *symbol = node->data;
+ if (!symbol->created) {
+ vsctl_fatal("row id \"%s\" is referenced but never created (e.g. "
+ "with \"-- --id=%s create ...\")",
+ node->name, node->name);
+ }
}
status = ovsdb_idl_txn_commit_block(txn);