From be839900419c7a74c4a46efd279d0ca16b35dc1f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 15 May 2008 23:28:07 +0000 Subject: Moved stuff into trunk. --- src/data/stack.h | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/data/stack.h (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h new file mode 100644 index 0000000..f5f91c2 --- /dev/null +++ b/src/data/stack.h @@ -0,0 +1,76 @@ +/*:* + *: File: ./src/data/stack.h + *: A simple interpreter + *: + *: WWW : http://fype.buetow.org + *: E-Mail : fype@dev.buetow.org + *: + *: Copyright (c) 2005 2006 2007 2008, Paul Buetow (http://www.pblabs.net) + *: All rights reserved. + *: + *: Redistribution and use in source and binary forms, with or without modi- + *: fication, are permitted provided that the following conditions are met: + *: * Redistributions of source code must retain the above copyright + *: notice, this list of conditions and the following disclaimer. + *: * Redistributions in binary form must reproduce the above copyright + *: notice, this list of conditions and the following disclaimer in the + *: documentation and/or other materials provided with the distribution. + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software + *: without specific prior written permission. + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: POSSIBILITY OF SUCH DAMAGE. + *:*/ + +#ifndef STACK_H +#define STACK_H + +#define stack_top(s) s->p_first->p_val; + +#include + +typedef struct StackElem_ { + struct StackElem_ *p_next; + void *p_val; +} StackElem; + +typedef struct { + StackElem *p_first; + StackElem *p_last; // Only needed for stack_merge + unsigned i_size; +} Stack; + +typedef struct { + StackElem *p_current; + StackElem *p_prev; +} StackIterator; + +Stack *stack_new(); +StackElem *stackelem_new(); +_Bool stack_empty(Stack *p_stack); +void stack_iterate(Stack *p_stack, void (*func)(void *p_void)); +void stack_push(Stack *p_stack, void *p_val); +void *stack_pop(Stack *p_stack); +void stack_clear(Stack *p_stack); +void stack_delete(Stack *p_stack); +void stack_delete_and_free(Stack *p_stack); +unsigned stack_size(Stack *p_stack); +void stack_merge(Stack *p_stack, Stack *p_stack_merge); +void stack_concat(Stack *p_stack, Stack *p_stack_concat); +StackIterator* stackiterator_new(Stack *p_stack); +void stackiterator_delete(StackIterator *p_iter); +_Bool stackiterator_has_next(StackIterator *p_iter); +void* stackiterator_next(StackIterator *p_iter); +_Bool stackiterator_remove_prev(StackIterator *p_iter); + +#endif -- cgit v1.2.3 From e4689bbb20dade47b98061d48ba73436c856f3ff Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 8 Aug 2008 09:31:58 +0000 Subject: changed header. --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index f5f91c2..99571b0 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul Buetow (http://www.pblabs.net) + *: + *: Copyright (c) 2005 2006 2007 2008, Paul Buetow (http://www.pb-labs.com) *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From da52f90a73abd653cfe9726bcf5c96338db0b7a2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 Aug 2008 01:46:47 +0000 Subject: some enhancements --- src/data/stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 99571b0..41574b0 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -5,7 +5,7 @@ *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org *: - *: Copyright (c) 2005 2006 2007 2008, Paul Buetow (http://www.pb-labs.com) + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow (http://www.pb-labs.com) *: All rights reserved. *: *: Redistribution and use in source and binary forms, with or without modi- -- cgit v1.2.3 From e9a9ad33583c49df48ae99cab9ba0fd80f150a9e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 Aug 2008 02:03:40 +0000 Subject: changed headers --- src/data/stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 41574b0..66cca50 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -5,7 +5,7 @@ *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow (http://www.pb-labs.com) + *: Copyright (c) 2005 2006 2007 2008, Dipl.-Inf. (FH) Paul C. Buetow *: All rights reserved. *: *: Redistribution and use in source and binary forms, with or without modi- -- cgit v1.2.3 From 7f3055c1f4429a81de3715d5d4173353382e2de2 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 24 Aug 2008 19:30:11 +0000 Subject: some mods --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 66cca50..4774cef 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Dipl.-Inf. (FH) Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Dipl.-Inf. (FH) Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From d527f50159f056dc165fa7eaf7bf80425a1e758d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 14 Oct 2008 20:38:27 +0000 Subject: GC removed, temporaly --- src/data/stack.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 4774cef..721ed31 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -60,6 +60,7 @@ StackElem *stackelem_new(); _Bool stack_empty(Stack *p_stack); void stack_iterate(Stack *p_stack, void (*func)(void *p_void)); void stack_push(Stack *p_stack, void *p_val); +void stack_debug(Stack *p_stack, void *p_val); void *stack_pop(Stack *p_stack); void stack_clear(Stack *p_stack); void stack_delete(Stack *p_stack); -- cgit v1.2.3 From a35ace22b374005c65bda8302761d24f75280170 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 14 Oct 2008 22:05:16 +0000 Subject: run astyle still lots of debugging to do. --- src/data/stack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 721ed31..e9fafea 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -59,7 +59,7 @@ Stack *stack_new(); StackElem *stackelem_new(); _Bool stack_empty(Stack *p_stack); void stack_iterate(Stack *p_stack, void (*func)(void *p_void)); -void stack_push(Stack *p_stack, void *p_val); +unsigned stack_push(Stack *p_stack, void *p_val); void stack_debug(Stack *p_stack, void *p_val); void *stack_pop(Stack *p_stack); void stack_clear(Stack *p_stack); -- cgit v1.2.3 From cb1450b796eff3c8830616e2e9a3d83d4dfb4900 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 18 Oct 2008 22:47:31 +0000 Subject: backdowngrade --- src/data/stack.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index e9fafea..4774cef 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -59,8 +59,7 @@ Stack *stack_new(); StackElem *stackelem_new(); _Bool stack_empty(Stack *p_stack); void stack_iterate(Stack *p_stack, void (*func)(void *p_void)); -unsigned stack_push(Stack *p_stack, void *p_val); -void stack_debug(Stack *p_stack, void *p_val); +void stack_push(Stack *p_stack, void *p_val); void *stack_pop(Stack *p_stack); void stack_clear(Stack *p_stack); void stack_delete(Stack *p_stack); -- cgit v1.2.3 From a5f564d59149de660c4832b8c6e8acd42770479c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 25 Oct 2008 00:12:08 +0000 Subject: make headers --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 4774cef..d7cfd3d 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Dipl.-Inf. (FH) Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From 1c6dd17947050d2f70dd8df6f4ad527180581c68 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 25 Oct 2008 00:23:48 +0000 Subject: astyle. more BSD style in return (FOO); --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index d7cfd3d..88bde8d 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From a1c3f47491b98cd9026f8e853cc9e72630805c12 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 26 Oct 2008 12:51:57 +0000 Subject: added the "scope" function --- src/data/stack.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 88bde8d..45acdf8 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -59,6 +59,10 @@ Stack *stack_new(); StackElem *stackelem_new(); _Bool stack_empty(Stack *p_stack); void stack_iterate(Stack *p_stack, void (*func)(void *p_void)); +void stack_iterate2(Stack *p_stack, void (*func)(void *p_void, void *p_void2), + void *p_void_arg); +void stack_iterate_level(Stack *p_stack, void (*func)(void *p_void, + int i_level)); void stack_push(Stack *p_stack, void *p_val); void *stack_pop(Stack *p_stack); void stack_clear(Stack *p_stack); -- cgit v1.2.3 From 1c2c79c47719ca828ce0eb4365ea0327fe89f2d8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 28 Oct 2008 22:23:40 +0000 Subject: initial references support. run "make headers" --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 45acdf8..9b766bd 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From eb2a3bdc387eb76908dcd59b165738adccc28786 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 1 Nov 2008 18:57:20 +0000 Subject: modified headers --- src/data/stack.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 9b766bd..86accd9 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -19,10 +19,10 @@ *: be used to endorse or promote products derived from this software *: without specific prior written permission. *: - *: THIS SOFTWARE IS PROVIDED BY Paul Buetow AS IS'' AND ANY EXPRESS OR + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL Paul Buetow BE LIABLE FOR ANY DIRECT, + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -- cgit v1.2.3 From 87de8060633801d3793246967f43c6159b0f5351 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 4 Nov 2008 22:55:22 +0000 Subject: astyle --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 86accd9..6d42d87 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +15,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From a46655f67043af257e70715903badf9d4321c4de Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 7 Nov 2008 22:11:06 +0000 Subject: one step further for arrays. --- src/data/stack.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 6d42d87..4468bbe 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -35,8 +35,6 @@ #ifndef STACK_H #define STACK_H -#define stack_top(s) s->p_first->p_val; - #include typedef struct StackElem_ { @@ -65,6 +63,7 @@ void stack_iterate_level(Stack *p_stack, void (*func)(void *p_void, int i_level)); void stack_push(Stack *p_stack, void *p_val); void *stack_pop(Stack *p_stack); +void *stack_top(Stack *p_stack); void stack_clear(Stack *p_stack); void stack_delete(Stack *p_stack); void stack_delete_and_free(Stack *p_stack); -- cgit v1.2.3 From 117201ad10df2859fb3510e8437d776f3a691f69 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 9 Nov 2008 13:23:58 +0000 Subject: changed the src headers. --- src/data/stack.h | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 4468bbe..b3d9150 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,13 +1,14 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org - *: E-Mail : fype@dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: AUTHOR : http://paul.buetow.org + *: E-Mail : fype at dev.buetow.org + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -15,20 +16,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From 44c97ead68a274e462460eef33d67e7442c2fa47 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 15 Dec 2008 20:57:29 +0000 Subject: say foo[1] works --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index b3d9150..3a5ebc9 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,14 +1,14 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: AUTHOR : http://paul.buetow.org *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -16,20 +16,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3 From 40ad7ffc7ebd91e90f0894badcc4132df9b3c45d Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 15 Dec 2008 20:58:59 +0000 Subject: modified headers --- src/data/stack.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.h') diff --git a/src/data/stack.h b/src/data/stack.h index 3a5ebc9..99db538 100644 --- a/src/data/stack.h +++ b/src/data/stack.h @@ -1,14 +1,14 @@ /*:* *: File: ./src/data/stack.h *: A simple interpreter - *: + *: *: WWW : http://fype.buetow.org *: AUTHOR : http://paul.buetow.org *: E-Mail : fype at dev.buetow.org - *: - *: Copyright (c) 2005 2006 2007 2008, Paul C. Buetow + *: + *: Copyright (c) 2005 - 2008, Paul Buetow *: All rights reserved. - *: + *: *: Redistribution and use in source and binary forms, with or without modi- *: fication, are permitted provided that the following conditions are met: *: * Redistributions of source code must retain the above copyright @@ -16,20 +16,20 @@ *: * Redistributions in binary form must reproduce the above copyright *: notice, this list of conditions and the following disclaimer in the *: documentation and/or other materials provided with the distribution. - *: * Neither the name of P. B. Labs nor the names of its contributors may - *: be used to endorse or promote products derived from this software + *: * Neither the name of P. B. Labs nor the names of its contributors may + *: be used to endorse or promote products derived from this software *: without specific prior written permission. - *: - *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR - *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + *: + *: THIS SOFTWARE IS PROVIDED BY PAUL C. BUETOW AS IS'' AND ANY EXPRESS OR + *: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *: WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, - *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + *: DISCLAIMED. IN NO EVENT SHALL PAUL C. BUETOW BE LIABLE FOR ANY DIRECT, + *: INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + *: (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + *: SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) *: HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + *: STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + *: IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *: POSSIBILITY OF SUCH DAMAGE. *:*/ -- cgit v1.2.3