1 #include <stdio.h>
 2 #include <stdlib.h>
 3 #include "rh_string.h"
 4 #include "handler.h"
 5 #include "http_request.h"
 6 #include "rh_chunk.h"
 7 
 8 
 9 DECLARE_HANDLER_FUNCTION (null,exec)
10 {
11         http_request_t  *request;
12 
13 #ifdef RHTTPD_DUMP_HANDLER_CALL
14         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
15 #endif
16 
17         request = handler->base->request;
18         
19         return HANDLER_SUCCESS;
20 }
21 
22 
23 DECLARE_HANDLER_FUNCTION (null,setup)
24 {
25         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
26 
27         return HANDLER_SUCCESS;
28 }
29 
30 DECLARE_HANDLER_FUNCTION (null,init)
31 {
32         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
33         
34         handler->data_local  = malloc(123);
35         if (NULL == handler->data_local)
36                 return HANDLER_FAILURE;
37         
38         return HANDLER_SUCCESS;
39 }
40 
41 DECLARE_HANDLER_FUNCTION (null,init_global)
42 {
43         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
44         
45         handler->data_global = malloc(456);
46         if (NULL == handler->data_global)
47                 return HANDLER_FAILURE;
48         
49         return HANDLER_SUCCESS;
50 }
51 
52 DECLARE_HANDLER_FUNCTION (null,free)
53 {
54         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
55         memset (handler->data_local, 0, 123);
56         free (handler->data_local);
57         return HANDLER_SUCCESS;
58 }
59 
60 DECLARE_HANDLER_FUNCTION (null,free_global)
61 {
62         printf ("%s(%p)\n", __FUNCTION__, (void*)handler);
63         memset (handler->data_global, 0, 456);
64         free (handler->data_global);
65         return HANDLER_SUCCESS;
66 }
67 
68 DECLARE_HANDLER_BEGIN (null)    
69         .DECLARE_HANDLER_SYMBOL (null, setup),
70         .DECLARE_HANDLER_SYMBOL (null, init),
71         .DECLARE_HANDLER_SYMBOL (null, init_global),
72         .DECLARE_HANDLER_SYMBOL (null, free),
73         .DECLARE_HANDLER_SYMBOL (null, free_global),
74         .DECLARE_HANDLER_SYMBOL (null, exec),
75 DECLARE_HANDLER_END


syntax highlighted by Code2HTML, v. 0.9.1