modify upstream makefile to allow hardening build flags to apply
[debian/yforth] / searche.c
1 /* yForth? - A Forth interpreter written in ANSI C
2  * Copyright (C) 2012 Luca Padovani
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  * ------------------------------------------------------------------------
17  * Module name:
18  * Abstract:
19  */
20
21 #include <stdio.h>
22 #include "yforth.h"
23 #include "searche.h"
24
25 /**************************************************************************/
26 /* WORDS ******************************************************************/
27 /**************************************************************************/
28
29 void _also() {
30         if (top < WORD_LISTS) {
31                 top++;
32                 list[top] = list[top - 1];
33         }
34 }
35
36 void _forth() {
37         list[top] = forth_wid;
38 }
39
40 void _only() {
41         top = 0;
42         list[0] = forth_wid;
43 }
44
45 void _order() {
46         register int i;
47         printf("[%p] ", voc);
48         for (i = 0; i <= top; i++) printf("%d: %p ", i, list[i]);
49 }
50
51 void _previous() {
52         if (top >= 0) top--;
53 }
54
55