Back to index

avfs  1.0.1
remote.h
Go to the documentation of this file.
00001 /*
00002     AVFS: A Virtual File System Library
00003     Copyright (C) 2000-2001  Miklos Szeredi <miklos@szeredi.hu>
00004 
00005     This program can be distributed under the terms of the GNU GPL.
00006     See the file COPYING.
00007 */
00008 
00009 #include "avfs.h"
00010 #define REM_LIST_SINGLE (1 << 0)
00011 #define REM_LIST_PARENT (1 << 1)
00012 
00013 struct remdirent {
00014     char *name;
00015     char *linkname;
00016     struct avstat attr;
00017 };
00018 
00019 struct remhostpath {
00020     char *host;
00021     char *path;
00022 };
00023 
00024 struct remdirlist {
00025     int flags;
00026     struct remhostpath hostpath;
00027     avsize_t num;
00028     struct remdirent *ents;
00029 };
00030 
00031 struct remgetparam {
00032     struct remhostpath hostpath;
00033     char *localname;
00034     void *data;
00035 };
00036 
00037 #define REM_DIR_ONLY (1 << 0)
00038 #define REM_NOCASE   (1 << 1)
00039 
00040 struct remote {
00041     void *data;
00042     char *name;
00043     int flags;
00044 
00045     int (*list) (struct remote *rem, struct remdirlist *dl);
00046     int (*get) (struct remote *rem, struct remgetparam *gp);
00047     int (*wait) (struct remote *rem, void *data, avoff_t end);
00048     void (*destroy) (struct remote *rem);
00049 };
00050 
00051 int av_remote_init(struct vmodule *module, struct remote *rem,
00052                      struct avfs **resp);
00053 void av_remote_add(struct remdirlist *dl, const char *name,
00054                      const char *linkname, struct avstat *attr);