View Source

[modwtcl]
apreq.h
dist/
libapreq1/
mod_wtcl.c
mod_wtcl.h
setupExclude.txt
util/
win.def
win.mak
wt1.1/
WtAppTable.c
WtAppTable.h
WtBasicCmds.c
WtBasicCmds.h
WtClientRequest.c
WtClientRequest.h
WtCollection.c
WtCollection.h
WtCollectionCmds.c
WtCollectionCmds.h
WtContext.c
WtContext.h
WtContextEvents.c
WtContextEvents.h
WtCookie.c
WtCookie.h
WtDbSession.c
WtDbSession.h
WtExecute.c
WtExecute.h
WtHtmlEntities.c
WtHtmlEntities.h
WtInitCmds.c
WtInitCmds.h
WtMtTable.c
WtMtTable.h
WtMultiTable.c
WtMultiTable.h
WtOS.h
WtProcSession.c
WtProcSession.h
WtResponse.c
WtResponse.h
WtServerCmds.c
WtServerCmds.h
WtSession.c
WtSession.h
WtSettings.c
WtSettings.h
WtTable.c
WtTable.h
WtTableCmds.c
WtTableCmds.h
WtTableUtil.c
WtTableUtil.h
WtUpload.c
WtUpload.h
WtUtil.c
WtUtil.h
WtWebErrors.c
WtWebErrors.h
WtWindows.h
File: / archive / modwtcl / WtContext.h

Lines Size Modified Created Owner MIME Types
162 4,034 2010/05/15 22:49:53 2011/06/13 15:35:15 BUILTIN\Administrators text/x-chdr

0001
/*
0002
 * Copyright 2001 Alexander Boverman and the original authors.
0003
 * 
0004
 * Licensed under the Apache License, Version 2.0 (the "License");
0005
 * you may not use this file except in compliance with the License.
0006
 * You may obtain a copy of the License at
0007
 * 
0008
 *      http://www.apache.org/licenses/LICENSE-2.0
0009
 * 
0010
 * Unless required by applicable law or agreed to in writing, software
0011
 * distributed under the License is distributed on an "AS IS" BASIS,
0012
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0013
 * See the License for the specific language governing permissions and
0014
 * limitations under the License.
0015
 */
