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

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

Webmaster