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-2006 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
6
    acting through the Defence Evaluation and Research Agency
36
    acting through the Defence Evaluation and Research Agency
7
    (DERA).  It is made available to Recipients with a
37
    (DERA).  It is made available to Recipients with a
8
    royalty-free licence for its use, reproduction, transfer
38
    royalty-free licence for its use, reproduction, transfer
9
    to other parties and amendment for any purpose not excluding
39
    to other parties and amendment for any purpose not excluding
10
    product development provided that any such use et cetera
40
    product development provided that any such use et cetera
11
    shall be deemed to be acceptance of the following conditions:-
41
    shall be deemed to be acceptance of the following conditions:-
12
    
42
 
13
        (1) Its Recipients shall ensure that this Notice is
43
        (1) Its Recipients shall ensure that this Notice is
14
        reproduced upon any copies or amended versions of it;
44
        reproduced upon any copies or amended versions of it;
15
    
45
 
16
        (2) Any amended version of it shall be clearly marked to
46
        (2) Any amended version of it shall be clearly marked to
17
        show both the nature of and the organisation responsible
47
        show both the nature of and the organisation responsible
18
        for the relevant amendment or amendments;
48
        for the relevant amendment or amendments;
19
    
49
 
20
        (3) Its onward transfer from a recipient to another
50
        (3) Its onward transfer from a recipient to another
21
        party shall be deemed to be that party's acceptance of
51
        party shall be deemed to be that party's acceptance of
22
        these conditions;
52
        these conditions;
23
    
53
 
24
        (4) DERA gives no warranty or assurance as to its
54
        (4) DERA gives no warranty or assurance as to its
25
        quality or suitability for any purpose and DERA accepts
55
        quality or suitability for any purpose and DERA accepts
26
        no liability whatsoever in relation to any use to which
56
        no liability whatsoever in relation to any use to which
27
        it may be put.
57
        it may be put.
28
*/
58
*/
Line 104... Line 134...
104
#endif /* defined (FS_NO_ENUM) */
134
#endif /* defined (FS_NO_ENUM) */
105
 
135
 
106
/*--------------------------------------------------------------------------*/
136
/*--------------------------------------------------------------------------*/
107
 
137
 
108
static BoolT
138
static BoolT
109
error_file_skip_white_space PROTO_N ((istream, c_ref))
139
error_file_skip_white_space(IStreamP istream,				     char    *c_ref)
110
			    PROTO_T (IStreamP istream X
-
 
111
				     char    *c_ref)
-
 
112
{
140
{
113
    BoolT comment = FALSE;
141
    BoolT comment = FALSE;
114
 
142
 
115
    for (;;) {
143
    for (;;) {
116
	char c;
144
	char c;
117
 
145
 
118
      redo:
146
      redo:
119
	switch (c = ISTREAM_READ_CHAR (istream)) {
147
	switch (c = ISTREAM_READ_CHAR(istream)) {
120
	  case '\0':
148
	  case '\0':
121
	    ISTREAM_HANDLE_NULL (istream, redo, eof);
149
	    ISTREAM_HANDLE_NULL(istream, redo, eof);
122
	    break;
150
	    break;
123
	  case '\n':
151
	  case '\n':
124
	    istream_inc_line (istream);
152
	    istream_inc_line(istream);
125
	    comment = FALSE;
153
	    comment = FALSE;
126
	    break;
154
	    break;
127
	  case '#':
155
	  case '#':
128
	    comment = TRUE;
156
	    comment = TRUE;
129
	    break;
157
	    break;
130
	  default:
158
	  default:
131
	    if ((!comment) && (!syntax_is_white_space (c))) {
159
	    if ((!comment) && (!syntax_is_white_space(c))) {
132
		*c_ref = c;
160
		*c_ref = c;
133
		return (TRUE);
161
		return(TRUE);
134
	    }
162
	    }
135
	}
163
	}
136
    }
164
    }
137
  eof:
165
  eof:
138
    return (FALSE);
166
    return(FALSE);
139
}
167
}
140
 
