2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1996
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
/*
|
|
|
30 |
VERSION INFORMATION
|
|
|
31 |
===================
|
|
|
32 |
|
|
|
33 |
--------------------------------------------------------------------------
|
|
|
34 |
$Header: /u/g/release/CVSROOT/Source/src/installers/680x0/common/input.c,v 1.1.1.1 1998/01/17 15:55:48 release Exp $
|
|
|
35 |
--------------------------------------------------------------------------
|
|
|
36 |
$Log: input.c,v $
|
|
|
37 |
* Revision 1.1.1.1 1998/01/17 15:55:48 release
|
|
|
38 |
* First version to be checked into rolling release.
|
|
|
39 |
*
|
|
|
40 |
Revision 1.1.1.1 1997/10/13 12:42:54 ma
|
|
|
41 |
First version.
|
|
|
42 |
|
|
|
43 |
Revision 1.1.1.1 1997/03/14 07:50:12 ma
|
|
|
44 |
Imported from DRA
|
|
|
45 |
|
|
|
46 |
* Revision 1.1.1.1 1996/09/20 10:56:54 john
|
|
|
47 |
*
|
|
|
48 |
* Revision 1.1.1.1 1996/03/26 15:45:12 john
|
|
|
49 |
*
|
|
|
50 |
* Revision 1.3 94/02/21 15:58:54 15:58:54 ra (Robert Andrews)
|
|
|
51 |
* Accomodate changes in basicread.c.
|
|
|
52 |
*
|
|
|
53 |
* Revision 1.2 93/11/19 16:21:20 16:21:20 ra (Robert Andrews)
|
|
|
54 |
* Comment of bignat stuff (no longer used).
|
|
|
55 |
*
|
|
|
56 |
* Revision 1.1 93/02/22 17:15:49 17:15:49 ra (Robert Andrews)
|
|
|
57 |
* Initial revision
|
|
|
58 |
*
|
|
|
59 |
--------------------------------------------------------------------------
|
|
|
60 |
*/
|
|
|
61 |
|
|
|
62 |
|
|
|
63 |
#include "config.h"
|
|
|
64 |
#include "utility.h"
|
|
|
65 |
#define failer failer_reject
|
|
|
66 |
#include "basicread.c"
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
/*
|
|
|
70 |
OPEN INPUT FILE
|
|
|
71 |
|
|
|
72 |
This routine is intended to replace initreader in basicread.c.
|
|
|
73 |
*/
|
|
|
74 |
|
|
|
75 |
void open_input
|
|
|
76 |
PROTO_N ( ( nm ) )
|
|
|
77 |
PROTO_T ( char *nm )
|
|
|
78 |
{
|
|
|
79 |
crt_dot_t = nm ;
|
|
|
80 |
crt_lno = -1 ;
|
|
|
81 |
failer_count = 0 ;
|
|
|
82 |
|
|
|
83 |
if ( strcmp ( nm, "-" ) ) {
|
|
|
84 |
fpin = fopen ( nm, "r" ) ;
|
|
|
85 |
if ( fpin == null ) {
|
|
|
86 |
error ( "Can't open input file, %s", nm ) ;
|
|
|
87 |
exit ( EXIT_FAILURE ) ;
|
|
|
88 |
}
|
|
|
89 |
} else {
|
|
|
90 |
int c ;
|
|
|
91 |
fpin = tmpfile () ;
|
|
|
92 |
if ( fpin == null ) {
|
|
|
93 |
error ( "Can't open temporary file" ) ;
|
|
|
94 |
exit ( EXIT_FAILURE ) ;
|
|
|
95 |
}
|
|
|
96 |
while ( c = fgetc ( stdin ), c != EOF ) fputc ( c, fpin ) ;
|
|
|
97 |
rewind ( fpin ) ;
|
|
|
98 |
}
|
|
|
99 |
pkt_index = -1 ;
|
|
|
100 |
file_pkt = -1 ;
|
|
|
101 |
table_flag = 0 ;
|
|
|
102 |
getcode_bitposn = 0 ;
|
|
|
103 |
read_line ( 1 ) ;
|
|
|
104 |
crt_line = buff ;
|
|
|
105 |
crt_ptr = crt_line ;
|
|
|
106 |
end_ptr = crt_line + cppkt ;
|
|
|
107 |
|
|
|
108 |
#if 0
|
|
|
109 |
bignat_work = alloc_nof ( unsigned short, 2 ) ;
|
|
|
110 |
bignat_work [0] = 0 ;
|
|
|
111 |
bignat_work [1] = 0 ;
|
|
|
112 |
bignat_len = 2 ;
|
|
|
113 |
#endif
|
|
|
114 |
return ;
|
|
|
115 |
}
|