#include <sys/types.h>#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <unistd.h>#include <fcntl.h>#include <string.h>#include <signal.h>#include <errno.h>#include <ctype.h>#include <assert.h>#include <sys/stat.h>#include <sys/wait.h>Go to the source code of this file.
Classes | |
| struct | cell |
| struct | program |
| struct | rule |
Defines | |
| #define | nil 0 |
| #define | _POSIX_SOURCE 1 |
| #define | LIB "/usr/lib" |
| #define | arraysize(a) (sizeof(a) / sizeof((a)[0])) |
| #define | arraylimit(a) ((a) + arraysize(a)) |
| #define | value car |
| #define | base cdr |
| #define | suffix cdr |
| #define | flags letter |
| #define | subst car |
| #define | is_unique(type) ((type) >= LETTER) |
| #define | W_SET 0x01 |
| #define | W_RDONLY 0x02 |
| #define | W_LOCAL 0x04 |
| #define | W_TEMP 0x08 |
| #define | W_SUFF 0x10 |
| #define | N_CHARS (1 + (unsigned char) -1) |
| #define | HASHDENSE 0x400 |
| #define | E_BASH 0x01 |
| #define | E_QUOTE 0x02 |
| #define | E_SIMPLE 0x04 |
| #define | match from |
| #define | R_PREFER 0x01 |
| #define | NO_PATH 2000000000 |
Typedefs | |
| typedef struct cell | cell_t |
| typedef enum type | type_t |
| typedef struct program | program_t |
| typedef enum how | how_t |
| typedef enum phase | phase_t |
| typedef struct rule | rule_t |
| typedef enum ruletype | ruletype_t |
| typedef enum exec | exec_t |
Enumerations | |
| enum | type { CELL, STRING, SUBST, LETTER, WORD, EQUALS, OPEN, CLOSE, PLUS, MINUS, STAR, INPUT, OUTPUT, WHITE, COMMENT, SEMI, EOLN, N_TYPES } |
| enum | how { SUPERFICIAL, PARTIAL, FULL, EXPLODE, IMPLODE } |
| enum | phase { INIT, SCAN, COMPILE } |
| enum | ruletype { ARG, PREFER, TRANSFORM, COMBINE } |
| enum | exec { DOIT, DONT } |
Functions | |
| void | report (char *label) |
| void | quit (int exit_code) |
| void | fatal (char *label) |
| void * | allocate (void *mem, size_t size) |
| void | deallocate (void *mem) |
| char * | copystr (const char *s) |
| void | princhar (int c) |
| void | prinstr (char *s) |
| void | prin2 (cell_t *p) |
| void | prin1 (cell_t *p) |
| void | prin1n (cell_t *p) |
| void | prin2n (cell_t *p) |
| cell_t * | newcell (void) |
| unsigned | hashfun (cell_t *p) |
| cell_t * | search (cell_t *p, cell_t ***hook) |
| void | dec (cell_t *p) |
| cell_t * | inc (cell_t *p) |
| cell_t * | go (cell_t *p, cell_t *field) |
| cell_t * | cons (type_t type, cell_t *p) |
| cell_t * | append (type_t type, cell_t *p) |
| cell_t * | findnword (char *name, size_t n) |
| cell_t * | findword (char *name) |
| void | interrupt (int sig) |
| int | extalnum (int c) |
| void | getdesc (void) |
| cell_t * | get_token (void) |
| cell_t * | explode (cell_t *p, how_t how) |
| cell_t * | get_string (cell_t **pp) |
| cell_t * | get_list (cell_t **pp, type_t stop) |
| program_t * | get_line (cell_t *file) |
| program_t * | get_prog (void) |
| void | makenames (cell_t ***ppr, cell_t *s, char **name, size_t i, size_t *n) |
| int | constant (cell_t *p) |
| cell_t * | evaluate (cell_t *p, how_t how) |
| void | modify (cell_t **pp, cell_t *p, type_t mode) |
| int | tainted (cell_t *p) |
| void | newrule (ruletype_t type, cell_t *from, cell_t *to) |
| int | talk (void) |
| void | unix_exec (cell_t *c) |
| void | execute (exec_t how, unsigned indent) |
| int | equal (cell_t *p, cell_t *q) |
| int | wordlist (cell_t **pw, int atom) |
| char * | maketemp (void) |
| void | inittemp (char *tmpdir) |
| void | deltemp (void) |
| cell_t * | splitenv (char *env) |
| void | key_usage (char *how) |
| void | inappropriate (void) |
| int | readonly (cell_t *v) |
| void | complain (cell_t *err) |
| int | keyword (char *name) |
| cell_t * | getvar (cell_t *v) |
| void | argscan (void) |
| void | compile (void) |
| void | transform (rule_t *) |
| void | exec_one (void) |
| int | argmatch (int shift, cell_t *match, cell_t *match1, char *arg1) |
| int | member (cell_t *p, cell_t *l) |
| long | basefind (cell_t *f, cell_t *l) |
| rule_t * | findpath (long depth, int seek, cell_t *file, rule_t *start) |
| cell_t * | predef (char *var, char *val) |
| void | usage (void) |
| int | main (int argc, char **argv) |
Variables | |
| char | version [] = "1.9" |
| char * | program |
| int | verbose = 0 |
| int | action = 2 |
| size_t | heap_chunks = 0 |
| program_t * | pc |
| program_t * | nextpc |
| cell_t * | oldcells |
| cell_t * | oblist [HASHDENSE+N_CHARS+N_TYPES] |
| char * | descr |
| FILE * | dfp |
| int | dch |
| unsigned | lineno |
| unsigned | indent |
| phase_t | phase |
| rule_t * | rules = nil |
| cell_t * | V_star |
| cell_t ** | pV_star |
| cell_t * | L_files |
| cell_t ** | pL_files = &L_files |
| cell_t * | V_in |
| cell_t * | V_out |
| cell_t * | V_stop |
| cell_t * | L_args |
| cell_t * | L_predef |
| char * | template |
| long | shortest |
| typedef enum ruletype ruletype_t |
| enum type |
| void newrule | ( | ruletype_t | type, | |
| cell_t * | from, | |||
| cell_t * | to | |||
| ) |
| size_t heap_chunks = 0 |
1.5.8