X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-idlc.in;h=2a4c67ca35f93df8870b97dde72539b7a2a77943;hb=1c2e2d2fc87c9435b6fe33112b0ddaab59f507c5;hp=e8371aa1d619b68729df109c3c1746cd44116850;hpb=991559357f6a03c3a5b70c053c8c2554aa8d5ee4;p=openvswitch diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in index e8371aa1..2a4c67ca 100755 --- a/ovsdb/ovsdb-idlc.in +++ b/ovsdb/ovsdb-idlc.in @@ -20,9 +20,7 @@ def annotateSchema(schemaFile, annotationFile): ovs.json.to_stream(schemaJson, sys.stdout) def constify(cType, const): - if (const - and cType.endswith('*') and not cType.endswith('**') - and (cType.startswith('struct uuid') or cType.startswith('char'))): + if (const and cType.endswith('*') and not cType.endswith('**')): return 'const %s' % cType else: return cType @@ -310,7 +308,7 @@ static void { /* Nothing to do. */ }''' % {'s': structName, 'c': columnName} - + # First, next functions. print ''' const struct %(s)s * @@ -489,7 +487,11 @@ static void\n%s_columns_init(void) print "struct ovsdb_idl_table_class %stable_classes[%sN_TABLES] = {" % (prefix, prefix.upper()) for tableName, table in sorted(schema.tables.iteritems()): structName = "%s%s" % (prefix, tableName.lower()) - print " {\"%s\"," % tableName + if table.is_root: + is_root = "true" + else: + is_root = "false" + print " {\"%s\", %s," % (tableName, is_root) print " %s_columns, ARRAY_SIZE(%s_columns)," % ( structName, structName) print " sizeof(struct %s)}," % structName @@ -566,7 +568,7 @@ if __name__ == "__main__": except getopt.GetoptError, geo: sys.stderr.write("%s: %s\n" % (argv0, geo.msg)) sys.exit(1) - + for key, value in options: if key in ['-h', '--help']: usage() @@ -576,7 +578,7 @@ if __name__ == "__main__": os.chdir(value) else: sys.exit(0) - + optKeys = [key for key, value in options] if not args: