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