168
 
141
static void
169
static void
142
error_file_null_character PROTO_N ((istream, type))
170
error_file_null_character(IStreamP        istream,				   ErrorFileTokenT type)
143
			  PROTO_T (IStreamP        istream X
-
 
144
				   ErrorFileTokenT type)
-
 
145
{
171
{
146
    switch (type) EXHAUSTIVE {
172
    switch (type)EXHAUSTIVE {
147
      case EFN_NAME:
173
      case EFN_NAME:
148
	E_errf_null_character_in_name (istream);
174
	E_errf_null_character_in_name(istream);
149
	UNREACHED;
175
	UNREACHED;
150
      case EFN_BUILTIN:
176
      case EFN_BUILTIN:
151
	E_errf_null_char_in_builtin (istream);
177
	E_errf_null_char_in_builtin(istream);
152
	UNREACHED;
178
	UNREACHED;
153
      case EFN_STRING:
179
      case EFN_STRING:
154
	E_errf_null_character_in_string (istream);
180
	E_errf_null_character_in_string(istream);
155
	UNREACHED;
181
	UNREACHED;
156
    }
182
    }
157
}
183
}
158
 
184
 
159
static void
185
static void
160
error_file_newline PROTO_N ((istream, type))
186
error_file_newline(IStreamP        istream,			    ErrorFileTokenT type)
161
		   PROTO_T (IStreamP        istream X
-
 
162
			    ErrorFileTokenT type)
-
 
163
{
187
{
164
    switch (type) EXHAUSTIVE {
188
    switch (type)EXHAUSTIVE {
165
      case EFN_NAME:
189
      case EFN_NAME:
166
	E_errf_newline_in_name (istream);
190
	E_errf_newline_in_name(istream);
167
	UNREACHED;
191
	UNREACHED;
168
      case EFN_BUILTIN:
192
      case EFN_BUILTIN:
169
	E_errf_newline_in_builtin (istream);
193
	E_errf_newline_in_builtin(istream);
170
	UNREACHED;
194
	UNREACHED;
171
      case EFN_STRING:
195
      case EFN_STRING:
172
	E_errf_newline_in_string (istream);
196
	E_errf_newline_in_string(istream);
173
	UNREACHED;
197
	UNREACHED;
174
    }
198
    }
175
}
199
}
176
 
200
 
177
static void
201
static void
178
error_file_illegal_escape PROTO_N ((istream, type))
202
error_file_illegal_escape(IStreamP        istream,				   ErrorFileTokenT type)
179
			  PROTO_T (IStreamP        istream X
-
 
180
				   ErrorFileTokenT type)
-
 
181
{
203
{
182
    switch (type) EXHAUSTIVE {
204
    switch (type)EXHAUSTIVE {
183
      case EFN_NAME:
205
      case EFN_NAME:
184
	E_errf_illegal_escape_in_name (istream);
206
	E_errf_illegal_escape_in_name(istream);
185
	UNREACHED;
207
	UNREACHED;
186
      case EFN_BUILTIN:
208
      case EFN_BUILTIN:
187
	E_errf_illegal_esc_in_builtin (istream);
209
	E_errf_illegal_esc_in_builtin(istream);
188
	UNREACHED;
210
	UNREACHED;
189
      case EFN_STRING:
211
      case EFN_STRING:
190
	E_errf_illegal_escape_in_string (istream);
212
	E_errf_illegal_escape_in_string(istream);
191
	UNREACHED;
213
	UNREACHED;
192
    }
214
    }
193
}
215
}
194
 
216
 
195
static void
217
static void
196
error_file_eof PROTO_N ((istream, type))
218
error_file_eof(IStreamP        istream,			ErrorFileTokenT type)
197
	       PROTO_T (IStreamP        istream X
-
 
198
			ErrorFileTokenT type)
