From 87412f02be79e1ed33f93528e5dfe2eca3880fe0 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Wed, 26 Feb 2014 16:18:33 -0800 Subject: [PATCH] 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 --- ovsdb/ovsdb-idlc.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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): -- 2.47.0