home *** CD-ROM | disk | FTP | other *** search
- /*
- ADSMISC.CPP -
-
- This file:
-
- Miscellaneous function definitions used in ADS C++
- classes.
-
-
- (C) Copyright 1988-1994 by Autodesk, Inc.
-
- This program is copyrighted by Autodesk, Inc. and is licensed
- to you under the following conditions. You may not distribute
- or publish the source code of this program in any form. You
- may incorporate this code in object form in derivative works
- provided such derivative works are (i.) are designed and
- intended to work solely with Autodesk, Inc. products, and
- (ii.) contain Autodesk's copyright notice "(C) Copyright
- 1988-1994 by Autodesk, Inc."
-
- AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
- AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MER-
- CHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC.
- DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
- UNINTERRUPTED OR ERROR FREE.
-
- */
- #include "adsinc.h"
-
- //-----------------------------------------------------------------------------
- static BOOL usr_brk = FALSE;
-
- //-----------------------------------------------------------------------------
- BOOL SetUserBrk( BOOL new_value )
- {
- usr_brk = new_value;
- return new_value;
- }
-
- //-----------------------------------------------------------------------------
- BOOL UserBrk()
- {
- return usr_brk;
- }
-
- //-----------------------------------------------------------------------------
- BOOL ShowLife( int cur_count )
- {
- static UINT last_count = 0;
- static int lastlen = 0;
- char rstr[ 25 ];
- char lstr[ 50 ];
- int bk, len;
-
- //
- // If cur_count == -1, we are initializing the process
- //
- if ( cur_count == -1 )
- {
- last_count = 0;
- lastlen = 0;
- usr_brk = FALSE;
- return TRUE;
- }
-
- last_count = cur_count;
- _itoa( cur_count, rstr, 10 );
- len = strlen( rstr );
- /* Back up over the last status output */
- for ( bk = 0; bk < lastlen; ++bk )
- {
- lstr[ bk ] = '\b';
- }
- lstr[ bk ] = EOS;
- lastlen = len;
- strcat( lstr, rstr );
- ads_printf( lstr );
- usr_brk = ads_usrbrk();
- return !usr_brk;
- }
-
-
-
-