-
 
199
{
219
{
200
    switch (type) EXHAUSTIVE {
220
    switch (type)EXHAUSTIVE {
201
      case EFN_NAME:
221
      case EFN_NAME:
202
	E_errf_eof_in_name (istream);
222
	E_errf_eof_in_name(istream);
203
	UNREACHED;
223
	UNREACHED;
204
      case EFN_BUILTIN:
224
      case EFN_BUILTIN:
205
	E_errf_eof_in_builtin (istream);
225
	E_errf_eof_in_builtin(istream);
206
	UNREACHED;
226
	UNREACHED;
207
      case EFN_STRING:
227
      case EFN_STRING:
208
	E_errf_eof_in_string (istream);
228
	E_errf_eof_in_string(istream);
209
	UNREACHED;
229
	UNREACHED;
210
    }
230
    }
211
}
231
}
212
 
232
 
213
static void
233
static void
214
error_file_read_until PROTO_N ((istream, term, type, token))
234
error_file_read_until(IStreamP        istream,			       char            term, 
215
		      PROTO_T (IStreamP        istream X
-
 
216
			       char            term X
-
 
217
			       ErrorFileTokenT type X
235
			       ErrorFileTokenT type, 
218
			       ErrorFileLexP   token)
236
			       ErrorFileLexP   token)
219
{
237
{
220
    DStringT dstring;
238
    DStringT dstring;
221
 
239
 
222
    dstring_init (&dstring);
240
    dstring_init(&dstring);
223
    for (;;) {
241
    for (;;) {
224
	char c;
242
	char c;
225
 
243
 
226
      redo:
244
      redo:
227
	switch (c = ISTREAM_READ_CHAR (istream)) {
245
	switch (c = ISTREAM_READ_CHAR(istream)) {
228
	  case '\0':
246
	  case '\0':
229
	    ISTREAM_HANDLE_NULL (istream, redo, eof);
247
	    ISTREAM_HANDLE_NULL(istream, redo, eof);
230
	    error_file_null_character (istream, type);
248
	    error_file_null_character(istream, type);
231
	    UNREACHED;
249
	    UNREACHED;
232
	  case '\n':
250
	  case '\n':
233
	    istream_inc_line (istream);
251
	    istream_inc_line(istream);
234
	    error_file_newline (istream, type);
252
	    error_file_newline(istream, type);
235
	    UNREACHED;
253
	    UNREACHED;
236
	  default:
254
	  default:
237
	    if (c == term) {
255
	    if (c == term) {
238
		CStringP tmp;
256
		CStringP tmp;
239
 
257
 
240
		tmp = dstring_to_cstring (&dstring);
258
		tmp = dstring_to_cstring(&dstring);
241
		dstring_destroy (&dstring);
259
		dstring_destroy(&dstring);
242
		token->u.string = tmp;
260
		token->u.string = tmp;
243
		return;
261
		return;
244
	    } else if (c == '\\') {
262
	    } else if (c == '\\') {
245
		switch (istream_read_escaped_char (istream, &c)) EXHAUSTIVE {
263
		switch (istream_read_escaped_char(istream, &c))EXHAUSTIVE {
246
		  case ISTREAM_STAT_READ_CHAR:
264
		  case ISTREAM_STAT_READ_CHAR:
247
		    if (c == '\0') {
265
		    if (c == '\0') {
248
			error_file_null_character (istream, type);
266
			error_file_null_character(istream, type);
249
			UNREACHED;
267
			UNREACHED;
250
		    }
268
		    }
251
		    dstring_append_char (&dstring, c);
269
		    dstring_append_char(&dstring, c);
252
		    break;
270
		    break;
253
		  case ISTREAM_STAT_SYNTAX_ERROR:
271
		  case ISTREAM_STAT_SYNTAX_ERROR:
254
		    error_file_illegal_escape (istream, type);
272
		    error_file_illegal_escape(istream, type);
255
		    UNREACHED;
273
		    UNREACHED;
256
		  case ISTREAM_STAT_NO_CHAR:
274
		  case ISTREAM_STAT_NO_CHAR:
257
		    /*NOTHING*/
275
		    /*NOTHING*/
258
		    break;
276
		    break;
259
		}
277
		}
260
	    } else {
278
	    } else {
261
		dstring_append_char (&dstring, c);
279
		dstring_append_char(&dstring, c);
262
	    }
280
	    }
263
	    break;
281
	    break;
264
	}
282
	}
265
    }
283
    }
266
  eof:
284
  eof:
267
    error_file_eof (istream, type);
285
    error_file_eof(istream, type);
268
    UNREACHED;
286
    UNREACHED;
269
}
287
}
270
 
