Mercurial > repo
comparison interps/c-intercal/src/ick-wrap.c @ 996:859f9b4339e6
<Gregor> tar xf egobot.tar.xz
author | HackBot |
---|---|
date | Sun, 09 Dec 2012 19:30:08 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
995:6883f5911eb7 | 996:859f9b4339e6 |
---|---|
1 $L | |
2 /* $A.c -- generated C-code file for INTERCAL program $A.i */ | |
3 | |
4 /* This code is explicitly *not* GPLed. Use, abuse, and redistribute freely */ | |
5 | |
6 #include <stdio.h> | |
7 #include <stdlib.h> | |
8 #include <time.h> | |
9 #include <setjmp.h> | |
10 | |
11 $M | |
12 #include "fiddle.h" | |
13 #include "abcess.h" | |
14 #include "ick_lose.h" | |
15 $K | |
16 | |
17 #ifdef ICK_EC | |
18 #include "ick_ec.h" | |
19 void ick_main(void); | |
20 #endif | |
21 | |
22 #define ICKABSTAINED(d) ick_abstained[d] | |
23 #define ICKSTASH(a,b,c,d) ick_stash(a, b, c+b, d) | |
24 #define ICKRETRIEVE(a,b,c,d,e) ick_retrieve(a+b, c, b, d[b], e) | |
25 #define ICKIGNORE(a,b,c) a[b] | |
26 | |
27 extern int ick_printflow; | |
28 | |
29 int ick_lineno; | |
30 | |
31 jmp_buf ick_cjb; | |
32 int ick_ccfc; | |
33 long ick_skipto=0; | |
34 $O | |
35 char* ick_globalargv0; | |
36 int ick_oldabstain; | |
37 int ick_abstained[$B]$C; | |
38 $D | |
39 $E | |
40 $P | |
41 int main(int argc, char *argv[]) | |
42 { | |
43 #ifndef YUK | |
44 ick_parseargs(argc,argv); | |
45 #endif | |
46 | |
47 ick_skipto = 0; | |
48 | |
49 ick_next = calloc(80, sizeof *ick_next); | |
50 #ifdef ICK_EC | |
51 ick_next_jmpbufs = malloc(81 * sizeof *ick_next_jmpbufs); | |
52 #endif | |
53 $N | |
54 ick_globalargv0=argv[0]; | |
55 #ifdef YUK | |
56 yuklines = $J; | |
57 yukcommands = $B; | |
58 globalargv = argv; | |
59 globalargc = argc; | |
60 #endif | |
61 /* set seed for random error generation */ | |
62 #ifdef USG | |
63 srand48(time(0) + getpid()); | |
64 #else | |
65 srand(time(0)); | |
66 #endif /* UNIX */ | |
67 | |
68 #if MULTITHREAD == 1 | |
69 ickmtinit(); | |
70 #endif | |
71 | |
72 /* set up stash storage */ | |
73 ick_stashinit(); | |
74 | |
75 $F | |
76 | |
77 #ifdef ICK_EC | |
78 ick_runstartups(); | |
79 ick_next(0); | |
80 } | |
81 | |
82 ICK_EC_FUNC_START(ick_main) | |
83 { | |
84 ick_linelabelnosp(0); | |
85 #endif | |
86 /* degenerated code */ | |
87 ick_restart: | |
88 top: | |
89 switch((int)ick_skipto) | |
90 { | |
91 case 0: | |
92 $G | |
93 default: | |
94 ick_lose(IE129, 0, (const char *)0); | |
95 } | |
96 | |
97 #ifdef YUK | |
98 if(yukloop) goto ick_restart; | |
99 #endif | |
100 ick_lose(IE633, $J, (const char *)0); | |
101 | |
102 $H | |
103 #ifndef ICK_EC | |
104 return 0; | |
105 #else | |
106 return; | |
107 #endif | |
108 } | |
109 #ifdef ICK_EC | |
110 ICK_EC_FUNC_END | |
111 #endif | |
112 $Q | |
113 /* Generated code for $A.i ends here */ |