]> git.proxmox.com Git - mirror_ovs.git/commitdiff
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 45ea869af06bc20676fb4e7470b434866f142593..ed3874de916e581ce238c37c76882833e1c3ddd0 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 7bbe6bf05feb6438220985a10116912726a3e5d4..fd4c915f0fd537cc7adfc5bfaf4f4b72399e35e2 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 975dfc1742507e28241b81e87ad58dc236fca3bf..1e17538f78635da0162bdf8f5563df35f1820410 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 78a6546215268f12fbc54d23bae245248e592d51..24387b876f50d52e5576bd56a12677733b673a8c 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_);
 }