288
 
271
static void
289
static void
272
error_file_check_builtin PROTO_N ((istream, token))
290
error_file_check_builtin(IStreamP      istream,				  ErrorFileLexP token)
273
			 PROTO_T (IStreamP      istream X
-
 
274
				  ErrorFileLexP token)
-
 
275
{
291
{
276
    if (cstring_ci_equal (token->u.string, "strings")) {
292
    if (cstring_ci_equal(token->u.string, "strings")) {
277
	token->tag = EFTOKEN_BLT_STRINGS;
293
	token->tag = EFTOKEN_BLT_STRINGS;
278
    } else if (cstring_ci_equal (token->u.string, "prefix")) {
294
    } else if (cstring_ci_equal(token->u.string, "prefix")) {
279
	token->tag = EFTOKEN_BLT_PREFIX;
295
	token->tag = EFTOKEN_BLT_PREFIX;
280
    } else if (cstring_ci_equal (token->u.string, "errors")) {
296
    } else if (cstring_ci_equal(token->u.string, "errors")) {
281
	token->tag = EFTOKEN_BLT_ERRORS;
297
	token->tag = EFTOKEN_BLT_ERRORS;
282
    } else {
298
    } else {
283
	E_errf_unknown_builtin (istream, token->u.string);
299
	E_errf_unknown_builtin(istream, token->u.string);
284
	UNREACHED;
300
	UNREACHED;
285
    }
301
    }
286
    DEALLOCATE (token->u.string);
302
    DEALLOCATE(token->u.string);
287
}
303
}
288
 
304
 
289
static void
305
static void
290
error_file_next_token PROTO_N ((istream, token))
306
error_file_next_token(IStreamP      istream,			       ErrorFileLexP token)
291
		      PROTO_T (IStreamP      istream X
-
 
292
			       ErrorFileLexP token)
-
 
293
{
307
{
294
    char c;
308
    char c;
295
 
309
 
296
    if (error_file_skip_white_space (istream, &c)) {
310
    if (error_file_skip_white_space(istream, &c)) {
297
	switch (c) {
311
	switch (c) {
298
	  case '%':
312
	  case '%':
299
	    error_file_read_until (istream, '%', EFN_BUILTIN, token);
313
	    error_file_read_until(istream, '%', EFN_BUILTIN, token);
300
	    error_file_check_builtin (istream, token);
314
	    error_file_check_builtin(istream, token);
301
	    break;
315
	    break;
302
	  case '\'':
316
	  case '\'':
303
	    error_file_read_until (istream, '\'', EFN_NAME, token);
317
	    error_file_read_until(istream, '\'', EFN_NAME, token);
304
	    token->tag = EFTOKEN_NAME;
318
	    token->tag = EFTOKEN_NAME;
305
	    break;
319
	    break;
306
	  case '"':
320
	  case '"':
307
	    error_file_read_until (istream, '"', EFN_STRING, token);
321
	    error_file_read_until(istream, '"', EFN_STRING, token);
308
	    token->tag = EFTOKEN_STRING;
322
	    token->tag = EFTOKEN_STRING;
309
	    break;
323
	    break;
310
	  default:
324
	  default:
311
	    E_errf_illegal_character (istream, c);
325
	    E_errf_illegal_character(istream, c);
312
	    UNREACHED;
326
	    UNREACHED;
313
	}
327
	}
314
    } else {
328
    } else {
315
	token->tag = EFTOKEN_EOF;
329
	token->tag = EFTOKEN_EOF;
316
    }
330
    }
317
}
331
}
318
 
