Skip to content

Commit

Permalink
ovsdb-idlc: Make schema version available.
Browse files Browse the repository at this point in the history
Future patches will make use of the ability to retrieve the schema
version against which they were compiled.

Signed-off-by: Justin Pettit <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Justin Pettit committed Feb 28, 2014
1 parent a4f22c2 commit 87412f0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ovsdb/ovsdb-idlc.in
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ struct %(s)s *%(s)s_insert(struct ovsdb_idl_txn *);

print "\nextern struct ovsdb_idl_class %sidl_class;" % prefix
print "\nvoid %sinit(void);" % prefix

print "\nconst char * %sget_db_version(void);" % prefix
print "\n#endif /* %(prefix)sIDL_HEADER */" % {'prefix': prefix.upper()}

def printEnum(members):
Expand Down Expand Up @@ -652,6 +654,16 @@ void
print " %s_columns_init();" % structName
print "}"

print """
/* Return the schema version. The caller must not free the returned value. */
const char *
%sget_db_version(void)
{
return "%s";
}
""" % (prefix, schema.version)



def ovsdb_escape(string):
def escape(match):
Expand Down

0 comments on commit 87412f0

Please sign in to comment.