ovsdb-idl: Export ovsdb_idl_txn_delete() and ovsdb_idl_txn_insert().
authorBen Pfaff <blp@nicira.com>
Wed, 27 Jan 2010 21:04:56 +0000 (13:04 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 27 Jan 2010 21:51:52 +0000 (13:51 -0800)
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
lib/ovsdb-idl.c
lib/ovsdb-idl.h
ovsdb/ovsdb-idlc.in

index 45ea869..ed3874d 100644 (file)
@@ -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 *);
 
index 7bbe6bf..fd4c915 100644 (file)
@@ -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)
 {
index 975dfc1..1e17538 100644 (file)
@@ -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 */
index 78a6546..24387b8 100755 (executable)
@@ -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_);
 }