Back to index

avfs  1.0.1
dav.h
Go to the documentation of this file.
00001 #ifndef INCLUDED_DAV_H
00002 #define INCLUDED_DAV_H 1
00003 
00004 #include "passwords.h"
00005 
00006 #include <ne_alloc.h>
00007 #include <http_request.h>
00008 #include <http_basic.h>
00009 #include <dav_basic.h>
00010 #include <dav_props.h>
00011 #include <uri.h>
00012 
00013 /* --------------------------------------------------------------------- */
00014 
00015 #define DAV_PARAM_SEP           ':'
00016 #define AV_MAX_DAV_CONNS        128
00017 
00018 /* --------------------------------------------------------------------- */
00019 
00023 struct av_dav_conn {
00024   http_session *sesh;
00025   char *user;
00026   char *password;
00027   struct uri uri;
00028   int isbusy;
00029 };
00030 
00031 struct av_dav_fdidat {
00032   struct uri *base_uri;
00033   char *tmpname;
00034   char *remote;
00035   int rdonly;
00036   int cursize;
00037   int error;
00038 };
00039 
00040 struct davdata {
00041   struct av_dav_conn allconns[AV_MAX_DAV_CONNS];
00042   struct pass_session sessions;
00043 };
00044 
00048 enum av_dav_resource_type {
00049     resr_normal = 0,
00050     resr_collection,
00051     resr_reference,
00052     resr_error
00053 };
00054 
00055 struct av_dav_resource {
00056     char *uri;
00057     char *displayname;
00058     enum av_dav_resource_type type;
00059     size_t size;
00060     time_t modtime;
00061     int is_executable;
00062     char *error_reason; /* error string returned for this resource */
00063     int error_status; /* error status returned for this resource */
00064     struct av_dav_resource *next;
00065 };
00066 
00067 extern void free_resource( struct av_dav_resource *res );
00068 extern void free_resource_list( struct av_dav_resource *res );
00069 
00070 /* --------------------------------------------------------------------- */
00071 
00072 extern int fetch_resource_list(struct av_dav_conn *conn,
00073                 const char *uri, int depth, int include_target,
00074                 struct av_dav_resource **reslist);
00075 
00076 /* --------------------------------------------------------------------- */
00077 
00078 #endif