Listing 2 DBG_STAK.C

/******************************************************
             Name: DBG_STAK.C
       Description: Library of functions to support
                  checking minimum stack .
                  available.
Global Function List: get_min_stackavail
                  check_min_stackavail
       Portability: MS-DOS Microsoft C or Borland C
******************************************************/

#include <<limits.h>>
#include <<malloc.h>>
#include <<stdlib.h>>

static size_t_MinStackAvail = UINT_MAX;

/******************************************************
      Name: check_min_stackavail
    Return: Minimum stack space up to the point this
           function is called.
Description: Keeps track of the minimum stack space
           available.
******************************************************/
size_t check_min_stackavail( void )  (
   {
   _MinStackAvail = min( _MinStackAvail,
        stackavail () );
   return ( _MinStackAvail );
   }

/******************************************************
      Name: get_min_stackavail
    Return: Minimum stack space up to the point this
           function is called.
Description: Retrieves the minimum stack space
           available.
******************************************************/
size_t get_min_stackavail( void )
   {
   return ( _MinStackAvail );
   }

/* End of File */