0016
0017
#ifndef _WT_CONTEXT_H
0018
#define _WT_CONTEXT_H
0019
0020
#include "WtSession.h"
0021
#include "apreq.h"
0022
0023
typedef enum {
0024
  WT_STATUS_NONE,
0025
  WT_STATUS_OK,
0026
  WT_STATUS_ERROR,
0027
  WT_STATUS_FATAL
0028
} WtStatus;
0029
0030
/* Initial request state */
0031
0032
typedef struct WtDispatchT
0033
{
0034
  Tcl_Time startTime;
0035
  int status;
0036
  int moduleStatus;
0037
  int terminate;
0038
} WtDispatch;
0039
0040
typedef struct WtPageLoaderT
0041
{
0042
  Tcl_Obj *includeSearchPath;
0043
  Tcl_Obj *includeNamespace;
0044
  int addHeaderTrailer;
0045
  Tcl_Obj *includeHeader;
0046
  Tcl_Obj *includeTrailer;
0047
  Tcl_Obj *scriptStartString;
0048
  Tcl_Obj *scriptEndString;
0049
  int interpolateText;
0050
  Tcl_Obj *textHandler;
0051
  Tcl_Obj *exprHandler;
0052
  int pageIndex;
0053
  Tcl_Obj *pageStack;
0054
} WtPageLoader;
0055
0056
typedef struct WtClientRequestT
0057
{
0058
  Tcl_Obj *headers;
0059
  int parseStatus;
0060
  int readRequestStatus;
0061
  ApacheRequest *apWeb;
0062
  Tcl_Obj *queryParams;
0063
  Tcl_Obj *postParams;
0064
  int readCookiesStatus;
0065
  ApacheCookieJar *apCookies;
0066
  Tcl_Obj *cookies;
0067
  Tcl_Obj *uploads;
0068
  Tcl_Obj *uploadHandler;
0069
  Tcl_Obj *uploadHandlerData;
0070
  Tcl_Obj *params;
0071
} WtClientRequest;
0072
0073
typedef struct WtClientResponseT
0074
{
0075
  Tcl_Obj *contentType;
0076
  Tcl_Obj *headers;
0077
  Tcl_Obj *successHeaders;
0078
  WtStatus headersStatus;
0079
  Tcl_Obj *cookies;
0080
  int status;
0081
  unsigned long bytesSent;
0082
} WtClientResponse;
0083
0084
typedef struct WtWebContextT
0085
{
0086
  int isPersistent;
0087
  request_rec *apReq;
0088
  int ctxRequestCount;
0089
  Tcl_Time requestStartTime;
0090
  int aInitDone;
0091
  int interpRequestCount;
0092
  int errorState;
0093
  Tcl_Obj *notices;
0094
  Tcl_Obj *taskSettings;
0095
  int interpIsNew;
0096
  Tcl_Interp *interp;
0097
  time_t interpCreationTime;
0098
  int packageLoadDone;
0099
  Tcl_Obj *usedNamespaces;
0100
  Tcl_Obj *taskNamespace;
0101
  Tcl_Obj *ctxEventHandlers;
0102
  int bInitDone;
0103
  int importCommands;
0104
  int pageIsStarted;
0105
  int readEnvStatus;
0106
  Tcl_Obj *serverVars;
0107
  WtPageLoader loader;
0108
  WtClientRequest clientRequest;
0109
  WtClientResponse clientResponse;
0110
  Tcl_Obj *errorStack;
0111
  int deleteInterp;
0112
  int terminate;
0113
  WtSession session;
0114
  Tcl_Obj *dataSourceHandler;
0115
} WtWebContext;
0116
0117
typedef struct WtContextT
0118
{
0119
  int serverInit;
0120
  int debug;
0121
  server_rec *apServer;
0122
  request_rec *apReq;
0123
  int requestCount;
0124
  Tcl_Channel webChannel;
0125
  Tcl_HashTable *optionCodes;
0126
  Tcl_HashTable *optionKeys;
0127
  Tcl_Obj *defaultCtxSettings;
0128
  WtWebContext *persistentWebContext;
0129
  WtWebContext *transientWebContext;
0130
  WtWebContext *web;
0131
} WtContext;
0132
0133
typedef struct WtThreadStorageT
0134
{
0135
  WtContext *context;
0136
} WtThreadStorage;
0137
0138
void WtInitServer(server_rec *s, pool *p);
0139
WtContext *WtGetContext();
0140
int WtProcessRequest(request_rec *r);
0141
int WtInitRequest(WtContext *w, request_rec *r, WtDispatch *disp);
0142
int WtInitWebContext(WtContext *w, int initRequest);
0143
WtWebContext *WtCreateWebContext(int isPersistent);
0144
int WtCreateInterp(WtContext *w, int initRequest);
0145
int WtInitInterp(WtContext *w, int initRequest);
0146
int WtInitPackages(WtContext *w, int initRequest);
0147
int WtInitTaskObjectsB(WtContext *w);
0148
int WtEndRequest(WtContext *w, request_rec *r, WtDispatch *disp);
0149
int WtRecreateInterp(WtContext *w, WtDispatch *disp);
0150
int WtDeleteInterp(WtContext *w);
0151
int WtReuseInterp(WtContext *w);
0152
int WtClearTaskObjects(WtContext *w);
0153
int WtDeleteContext();
0154
int WtDeleteWebContext(WtContext *w);
0155
void WtEndServer(server_rec *s, pool *p);
0156
Tcl_Obj *WtGetServerConf(server_rec *s);
0157
Tcl_Obj *WtGetDirConf(request_rec *r);
0158
WtContext *WtGetAssocContext(Tcl_Interp *interp);
0159
0160
extern const char *wtVersion;
0161
0162
#endif /* !_WT_CONTEXT_H */