Annotation of Amaya/amaya/libwww.h, revision 1.4

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

Webmaster