{
struct ovsdb_schema *schema;
schema = xzalloc(sizeof *schema);
schema->name = xstrdup(name);
{
struct ovsdb_schema *schema;
schema = xzalloc(sizeof *schema);
schema->name = xstrdup(name);
SHASH_FOR_EACH (node, &old->tables) {
const struct ovsdb_table_schema *ts = node->data;
SHASH_FOR_EACH (node, &old->tables) {
const struct ovsdb_table_schema *ts = node->data;
SHASH_FOR_EACH (node, &schema->tables) {
ovsdb_table_schema_destroy(node->data);
}
shash_destroy(&schema->tables);
SHASH_FOR_EACH (node, &schema->tables) {
ovsdb_table_schema_destroy(node->data);
}
shash_destroy(&schema->tables);
ovsdb_schema_from_json(struct json *json, struct ovsdb_schema **schemap)
{
struct ovsdb_schema *schema;
ovsdb_schema_from_json(struct json *json, struct ovsdb_schema **schemap)
{
struct ovsdb_schema *schema;
ovsdb_parser_init(&parser, json, "database schema");
name = ovsdb_parser_member(&parser, "name", OP_ID);
ovsdb_parser_init(&parser, json, "database schema");
name = ovsdb_parser_member(&parser, "name", OP_ID);
tables = ovsdb_parser_member(&parser, "tables", OP_OBJECT);
error = ovsdb_parser_finish(&parser);
if (error) {
return error;
}
tables = ovsdb_parser_member(&parser, "tables", OP_OBJECT);
error = ovsdb_parser_finish(&parser);
if (error) {
return error;
}
SHASH_FOR_EACH (node, json_object(tables)) {
struct ovsdb_table_schema *table;
SHASH_FOR_EACH (node, json_object(tables)) {
struct ovsdb_table_schema *table;
json = json_object_create();
json_object_put_string(json, "name", schema->name);
json = json_object_create();
json_object_put_string(json, "name", schema->name);