git://git.onelab.eu
/
sliver-openvswitch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e1c1de3
)
ovsdb-idl: Add "safe" iterator macro to generated code.
author
Ben Pfaff
<blp@nicira.com>
Fri, 30 Apr 2010 21:16:25 +0000
(14:16 -0700)
committer
Justin Pettit
<jpettit@nicira.com>
Fri, 30 Apr 2010 23:53:29 +0000
(16:53 -0700)
ovsdb/ovsdb-idlc.in
patch
|
blob
|
history
diff --git
a/ovsdb/ovsdb-idlc.in
b/ovsdb/ovsdb-idlc.in
index
6a0303d
..
c89048e
100755
(executable)
--- a/
ovsdb/ovsdb-idlc.in
+++ b/
ovsdb/ovsdb-idlc.in
@@
-158,7
+158,14
@@
def printCIDLHeader(schemaFile):
print '''
const struct %(s)s *%(s)s_first(const struct ovsdb_idl *);
const struct %(s)s *%(s)s_next(const struct %(s)s *);
print '''
const struct %(s)s *%(s)s_first(const struct ovsdb_idl *);
const struct %(s)s *%(s)s_next(const struct %(s)s *);
-#define %(S)s_FOR_EACH(ROW, IDL) for ((ROW) = %(s)s_first(IDL); (ROW); (ROW) = %(s)s_next(ROW))
+#define %(S)s_FOR_EACH(ROW, IDL) \\
+ for ((ROW) = %(s)s_first(IDL); \\
+ (ROW); \\
+ (ROW) = %(s)s_next(ROW))
+#define %(S)s_FOR_EACH_SAFE(ROW, NEXT, IDL) \\
+ for ((ROW) = %(s)s_first(IDL); \\
+ (ROW) ? ((NEXT) = %(s)s_next(ROW), 1) : 0; \\
+ (ROW) = (NEXT))
void %(s)s_delete(const struct %(s)s *);
struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);
void %(s)s_delete(const struct %(s)s *);
struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);