home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / ACADWIN / ADS / CPP / GENERAL / ADSMISC.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  2.2 KB  |  84 lines

  1. /* 
  2.     ADSMISC.CPP -
  3.     
  4.     This file:
  5.  
  6.         Miscellaneous function definitions used in ADS C++
  7.         classes.
  8.         
  9.  
  10.     (C) Copyright 1988-1994 by Autodesk, Inc.
  11.  
  12.     This program is copyrighted by Autodesk, Inc. and is  licensed
  13.     to you under the following conditions.  You may not distribute
  14.     or  publish the source code of this program in any form.   You
  15.     may  incorporate this code in object form in derivative  works
  16.     provided  such  derivative  works  are  (i.) are  designed and
  17.     intended  to  work  solely  with  Autodesk, Inc. products, and
  18.     (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  19.     1988-1994 by Autodesk, Inc."
  20.  
  21.     AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  22.     AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  23.     CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  24.     DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  25.     UNINTERRUPTED OR ERROR FREE.
  26.  
  27. */
  28. #include "adsinc.h"
  29.  
  30. //-----------------------------------------------------------------------------
  31. static BOOL usr_brk = FALSE;
  32.  
  33. //-----------------------------------------------------------------------------
  34. BOOL    SetUserBrk( BOOL new_value )
  35. {
  36.     usr_brk = new_value;
  37.     return new_value;
  38. }
  39.  
  40. //-----------------------------------------------------------------------------
  41. BOOL UserBrk()
  42. {
  43.     return usr_brk;
  44. }
  45.  
  46. //-----------------------------------------------------------------------------
  47. BOOL ShowLife( int cur_count )
  48. {
  49.     static UINT last_count    = 0;
  50.     static int lastlen      = 0;
  51.     char rstr[ 25 ];
  52.     char lstr[ 50 ];
  53.     int bk, len;
  54.  
  55.     //
  56.     // If cur_count == -1, we are initializing the process
  57.     //
  58.     if ( cur_count == -1 )
  59.     {
  60.         last_count = 0;
  61.         lastlen = 0;
  62.         usr_brk = FALSE;
  63.         return TRUE;
  64.     }
  65.  
  66.     last_count = cur_count;
  67.     _itoa( cur_count, rstr, 10 );
  68.     len = strlen( rstr );
  69.     /* Back up over the last status output */
  70.     for ( bk = 0; bk < lastlen; ++bk )
  71.     {
  72.         lstr[ bk ] = '\b';
  73.     }
  74.     lstr[ bk ] = EOS;
  75.     lastlen = len;
  76.     strcat( lstr, rstr );
  77.     ads_printf( lstr );
  78.     usr_brk = ads_usrbrk();
  79.     return !usr_brk;
  80. }
  81.  
  82.  
  83.  
  84.