Debian Codegraph @

gcc/m2/mc-boot/Galists.h

raw
1 /* do not edit automatically generated by mc from alists. */
2 /* alists.def address lists module.
3
4 Copyright (C) 2015-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <[email protected]>.
6
7 This file is part of GNU Modula-2.
8
9 GNU Modula-2 is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3, or (at your option)
12 any later version.
13
14 GNU Modula-2 is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GNU Modula-2; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
22
23
24 #if !defined (_alists_H)
25 # define _alists_H
26
27 #include "config.h"
28 #include "system.h"
29 # ifdef __cplusplus
30 extern "C" {
31 # endif
32 #include <stdbool.h>
33 # if !defined (PROC_D)
34 # define PROC_D
35 typedef void (*PROC_t) (void);
36 typedef struct { PROC_t proc; } PROC;
37 # endif
38
39 # include "GSYSTEM.h"
40
41 # if defined (_alists_C)
42 # define EXTERN
43 # else
44 # define EXTERN extern
45 # endif
46
47 #if !defined (alists_alist_D)
48 # define alists_alist_D
49 typedef void *alists_alist;
50 #endif
51
52 typedef struct alists_performOperation_p alists_performOperation;
53
54 typedef void (*alists_performOperation_t) (void *);
55 struct alists_performOperation_p { alists_performOperation_t proc; };
56
57
58 /*
59 initList - creates a new alist, l.
60 */
61
62 EXTERN alists_alist alists_initList (void);
63
64 /*
65 killList - deletes the complete alist, l.
66 */
67
68 EXTERN void alists_killList (alists_alist *l);
69
70 /*
71 putItemIntoList - places an ADDRESS, c, into alist, l.
72 */
73
74 EXTERN void alists_putItemIntoList (alists_alist l, void * c);
75
76 /*
77 getItemFromList - retrieves the nth ADDRESS from alist, l.
78 */
79
80 EXTERN void * alists_getItemFromList (alists_alist l, unsigned int n);
81
82 /*
83 getIndexOfList - returns the index for ADDRESS, c, in alist, l.
84 If more than one CARDINAL, c, exists the index
85 for the first is returned.
86 */
87
88 EXTERN unsigned int alists_getIndexOfList (alists_alist l, void * c);
89
90 /*
91 noOfItemsInList - returns the number of items in alist, l.
92 */
93
94 EXTERN unsigned int alists_noOfItemsInList (alists_alist l);
95
96 /*
97 includeItemIntoList - adds an ADDRESS, c, into a alist providing
98 the value does not already exist.
99 */
100
101 EXTERN void alists_includeItemIntoList (alists_alist l, void * c);
102
103 /*
104 removeItemFromList - removes an ADDRESS, c, from a alist.
105 It assumes that this value only appears once.
106 */
107
108 EXTERN void alists_removeItemFromList (alists_alist l, void * c);
109
110 /*
111 isItemInList - returns true if a ADDRESS, c, was found in alist, l.
112 */
113
114 EXTERN bool alists_isItemInList (alists_alist l, void * c);
115
116 /*
117 foreachItemInListDo - calls procedure, P, foreach item in alist, l.
118 */
119
120 EXTERN void alists_foreachItemInListDo (alists_alist l, alists_performOperation p);
121
122 /*
123 duplicateList - returns a duplicate alist derived from, l.
124 */
125
126 EXTERN alists_alist alists_duplicateList (alists_alist l);
127
128 /*
129 equalList - returns TRUE if left contains the same information as right.
130 */
131
132 EXTERN bool alists_equalList (alists_alist left, alists_alist right);
133 # ifdef __cplusplus
134 }
135 # endif
136
137 # undef EXTERN
138 #endif