-/* $Id: chars.c,v 1.10 2009/10/30 18:43:24 kristaps Exp $ */
+/* $Id: chars.c,v 1.13 2009/11/05 07:21:01 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
int type;
#define CHARS_CHAR (1 << 0)
#define CHARS_STRING (1 << 1)
-#define CHARS_BOTH (0x03)
+#define CHARS_BOTH (CHARS_CHAR | CHARS_STRING)
};
#define LINES_MAX 351
#define BOTH(w, x, y, z, a, b) \
{ NULL, (w), (y), (a), (x), (z), (b), CHARS_BOTH },
-static struct ln lines[LINES_MAX] = {
+#define CHAR_TBL_START static struct ln lines[LINES_MAX] = {
+#define CHAR_TBL_END };
+
#include "chars.in"
-};
struct tbl {
enum chars type;
tab = malloc(sizeof(struct tbl));
if (NULL == tab) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}
htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
if (NULL == htab) {
- fprintf(stderr, "memory exhausted\n");
+ perror(NULL);
exit(EXIT_FAILURE);
}