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