Annotation of Amaya/amaya/libwww.h, revision 1.21
1.1 cvs 1: /*
2: *
3: * (c) COPYRIGHT MIT and INRIA, 1996.
4: * Please first read the full copyright statement in file COPYRIGHT.
5: *
6: */
7:
8: #ifndef AMAYA_LIBWWW_H
9: #define AMAYA_LIBWWW_H
10:
1.15 cvs 11: /***********
12: Things to put in sysdep.h???
13: **********/
14: /*typedef u_long SockOps; */
15: #ifndef _WINSOCKAPI_
16: #define FD_READ 0x01
17: #define FD_WRITE 0x02
18: #define FD_OOB 0x04
19: #define FD_ACCEPT 0x08
20: #define FD_CONNECT 0x10
21: #define FD_CLOSE 0x20
22: #endif /* _WINSOCKAPI_ */
23: typedef unsigned long ms_t;
24: /************/
1.6 cvs 25:
1.1 cvs 26: #include "WWWLib.h"
27: #include "WWWApp.h"
28: #include "WWWHTTP.h"
29: #include "WWWInit.h"
30: #include "HTReqMan.h"
31: #include "HTReq.h"
32: #include "HTAncMan.h"
33: #include "HTAccess.h"
34: #include "HTAlert.h"
35: #include "HTNetMan.h"
36: #include "HTBInit.h"
37: #include "WWWHTTP.h" /* HTTP access module */
38: #include "HTProxy.h"
1.9 cvs 39: #include "HTHost.h"
40:
1.1 cvs 41: typedef struct _AHTDocIdStatus
42: {
43: int docid; /* a docid */
44: int counter; /* number of open requests associated with dicid */
45: }
46: AHTDocId_Status;
47:
48:
49: typedef struct __AmayaContext
50: {
51: HTList *reqlist; /* List of current requests */
52: HTList *docid_status; /* Status for each active docid */
1.15 cvs 53: int open_requests; /* number of open requests */
1.1 cvs 54: }
55: AmayaContext;
56:
57: /* the possible states for a request */
58:
59: typedef enum _AHTReqStatus
60: {
61: HT_NEW = 0, /* new request */
62: HT_NEW_PENDING = 1, /* new request, waiting for a socket */
63: HT_WAITING = 2, /* active request, waiting for socket events */
64: HT_BUSY = 4, /* the request is currently being processed */
65: HT_END = 8, /* the request has ended */
66: HT_ABORT = 16, /* user aborted the request */
1.15 cvs 67: HT_CACHE = 32,
68: HT_ERR = 64 /* an error happened during the request */
1.1 cvs 69: }
70: AHTReqStatus;
71:
72: typedef struct _AHTReqContext
73: {
1.18 cvs 74: HTRequest *request; /* Pointer to the associated request object */
75: HTParentAnchor *anchor;
76: HTMethod method; /* What method are we envoking */
77: int docid; /* docid to which this request belongs */
78: AHTReqStatus reqStatus; /* status of the request */
1.19 cvs 79: HTEventType read_type; /* The type operation which must be used during
1.18 cvs 80: ** an Xt read callback */
81:
1.19 cvs 82: HTEventType write_type; /* The type operation which must be used during
1.18 cvs 83: ** an Xt write callback */
84:
1.19 cvs 85: HTEventType except_type; /* The type operation which must be used during
86: ** an Xt exception callback */
1.18 cvs 87:
1.1 cvs 88: #ifdef WWW_XWINDOWS
1.18 cvs 89: XtInputId read_xtinput_id; /* The read xt event id assocciated with
1.1 cvs 90: the request */
1.18 cvs 91: XtInputId write_xtinput_id; /* The write xt event id assocciated with
1.1 cvs 92: the request */
1.18 cvs 93: XtInputId except_xtinput_id; /* The except xt event id assocciated with
1.1 cvs 94: the request */
95: #endif /* WWW_XWINDOWS */
1.18 cvs 96:
1.1 cvs 97: /*** Experimental ****/
1.18 cvs 98: SOCKET read_sock; /* read socket associated with the request */
99: SOCKET write_sock; /* write socket associated with the request */
100: SOCKET except_sock; /* except socket associated with the request */
1.1 cvs 101: /*** End of experimental stuff ****/
1.18 cvs 102:
103: char *outputfile; /* file to receive incoming data */
1.19 cvs 104: FILE *output; /* file pointer to outputfile */
105: int mode; /* Mode of request: SYNC/ASYNC/IASYNC/FORM POST/FORM GET */
1.18 cvs 106: char *urlName; /* url to retrieve/or that was retrieved */
107: char status_urlName [MAX_LENGTH]; /* url name to be displayed on the status bar */
108: TIcbf *incremental_cbf; /* For IASYNC mode, @ of callback function */
109: /* It'll be called each time a new data package */
110: /* is received */
111: void *context_icbf; /* Context for the above cbf */
112: TTcbf *terminate_cbf; /* optional CBF which will be invoked after */
113: /* a file has been received */
114: void *context_tcbf; /* Context for the above cbf */
115:
116: /* the following element points to the content type of
1.10 cvs 117: a requested node */
1.18 cvs 118:
119: char *content_type;
1.10 cvs 120:
1.18 cvs 121: /* The following elements are used for the PUT and POST */
1.19 cvs 122: HTAnchor *source;
123: HTAnchor *dest; /* Destination for PUT etc. */
124: unsigned long block_size; /* size in bytes of the file to put */
125: int put_counter; /* number of bytes already put */
1.15 cvs 126: HTAssocList *formdata; /* ptr to a struct containing the formdata used with POST */
127:
1.19 cvs 128: char *error_stream; /* pointer to an error message associated with the
129: request */
130: int error_stream_size; /* size of the above message */
1.21 ! cvs 131: ThotBool error_html; /* If TRUE, means the applications wants to display
1.19 cvs 132: error_stream. If false, error_stream is not
133: displayed at all */
1.1 cvs 134: }
135: AHTReqContext;
136:
1.4 cvs 137: THOT_EXPORT char AmayaLastHTTPErrorMsg [MAX_LENGTH];
1.1 cvs 138: THOT_EXPORT HTList *conv; /* List of global converters */
139: THOT_EXPORT AmayaContext *Amaya; /* Amaya's request global context */
140: #endif /* AMAYA_LIBWWW_H */
1.15 cvs 141:
Webmaster