summaryrefslogtreecommitdiff
path: root/ovsdb/column.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-10 15:37:52 -0800
committerBen Pfaff <blp@nicira.com>2010-02-15 11:31:05 -0800
commit58985e09eafe83a7fbe9c85626e44abe9d9eca8c (patch)
treee6a8b8157ebf489a8f7d97af5bcdb2910949fabe /ovsdb/column.c
parente5125481cf98eebb4ff49c7881410493629c9ec0 (diff)
downloadopenvswitch-58985e09eafe83a7fbe9c85626e44abe9d9eca8c.tar.gz
ovsdb: Add functions to clone schemas.
These will be used by an upcoming commit.
Diffstat (limited to 'ovsdb/column.c')
-rw-r--r--ovsdb/column.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ovsdb/column.c b/ovsdb/column.c
index 0a1f6e4d9..58fff1084 100644
--- a/ovsdb/column.c
+++ b/ovsdb/column.c
@@ -31,6 +31,7 @@ ovsdb_column_create(const char *name, const char *comment,
bool mutable, bool persistent,
const struct ovsdb_type *type)
{
+ /* Doesn't set the new column's 'index': the caller must do that. */
struct ovsdb_column *column;
column = xzalloc(sizeof *column);
@@ -43,6 +44,15 @@ ovsdb_column_create(const char *name, const char *comment,
return column;
}
+struct ovsdb_column *
+ovsdb_column_clone(const struct ovsdb_column *old)
+{
+ /* Doesn't copy the column's 'index': the caller must do that. */
+ return ovsdb_column_create(old->name, old->comment,
+ old->mutable, old->persistent,
+ &old->type);
+}
+
void
ovsdb_column_destroy(struct ovsdb_column *column)
{