| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| #if HAVE_CONFIG_H |
| # include "config.h" |
| #endif |
| |
| #include <stdarg.h> |
| #include <stdio.h> |
| #include <stdlib.h> |
| |
| #include "misc.h" |
| |
| void |
| die(const char *format, ...) |
| { |
| va_list args; |
| va_start(args, format); |
| vfprintf(stderr, format, args); |
| va_end(args); |
| |
| exit(EXIT_FAILURE); |
| } |
| |
| void |
| werror(const char *format, ...) |
| { |
| va_list args; |
| va_start(args, format); |
| vfprintf(stderr, format, args); |
| va_end(args); |
| } |
| |
| void * |
| xalloc(size_t size) |
| { |
| void *p = malloc(size); |
| if (!p) |
| { |
| fprintf(stderr, "Virtual memory exhausted.\n"); |
| abort(); |
| } |
| |
| return p; |
| } |
| |
| const char |
| sexp_token_chars[0x80] = |
| { |
| |
| 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, |
| 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, |
| |
| 0,0,0,0,0,0,0,0, 0,0,1,1,0,1,1,1, |
| |
| 1,1,1,1,1,1,1,1, 1,1,1,0,0,1,0,0, |
| |
| 0,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, |
| |
| 1,1,1,1,1,1,1,1, 1,1,1,0,0,0,0,1, |
| |
| 0,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, |
| |
| 1,1,1,1,1,1,1,1, 1,1,1,0,0,0,0,0, |
| }; |