midgard/apache2.h

00001 /* $Id: apache2.h,v 1.18 2006/04/30 11:05:56 piotras Exp $
00002  *
00003  * midgard/apache2.h: apache helper routines and data structures
00004  *
00005  * Copyright (C) 1999 Jukka Zitting <jukka.zitting@iki.fi>
00006  * Copyright (C) 2000 The Midgard Project ry
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Library General Public
00010  * License as published by the Free Software Foundation; either
00011  * version 2 of the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Library General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with this library; see the file COPYING.  If not, write to
00020  * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021  * Boston, MA 02111-1307, USA.
00022  */
00023 #ifndef MGD_APACHE_H
00024 #define MGD_APACHE_H
00025 #include <httpd.h>
00026 #include <http_log.h>
00027 #include <midgard/midgard.h>
00028 #include <midgard/types.h>
00029 #include <midgard/midgard_schema.h>
00030 
00031 #define MOD_MIDGARD_RESOURCE_PAGE            0
00032 #define MOD_MIDGARD_RESOURCE_PAGE_REDIRECT   1
00033 #define MOD_MIDGARD_RESOURCE_BLOB            2
00034 #define MOD_MIDGARD_RESOURCE_FILETEMPLATE    3
00035 
00036 #define MIDGARD_HANDLER "application/x-httpd-php-midgard"
00037 
00038 struct _midgard_database_connection;
00039 
00040 typedef struct {
00041    char *username;
00042    char *password;
00043    char *hostname;
00044    int refcount;
00045    struct _midgard_database_connection *current;
00046 
00047    midgard *mgd;
00048 } midgard_database_handle;
00049 
00050 typedef struct _midgard_database_connection {
00051    char *name;
00052    midgard_database_handle *handle;
00053 } midgard_database_connection;
00054 
00055 typedef struct _server_config
00056 {
00057         char *default_realm;
00058 
00059    struct {
00060            midgard_database_connection* page;
00061            midgard_database_connection* auth;
00062            midgard_database_connection* main;
00063    } database;
00064 
00065    struct {
00066       int on, set;
00067    } forcedroot;
00068 
00069     char *pagecache; 
00070     midgard_auth_type authtype;
00071     int authtrusted;
00072 }
00073 midgard_server_config;
00074 
00075 #define MGD_AUTH_SNOOP_NONE   0
00076 #define MGD_AUTH_SNOOP_OK     1
00077 #define MGD_AUTH_SNOOP_FAILED 2
00078 
00079 typedef struct _request_config {
00080         request_rec *req;
00081         apr_pool_t  *pool;
00082         midgard     *mgd;
00083 
00084         int host, style;
00085         int author;
00086   int phpdbg;
00087   int glibdbg;
00088   
00089    struct {
00090       int required;
00091       int passed;
00092       int cookie;
00093    } auth;
00094 
00095    int prelen;
00096    int self_len;
00097 
00098    struct {
00099       int status; /*[eeh] obsolete in mod2 */
00100       int id; /*[eeh] rename to page for mod2 */
00101       int type; /*[eeh] obsolete in mod2 */
00102       int active_page; /*[eeh] obsolete in mod2 */
00103            const char *content_type;
00104    } resource;
00105 
00106    const char *path; /*[eeh] obsolete in mod2 */
00107 
00108         apr_array_header_t *argv;
00109 
00110         GHashTable *elements;
00111         midgard_style *mgd_style;
00112         midgard_server_config *scfg;
00113 
00114         int preparser_active;
00115 
00116    struct {
00117       midgard_database_connection* current;
00118       midgard_database_connection* page;
00119       midgard_database_connection* main;
00120    } database;
00121 } midgard_request_config;
00122 
00123 typedef struct _directory_config {
00124    struct {
00125       int on;
00126       int set;
00127    } engine;
00128 
00129    struct {
00130       int on;
00131       int set;
00132    } extauth;
00133 
00134     char *rootfile;
00135     char *templatefile;
00136     char *blobdir;
00137     char *parser;
00138     char *extension;
00139 #if HAVE_MIDGARD_VC
00140     char *cvs_script;
00141 #endif /* HAVE_MIDGARD_VC */
00142 #if HAVE_MIDGARD_QUOTA
00143    struct {
00144       int on;
00145       int set;
00146    } quota;
00147 #endif /* HAVE_MIDGARD_VC */
00148    struct {
00149       int on;
00150       int set;
00151    } attachmenthost;
00152   char* ah_prefix;
00153   guint loglevel;
00154   const gchar *logfile;
00155   MidgardSchema *schema;
00156   const char *schemafile;
00157   midgard_auth_type authtype;
00158   int authtrusted;      
00159 } midgard_directory_config;
00160 
00161 #endif

Generated on Thu Feb 22 06:15:13 2007 for midgard-core by  doxygen 1.4.6