332
 
319
static void
333
static void
320
error_file_parse_strings PROTO_N ((istream, token))
334
error_file_parse_strings(IStreamP      istream,				  ErrorFileLexP token)
321
			 PROTO_T (IStreamP      istream X
-
 
322
				  ErrorFileLexP token)
-
 
323
{
335
{
324
    while (error_file_next_token (istream, token),
336
    while (error_file_next_token(istream, token),
325
	   (token->tag == EFTOKEN_NAME)) {
337
	  (token->tag == EFTOKEN_NAME)) {
326
	CStringP name = token->u.string;
338
	CStringP name = token->u.string;
327
 
339
 
328
	if (error_file_next_token (istream, token),
340
	if (error_file_next_token(istream, token),
329
	    (token->tag != EFTOKEN_STRING)) {
341
	   (token->tag != EFTOKEN_STRING)) {
330
	    E_errf_expected_string (istream);
342
	    E_errf_expected_string(istream);
331
	    UNREACHED;
343
	    UNREACHED;
332
	} else if (!error_redefine_string (name, token->u.string)) {
344
	} else if (!error_redefine_string(name, token->u.string)) {
333
	    E_errf_unknown_string (istream, name);
345
	    E_errf_unknown_string(istream, name);
334
	    UNREACHED;
346
	    UNREACHED;
335
	}
347
	}
336
	DEALLOCATE (name);
348
	DEALLOCATE(name);
337
    }
349
    }
338
}
350
}
339
 
351
 
340
static void
352
static void
341
error_file_parse_prefix PROTO_N ((istream, token))
353
error_file_parse_prefix(IStreamP      istream,				 ErrorFileLexP token)
342
			PROTO_T (IStreamP      istream X
-
 
343
				 ErrorFileLexP token)
-
 
344
{
354
{
345
    error_file_next_token (istream, token);
355
    error_file_next_token(istream, token);
346
    if (token->tag != EFTOKEN_STRING) {
356
    if (token->tag != EFTOKEN_STRING) {
347
	E_errf_expected_string (istream);
357
	E_errf_expected_string(istream);
348
	UNREACHED;
358
	UNREACHED;
349
    } else if (!error_set_prefix_message (token->u.string)) {
359
    } else if (!error_set_prefix_message(token->u.string)) {
350
	E_errf_illegal_message (istream, token->u.string);
360
	E_errf_illegal_message(istream, token->u.string);
351
	UNREACHED;
361
	UNREACHED;
352
    }
362
    }
353
    DEALLOCATE (token->u.string);
363
    DEALLOCATE(token->u.string);
354
    error_file_next_token (istream, token);
364
    error_file_next_token(istream, token);
355
}
365
}
356
 
366
 
357
static void
367
static void
358
error_file_parse_errors PROTO_N ((istream, token))
368
error_file_parse_errors(IStreamP      istream,				 ErrorFileLexP token)
359
			PROTO_T (IStreamP      istream X
-
 
360
				 ErrorFileLexP token)
-
 
