9 for fn in sys.argv[1:]:
12 if not line or line[0]=='#':
15 parts = line[:-1].split()
21 enums.append([None, cur_categ, parts[2]])
24 enums.append([int(parts[2], 0), cur_categ, parts[0]])
26 sys.stderr.write("Syntax error in %s: %s\n"%(fn, e))
31 if n[2]==e[2] and n[0] is not None:
34 sys.stderr.write("Could not find value for enum reference %s in category %s\n"%(e[2], e[1]))
36 enums.sort(lambda x, y: cmp(x[0], y[0])*2+cmp(x[1], y[1]))
38 '''categs = set([e[2] for e in enums])
40 print c, reduce(lambda x, y: x^y, [ord(c[i])*(1<<i) for i in range(len(c))])'''
42 print "EnumInfo enums[] ="
46 print "\t{ 0x%X, \"%s\", \"GL_%s\" },"%(e[0], e[1], e[2])
49 print "unsigned enum_count = %d;"%len(enums)