Debian Codegraph @

gcc/m2/pge-boot/GLists.h

raw
1 /* do not edit automatically generated by mc from Lists. */
2 /* Lists.def provides an unordered list manipulation package.
3
4 Copyright (C) 2001-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 (_Lists_H)
25 # define _Lists_H
26
27 # ifdef __cplusplus
28 extern "C" {
29 # endif
30 #include <stdbool.h>
31 # if !defined (PROC_D)
32 # define PROC_D
33 typedef void (*PROC_t) (void);
34 typedef struct { PROC_t proc; } PROC;
35 # endif
36
37 # include "GSYSTEM.h"
38 # include "GSymbolKey.h"
39
40 # if defined (_Lists_C)
41 # define EXTERN
42 # else
43 # define EXTERN extern
44 # endif
45
46 #if !defined (Lists_List_D)
47 # define Lists_List_D
48 typedef void *Lists_List;
49 #endif
50
51
52 /*
53 InitList - creates a new list, l.
54 */
55
56 EXTERN void Lists_InitList (Lists_List *l);
57
58 /*
59 KillList - deletes the complete list, l.
60 */
61
62 EXTERN void Lists_KillList (Lists_List *l);
63
64 /*
65 PutItemIntoList - places a CARDINAL, c, into list, l.
66 */
67
68 EXTERN void Lists_PutItemIntoList (Lists_List l, unsigned int c);
69
70 /*
71 GetItemFromList - retrieves the nth WORD from list, l.
72 */
73
74 EXTERN unsigned int Lists_GetItemFromList (Lists_List l, unsigned int n);
75
76 /*
77 GetIndexOfList - returns the index for WORD, c, in list, l.
78 If more than one CARDINAL, c, exists the index
79 for the first is returned.
80 */
81
82 EXTERN unsigned int Lists_GetIndexOfList (Lists_List l, unsigned int c);
83
84 /*
85 NoOfItemsInList - returns the number of items in list, l.
86 */
87
88 EXTERN unsigned int Lists_NoOfItemsInList (Lists_List l);
89
90 /*
91 IncludeItemIntoList - adds a WORD, c, into a list providing
92 the value does not already exist.
93 */
94
95 EXTERN void Lists_IncludeItemIntoList (Lists_List l, unsigned int c);
96
97 /*
98 RemoveItemFromList - removes a WORD, c, from a list.
99 It assumes that this value only appears once.
100 */
101
102 EXTERN void Lists_RemoveItemFromList (Lists_List l, unsigned int c);
103
104 /*
105 IsItemInList - returns true if a WORD, c, was found in list, l.
106 */
107
108 EXTERN bool Lists_IsItemInList (Lists_List l, unsigned int c);
109
110 /*
111 ForeachItemInListDo - calls procedure, P, foreach item in list, l.
112 */
113
114 EXTERN void Lists_ForeachItemInListDo (Lists_List l, SymbolKey_PerformOperation P);
115
116 /*
117 DuplicateList - returns a duplicate list derived from, l.
118 */
119
120 EXTERN Lists_List Lists_DuplicateList (Lists_List l);
121 # ifdef __cplusplus
122 }
123 # endif
124
125 # undef EXTERN
126 #endif