Subversion Repositories tendra.SVN

Rev

Rev 2 | Go to most recent revision | Details | Compare with Previous | 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
/**** nstring-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 nstrings (defined in the files
41
 * "dstring.[ch]") to be created.
42
 *
43
 ***=== TYPES ================================================================
44
 *
45
 ** Type:	NStringListEntryT
46
 ** Type:	NStringListEntryP
47
 ** Repr:	<private>
48
 *
49
 * This is the nstring list entry type.
50
 *
51
 ** Type:	NStringListT
52
 ** Type:	NStringListP
53
 ** Repr:	<private>
54
 *
55
 * This is the nstring list type.
56
 *
57
 ***=== FUNCTIONS ============================================================
58
 *
59
 ** Function:	void			nstring_list_init
60
 *			PROTO_S ((NStringListP list))
61
 ** Exceptions:
62
 *
63
 * This function initialises the specified nstring list to be an empty list.
64
 *
65
 ** Function:	void			nstring_list_append
66
 *			PROTO_S ((NStringListP list, NStringP nstring))
67
 ** Exceptions:	XX_dalloc_no_memory
68
 *
69
 * This function appends the specified nstring onto the specified list.
70
 *
71
 ** Function:	NStringListEntryP	nstring_list_head
72
 *			PROTO_S ((NStringListP list))
73
 ** Exceptions:
74
 *
75
 * This function returns a pointer to the first entry in the specified list.
76
 *
77
 ** Function:	NStringP		nstring_list_entry_string
78
 *			PROTO_S ((NStringListEntryP entry))
79
 ** Exceptions:
80
 *
81
 * This function returns a pointer to the nstring stored in the specified
82
 * list entry.
83
 *
84
 ** Function:	NStringListEntryP	nstring_list_entry_deallocate
85
 *			PROTO_S ((NStringListEntryP 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: nstring-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:49  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:53  smf
104
 * Initial import of library shared files.
105
 *
106
**/
107
 
108
/****************************************************************************/
109
 
110
#ifndef H_NSTRING_LIST
111
#define H_NSTRING_LIST
112
 
113
#include "os-interface.h"
114
#include "dalloc.h"
115
#include "dstring.h"
116
 
117
/*--------------------------------------------------------------------------*/
118
 
119
typedef struct NStringListEntryT {
120
    struct NStringListEntryT   *next;
121
    NStringT			string;
122
} NStringListEntryT, *NStringListEntryP;
123
 
124
typedef struct NStringListT {
125
    NStringListEntryP		head;
126
    NStringListEntryP	       *tail;
127
} NStringListT, *NStringListP;
128
 
129
/*--------------------------------------------------------------------------*/
130
 
131
extern void			nstring_list_init
132
	PROTO_S ((NStringListP));
133
extern void			nstring_list_append
134
	PROTO_S ((NStringListP, NStringP));
135
extern NStringListEntryP	nstring_list_head
136
	PROTO_S ((NStringListP));
137
extern NStringP			nstring_list_entry_string
138
	PROTO_S ((NStringListEntryP));
139
extern NStringListEntryP	nstring_list_entry_deallocate
140
	PROTO_S ((NStringListEntryP));
141
 
142
#endif /* !defined (H_NSTRING_LIST) */
143
 
144
/*
145
 * Local variables(smf):
146
 * eval: (include::add-path-entry "../os-interface" "../generated")
147
 * end:
148
**/