X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=ovsdb%2Fovsdb-idlc.in;h=282feb2d0204db544b9d0a7c714fef2a99e407fe;hb=932104f483ef4384d15dec1d26661da8da58de8d;hp=555efca50aeb1655d97e2c9c8cf274173b15b0ad;hpb=80c12152f30b0598a36198d9ec67a85f2357e623;p=cascardo%2Fovs.git diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index 555efca50..282feb2d0 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -177,6 +177,15 @@ const struct %(s)s *%(s)s_next(const struct %(s)s *); (ROW) ? ((NEXT) = %(s)s_next(ROW), 1) : 0; \\ (ROW) = (NEXT)) +unsigned int %(s)s_get_seqno(const struct ovsdb_idl *); +unsigned int %(s)s_row_get_seqno(const struct %(s)s *row, enum ovsdb_idl_change change); +const struct %(s)s *%(s)s_track_get_first(const struct ovsdb_idl *); +const struct %(s)s *%(s)s_track_get_next(const struct %(s)s *); +#define %(S)s_FOR_EACH_TRACKED(ROW, IDL) \\ + for ((ROW) = %(s)s_track_get_first(IDL); \\ + (ROW); \\ + (ROW) = %(s)s_track_get_next(ROW)) + void %(s)s_init(struct %(s)s *); void %(s)s_delete(const struct %(s)s *); struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *); @@ -462,6 +471,28 @@ const struct %(s)s * %(s)s_next(const struct %(s)s *row) { return %(s)s_cast(ovsdb_idl_next_row(&row->header_)); +} + +unsigned int %(s)s_get_seqno(const struct ovsdb_idl *idl) +{ + return ovsdb_idl_table_get_seqno(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s]); +} + +unsigned int %(s)s_row_get_seqno(const struct %(s)s *row, enum ovsdb_idl_change change) +{ + return ovsdb_idl_row_get_seqno(&row->header_, change); +} + +const struct %(s)s * +%(s)s_track_get_first(const struct ovsdb_idl *idl) +{ + return %(s)s_cast(ovsdb_idl_track_get_first(idl, &%(p)stable_classes[%(P)sTABLE_%(T)s])); +} + +const struct %(s)s +*%(s)s_track_get_next(const struct %(s)s *row) +{ + return %(s)s_cast(ovsdb_idl_track_get_next(&row->header_)); }''' % {'s': structName, 'p': prefix, 'P': prefix.upper(), @@ -469,6 +500,7 @@ const struct %(s)s * 'T': tableName.upper()} print ''' + /* Deletes 'row' from table "%(t)s". 'row' may be freed, so it must not be * accessed afterward. *