system.h 2.25 KB
Newer Older
clean's avatar
clean committed
1
2
3
4
5
6
7
8
9
/*
       system.h
       Author: Eric Nocker
       At: Department of Computer Science
           University of Nijmegen
*/

#define _SYSTEM_

10
11
12
13
14
#if defined (__MWERKS__) && defined (_X86_)
#	define _WINDOWS_
#endif

#if defined (applec) || (defined (__MWERKS__) && !defined (_X86_)) || defined (__MRC__)
clean's avatar
clean committed
15
#	define _MAC_
16
#	define __ppc__
clean's avatar
clean committed
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
#endif

#define _DEBUG_

#if defined (_MAC_)
# include "mac.h"
#elif defined (_SUN_)
# include "sun.h"
#elif defined (OS2)
#  include "os2.h"
#elif defined (_WINDOWS_)
#  include "windows_io.h"
#else
#  include "standard.h"
#endif

#include "types.t"

#ifdef GEN_SUPPORT_H
# include "gensupport.h"
#else

#define MAXPATHLEN 1024

extern char *PATHLIST;

extern char *GetFileExtension (FileKind kind);
extern File FOpen (char *wname, FileKind kind, char *mode);
#if defined(WRITE_DCL_MODIFICATION_TIME) && WRITE_DCL_MODIFICATION_TIME
extern File FOpenWithFileTime (char *file_name,FileKind kind, char *mode,FileTime *file_time_p);
#endif
extern int FDelete (char *fname, FileKind kind);
extern int FClose (File f);

extern int FPutS (char *s, File f);
extern size_t FWrite (void *ptr, size_t size, size_t count, File f);
53
#ifdef _VARARGS_
clean's avatar
clean committed
54
extern int FPrintF (File f, char *fmt,...);
55
#else
clean's avatar
clean committed
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
extern int FPrintF (); /* (File w, char *fmt,...) */
#endif

#ifndef __ppc__
extern char *FGetS (char *s, int n, File f);
#endif
extern size_t FRead (void *ptr, size_t size, size_t count, File f);
extern int FSeek (File f, long offset, int origin);
extern long FTell (File f);
extern FileTime FGetFileTime (char *fname, FileKind kind);
#if defined(WRITE_DCL_MODIFICATION_TIME) && WRITE_DCL_MODIFICATION_TIME
extern void FWriteFileTime (FileTime file_time,File f);
#endif
extern Bool GetOptionsFromIclFile (char *fname, CompilerOptions *opts);

#ifdef _VARARGS_
	extern void DoError (char *fmt,...);
	extern void DoFatalError (char *fmt,...);
	extern void CmdError (char *errormsg,...);
#else
	extern void DoError ();
	extern void DoFatalError ();
	extern void CmdError ();
#endif

extern void (*SetSignal (void (*f) (void))) (void);
	
extern int CheckInterrupt (void);

extern void *Alloc (unsigned long count, SizeT size);

extern void Free (void *p);

#ifdef THINK_C
#define ReSize(A) (((A)+1) & ~1)
#else
#define ReSize(A) (((A)+3) & ~3)
#endif

extern int System (char *s);

#endif