361
{
369
{
362
    while (error_file_next_token (istream, token),
370
    while (error_file_next_token(istream, token),
363
	   (token->tag == EFTOKEN_NAME)) {
371
	  (token->tag == EFTOKEN_NAME)) {
364
	CStringP name = token->u.string;
372
	CStringP name = token->u.string;
365
 
373
 
366
	error_file_next_token (istream, token);
374
	error_file_next_token(istream, token);
367
	if (token->tag != EFTOKEN_STRING) {
375
	if (token->tag != EFTOKEN_STRING) {
368
	    E_errf_expected_string (istream);
376
	    E_errf_expected_string(istream);
369
	    UNREACHED;
377
	    UNREACHED;
370
	} else {
378
	} else {
371
	    switch (error_redefine_error (name, token->u.string)) EXHAUSTIVE {
379
	    switch (error_redefine_error(name, token->u.string))EXHAUSTIVE {
372
	      case ERROR_STATUS_BAD_ERROR:
380
	      case ERROR_STATUS_BAD_ERROR:
373
		E_errf_unknown_error (istream, name);
381
		E_errf_unknown_error(istream, name);
374
		UNREACHED;
382
		UNREACHED;
375
	      case ERROR_STATUS_BAD_MESSAGE:
383
	      case ERROR_STATUS_BAD_MESSAGE:
376
		E_errf_illegal_message (istream, token->u.string);
384
		E_errf_illegal_message(istream, token->u.string);
377
		UNREACHED;
385
		UNREACHED;
378
	      case ERROR_STATUS_SUCCESS:
386
	      case ERROR_STATUS_SUCCESS:
379
		/*NOTHING*/
387
		/*NOTHING*/
380
		break;
388
		break;
381
	    }
389
	    }
382
	}
390
	}
383
	DEALLOCATE (name);
391
	DEALLOCATE(name);
384
	DEALLOCATE (token->u.string);
392
	DEALLOCATE(token->u.string);
385
    }
393
    }
386
}
394
}
387
 
395
 
388
/*--------------------------------------------------------------------------*/
396
/*--------------------------------------------------------------------------*/
389
 
397
 
390
void
398
void
391
error_file_parse PROTO_N ((name, must_open))
399
error_file_parse(CStringP name,			  BoolT    must_open)
392
		 PROTO_T (CStringP name X
-
 
393
			  BoolT    must_open)
-
 
394
{
400
{
395
    IStreamT      istream;
401
    IStreamT      istream;
396
    ErrorFileLexT token;
402
    ErrorFileLexT token;
397
 
403
 
398
    if (istream_open (&istream, name)) {
404
    if (istream_open(&istream, name)) {
399
	error_file_next_token (&istream, &token);
405
	error_file_next_token(&istream, &token);
400
	while (token.tag != EFTOKEN_EOF) {
406
	while (token.tag != EFTOKEN_EOF) {
401
	    switch (token.tag) {
407
	    switch (token.tag) {
402
	      case EFTOKEN_BLT_STRINGS:
408
	      case EFTOKEN_BLT_STRINGS:
403
		error_file_parse_strings (&istream, &token);
409
		error_file_parse_strings(&istream, &token);
404
		break;
410
		break;
405
	      case EFTOKEN_BLT_PREFIX:
411
	      case EFTOKEN_BLT_PREFIX:
406
		error_file_parse_prefix (&istream, &token);
412
		error_file_parse_prefix(&istream, &token);
407
		break;
413
		break;
408
	      case EFTOKEN_BLT_ERRORS:
414
	      case EFTOKEN_BLT_ERRORS:
409
		error_file_parse_errors (&istream, &token);
415
		error_file_parse_errors(&istream, &token);
410
		break;
416
		break;
411
	      default:
417
	      default:
412
		E_errf_expected_section (&istream);
418
		E_errf_expected_section(&istream);
413
		UNREACHED;
419
		UNREACHED;
414
	    }
420
	    }
415
	}
421
	}
416
	istream_close (&istream);
422
	istream_close(&istream);
417
    } else if (must_open) {
423
    } else if (must_open) {
418
	E_errf_cannot_open (name);
424
	E_errf_cannot_open(name);
419
	UNREACHED;
425
	UNREACHED;
420
    }
426
    }
421
}
427
}
422

428

423
/*
429
/*