-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsubroute.c
executable file
·88 lines (71 loc) · 1.84 KB
/
subroute.c
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
84
85
86
87
88
/*
Copyright 2007 TeX Users Group
Copyright 2014 Clerk Ma
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
*/
#define EXTERN extern
#include "yandytex.h"
// texk/web2c/lib/uexit.c
void uexit (int unix_code)
{
int final_code;
update_terminal();
if (unix_code == 0)
final_code = EXIT_SUCCESS;
else if (unix_code == 1)
final_code = EXIT_FAILURE;
else
final_code = unix_code;
if (jump_used)
{
printf("Jump Buffer already used.\n");
exit(1);
}
jump_used++;
exit(final_code);
}
// texk/web2c/lib/zround.c
integer web2c_round (double r)
{
integer i;
if (r > 2147483647.0)
i = 2147483647;
else if (r < -2147483647.0)
i = -2147483647;
else if (r >= 0.0)
i = (integer) (r + 0.5);
else
i = (integer) (r - 0.5);
return i;
}
// Unixify filename and path (turn \ into /)
// --- assumes null terminated
char * unixify (char * t)
{
char * s = t;
if (s == NULL)
return s;
if (t != '\0')
{
while (*s != '\0')
{
if (*s == '\\')
*s = '/';
s++;
}
}
if (trace_flag)
printf("Unixified name: %s\n", t);
return t;
}