]> err.no Git - sope/blob - Recycler/mod_objc/ApacheModule.m
make makefiles detect 64bit FHS locations
[sope] / Recycler / mod_objc / ApacheModule.m
1 // $Id: ApacheModule.m,v 1.1 2004/06/08 11:15:59 helge Exp $
2
3 #include "ApacheModule.h"
4 #include "ApacheCmdParms.h"
5 #include "ApacheResourcePool.h"
6 #import <Foundation/Foundation.h>
7 #include "httpd.h"
8
9 int ApacheDeclineRequest = DECLINED;
10 int ApacheHandledRequest = OK;
11
12 @implementation ApacheModule
13
14 - (NSString *)usageForConfigSelector:(SEL)_selector {
15   return nil;
16 }
17
18 /* logging */
19
20 - (void)logWithFormat:(NSString *)_format, ... {
21   NSString *value = nil;
22   va_list  ap;
23
24   va_start(ap, _format);
25   value = [NSString stringWithFormat:_format arguments:ap];
26   va_end(ap);
27   
28 #if DEBUG
29   printf("|0x%08X| %s\n", (unsigned int)self, [[value description] cString]);
30 #else
31   NSLog(@"|0x%08X| %@", self, value);
32 #endif
33 }
34 - (void)debugWithFormat:(NSString *)_format, ... {
35   static char showDebug = 2;
36   NSString *value = nil;
37   va_list  ap;
38   
39   if (showDebug == 2) {
40 #if 0
41     showDebug = [WOApplication isDebuggingEnabled] ? 1 : 0;
42 #endif
43   }
44   
45   if (showDebug) {
46     va_start(ap, _format);
47     value = [NSString stringWithFormat:_format arguments:ap];
48     va_end(ap);
49     
50 #if DEBUG
51     printf("|0x%08X|D %s\n", (unsigned int)self,
52            [[value description] cString]);
53 #else
54     NSLog(@"|0x%08X|D %@", self, value);
55 #endif
56   }
57 }
58
59 @end /* ApacheModule */