home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_10 / 1010033a < prev    next >
Text File  |  1992-08-10  |  1KB  |  46 lines

  1. /*                    Listing 2                     */
  2. /*****************************************************
  3.                 Name: DBG_STAK.C
  4.          Description: Library of functions to support
  5.                       bidirection communications with
  6.                       PC parallel port.
  7. Global Function List: get_min_stackavail
  8.                       check_min_stackavail
  9.          Portability: MS-DOS Microsoft C or Borland C
  10. *****************************************************/
  11.  
  12. #include <<limits.h>>
  13. #include <<malloc.h>>
  14. #include <<stdlib.h>>
  15.  
  16. static size_t _MinStackAvail = UINT_MAX;
  17.  
  18. /*****************************************************
  19.        Name: check_min_stackavail
  20.      Return: Minimum stack space up to the point this
  21.              function is called.
  22. Description: Keeps track of the minimum stack space
  23.              available.
  24. *****************************************************/
  25. size_t check_min_stackavail( void )
  26.    {
  27.    _MinStackAvail = min( _MinStackAvail,
  28.          stackavail() );
  29.    return ( _MinStackAvail );
  30.    }
  31.  
  32. /*****************************************************
  33.        Name: get_min_stackavail
  34.      Return: Minimum stack space up to the point this
  35.              function is called.
  36. Description: Retrieves the minimum stack space
  37.              available.
  38. *****************************************************/
  39. size_t get_min_stackavail( void )
  40.    {
  41.    return ( _MinStackAvail );
  42.    }
  43.  
  44. /* End of File */
  45.  
  46.