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
/**** cstring-list.h --- String list ADT.
32
 *
33
 ** Author: Steve Folkes <smf@hermes.mod.uk>
34
 *
35
 **** Commentary:
36
 *
37
 ***=== INTRODUCTION =========================================================
38
 *
39
 * This file specifies the interface to a string list facility.  This
40
 * particular facility allows lists of cstrings (defined in the files
41
 * "cstring.[ch]") to be created.
42
 *
43
 ***=== TYPES ================================================================
44
 *
45
 ** Type:	CStringListEntryT
46
 ** Type:	CStringListEntryP
47
 ** Repr:	<private>
48
 *
49
 * This is the cstring list entry type.
50
 *
51
 ** Type:	CStringListT
52
 ** Type:	CStringListP
53
 ** Repr:	<private>
54
 *
55
 * This is the cstring list type.
56
 *
57
 ***=== FUNCTIONS ============================================================
58
 *
59
 ** Function:	void			cstring_list_init
60
 *			PROTO_S ((CStringListP list))
61
 ** Exceptions:
62
 *
63
 * This function initialises the specified cstring list to be an empty list.
64
 *
65
 ** Function:	void			cstring_list_append
66
 *			PROTO_S ((CStringListP list, CStringP cstring))
67
 ** Exceptions:	XX_dalloc_no_memory
68
 *
69
 * This function appends the specified cstring onto the specified list.
70
 *
71
 ** Function:	CStringListEntryP	cstring_list_head
72
 *			PROTO_S ((CStringListP list))
73
 ** Exceptions:
74
 *
75
 * This function returns a pointer to the first entry in the specified list.
76
 *
77
 ** Function:	CStringP		cstring_list_entry_string
78
 *			PROTO_S ((CStringListEntryP entry))
79
 ** Exceptions:
80
 *
81
 * This function returns a pointer to the cstring stored in the specified
82
 * list entry.
83
 *
84
 ** Function:	CStringListEntryP	cstring_list_entry_deallocate
85
 *			PROTO_S ((CStringListEntryP entry))
86
 ** Exceptions:
87
 *
88
 * This function deallocates the specified list entry (without deallocating
89
 * the string - this must be done by the calling function) and returns a
90
 * pointer to the next entry in the list.  Once this function has been called,
91
 * the state of the list that the entry is a member of is undefined.  It is
92
 * only useful for deallocating the entire list in a loop.
93
 *
94
 **** Change log:
95
 * $Log: cstring-list.h,v $
96
 * Revision 1.1.1.1  1998/01/17  15:57:17  release
97
 * First version to be checked into rolling release.
98
 *
99
 * Revision 1.2  1994/12/12  11:44:32  smf
100
 * Performing changes for 'CR94_178.sid+tld-update' - bringing in line with
101
 * OSSG C Coding Standards.
102
 *
103
 * Revision 1.1.1.1  1994/07/25  16:05:48  smf
104
 * Initial import of library shared files.
105
 *
106
**/
107
 
108
/****************************************************************************/
109
 
110
#ifndef H_CSTRING_LIST
111
#define H_CSTRING_LIST
112
 
113
#include "os-interface.h"
114
#include "cstring.h"
115
#include "dalloc.h"
116
 
117
/*--------------------------------------------------------------------------*/
118
 
119
typedef struct CStringListEntryT {
120
    struct CStringListEntryT   *next;
121
    CStringP			string;
122
} CStringListEntryT, *CStringListEntryP;
123
 
124
typedef struct CStringListT {
125
    CStringListEntryP		head;
126
    CStringListEntryP	       *tail;
127
} CStringListT, *CStringListP;
128
 
129
/*--------------------------------------------------------------------------*/
130
 
131
extern void			cstring_list_init
132
	PROTO_S ((CStringListP));
133
extern void			cstring_list_append
134
	PROTO_S ((CStringListP, CStringP));
135
extern BoolT			cstring_list_contains
136
	PROTO_S ((CStringListP, CStringP));
137
extern CStringListEntryP	cstring_list_head
138
	PROTO_S ((CStringListP));
139
extern CStringP			cstring_list_entry_string
140
	PROTO_S ((CStringListEntryP));
141
extern CStringListEntryP	cstring_list_entry_deallocate
142
	PROTO_S ((CStringListEntryP));
143
 
144
#endif /* !defined (H_CSTRING_LIST) */
145
 
146
/*
147
 * Local variables(smf):
148
 * eval: (include::add-path-entry "../os-interface" "../generated")
149
 * end:
150
**/