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

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.31      cvs        26: #ifndef _WINDOWS
1.32      cvs        27: #ifdef _GTK
1.31      cvs        28: #if !defined(BOOL)
                     29: typedef char BOOL;
1.32      cvs        30: #endif
1.31      cvs        31: #endif
                     32: #endif
                     33: 
1.36      kirschpi   34: /* For windows plataforms, to guarantee that 
                     35:  * HT_DAV option for the libwww WebDAV module
                     36:  * will be defined.  */
1.35      cvs        37: #ifdef DAV
                     38: #ifndef HT_DAV
                     39: #define HT_DAV
                     40: #endif /* HT_DAV */
                     41: #endif /* DAV */
                     42: 
1.37    ! kahan      43: #include "wwwsys.h"
1.1       cvs        44: #include "WWWLib.h"
1.22      cvs        45: #include "AHTInit.h"
1.1       cvs        46: #include "WWWApp.h"
                     47: #include "WWWHTTP.h"
                     48: #include "HTReqMan.h"
                     49: #include "HTReq.h"
                     50: #include "HTAncMan.h"
                     51: #include "HTAccess.h"
                     52: #include "HTAlert.h"
                     53: #include "HTNetMan.h"
                     54: #include "HTBInit.h"
                     55: #include "WWWHTTP.h"           /* HTTP access module */
                     56: #include "HTProxy.h"
