home *** CD-ROM | disk | FTP | other *** search
- /*
- LogTest.c - A simple test of the logging system.
- */
-
- #include "LogToFile.h"
- #include <Memory.h>
- #include <QuickDraw.h>
- #include <Fonts.h>
- #include <Windows.h>
- #include <Menus.h>
- #include <TextEdit.h>
- #include <Dialogs.h>
- #include <OSEvents.h>
-
- /*
- This #pragma indicates that all functions in this file will be logged.
- You can move it to a single routine to log just that routine.
- #pragma options( profile, force_frame )
-
- The opposite of this command is:
- #pragma options( !profile, !force_frame )
- */
- #pragma options( profile, force_frame )
-
- /*
- Prototypes
- */
- void InitMacToolbox( void );
- void DoSomething( void );
- void Func1( void );
- short Func2( short x );
-
-
- main()
- {
- InitMacToolbox();
-
- // initialize the logging system
- LogInit( NULL, // default file location
- true, // delete the old file
- false, // don't flush the volume all the time
- true ); // start logging
-
- // call a few routines
- DoSomething();
-
- // close the log file
- LogDInit();
- }
-
-
- void DoSomething( void )
- {
- Func1();
- Func2( 10 );
- }
-
- void Func1( void )
- {
- static short x = 0;
- if ( ++x < 2 )
- Func1();
- }
-
- short Func2( short x )
- {
- return( 2 * x );
- }
-
- static void InitMacToolbox( void )
- {
- MaxApplZone();
- MoreMasters(); MoreMasters();
- InitGraf( &qd.thePort );
- InitFonts();
- InitWindows();
- InitCursor();
- InitMenus();
- InitDialogs( 0L );
- TEInit();
- FlushEvents( -1, 0 );
- }
-
-