-/* $Id: chars.c,v 1.8 2009/09/23 09:06:44 kristaps Exp $ */
+/* $Id: chars.c,v 1.11 2009/10/31 06:10:57 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <assert.h>
-#include <err.h>
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define CHARS_BOTH (0x03)
};
-#define LINES_MAX 337
+#define LINES_MAX 351
#define CHAR(w, x, y, z, a, b) \
{ NULL, (w), (y), (a), (x), (z), (b), CHARS_CHAR },
* (they're in-line re-ordered during lookup).
*/
- if (NULL == (tab = malloc(sizeof(struct tbl))))
- err(1, "malloc");
- tab->type = type;
+ tab = malloc(sizeof(struct tbl));
+ if (NULL == tab) {
+ perror(NULL);
+ exit(EXIT_FAILURE);
+ }
htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
- if (NULL == htab)
- err(1, "malloc");
+ if (NULL == htab) {
+ perror(NULL);
+ exit(EXIT_FAILURE);
+ }
for (i = 0; i < LINES_MAX; i++) {
hash = (int)lines[i].code[0] - PRINT_LO;
}
tab->htab = htab;
+ tab->type = type;
return(tab);
}