c++: add fixed test [PR94100]
[official-gcc.git] / gcc / m2 / mc-boot / GmcStack.h
blobfe790ced893383f3917e613462de6e902cad7bc0
1 /* do not edit automatically generated by mc from mcStack. */
2 /* mcStack.def provides a stack data type and associated procedures.
4 Copyright (C) 2015-2025 Free Software Foundation, Inc.
5 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
7 This file is part of GNU Modula-2.
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.
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.
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/>. */
24 #if !defined (_mcStack_H)
25 # define _mcStack_H
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
39 # include "GSYSTEM.h"
41 # if defined (_mcStack_C)
42 # define EXTERN
43 # else
44 # define EXTERN extern
45 # endif
47 #if !defined (mcStack_stack_D)
48 # define mcStack_stack_D
49 typedef void *mcStack_stack;
50 #endif
54 init - create and return a stack.
57 EXTERN mcStack_stack mcStack_init (void);
60 kill - deletes stack, s.
63 EXTERN void mcStack_kill (mcStack_stack *s);
66 push - an address, a, onto the stack, s.
67 It returns, a.
70 EXTERN void * mcStack_push (mcStack_stack s, void * a);
73 pop - and return the top element from stack, s.
76 EXTERN void * mcStack_pop (mcStack_stack s);
79 replace - performs a pop; push (a); return a.
82 EXTERN void * mcStack_replace (mcStack_stack s, void * a);
85 depth - returns the depth of the stack.
88 EXTERN unsigned int mcStack_depth (mcStack_stack s);
91 access - returns the, i, th stack element.
92 The top of stack is defined by:
94 access (s, depth (s)).
97 EXTERN void * mcStack_access (mcStack_stack s, unsigned int i);
98 # ifdef __cplusplus
100 # endif
102 # undef EXTERN
103 #endif