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