From: Justin Pettit Date: Thu, 27 Feb 2014 00:18:33 +0000 (-0800) Subject: ovsdb-idlc: Make schema version available. X-Git-Tag: sliver-openvswitch-2.2.90-1~9^2~10 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=87412f02be79e1ed33f93528e5dfe2eca3880fe0 ovsdb-idlc: Make schema version available. Future patches will make use of the ability to retrieve the schema version against which they were compiled. Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index ec1c65536..d680f7c6c 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -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): @@ -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):