HEAD: remove ridiculous dependency of wvmapi (actually wvtnef) on evolution
[wvapps.git] / funfs / funfs.h
blob4bfff7249142b893024c4dde02f4c259b7f13f47
1 #ifndef __FUNFS_H
2 #define __FUNFS_H
4 #include "wvfs.h"
5 #include "funfscommon.h"
7 #include <wvlog.h>
8 #include <wvbuf.h>
9 #include <wvhashtable.h>
10 #include <wvstreamclone.h>
11 #include <wvtcp.h>
12 #include <uniconf.h>
15 class FunFS : public WvFS, public WvStreamClone
17 public:
18 FunFS(UniConf _cfg);
19 virtual ~FunFS();
21 virtual bool isok() const;
22 virtual size_t write(WvStream *job, WvBuf &inbuf);
23 virtual size_t write(const void *buf, size_t count) { assert(0); }
24 virtual size_t write(WvBuf &inbuf, size_t count) { assert(0); }
26 void data_mode_execute(WvStream &, void *);
27 void line_mode_execute(WvStream &, void *);
29 /*** WvFS Stuff ***/
30 virtual int fs_chmod(CONTEXT, PATH, mode_t mode);
31 virtual int fs_chown(CONTEXT, PATH, uid_t uid, gid_t gid);
32 virtual int fs_getattr(CONTEXT, PATH, struct fuse_attr *attr);
33 virtual int fs_getdir(CONTEXT, PATH, WvFuseDirCb &cb);
34 virtual int fs_link(CONTEXT, PATH, WvStringParm to);
35 virtual int fs_mkdir(CONTEXT, PATH, mode_t mode);
36 virtual int fs_mknod(CONTEXT, PATH, mode_t mode, dev_t rdev);
37 virtual int fs_open(CONTEXT, PATH, int flags);
38 virtual int fs_readlink(CONTEXT, PATH, char *buf, size_t size);
39 virtual int fs_rename(CONTEXT, PATH, WvStringParm to);
40 virtual int fs_rmdir(CONTEXT, PATH);
41 virtual int fs_symlink(CONTEXT, PATH, WvStringParm to);
42 virtual int fs_unlink(CONTEXT, PATH);
43 virtual int fs_utime(CONTEXT, PATH, struct utimbuf *buf);
45 virtual int fs_release(CONTEXT, FD);
46 virtual int fs_read(CONTEXT, FD, char *buf, size_t size, off_t offset);
47 virtual int fs_truncate(CONTEXT, FD, off_t size);
48 virtual int fs_write(CONTEXT, FD, const char *buf, size_t size,
49 off_t offset);
51 virtual int fs_statfs(CONTEXT, struct fuse_kstatfs *fst);
53 virtual void set_message_callback(WvFSMessageCB cb)
54 { messagecb = cb; }
56 protected:
57 void got_reply(uint16 replyid);
58 void got_message();
60 bool reply_ready;
62 mutable bool ok;
63 WvTCPConn *&mycloned;
65 mutable WvLog log;
66 WvDynBuf xinbuf;
67 WvDynBuf xoutbuf;
69 WvMap<uint16, WvStream*> jobmap;
70 static uint16 jobid;
72 UniConf cfg;
74 WvFSMessageCB messagecb;
77 #endif // __FUNFS_H