home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 January / macformat46.iso / Shareware Plus / Developers / Library / Grant's CGI Framework / Grant's CGI Framework / grantscgi / Util / LogUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-20  |  2.3 KB  |  93 lines

  1. #pragma once
  2. /*****
  3.  *
  4.  *    LogUtil.c
  5.  *
  6.  *    Logging functions
  7.  *
  8.  *    This is a support file for "Grant's CGI Framework".
  9.  *    Please see the license agreement that accompanies the distribution package
  10.  *    for licensing details.
  11.  *
  12.  *    Copyright ©1995,1996 by Grant Neufeld
  13.  *    grant@acm.com
  14.  *    http://arpp.carleton.ca/cgi/framework/
  15.  *
  16.  *****/
  17.  
  18. #include "MyConfiguration.h"
  19.  
  20. #include "CGI.h"
  21.  
  22.  
  23. /***  CONSTANTS  ***/
  24.  
  25. #define kLogLinebreak            '\r'
  26. #define kLogLinebreakP            "\p\r"
  27.  
  28.  
  29. /***  FUNCTION PROTOTYPES  ***/
  30.  
  31.     
  32. #if kCompileWithLogSupport || kCompilingForWSAPI
  33. p_export SInt32    LogWriteEntry        ( CGIHdl, char * );
  34. p_export SInt32    LogWriteDebugEntry    ( CGIHdl, char *, char *, UInt16 );
  35. p_export SInt32    DisplayString        ( CGIHdl, char * );
  36. #else
  37. #define LogWriteEntry(a,b)            (noErr)
  38. #define LogWriteDebugEntry(a,b,c,d)    (noErr)
  39. #define DisplayString(a,b)            (noErr)
  40. #endif
  41.  
  42. #if kCompileWithLogSupport && !kCompilingForWSAPI
  43.  
  44.     OSErr    LogStartup                ( void );
  45.     OSErr    LogQuit                    ( void );
  46.     
  47.     OSErr    LogFileOpen                ( void );
  48.     OSErr    LogFileClose            ( void );
  49. p_export OSErr    LogFileFlush        ( void );
  50.     
  51.     /* coming soon? */
  52. //    OSErr    LogWindowOpen            ( void );
  53. //    OSErr    LogWindowClose            ( void );
  54.  
  55. p_export OSErr    LogString                ( const char * );
  56. p_export OSErr    LogStringP                ( const StringPtr );
  57. p_export OSErr    LogStringAndSeparator    ( const char *, char );
  58. p_export OSErr    LogStringAndSeparatorP    ( const StringPtr, char );
  59.     
  60. #if kCompileWithDebugLogging
  61.     p_export OSErr    LogStringDebug        ( const char * );
  62.     p_export OSErr    LogStringDebugP        ( const StringPtr );
  63. #else
  64.         #define LogStringDebug(s)    (noErr)
  65.         #define LogStringDebugP(s)    (noErr)
  66. #endif /* kCompileWithDebugLogging */
  67.  
  68.  
  69. /***  MACROS  ***/
  70.  
  71. #define LogStringBreak(a)    LogStringAndSeparator(a,kLogLinebreak)
  72. #define LogStringBreakP(a)    LogStringAndSeparatorP(a,kLogLinebreak)
  73.  
  74.  
  75. #else    /* if !( kCompileWithLogSupport && !kCompilingForWSAPI ) */
  76.  
  77. #define LogStartup(a)    (noErr)
  78. #define LogQuit(a)    (noErr)
  79. #define LogFileOpen(a)    (noErr)
  80. #define LogFileClose(a)    (noErr)
  81. #define LogFileFlush(a)    (noErr)
  82. #define LogString(a)    (noErr)
  83. #define LogStringP(a)    (noErr)
  84. #define LogStringAndSeparator(a,b)    (noErr)
  85. #define LogStringAndSeparatorP(a,b)    (noErr)
  86. #define LogStringDebug(s)    (noErr)
  87. #define LogStringDebugP(s)    (noErr)
  88. #define LogStringBreak(a)    (noErr)
  89. #define LogStringBreakP(a)    (noErr)
  90.     
  91. #endif /* kCompileWithLogSupport && !kCompilingForWSAPI */
  92. /***  EOF  ***/
  93.