7
int _EscIO2 (int errorcode, char* filename)
8
{ fprintf(stderr,"Input file %s not found\n",filename);
9
exit(errorcode); return errorcode; }
10
int _EscIO (int errorcode){ return _EscIO2(errorcode,""); }
11
int _Escape (int exitcode)
12
{ exit(exitcode); return exitcode; }
13
int _SETIO (int OK, int errorcode){ return P_ioresult = OK ? 0 : errorcode; }
14
int P_eof (FILE * infile)
16
if (feof(infile)) return 1;
19
ungetc(x,infile); return 0;
21
void PASCAL_MAIN (int npars, char ** pars)
22
{ P_argc = npars; P_argv = pars; }
24
void scan1(char *s, short p, short *n)
25
{ sscanf(s+p-1,"%hd",n);
28
short pos1(char c, char *s)
29
{ char *t = strchr(s,c);
30
if (t) return (short) (t-s+1); else return 0;
33
void delete1(char *s, short p)
34
{ char *t = (s+=p); s=t-1;
35
while (*s) *s++ = *t++;
38
void predelete(char *s, short l)
40
while (*t) *s++ = *t++;
44
void shorten(char *s, short new_length)
45
{ s[new_length] = '\0';
48
short posNot(char c, char *s)
55
void getNum(char *line, short *k)
56
{ int j=sscanf(line,"%hd",k);
61
void getTwoNums(char *line, short *k1, short *k2)
62
{ int param = sscanf(line,"%hd/%hd",k1,k2);
67
{ while (*s) { *s = toupper(*s); s++; }
70
boolean startsWith(char *s1, char *s2)
71
{ while (*s2) { if (*s1++ != *s2++) return false; }
75
void insertChar(char c, char *s, short p)
78
do { x=c; c=*s; *s++=x; } while (x);
81
char *substr_(char *Result, char *s, short start, short count)
84
while (count--) *R++ = *s++;