Return to libwww.h CVS log | Up to [Public] / Amaya / amaya |
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 */ 54: boolean cache; /* cache active */ 1.1 cvs 55: } 56: AmayaContext; 57: 58: /* the possible states for a request */ 59: 60: typedef enum _AHTReqStatus 61: { 62: HT_NEW = 0, /* new request */ 63: HT_NEW_PENDING = 1, /* new request, waiting for a socket */ 64: HT_WAITING = 2, /* active request, waiting for socket events */ 65: HT_BUSY = 4, /* the request is currently being processed */ 66: HT_END = 8, /* the request has ended */ 67: HT_ABORT = 16, /* user aborted the request */ 1.15 cvs 68: HT_CACHE = 32, 69: HT_ERR = 64 /* an error happened during the request */ 1.1 cvs 70: } 71: AHTReqStatus; 72: 73: #ifdef _WINDOWS 74: typedef int XtInputId; 75: #endif 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 */ 1.15 cvs 84: HTEventType read_type; /* The type operation which must be used during 1.1 cvs 85: ** an Xt read callback */ 86: 1.15 cvs 87: HTEventType write_type; /* The type operation which must be used during 1.1 cvs 88: ** an Xt write callback */ 89: 1.15 cvs 90: HTEventType except_type; /* The type operation which must be used during 1.1 cvs 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 */ 1.15 cvs 130: int put_counter; /* number of bytes already put */ 131: HTAssocList *formdata; /* ptr to a struct containing the formdata used with POST */ 132: 1.1 cvs 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: 146: #endif /* AMAYA_LIBWWW_H */ 1.15 cvs 147: