home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / UsageLogger 1.0 / UsageLogger.h < prev    next >
Encoding:
Text File  |  1994-11-08  |  1.4 KB  |  63 lines  |  [TEXT/KAHL]

  1. //
  2. // This is a hack which makes usagelogger compile under
  3. // both the old and the universal headers.
  4. //
  5. #if !NEW_HEADERS_AVAILABLE
  6.     #define AEEventHandlerUPP EventHandlerProcPtr 
  7. #endif
  8.  
  9. typedef struct TimeStampInfo
  10. {
  11.     unsigned long starting_time;
  12.     OSType   theType;
  13.     short    theFile;
  14. } TimeStampInfo;
  15.  
  16. typedef struct config
  17. {
  18.     OSType prefsFolderType;
  19.     OSType logFileCreator;
  20. } config;
  21.  
  22. typedef pascal OSErr AEventHandler(
  23.     AppleEvent *theAppleEvent, AppleEvent *replyAppleEvent, long refCon);
  24.  
  25. AEventHandler DoAEOpenApplication;
  26. AEventHandler UnhandledAEvent;
  27. AEventHandler DoAEQuitApplication;
  28. AEventHandler DoAEFlushLog;
  29. AEventHandler DoAELogText;
  30.  
  31. #define DoAEOpenDocuments  UnhandledAEvent
  32. #define DoAEPrintDocuments UnhandledAEvent
  33.  
  34. OSErr InitAppleEventsStuff( Boolean *quitFlag, long foundVRefnum, short theFile);
  35.  
  36. void main( void);
  37.  
  38. void basicTimeStamp( short theFile, OSType theType, long now);
  39. void TimeStamp( short theFile, OSType theType);
  40.  
  41. void NotifyUserAndQuit( const short messageno);
  42.  
  43. pascal void myResponse( NMRecPtr theNMRec);
  44.  
  45. OSErr writeChar( short defile, char theletter);
  46.  
  47. #define writeATab(theFile) (void)writeChar( theFile, '\t')
  48. #define writeAReturn(theFile) (void)writeChar( theFile, '\n')
  49. #define writeASpace(theFile) (void)writeChar( theFile, ' ')
  50.  
  51. OSErr writePString( short theFile, StringPtr string);
  52. //
  53. // 'STR ' resource numbers:
  54. //
  55. enum
  56. {
  57.     needsAppleEvents = 128,
  58.     handlerInstallFailed,
  59.     couldNotSetDirectory,
  60.     outputFileOpenError,
  61.     logFileName
  62. };
  63.