2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
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 |
|
|
|
31 |
#ifndef CONFIG_INCLUDED
|
|
|
32 |
#define CONFIG_INCLUDED
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
INCLUDE THE BASIC SYSTEM HEADERS
|
|
|
37 |
|
|
|
38 |
These headers are required in several places. It is easiest to
|
|
|
39 |
include them here. These are the only system headers included.
|
|
|
40 |
The program is ANSI compliant. It uses the following objects :
|
|
|
41 |
|
|
|
42 |
(a) Types : FILE, size_t, va_list.
|
|
|
43 |
|
|
|
44 |
(b) Procedures or macros : exit, fclose, fgetc, fopen,
|
|
|
45 |
fprintf, fputc, fputs, fseek, ftell, getc, isprint,
|
|
|
46 |
malloc, printf, putchar, realloc, sprintf, strcmp,
|
|
|
47 |
strlen, strncmp, strncpy, va_end, va_start, vfprintf.
|
|
|
48 |
|
|
|
49 |
(c) Expressions : EOF, EXIT_FAILURE, EXIT_SUCCESS, NULL,
|
|
|
50 |
SEEK_SET, stderr, stdout.
|
|
|
51 |
*/
|
|
|
52 |
|
|
|
53 |
#include <stdio.h>
|
|
|
54 |
#include <string.h>
|
|
|
55 |
#include <stdlib.h>
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
/*
|
|
|
59 |
HACKS
|
|
|
60 |
|
|
|
61 |
These hacks are designed to aid compilation on non-compliant systems.
|
|
|
62 |
SEEK_SET is not defined on, for example, SUN-OS.
|
|
|
63 |
*/
|
|
|
64 |
|
|
|
65 |
#ifndef EXIT_SUCCESS
|
|
|
66 |
#define EXIT_SUCCESS 0
|
|
|
67 |
#endif
|
|
|
68 |
|
|
|
69 |
#ifndef EXIT_FAILURE
|
|
|
70 |
#define EXIT_FAILURE 1
|
|
|
71 |
#endif
|
|
|
72 |
|
|
|
73 |
#ifndef SEEK_SET
|
|
|
74 |
#define SEEK_SET 0
|
|
|
75 |
#endif
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
/*
|
|
|
79 |
MACRO TO DEAL WITH PROCEDURE PROTOTYPES
|
|
|
80 |
|
|
|
81 |
Procedure declarations are given by the macro procedure with is
|
|
|
82 |
defined to either give the full prototype or the tradition declaration
|
|
|
83 |
depending on the value of __STDC__.
|
|
|
84 |
*/
|
|
|
85 |
|
|
|
86 |
#include "ossg.h"
|
|
|
87 |
|
|
|
88 |
|
|
|
89 |
/*
|
|
|
90 |
USEFUL MACROS
|
|
|
91 |
|
|
|
92 |
These macros are used in several places. They are defined here for
|
|
|
93 |
convenience.
|
|
|
94 |
*/
|
|
|
95 |
|
|
|
96 |
#define null NULL
|
|
|
97 |
#define BYTESIZE 8
|
|
|
98 |
#define hash_size 31
|
|
|
99 |
#define streq( X, Y ) ( strcmp ( ( X ), ( Y ) ) == 0 )
|
|
|
100 |
|
|
|
101 |
|
|
|
102 |
/*
|
|
|
103 |
MAGIC NUMBERS
|
|
|
104 |
|
|
|
105 |
These macros give the magic numbers for TDF capsules and libraries.
|
|
|
106 |
*/
|
|
|
107 |
|
|
|
108 |
#define MAGIC_NUMBER "TDFC"
|
|
|
109 |
#define MAGIC_LINK_NUMBER "TDFL"
|
|
|
110 |
|
|
|
111 |
|
|
|
112 |
#endif
|