]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/m2/pge-boot/GIndexing.h
Update copyright years.
[thirdparty/gcc.git] / gcc / m2 / pge-boot / GIndexing.h
CommitLineData
1eee94d3
GM
1/* do not edit automatically generated by mc from Indexing. */
2/* Indexing.def provides a dynamic indexing mechanism for CARDINAL.
3
a945c346 4Copyright (C) 2003-2024 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
19Under Section 7 of GPL version 3, you are granted additional
20permissions described in the GCC Runtime Library Exception, version
213.1, as published by the Free Software Foundation.
22
23You should have received a copy of the GNU General Public License and
24a copy of the GCC Runtime Library Exception along with this program;
25see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
26<http://www.gnu.org/licenses/>. */
27
28
29#if !defined (_Indexing_H)
30# define _Indexing_H
31
32#include "config.h"
33#include "system.h"
34# ifdef __cplusplus
35extern "C" {
36# endif
9525daf0 37#include <stdbool.h>
1eee94d3
GM
38# if !defined (PROC_D)
39# define PROC_D
40 typedef void (*PROC_t) (void);
41 typedef struct { PROC_t proc; } PROC;
42# endif
43
44# include "GSYSTEM.h"
45
46# if defined (_Indexing_C)
47# define EXTERN
48# else
49# define EXTERN extern
50# endif
51
52#if !defined (Indexing_Index_D)
53# define Indexing_Index_D
54 typedef void *Indexing_Index;
55#endif
56
57typedef struct Indexing_IndexProcedure_p Indexing_IndexProcedure;
58
59typedef void (*Indexing_IndexProcedure_t) (void *);
60struct Indexing_IndexProcedure_p { Indexing_IndexProcedure_t proc; };
61
62
63/*
64 InitIndex - creates and returns an Index.
65*/
66
67EXTERN Indexing_Index Indexing_InitIndex (unsigned int low);
68
69/*
70 KillIndex - returns Index to free storage.
71*/
72
73EXTERN Indexing_Index Indexing_KillIndex (Indexing_Index i);
74
75/*
76 DebugIndex - turns on debugging within an index.
77*/
78
79EXTERN Indexing_Index Indexing_DebugIndex (Indexing_Index i);
80
81/*
82 InBounds - returns TRUE if indice, n, is within the bounds
83 of the dynamic array.
84*/
85
9525daf0 86EXTERN bool Indexing_InBounds (Indexing_Index i, unsigned int n);
1eee94d3
GM
87
88/*
89 HighIndice - returns the last legally accessible indice of this array.
90*/
91
92EXTERN unsigned int Indexing_HighIndice (Indexing_Index i);
93
94/*
95 LowIndice - returns the first legally accessible indice of this array.
96*/
97
98EXTERN unsigned int Indexing_LowIndice (Indexing_Index i);
99
100/*
101 PutIndice - places, a, into the dynamic array at position i[n]
102*/
103
104EXTERN void Indexing_PutIndice (Indexing_Index i, unsigned int n, void * a);
105
106/*
107 GetIndice - retrieves, element i[n] from the dynamic array.
108*/
109
110EXTERN void * Indexing_GetIndice (Indexing_Index i, unsigned int n);
111
112/*
113 IsIndiceInIndex - returns TRUE if, a, is in the index, i.
114*/
115
9525daf0 116EXTERN bool Indexing_IsIndiceInIndex (Indexing_Index i, void * a);
1eee94d3
GM
117
118/*
119 RemoveIndiceFromIndex - removes, a, from Index, i.
120*/
121
122EXTERN void Indexing_RemoveIndiceFromIndex (Indexing_Index i, void * a);
123
124/*
125 DeleteIndice - delete i[j] from the array.
126*/
127
128EXTERN void Indexing_DeleteIndice (Indexing_Index i, unsigned int j);
129
130/*
131 IncludeIndiceIntoIndex - if the indice is not in the index, then
132 add it at the end.
133*/
134
135EXTERN void Indexing_IncludeIndiceIntoIndex (Indexing_Index i, void * a);
136
137/*
138 ForeachIndiceInIndexDo - for each j indice of i, call procedure p(i[j])
139*/
140
141EXTERN void Indexing_ForeachIndiceInIndexDo (Indexing_Index i, Indexing_IndexProcedure p);
142# ifdef __cplusplus
143}
144# endif
145
146# undef EXTERN
147#endif