-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathSTDIO.H
83 lines (74 loc) · 1.98 KB
/
STDIO.H
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
/*****************************/
/* Hisoft C */
/* Standard Function Library */
/* Header for ZX Spectrum */
/* */
/* Copyright (C) 1984 Hisoft */
/* Last changed 10 Dec 1984 */
/*****************************/
#list-
#define NULL 0 /* for use with pointers */
#define FALSE 0 /* for Boolean operations */
#define TRUE 1 /* " */
#define EOF -1 /* end of file value */
#define ERROR -1
#define void int /* to use for type of functions which re-
turn no value */
/* File system Structure */
typedef int FILE;
/* Storage Allocation Structure and Variables */
struct _header
{
struct _header * _ptr;
unsigned _size;
};
typedef struct _header HEADER, * HEADER_PTR;
HEADER _base, *_allocp;
/* Function type forward declarations for non-int library
functions */
extern char *strcat(), *strcpy(), *calloc(),
*fgets(),*gets(),*sbrk();
extern unsigned strlen();
/*two arithmetic functions vhich need to be declared
BEFORE they are used, because they are vari-
adic (take any number of arguments). This
means that if you include "stdio.h" these func-
tions will always be compiled into your program.
You may wish to make a version of this file witho-
ut these two routines if you want to compile a lar-
ge amount of code and don't need them.*/
int
max(param_byte_count) auto
{
static int argc, *argv, max;
argc = param_byte_count/2 - 1;
argv = ¶m_byte_count + argc;
max = -32767;
while (argc--)
{
if (*argv > max) max = *argv;
--argv;
}
return max;
}
int
min(param_byte_count) auto
{
static int argc, *argv, min;
argc = param_byte_count/2 - 1;
argv = ¶m_byte_count + argc;
min = 32767;
while (argc--)
{
if (*argv < min) min = *argv;
--argv;
}
return min;
}
#list+
/*****************************/
/* Hisoft C */
/* Standard Function Library */
/* End Header */
/*****************************/