Subversion Repositories tendra.SVN

Rev

Rev 2 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line -... Line 1...
-
 
1
/*
-
 
2
 * Copyright (c) 2002-2005 The TenDRA Project <http://www.tendra.org/>.
-
 
3
 * All rights reserved.
-
 
4
 *
-
 
5
 * Redistribution and use in source and binary forms, with or without
-
 
6
 * modification, are permitted provided that the following conditions are met:
-
 
7
 *
-
 
8
 * 1. Redistributions of source code must retain the above copyright notice,
-
 
9
 *    this list of conditions and the following disclaimer.
-
 
10
 * 2. Redistributions in binary form must reproduce the above copyright notice,
-
 
11
 *    this list of conditions and the following disclaimer in the documentation
-
 
12
 *    and/or other materials provided with the distribution.
-
 
13
 * 3. Neither the name of The TenDRA Project nor the names of its contributors
-
 
14
 *    may be used to endorse or promote products derived from this software
-
 
15
 *    without specific, prior written permission.
-
 
16
 *
-
 
17
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
-
 
18
 * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-
 
19
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-
 
20
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
-
 
21
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-
 
22
 * EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-
 
23
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-
 
24
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-
 
25
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-
 
26
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-
 
27
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
 
28
 *
-
 
29
 * $Id$
-
 
30
 */
1
/*
31
/*
2
    		 Crown Copyright (c) 1997
32
    		 Crown Copyright (c) 1997
3
 
33
 
4
    This TenDRA(r) Computer Program is subject to Copyright
34
    This TenDRA(r) Computer Program is subject to Copyright
5
    owned by the United Kingdom Secretary of State for Defence
35
    owned by the United Kingdom Secretary of State for Defence
Line 88... Line 118...
88
 
118
 
89
 
119
 
90
/* PROCEDURES */
120
/* PROCEDURES */
91
 
121
 
92
int outinit
122
int outinit
93
    PROTO_N ( (intermed) )
-
 
94
    PROTO_T ( char *intermed )
123
(char *intermed)
95
{
124
{
96
  fpout = fopen (intermed, "w");
125
  fpout = fopen(intermed, "w");
97
  return (fpout != (FILE *) 0);
126
  return(fpout != (FILE *)0);
98
}
127
}
99
 
128
 
100
void outc
129
void outc
101
    PROTO_N ( (c) )
-
 
102
    PROTO_T ( char c )
130
(char c)
103
{
131
{
104
  int   st = fputc (c, fpout);
132
  int   st = fputc(c, fpout);
105
  if (st == EOF) {
133
  if (st == EOF) {
106
    failer (BAD_OUTPUT);
134
    failer(BAD_OUTPUT);
107
    exit(EXIT_FAILURE);
135
    exit(EXIT_FAILURE);
108
  };
136
  };
109
}
137
}
110
 
138
 
111
void outs
139
void outs
112
    PROTO_N ( (s) )
-
 
113
    PROTO_T ( char *s )
140
(char *s)
114
{
141
{
115
  int   st = fputs (s, fpout);
142
  int   st = fputs(s, fpout);
116
  if (st == EOF) {
143
  if (st == EOF) {
117
    failer (BAD_OUTPUT);
144
    failer(BAD_OUTPUT);
118
    exit(EXIT_FAILURE);
145
    exit(EXIT_FAILURE);
119
  };
146
  };
120
}
147
}
121
 
148
 
122
 
149
 
123
 
150
 
124
 
151
 
125
void outnl
152
void outnl
126
    PROTO_Z ()
153
(void)
127
{
154
{
128
 
155
 
129
  int   st = fputs ("\n", fpout);
156
  int   st = fputs("\n", fpout);
130
  if (st == EOF) {
157
  if (st == EOF) {
131
    failer (BAD_OUTPUT);
158
    failer(BAD_OUTPUT);
132
    exit(EXIT_FAILURE);
159
    exit(EXIT_FAILURE);
133
  };
160
  };
134
 
161
 
135
#ifdef NEWDWARF
162
#ifdef NEWDWARF
136
  instr_count = -1;
163
  instr_count = -1;
Line 141... Line 168...
141
}
168
}
142
 
169
 
143
 
170
 
144
 
171
 
145
void outn
172
void outn
146
    PROTO_N ( (n) )
-
 
147
    PROTO_T ( long n )
173
(long n)
148
{
174
{
149
  int   st = fprintf (fpout, "%ld", n);
175
  int   st = fprintf(fpout, "%ld", n);
150
  if (st == EOF) {
176
  if (st == EOF) {
151
    failer (BAD_OUTPUT);
177
    failer(BAD_OUTPUT);
152
    exit(EXIT_FAILURE);
178
    exit(EXIT_FAILURE);
153
  };
179
  };
154
 
180
 
155
}
181
}
156
 
182
 
157
void outhex
183
void outhex
158
    PROTO_N ( (n) )
-
 
159
    PROTO_T ( int n )
184
(int n)
160
{
185
{
161
  int   st = fprintf (fpout, "0x%x", (unsigned int)n);
186
  int   st = fprintf(fpout, "0x%x",(unsigned int)n);
162
  if (st == EOF) {
187
  if (st == EOF) {
163
    failer (BAD_OUTPUT);
188
    failer(BAD_OUTPUT);
164
    exit(EXIT_FAILURE);
189
    exit(EXIT_FAILURE);
165
  };
190
  };
166
 
191
 
167
}
192
}