From 9e336f491038f440dc846c172daeea0d0a77b20c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 27 Jan 2010 13:04:56 -0800 Subject: [PATCH] ovsdb-idl: Export ovsdb_idl_txn_delete() and ovsdb_idl_txn_insert(). ovs-vsctl wants to use these functions directly, so make them available through the ovsdb-idl public header instead of only through the private one. Also, change the prototypes to make them usable without casts. --- lib/ovsdb-idl-provider.h | 4 ---- lib/ovsdb-idl.c | 6 ++++-- lib/ovsdb-idl.h | 3 +++ ovsdb/ovsdb-idlc.in | 3 +-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ovsdb-idl-provider.h b/lib/ovsdb-idl-provider.h index 45ea869af..ed3874de9 100644 --- a/lib/ovsdb-idl-provider.h +++ b/lib/ovsdb-idl-provider.h @@ -71,10 +71,6 @@ struct ovsdb_idl_row *ovsdb_idl_get_row_arc( void ovsdb_idl_txn_verify(const struct ovsdb_idl_row *, const struct ovsdb_idl_column *); -void ovsdb_idl_txn_delete(struct ovsdb_idl_row *); -struct ovsdb_idl_row *ovsdb_idl_txn_insert( - struct ovsdb_idl_txn *, - const struct ovsdb_idl_table_class *); struct ovsdb_idl_txn *ovsdb_idl_txn_get(const struct ovsdb_idl_row *); diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 7bbe6bf05..fd4c915f0 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -1300,8 +1300,10 @@ ovsdb_idl_txn_verify(const struct ovsdb_idl_row *row_, } void -ovsdb_idl_txn_delete(struct ovsdb_idl_row *row) +ovsdb_idl_txn_delete(const struct ovsdb_idl_row *row_) { + struct ovsdb_idl_row *row = (struct ovsdb_idl_row *) row_; + assert(row->new != NULL); if (!row->old) { ovsdb_idl_row_clear_new(row); @@ -1319,7 +1321,7 @@ ovsdb_idl_txn_delete(struct ovsdb_idl_row *row) row->new = NULL; } -struct ovsdb_idl_row * +const struct ovsdb_idl_row * ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, const struct ovsdb_idl_table_class *class) { diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h index 975dfc174..1e17538f7 100644 --- a/lib/ovsdb-idl.h +++ b/lib/ovsdb-idl.h @@ -74,5 +74,8 @@ void ovsdb_idl_txn_read(const struct ovsdb_idl_row *, void ovsdb_idl_txn_write(const struct ovsdb_idl_row *, const struct ovsdb_idl_column *, struct ovsdb_datum *); +void ovsdb_idl_txn_delete(const struct ovsdb_idl_row *); +const struct ovsdb_idl_row *ovsdb_idl_txn_insert( + struct ovsdb_idl_txn *, const struct ovsdb_idl_table_class *); #endif /* ovsdb-idl.h */ diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index 78a654621..24387b876 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -524,9 +524,8 @@ const struct %(s)s * print ''' void -%(s)s_delete(const struct %(s)s *row_) +%(s)s_delete(const struct %(s)s *row) { - struct %(s)s *row = (struct %(s)s *) row_; ovsdb_idl_txn_delete(&row->header_); } -- 2.43.0