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

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

Webmaster