Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – tendra.SVN – Blame – /branches/tendra4/src/tools/tnc/utility.h – Rev 2

Subversion Repositories tendra.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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 UTILITY_INCLUDED
32
#define UTILITY_INCLUDED
33
 
34
 
35
/*
36
    ERROR REPORTING ROUTINES
37
*/
38
 
39
extern boolean is_fatal ;
40
extern int exit_status ;
41
extern boolean text_input, text_output ;
42
extern void fatal_error PROTO_W ( ( char *, ... ) ) ;
43
extern void input_error PROTO_W ( ( char *, ... ) ) ;
44
extern void warning PROTO_W ( ( char *, ... ) ) ;
45
 
46
 
47
/*
48
    MEMORY ALLOCATION ROUTINES
49
*/
50
 
51
extern pointer xalloc PROTO_S ( ( int ) ) ;
52
extern pointer xrealloc PROTO_S ( ( pointer, int ) ) ;
53
extern char *string_copy PROTO_S ( ( char *, int ) ) ;
54
extern char *temp_copy PROTO_S ( ( char * ) ) ;
55
 
56
 
57
/*
58
    MACROS FOR ADDRESSING MEMORY ALLOCATION ROUTINES
59
*/
60
 
61
#define alloc_nof( TYPE, NO )\
62
    ( ( TYPE * ) xalloc ( ( ( int ) ( NO ) * ( int ) sizeof ( TYPE ) ) ) )
63
 
64
#define realloc_nof( PTR, TYPE, NO )\
65
    ( ( TYPE * ) xrealloc ( ( pointer ) ( PTR ),\
66
      ( ( int ) ( NO ) * ( int ) sizeof ( TYPE ) ) ) )
67
 
68
#define string_copy_aux( STR )\
69
    string_copy ( ( STR ), ( int ) strlen ( STR ) )
70
 
71
 
72
/*
73
    CONVERSION ROUTINES
74
*/
75
 
76
extern char *ulong_to_octal PROTO_S ( ( unsigned long ) ) ;
77
extern unsigned long octal_to_ulong PROTO_S ( ( char * ) ) ;
78
extern boolean fits_ulong PROTO_S ( ( char *, int ) ) ;
79
 
80
 
81
#endif