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.c | 234 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 234 insertions(+) create mode 100644 src/data/stack.c (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c new file mode 100644 index 0000000..f0392d0 --- /dev/null +++ b/src/data/stack.c @@ -0,0 +1,234 @@ +/*:* + *: File: ./src/data/stack.c + *: 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. + *:*/ + +#include "stack.h" + +#include "../defines.h" + +Stack* +stack_new() { + Stack *p_stack = (Stack *) malloc(sizeof(Stack)); + + p_stack->p_first = p_stack->p_last = NULL; + p_stack->i_size = 0; + + return (p_stack); +} + +StackElem* +stackelem_new() { + StackElem *p_elem = (StackElem *) malloc(sizeof(StackElem)); + + p_elem->p_next = NULL; + p_elem->p_val = NULL; + + return (p_elem); +} + +_Bool +stack_empty(Stack *p_stack) { + return (p_stack->i_size == 0); +} + +void +stack_push(Stack *p_stack, void *p_val) { + StackElem *p_elem = stackelem_new(); + + p_elem->p_val = p_val; + p_elem->p_next = p_stack->p_first; + p_stack->p_first = p_elem; + + if (p_stack->p_last == NULL) + p_stack->p_last = p_stack->p_first; + + ++p_stack->i_size; +} + +void* +stack_pop(Stack *p_stack) { + if (stack_empty(p_stack)) + return (NULL); + + StackElem *p_elem = p_stack->p_first; + p_stack->p_first = p_elem->p_next; + + void *p_val = p_elem->p_val; + free(p_elem); + --p_stack->i_size; + + if (p_stack->i_size == 0) + p_stack->p_last = NULL; + + return (p_val); +} + +void +stack_clear(Stack *p_stack) { + for (;!stack_empty(p_stack); stack_pop(p_stack)); +} + +void +stack_delete(Stack *p_stack) { + stack_clear(p_stack); + free(p_stack); +} + +void +stack_delete_and_free(Stack *p_stack) { + for (;!stack_empty(p_stack); free(stack_pop(p_stack))); + stack_delete(p_stack); +} + +unsigned +stack_size(Stack *p_stack) { + if (!p_stack) + return (0); + + return (p_stack->i_size); +} + +void +stack_merge(Stack *p_stack, Stack *p_stack_merge) { + if (stack_empty(p_stack_merge)) + return; + + if (stack_empty(p_stack)) { + p_stack->p_first = p_stack_merge->p_first; + p_stack->p_last = p_stack_merge->p_last; + p_stack->i_size = p_stack_merge->i_size; + + } else { + StackElem *p_old_first = p_stack->p_first; + + p_stack->p_first = p_stack_merge->p_first; + p_stack_merge->p_last->p_next = p_old_first; + p_stack->i_size += p_stack_merge->i_size; + } + + p_stack_merge->p_first = p_stack_merge->p_last = NULL; + p_stack_merge->i_size = 0; +} + +void +stack_concat(Stack *p_stack, Stack *p_stack_concat) { + if (stack_empty(p_stack_concat)) + return; + + Stack *p_stack_tmp = stack_new(); + + StackIterator *p_iter = stackiterator_new(p_stack_concat); + + while (stackiterator_has_next(p_iter)) + stack_push(p_stack_tmp, stackiterator_next(p_iter)); + + stackiterator_delete(p_iter); + + while (!stack_empty(p_stack_tmp)) + stack_push(p_stack, stack_pop(p_stack_tmp)); + + stack_delete(p_stack_tmp); +} + +void +stack_iterate(Stack *p_stack, void (*func)(void *p_void)) { + if (!p_stack) + return; + + StackElem *p_elem = p_stack->p_first; + + while (p_elem) { + (*func)(p_elem->p_val); + p_elem = p_elem->p_next; + } +} + +StackIterator* +stackiterator_new(Stack *p_stack) { + StackIterator *p_iter = malloc(sizeof(StackIterator)); + + p_iter->p_current = p_stack->p_first; + p_iter->p_prev = NULL; + + return (p_iter); +} + +void +stackiterator_delete(StackIterator *p_iter) { + free(p_iter); +} + +void* +stackiterator_next(StackIterator *p_iter) { + if (!p_iter) + return (NULL); + + StackElem *p_elem = p_iter->p_current; + + if (!p_elem) + return (NULL); + + p_iter->p_prev = p_iter->p_current; + p_iter->p_current = p_elem->p_next; + + return (p_elem->p_val); +} + +_Bool +stackiterator_has_next(StackIterator *p_iter) { + return (p_iter->p_current ? true : false); +} + +_Bool +stackiterator_remove_prev(StackIterator *p_iter) { + StackElem *p_prev = p_iter->p_prev; + + if (p_prev == NULL) + return (false); + + StackElem *p_next = p_prev->p_next; + + if (p_next == NULL) + return (false); + + p_prev->p_val = p_next->p_val; + p_prev->p_next = p_next->p_next; + + + free(p_next); + + p_iter->p_current = p_prev; + p_iter->p_prev = NULL; + + return (true); +} -- 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index f0392d0..7fb6402 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 7fb6402..610d139 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -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.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 610d139..877a8b6 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 877a8b6..9afb9b4 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 9afb9b4..778e41e 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -61,6 +61,22 @@ stack_empty(Stack *p_stack) { return (p_stack->i_size == 0); } +void +stack_debug(Stack *p_stack, void *p_val) { + printf("bPUSH %d %d\n", stack_size(p_stack), (int)p_stack); + StackElem *p_elem = stackelem_new(); + + p_elem->p_val = p_val; + p_elem->p_next = p_stack->p_first; + p_stack->p_first = p_elem; + + if (p_stack->p_last == NULL) + p_stack->p_last = p_stack->p_first; + + ++p_stack->i_size; + printf("aPUSH %d %d\n", stack_size(p_stack), (int)p_stack); +} + void stack_push(Stack *p_stack, void *p_val) { StackElem *p_elem = stackelem_new(); -- 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.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 778e41e..0f5f58e 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -63,7 +63,7 @@ stack_empty(Stack *p_stack) { void stack_debug(Stack *p_stack, void *p_val) { - printf("bPUSH %d %d\n", stack_size(p_stack), (int)p_stack); + printf("bPUSH %d %d\n", stack_size(p_stack), (int)p_stack); StackElem *p_elem = stackelem_new(); p_elem->p_val = p_val; @@ -74,13 +74,12 @@ stack_debug(Stack *p_stack, void *p_val) { p_stack->p_last = p_stack->p_first; ++p_stack->i_size; - printf("aPUSH %d %d\n", stack_size(p_stack), (int)p_stack); + printf("aPUSH %d %d\n", stack_size(p_stack), (int)p_stack); } -void +unsigned stack_push(Stack *p_stack, void *p_val) { StackElem *p_elem = stackelem_new(); - p_elem->p_val = p_val; p_elem->p_next = p_stack->p_first; p_stack->p_first = p_elem; @@ -88,7 +87,7 @@ stack_push(Stack *p_stack, void *p_val) { if (p_stack->p_last == NULL) p_stack->p_last = p_stack->p_first; - ++p_stack->i_size; + return (++p_stack->i_size); } void* -- 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.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 0f5f58e..9afb9b4 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -62,8 +62,7 @@ stack_empty(Stack *p_stack) { } void -stack_debug(Stack *p_stack, void *p_val) { - printf("bPUSH %d %d\n", stack_size(p_stack), (int)p_stack); +stack_push(Stack *p_stack, void *p_val) { StackElem *p_elem = stackelem_new(); p_elem->p_val = p_val; @@ -74,20 +73,6 @@ stack_debug(Stack *p_stack, void *p_val) { p_stack->p_last = p_stack->p_first; ++p_stack->i_size; - printf("aPUSH %d %d\n", stack_size(p_stack), (int)p_stack); -} - -unsigned -stack_push(Stack *p_stack, void *p_val) { - StackElem *p_elem = stackelem_new(); - p_elem->p_val = p_val; - p_elem->p_next = p_stack->p_first; - p_stack->p_first = p_elem; - - if (p_stack->p_last == NULL) - p_stack->p_last = p_stack->p_first; - - return (++p_stack->i_size); } void* -- 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 9afb9b4..4ff3cff 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 4ff3cff..5997c86 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 5997c86..e7d5766 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -173,6 +173,35 @@ 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) { + if (!p_stack) + return; + + StackElem *p_elem = p_stack->p_first; + + while (p_elem) { + (*func)(p_elem->p_val, p_void_arg); + p_elem = p_elem->p_next; + } +} + +void +stack_iterate_level(Stack *p_stack, void (*func)(void *p_void, + int i_level)) { + if (!p_stack) + return; + + StackElem *p_elem = p_stack->p_first; + + int i_level = 0; + while (p_elem) { + (*func)(p_elem->p_val, i_level++); + p_elem = p_elem->p_next; + } +} + StackIterator* stackiterator_new(Stack *p_stack) { StackIterator *p_iter = malloc(sizeof(StackIterator)); -- 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index e7d5766..bdbc3cc 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index bdbc3cc..a9bbdf7 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index a9bbdf7..f1da22a 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,13 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index f1da22a..00d5d88 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -93,6 +93,14 @@ stack_pop(Stack *p_stack) { return (p_val); } +void* +stack_top(Stack *p_stack) { + if (stack_empty(p_stack)) + return (NULL); + + return (p_stack->p_first->p_val); +} + void stack_clear(Stack *p_stack) { for (;!stack_empty(p_stack); stack_pop(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.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 00d5d88..f83cacb 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,13 +1,14 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index f83cacb..28b5efc 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,14 +1,14 @@ /*:* *: File: ./src/data/stack.c *: 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.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/data/stack.c') diff --git a/src/data/stack.c b/src/data/stack.c index 28b5efc..b20354e 100644 --- a/src/data/stack.c +++ b/src/data/stack.c @@ -1,14 +1,14 @@ /*:* *: File: ./src/data/stack.c *: 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