| 1 |
/* cfuncs.h DPL 1997-03-31, 2001-12-22 */ |
| 2 |
|
| 3 |
#ifndef CFUNCS_H |
| 4 |
# define CFUNCS_H |
| 5 |
|
| 6 |
# define STRINGS_H |
| 7 |
typedef char Char; |
| 8 |
typedef void Void; |
| 9 |
#define Static static |
| 10 |
#define Local static |
| 11 |
#define SHORT_MAX 65535 |
| 12 |
|
| 13 |
# define FileNotFound 10 |
| 14 |
# define FileWriteError 38 |
| 15 |
#ifndef STDIO_H |
| 16 |
# include <stdio.h> |
| 17 |
#endif |
| 18 |
#ifndef CTYPE_H |
| 19 |
# include <ctype.h> |
| 20 |
#endif |
| 21 |
#ifndef STRING_H |
| 22 |
# include <string.h> |
| 23 |
#endif |
| 24 |
#ifndef STDLIB_H |
| 25 |
# include <stdlib.h> |
| 26 |
#endif |
| 27 |
#ifndef _FNSIZE |
| 28 |
# define _FNSIZE 120 |
| 29 |
#endif |
| 30 |
|
| 31 |
typedef unsigned char boolean; |
| 32 |
#define false 0 |
| 33 |
#define true 1 |
| 34 |
|
| 35 |
extern int _EscIO (int); |
| 36 |
extern int _EscIO2 (int errorcode, char* filename); |
| 37 |
extern int _Escape (int); |
| 38 |
extern int P_eof (FILE *); |
| 39 |
extern int _SETIO (int, int); |
| 40 |
|
| 41 |
extern void PASCAL_MAIN (int, char **); |
| 42 |
extern int P_argc; |
| 43 |
extern int P_ioresult; |
| 44 |
extern char **P_argv; |
| 45 |
|
| 46 |
#ifdef CFUNCS_C |
| 47 |
# define vextern |
| 48 |
#else |
| 49 |
# define vextern extern |
| 50 |
#endif |
| 51 |
/* String handling primitives. */ |
| 52 |
|
| 53 |
extern void scan1(char *s, short p, short *n); |
| 54 |
/* Read an integer at position p of s */ |
| 55 |
extern boolean startsWith(char *s1, char *s2); |
| 56 |
/* True if s1 starts with s2 */ |
| 57 |
extern short pos1(char c, char *s); |
| 58 |
extern short posNot(char c, char *s); |
| 59 |
extern void insertChar(char c, char *s, short p); |
| 60 |
extern char *substr_(char *Result, char *s, short start, short count); |
| 61 |
extern void getNum(char *line, short *k); |
| 62 |
extern void getTwoNums(char *line, short *k1, short *k2); |
| 63 |
extern void toUpper(char *s); |
| 64 |
extern void delete1(char *s, short p); |
| 65 |
extern void predelete(char *s, short l); |
| 66 |
extern void shorten(char *s, short new_length); |
| 67 |
extern short strpos2 (char *s1, char *s2, short p); |
| 68 |
extern short nextWordBound(char *s, char trigger, short p); |
| 69 |
|
| 70 |
#undef vextern |
| 71 |
|
| 72 |
#endif /*CFUNCS_H*/ |
| 73 |
|