File: remote.h

package info (click to toggle)
avfs 1.2.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,916 kB
  • sloc: ansic: 31,364; sh: 6,482; perl: 1,916; makefile: 351
file content (54 lines) | stat: -rw-r--r-- 1,230 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
    AVFS: A Virtual File System Library
    Copyright (C) 2000-2001  Miklos Szeredi <miklos@szeredi.hu>

    This program can be distributed under the terms of the GNU GPL.
    See the file COPYING.
*/

#include "avfs.h"
#define REM_LIST_SINGLE (1 << 0)
#define REM_LIST_PARENT (1 << 1)

struct remdirent {
    char *name;
    char *linkname;
    struct avstat attr;
};

struct remhostpath {
    char *host;
    char *path;
};

struct remdirlist {
    int flags;
    struct remhostpath hostpath;
    avsize_t num;
    struct remdirent *ents;
};

struct remgetparam {
    struct remhostpath hostpath;
    char *localname;
    void *data;
};

#define REM_DIR_ONLY (1 << 0)
#define REM_NOCASE   (1 << 1)

struct remote {
    void *data;
    char *name;
    int flags;

    int (*list) (struct remote *rem, struct remdirlist *dl);
    int (*get) (struct remote *rem, struct remgetparam *gp);
    int (*wait) (struct remote *rem, void *data, avoff_t end);
    void (*destroy) (struct remote *rem);
};

int av_remote_init(struct vmodule *module, struct remote *rem,
                     struct avfs **resp);
void av_remote_add(struct remdirlist *dl, const char *name,
                     const char *linkname, struct avstat *attr);