home *** CD-ROM | disk | FTP | other *** search
- /*********************
- *
- * ut_stack.c - local stack implementaion.
- *
- * Purpose: This file contains the push and pop functions to implement
- * a local stack.
- *
- * Blackstar C Function Library
- * (c) Copyright 1985,1989 Sterling Castle Software
- *
- *******/
-
- #include "blackstr.h"
- #include "ut_head.h"
-
- int lstack_[BLIB_CSTACK]; /* local stack */
- int *lstkptr_ = &lstack_[0]; /* local stack pointer */
- int *lstkend_ = &lstack_[BLIB_CSTACK-1]; /* end of stack */
-
-
- /********
- *
- * ut_push(val) - push a value onto the stack
- *
- **/
-
- int ut_push(int val)
- {
- *lstkptr_++ = val;
- if(lstkptr_ > lstkend_)
- return(ERROR);
- else
- return NUL;
- }
-
-
- /********
- *
- * ut_pop() - get a value off the local stack
- *
- **/
-
- int ut_pop(void)
- {
- return(*--lstkptr_);
- }
-
-