File: prescheme.c

package info (click to toggle)
scsh 0.5.1-2
  • links: PTS
  • area: non-free
  • in suites: potato, slink
  • size: 6,540 kB
  • ctags: 8,656
  • sloc: lisp: 39,346; ansic: 13,466; sh: 1,669; makefile: 624
file content (37 lines) | stat: -rw-r--r-- 759 bytes parent folder | download
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
/*Copyright (c) 1993 by Richard Kelsey and Jonathan Rees.  See file COPYING.*/

#include <stdio.h>

void TTerror(message, count, data1, data2, data3)
  const char *message;
  int count;
  long data1, data2, data3;
{
  switch (count) {
  case 0:
    fprintf(stderr, "\n%s\n", message);
    break;
  case 1:
    fprintf(stderr, "\n%s\n%d\n", message, data1);
    break;
  case 2:
    fprintf(stderr, "\n%s\n%d\n%d\n", message, data1, data2);
    break;
  case 3:
    fprintf(stderr, "\n%s\n%d\n%d\n%d\n", message, data1, data2, data3);
    break;
  }
  exit(-1);
}

/* Driver loop for tail-recursive calls */

long TTreturn_value;

long
TTrun_machine(long (*proc) (void))
{
  while (proc != 0)
    proc = (long (*) (void)) (*proc)();
  return TTreturn_value;
}