]> err.no Git - sope/blob - sope-appserver/mod_ngobjweb/common.h
Xcode build fixed for linking against libical.framework
[sope] / sope-appserver / mod_ngobjweb / common.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
6   OGo is free software; you can redistribute it and/or modify it under
7   the terms of the GNU Lesser General Public License as published by the
8   Free Software Foundation; either version 2, or (at your option) any
9   later version.
10
11   OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12   WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
14   License for more details.
15
16   You should have received a copy of the GNU Lesser General Public
17   License along with OGo; see the file COPYING.  If not, write to the
18   Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __NGObjWeb_Adaptors_apache_H__
24 #define __NGObjWeb_Adaptors_apache_H__
25
26 /* System includes */
27
28 #include <strings.h>
29 #include <netdb.h>
30 #include <sys/types.h>
31 #include <netinet/in.h>
32 #include <sys/un.h>
33 #include <arpa/inet.h>
34 #include <unistd.h>
35
36 /* Apache includes */
37
38 #include <httpd.h>
39 #include <http_core.h>
40 #include <http_config.h>
41 #include <http_log.h>
42 #include <http_protocol.h>
43
44 #if MODULE_MAGIC_NUMBER_MAJOR >= 20010224
45 /* apache ap version 2 */
46 #include "apr.h"
47 #include "apr_buckets.h"
48 #include "apr_strings.h"
49 #include "apr_portable.h"
50 #include "apr_optional.h"
51 #include "apr_lib.h"
52 #include "ap_config.h"
53 #include "ap_listen.h"
54 #else
55 /* for compatibility */
56 #define AP_VERSION_1
57
58 #define apr_array_header_t array_header
59 #define apr_inet_addr      inet_addr
60 #define apr_isalnum        isalnum
61 #define apr_isspace        isspace
62 #define apr_palloc         ap_palloc
63 #define apr_pcalloc        ap_pcalloc
64 #define apr_pool_t         pool
65 #define apr_table_elts     ap_table_elts
66 #define apr_table_entry_t  table_entry
67 #define apr_table_get      ap_table_get
68 #define apr_table_make     ap_make_table
69 #define apr_table_set      ap_table_set
70 #define apr_table_t        table
71 #define apr_sleep          sleep
72 #define apr_snprintf       snprintf
73
74 #define ap_log_error(file, line, level, status, vars...) \
75         ap_log_error(file, line, level, ## vars)
76 #endif
77
78 #include "NGBufferedDescriptor.h"
79
80 module ngobjweb_module;
81
82 typedef struct {
83   char *snsPort;  /* the port of the SNS daemon                */
84   int  snsPortDomain;
85   
86   char *appPort; /* a single pass-through port of an instance */
87   int  appPortDomain;
88   
89   char *appPrefix;
90   int  useHTTP;
91 } ngobjweb_dir_config;
92
93 #define MAX_PORTNAME_SIZE   140
94 #define MAX_SNS_PATH_SIZE   MAX_PORTNAME_SIZE
95 #define MAX_APP_PREFIX_SIZE 256
96
97 /* SNS */
98
99 extern void *
100 _sendSNSQuery(request_rec *_rq, const char *_line, const char *_cookie,
101               int *_domain, size_t *_len,
102               const char *_appName,
103               ngobjweb_dir_config *_cfg);
104
105 /* HTTP */
106
107 extern unsigned char
108 NGScanResponseLine(NGBufferedDescriptor *_in,
109                    unsigned char *_version, int *_status, 
110                    unsigned char *_text);
111 extern apr_table_t *NGScanHeaders(apr_pool_t *_pool, NGBufferedDescriptor *_in);
112
113 /* handlers */
114
115 extern int ngobjweb_handler(request_rec *r);
116
117 /* commands */
118
119 extern const char *ngobjweb_set_sns_port(cmd_parms *cmd,
120                                          ngobjweb_dir_config *cfg,
121                                          char *arg);
122 extern const char *ngobjweb_set_app_port(cmd_parms *cmd,
123                                          ngobjweb_dir_config *cfg,
124                                          char *arg);
125 extern const char *ngobjweb_set_app_prefix(cmd_parms *cmd,
126                                            ngobjweb_dir_config *cfg,
127                                            char *arg);
128 extern const char *ngobjweb_set_use_http(cmd_parms *cmd,
129                                          ngobjweb_dir_config *cfg);
130
131 /* configuration */
132
133 extern void *ngobjweb_create_dir_config(apr_pool_t *p, char *dummy);
134 extern void *ngobjweb_merge_dir_configs(apr_pool_t *p, void *basev, void *addv);
135
136 #endif /* __NGObjWeb_Adaptors_apache_H__ */