File: ick-wrap.c

package info (click to toggle)
intercal 29%3A0.29-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 5,324 kB
  • ctags: 1,941
  • sloc: ansic: 9,047; sh: 1,277; yacc: 1,079; lex: 518; lisp: 463; makefile: 423; perl: 304
file content (113 lines) | stat: -rw-r--r-- 1,854 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
$L
/* $A.c -- generated C-code file for INTERCAL program $A.i */

/* This code is explicitly *not* GPLed.  Use, abuse, and redistribute freely */

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <setjmp.h>

$M
#include "fiddle.h"
#include "abcess.h"
#include "ick_lose.h"
$K

#ifdef ICK_EC
#include "ick_ec.h"
void ick_main(void);
#endif

#define ICKABSTAINED(d) ick_abstained[d]
#define ICKSTASH(a,b,c,d) ick_stash(a, b, c+b, d)
#define ICKRETRIEVE(a,b,c,d,e) ick_retrieve(a+b, c, b, d[b], e)
#define ICKIGNORE(a,b,c) a[b]

extern int ick_printflow;

int ick_lineno;

jmp_buf ick_cjb;
int ick_ccfc;
long ick_skipto=0;
$O
char* ick_globalargv0;
int ick_oldabstain;
int ick_abstained[$B]$C;
$D
$E
$P
int main(int argc, char *argv[])
{
#ifndef YUK
    ick_parseargs(argc,argv);
#endif

    ick_skipto = 0;

    ick_next = calloc(80, sizeof *ick_next);
#ifdef ICK_EC
    ick_next_jmpbufs = malloc(81 * sizeof *ick_next_jmpbufs);
#endif
$N
    ick_globalargv0=argv[0];
#ifdef YUK
    yuklines = $J;
    yukcommands = $B;
    globalargv = argv;
    globalargc = argc;
#endif
    /* set seed for random error generation */
#ifdef USG
    srand48(time(0) + getpid());
#else
    srand(time(0));
#endif /* UNIX */

#if MULTITHREAD == 1
    ickmtinit();
#endif

    /* set up stash storage */
    ick_stashinit();

    $F

#ifdef ICK_EC
    ick_runstartups();
    ick_next(0);
}

ICK_EC_FUNC_START(ick_main)
{
  ick_linelabelnosp(0);
#endif
      /* degenerated code */
 ick_restart:
 top:
    switch((int)ick_skipto)
    {
    case 0:
      $G
    default:
      ick_lose(IE129, 0, (const char *)0);
    }

#ifdef YUK
    if(yukloop) goto ick_restart;
#endif
    ick_lose(IE633, $J, (const char *)0);

    $H
#ifndef ICK_EC
    return 0;
#else
    return;
#endif
}
#ifdef ICK_EC
ICK_EC_FUNC_END
#endif
$Q
/* Generated code for $A.i ends here */