bool mutable, bool persistent,
const struct ovsdb_type *type)
{
- struct ovsdb_column *ts;
+ struct ovsdb_column *column;
- ts = xzalloc(sizeof *ts);
- ts->name = xstrdup(name);
- ts->comment = comment ? xstrdup(comment) : NULL;
- ts->mutable = mutable;
- ts->persistent = persistent;
- ts->type = *type;
+ column = xzalloc(sizeof *column);
+ column->name = xstrdup(name);
+ column->comment = comment ? xstrdup(comment) : NULL;
+ column->mutable = mutable;
+ column->persistent = persistent;
+ column->type = *type;
- return ts;
+ return column;
}
void
"array of distinct column names expected");
}
+struct json *
+ovsdb_column_set_to_json(const struct ovsdb_column_set *set)
+{
+ struct json *json;
+ size_t i;
+
+ json = json_array_create_empty();
+ for (i = 0; i < set->n_columns; i++) {
+ json_array_add(json, json_string_create(set->columns[i]->name));
+ }
+ return json;
+}
+
void
ovsdb_column_set_add(struct ovsdb_column_set *set,
const struct ovsdb_column *column)