1.9       cvs        57: #include "HTHost.h"
1.35      cvs        58: 
1.9       cvs        59: 
1.1       cvs        60: typedef struct _AHTDocIdStatus
                     61:   {
                     62:      int                 docid;        /* a docid */
                     63:      int                 counter;      /* number of open requests associated with dicid */
                     64:   }
                     65: AHTDocId_Status;
                     66: 
                     67: 
                     68: typedef struct __AmayaContext
                     69:   {
                     70:      HTList             *reqlist;      /* List of current requests */
                     71:      HTList             *docid_status; /* Status for each active docid */
1.15      cvs        72:      int                 open_requests;        /* number of open requests */
1.1       cvs        73:   }
                     74: AmayaContext;
                     75: 
                     76: /* the possible states for a request */
                     77: 
                     78: typedef enum _AHTReqStatus
                     79:   {
                     80:      HT_NEW = 0,          /* new request */
                     81:      HT_NEW_PENDING = 1,  /* new request, waiting for a socket */
                     82:      HT_WAITING = 2,      /* active request, waiting for socket events */
                     83:      HT_BUSY = 4,         /* the request is currently being processed */
                     84:      HT_END = 8,          /* the request has ended */
                     85:      HT_ABORT = 16,       /* user aborted the request */
1.15      cvs        86:      HT_CACHE = 32,
                     87:      HT_ERR = 64          /* an error happened during the request */
1.1       cvs        88:   }
                     89: AHTReqStatus;
                     90: 
                     91: typedef struct _AHTReqContext
                     92:   {
1.18      cvs        93:     HTRequest          *request;       /* Pointer to the associated request object     */
                     94:     HTParentAnchor     *anchor;
1.24      cvs        95:     HTMethod            method;                /* What method are we invoking                  */
1.18      cvs        96:     int                 docid;         /* docid to which this request belongs          */
                     97:     AHTReqStatus        reqStatus;     /* status of the request                        */
1.19      cvs        98:     HTEventType         read_type;     /* The type operation which must be used during
1.18      cvs        99:                                        ** an Xt read callback */
1.24      cvs       100:     char               *default_put_name;  /* @@what's the def name? */
1.33      kahan     101:     ThotBool            put_redirection; /* a PUT operation was redirected */
1.24      cvs       102: 
1.19      cvs       103:     HTEventType         write_type;    /* The type operation which must be used during
1.18      cvs       104:                                        ** an Xt write callback */
                    105:     
1.19      cvs       106:     HTEventType         except_type;   /* The type operation which must be used during
                    107:                                        ** an Xt exception callback */
1.18      cvs       108:     
1.1       cvs       109: #ifdef WWW_XWINDOWS
1.18      cvs       110:     XtInputId           read_xtinput_id;       /* The read xt event id assocciated with
1.1       cvs       111:                                                   the request */
1.18      cvs       112:     XtInputId           write_xtinput_id;      /* The write xt event id assocciated with
1.1       cvs       113:                                                   the request */
1.18      cvs       114:     XtInputId           except_xtinput_id;     /* The except xt event id assocciated with
1.1       cvs       115:                                                   the request */
                    116: #endif                         /* WWW_XWINDOWS */
1.18      cvs       117:     
1.1       cvs       118:     /*** Experimental ****/
1.18      cvs       119:     SOCKET             read_sock;              /* read socket associated with the request */
                    120:     SOCKET             write_sock;             /* write socket associated with the request */
                    121:     SOCKET             except_sock;            /* except socket associated with the request */
1.1       cvs       122:     /*** End of experimental stuff ****/
1.18      cvs       123:     
1.30      cvs       124:     char*            outputfile;       /* file to receive incoming data         */
1.19      cvs       125:     FILE               *output;                /* file pointer to outputfile            */
1.26      cvs       126:     int                mode;           /* Mode of request: SYNC/ASYNC/IASYNC/FORM POST/FORM GET   */
1.30      cvs       127:     char*            urlName;  /* url to retrieve/or that was retrieved */
                    128:     char             status_urlName [MAX_LENGTH]; /* url name to be displayed on the status bar */
1.18      cvs       129:     TIcbf              *incremental_cbf;       /* For IASYNC mode, @ of callback function */
                    130:     /* It'll be called each time a new data package */
                    131:     /* is received                                  */
                    132:     void               *context_icbf;  /* Context for the above cbf                  */
                    133:     TTcbf              *terminate_cbf;         /* optional CBF which will be invoked after  */
                    134:     /* a file has been received                  */
                    135:     void               *context_tcbf;  /* Context for the above cbf                 */
                    136:     
1.28      cvs       137:     /*                 the following structure holds a copy of the
                    138:                       HTTP headers that the application is interested in */
                    139:     AHTHeaders         http_headers;
1.10      cvs       140: 
1.18      cvs       141:     /* The following elements are used for the PUT and POST */
1.19      cvs       142:     HTAnchor           *source;
                    143:     HTAnchor           *dest;  /* Destination for PUT etc.              */
                    144:     unsigned long       block_size;     /* size in bytes of the file to put      */
                    145:     int                 put_counter;    /* number of bytes already put           */
1.15      cvs       146:     HTAssocList        *formdata;        /* ptr to a struct containing the formdata used with POST */
                    147: 
1.23      cvs       148:     char*               error_stream;      /* pointer to an error message associated with the
1.19      cvs       149:                                              request */
                    150:     int                 error_stream_size; /* size of the above message */
1.21      cvs       151:     ThotBool            error_html;        /* If TRUE, means the applications wants to display
1.19      cvs       152:                                              error_stream. If false, error_stream is not 
                    153:                                              displayed at all */
1.25      cvs       154:     char               *document;
1.34      kirschpi  155: 
                    156: #ifdef DAV
                    157:     /* WebDAV request context object - it will be a AHTDAVContext object */
                    158:     /* MKP: I declared was a void * to avoid circular references between
                    159:      *      libwww.h and davlib.h */
                    160:     void      *dav_context;
                    161: #endif /* DAV */    
1.1       cvs       162:   }
                    163: AHTReqContext;
                    164: 
1.29      kahan     165: /*
                    166: ** the HTTP error messages
                    167: */
                    168: /* an interpreted version of the error */
1.30      cvs       169: THOT_EXPORT char      AmayaLastHTTPErrorMsg [MAX_LENGTH];
1.29      kahan     170: /* the reason string sent by the server */
1.30      cvs       171: THOT_EXPORT char      AmayaLastHTTPErrorMsgR [MAX_LENGTH];
1.1       cvs       172: THOT_EXPORT HTList      *conv; /* List of global converters */
                    173: THOT_EXPORT AmayaContext *Amaya;       /* Amaya's request global context    */
                    174: #endif /* AMAYA_LIBWWW_H */
1.15      cvs       175: 

Webmaster