Annotation of Amaya/amaya/libwww.h, revision 1.8
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.6 cvs 11:
1.1 cvs 12: #include "WWWLib.h"
13: #include "WWWApp.h"
14: #include "WWWHTTP.h"
15: #include "WWWInit.h"
16: #include "HTReqMan.h"
17: #include "HTReq.h"
18: #include "HTAncMan.h"
19: #include "HTAccess.h"
20: #include "HTEvntrg.h"
21: #include "HTAlert.h"
22: #include "HTNetMan.h"
23: #include "HTBInit.h"
24: #include "WWWHTTP.h" /* HTTP access module */
25: #include "HTProxy.h"
26:
27: typedef struct _AHTDocIdStatus
28: {
29: int docid; /* a docid */
30: int counter; /* number of open requests associated with dicid */
31: }
32: AHTDocId_Status;
33:
34:
35: typedef struct __AmayaContext
36: {
37: HTList *reqlist; /* List of current requests */
38: HTList *docid_status; /* Status for each active docid */
39: int open_requests; /* number of open requests */
40: }
41: AmayaContext;
42:
43: /* the possible states for a request */
44:
45: typedef enum _AHTReqStatus
46: {
47: HT_NEW = 0, /* new request */
48: HT_NEW_PENDING = 1, /* new request, waiting for a socket */
49: HT_WAITING = 2, /* active request, waiting for socket events */
50: HT_BUSY = 4, /* the request is currently being processed */
51: HT_END = 8, /* the request has ended */
52: HT_ABORT = 16, /* user aborted the request */
53: HT_ERR = 32 /* an error happened during the request */
54: }
55: AHTReqStatus;
56:
57: #ifdef _WINDOWS
58: typedef int XtInputId;
59: #endif
60:
61: /* The structure used for requests */
62:
63: typedef void TIcbf (void *request_context, const char *data_block, int data_block_size, int request_status);
64:
65: typedef void TTcbf (void *request_context, int request_status);
66:
67: typedef struct _AHTReqContext
68: {
69: HTRequest *request; /* Pointer to the associated request object */
70: HTParentAnchor *anchor;
71: HTMethod method; /* What method are we envoking */
72: int docid; /* docid to which this request belongs */
73: AHTReqStatus reqStatus; /* status of the request */
74: SockOps read_ops; /* The ops operation which must be used during
75: ** an Xt read callback */
76:
77: SockOps write_ops; /* The ops operation which must be used during
78: ** an Xt write callback */
79:
80: SockOps except_ops; /* The ops operation which must be used during
81: ** an Xt exception callback */
82:
83: #ifdef WWW_XWINDOWS
84: XtInputId read_xtinput_id; /* The read xt event id assocciated with
85: the request */
86: XtInputId write_xtinput_id; /* The write xt event id assocciated with
87: the request */
88: XtInputId except_xtinput_id; /* The except xt event id assocciated with
89: the request */
90: #endif /* WWW_XWINDOWS */
91:
92: /*** Experimental ****/
93: SOCKET read_sock; /* read socket associated with the request */
94: SOCKET write_sock; /* write socket associated with the request */
95: SOCKET except_sock; /* except socket associated with the request */
96: /*** End of experimental stuff ****/
97:
98: char *outputfile; /* file to receive incoming data */
99: FILE *output; /* file pointer to outputfile */
100: int mode; /* Mode of request: SYNC/ASYNC/IASYNC/FORM POST/FORM GET */
101: char *urlName; /* url to retrieve/or that was retrieved */
102: char status_urlName [MAX_LENGTH]; /* url name to be displayed on the status bar */
103: TIcbf *incremental_cbf; /* For IASYNC mode, @ of callback function */
104: /* It'll be called each time a new data package */
105: /* is received */
106: void *context_icbf; /* Context for the above cbf */
107: TTcbf *terminate_cbf; /* optional CBF which will be invoked after */
108: /* a file has been received */
109: void *context_tcbf; /* Context for the above cbf */
110:
111: /* The following elements are used for the PUT and POST */
112:
113: HTParentAnchor *dest; /* Destination for PUT etc. */
114: unsigned long block_size; /* size in bytes of the file to put */
115: int put_counter; /* number of bytes already put */
116: char *mem_ptr; /* ptr to a struct in mem which contains a copy */
117: /* of the file to put */
118: char *error_stream; /* pointer to an error message associated with the
119: request */
120: int error_stream_size; /* size of the above message */
121: boolean error_html; /* If TRUE, means the applications wants to display
122: error_stream. If false, error_stream is not
123: displayed at all */
124: }
125: AHTReqContext;
126:
1.4 cvs 127: THOT_EXPORT char AmayaLastHTTPErrorMsg [MAX_LENGTH];
1.1 cvs 128: THOT_EXPORT HTList *conv; /* List of global converters */
129: THOT_EXPORT AmayaContext *Amaya; /* Amaya's request global context */
130:
131: #endif /* AMAYA_LIBWWW_H */
Webmaster