- struct name_table_entry *name_table = typeCalloc(struct name_table_entry, CAPTABSIZE);
- struct name_table_entry **hash_table = typeCalloc(struct name_table_entry *, HASHTABSIZE);
- const char *root_name = "";
- int column = 0;
- int n;
- char buffer[BUFSIZ];
-
- static const char * typenames[] = { "BOOLEAN", "NUMBER", "STRING" };
-
- short BoolCount = 0;
- short NumCount = 0;
- short StrCount = 0;
-
- /* The first argument is the column-number (starting with 0).
- * The second is the root name of the tables to generate.
- */
- if (argc <= 2
- || (column = atoi(argv[1])) <= 0
- || (column >= MAX_COLUMNS)
- || *(root_name = argv[2]) == 0) {
- fprintf(stderr, "usage: make_hash column root_name\n");
- exit(EXIT_FAILURE);
- }
-
- /*
- * Read the table into our arrays.
- */
- for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin); ) {
- char **list, *nlp = strchr(buffer, '\n');
- if (nlp)
- *nlp = '\0';
- list = parse_columns(buffer);
- if (list == 0) /* blank or comment */
- continue;
- name_table[n].nte_link = -1; /* end-of-hash */
- name_table[n].nte_name = strdup(list[column]);
- if (!strcmp(list[2], "bool")) {
- name_table[n].nte_type = BOOLEAN;
- name_table[n].nte_index = BoolCount++;
- } else if (!strcmp(list[2], "num")) {
- name_table[n].nte_type = NUMBER;
- name_table[n].nte_index = NumCount++;
- } else if (!strcmp(list[2], "str")) {
- name_table[n].nte_type = STRING;
- name_table[n].nte_index = StrCount++;
- } else {
- fprintf(stderr, "Unknown type: %s\n", list[2]);
- exit(EXIT_FAILURE);
- }
- n++;
+ struct name_table_entry *name_table = typeCalloc(struct
+ name_table_entry, CAPTABSIZE);
+ struct name_table_entry **hash_table = typeCalloc(struct name_table_entry
+ *, HASHTABSIZE);
+ const char *root_name = "";
+ int column = 0;
+ int n;
+ char buffer[BUFSIZ];
+
+ static const char *typenames[] =
+ {"BOOLEAN", "NUMBER", "STRING"};
+
+ short BoolCount = 0;
+ short NumCount = 0;
+ short StrCount = 0;
+
+ /* The first argument is the column-number (starting with 0).
+ * The second is the root name of the tables to generate.
+ */
+ if (argc <= 2
+ || (column = atoi(argv[1])) <= 0
+ || (column >= MAX_COLUMNS)
+ || *(root_name = argv[2]) == 0) {
+ fprintf(stderr, "usage: make_hash column root_name\n");
+ exit(EXIT_FAILURE);
+ }
+
+ /*
+ * Read the table into our arrays.
+ */
+ for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) {
+ char **list, *nlp = strchr(buffer, '\n');
+ if (nlp)
+ *nlp = '\0';
+ list = parse_columns(buffer);
+ if (list == 0) /* blank or comment */
+ continue;
+ name_table[n].nte_link = -1; /* end-of-hash */
+ name_table[n].nte_name = strdup(list[column]);
+ if (!strcmp(list[2], "bool")) {
+ name_table[n].nte_type = BOOLEAN;
+ name_table[n].nte_index = BoolCount++;
+ } else if (!strcmp(list[2], "num")) {
+ name_table[n].nte_type = NUMBER;
+ name_table[n].nte_index = NumCount++;
+ } else if (!strcmp(list[2], "str")) {
+ name_table[n].nte_type = STRING;
+ name_table[n].nte_index = StrCount++;
+ } else {
+ fprintf(stderr, "Unknown type: %s\n", list[2]);
+ exit(EXIT_FAILURE);