HEAD: remove ridiculous dependency of wvmapi (actually wvtnef) on evolution
[wvapps.git] / funfs / wvfuse.h
blob632ca3c3e117e791f22fcead4d2312ad3bdbdf31
1 /*
2 * WvFUSE: A WvStreams library for FUSE.
3 * Copyright (C) 2002 Net Integration Technologies, Inc.
5 * This program can be distributed under the terms of the GNU GPL.
6 * See the file COPYING.
8 * This class implements the main FUSE functions: creating the filesystem,
9 * reading commands, creating objects to process the commands, maintaining
10 * nodes, etc.
13 #ifndef __WVFUSE_H
14 #define __WVFUSE_H
16 #include "wvfs.h"
17 #include "wvfuseinomgr.h"
19 #include <wvfdstream.h>
20 #include <wvstring.h>
21 #include <wvstreamlist.h>
22 #include <wvlog.h>
23 #include <uniconf.h>
25 #define FUSE_MAX_PATH 4096
26 #define FUSE_KERNEL_VERSION_ENV "_FUSE_KERNEL_VERSION"
28 typedef long unsigned int fino_t;
30 /** Enable debuging output */
31 #define FUSE_DEBUG (1 << 1)
33 #define FUSE_INVAL_FD 1
34 #define FUSE_INVAL_PATH 2
37 class MyFDStream : public WvFDStream
39 public:
40 MyFDStream(int fd) : WvFDStream(fd) {};
41 virtual void seterr(int errnum)
43 if (errnum != ENOENT) WvStream::seterr(errnum);
48 class WvFuse : public WvStreamList, public WvFuseInoMgr
50 public:
51 bool fs_unmounted;
53 WvFuse(WvFS *_fs, UniConf &_cfg);
54 virtual ~WvFuse();
56 virtual bool isok() const;
57 virtual int getfd() const;
59 void send_reply_raw(char *outbuf, size_t outsize);
61 void message_handler(int type, WvStringParm path);
63 protected:
64 virtual void execute();
66 void do_invalidate(fino_t ino);
68 WvFS *fs;
69 WvLog log;
70 MyFDStream s;
71 unsigned int flags;
74 #endif // __WVFUSE_H