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

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: 
                     67: typedef void        TIcbf (void *request_context, const char *data_block, int data_block_size, int request_status);
                     68: 
                     69: typedef void        TTcbf (void *request_context, int request_status);
                     70: 
                     71: typedef struct _AHTReqContext
                     72:   {
                     73:      HTRequest          *request;      /* Pointer to the associated request object     */
                     74:      HTParentAnchor     *anchor;
                     75:      HTMethod            method;       /* What method are we envoking                  */
                     76:      int                 docid;                /* docid to which this request belongs          */
                     77:      AHTReqStatus        reqStatus;    /* status of the request                        */
                     78:      SockOps             read_ops;     /* The ops operation which must be used during
                     79:                                           ** an Xt read callback */
                     80: 
                     81:      SockOps             write_ops;    /* The ops operation which must be used during
                     82:                                           ** an Xt write callback */
                     83: 
                     84:      SockOps             except_ops;   /* The ops operation which must be used during
                     85:                                           ** an Xt exception callback */
                     86: 
                     87: #ifdef WWW_XWINDOWS
                     88:      XtInputId           read_xtinput_id;      /* The read xt event id assocciated with
                     89:                                                   the request */
                     90:      XtInputId           write_xtinput_id;     /* The write xt event id assocciated with
                     91:                                                   the request */
                     92:      XtInputId           except_xtinput_id;    /* The except xt event id assocciated with
                     93:                                                   the request */
                     94: #endif                         /* WWW_XWINDOWS */
                     95: 
                     96:     /*** Experimental ****/
                     97:      SOCKET             read_sock;              /* read socket associated with the request */
                     98:      SOCKET             write_sock;             /* write socket associated with the request */
                     99:      SOCKET             except_sock;            /* except socket associated with the request */
                    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: 
1.10    ! cvs       115:      /*                 the following element points to the content type of 
        !           116:                         a requested node */
        !           117: 
        !           118:      char               *content_type;
        !           119: 
1.1       cvs       120:      /* The following elements are used for the PUT and POST */
                    121: 
                    122:      HTParentAnchor     *dest; /* Destination for PUT etc.              */
                    123:      unsigned long       block_size;   /* size in bytes of the file to put      */
                    124:      int                 put_counter;  /* number of bytes already put           */
                    125:      char               *mem_ptr;      /* ptr to a struct in mem which contains a copy */
                    126:      /* of the file to put                           */
                    127:      char               *error_stream;        /* pointer to an error message associated with the
                    128:                                                 request */
                    129:      int                 error_stream_size;   /* size of the above message */
                    130:      boolean                error_html;       /* If TRUE, means the applications wants to display
                    131:                                                 error_stream. If false, error_stream is not 
                    132:                                                 displayed at all */
                    133:   }
                    134: AHTReqContext;
                    135: 
1.4       cvs       136: THOT_EXPORT char AmayaLastHTTPErrorMsg [MAX_LENGTH];
1.1       cvs       137: THOT_EXPORT HTList      *conv; /* List of global converters */
                    138: THOT_EXPORT AmayaContext *Amaya;       /* Amaya's request global context    */
                    139: 
                    140: #endif /* AMAYA_LIBWWW_H */

Webmaster