4 from structs import structs;
6 # command line arguments
11 f = open(outfile, "w");
14 * sanity checks for generated foreign headers:
15 * - verify struct sizes
17 * generated by %s -- DO NOT EDIT
27 f.write('#include "%s.h"\n' % a);
29 f.write('int main(int argc, char *argv[])\n{\n');
31 f.write('\tprintf("\\n");');
32 f.write('printf("%-25s |", "structs");\n');
34 f.write('\tprintf("%%8s", "%s");\n' % a);
35 f.write('\tprintf("\\n");');
37 f.write('\tprintf("\\n");');
38 for struct in structs:
39 f.write('\tprintf("%%-25s |", "%s");\n' % struct);
45 f.write('#ifdef %s_has_no_%s\n' % (a, struct));
46 f.write('\tprintf("%8s", "-");\n');
48 f.write('\tprintf("%%8zd", sizeof(struct %s));\n' % s);
51 f.write('\tprintf("\\n");\n\n');
53 f.write('\tprintf("\\n");\n');
54 f.write('\texit(0);\n');