Added README, LICENSE, Makefile for future PDP-11 Unix FUSE fs driver project.
[pdp11-unix-fusefs] / fs.h
CommitLineData
845dfc67
AT
1#define FUSE_USE_VERSION 31
2#include <stdio.h>
3#include <stdlib.h>
4#include <string.h>
5#include <stdarg.h>
6#include <stdint.h>
7#include <assert.h>
8#include <errno.h>
9#include <fcntl.h>
10#include <dirent.h>
11#include <time.h>
12#include <sys/sysmacros.h>
13
14
15#define nil NULL
16typedef int8_t int8;
17typedef uint8_t uint8;
18typedef uint16_t uint16;
19typedef int16_t int16;
20typedef uint32_t uint32;
21typedef int32_t int32;
22typedef unsigned int uint;
23
24#define USED(x) ((void)x)
25
26/* the data containing our file system */
27extern uint8 *fsdata;
28extern int fslen;
29
30void panic(char *fmt, ...);
31void *emalloc(int size);
32FILE *mustopen(const char *name, const char *mode);
33
34typedef struct Dirbuf Dirbuf;
35struct Dirbuf
36{
37 char *p;
38 size_t size;
39};
40
41typedef struct DInode DInode;
42struct DInode;
43
44typedef struct Inode Inode;
45struct Inode
46{
47 int count;
48 int ino; /* not really needed */
49 DInode *i;
50};
51
52void fs_init(void);
53Inode *fs_iget(uint ino);
54void fs_iput(Inode *ip);
55int fs_open(uint ino, int flags);
56int fs_stat(uint ino, struct stat *stbuf);
57int fs_read(uint ino, void *vdst, int offset, int len);
58int fs_write(uint ino, void *vsrc, int offset, int len);
59struct dirent *fs_readdir(uint ino);
60int fs_mknod(uint ino, const char *name, mode_t mode, dev_t rdev, uint *newino);
61int fs_mkdir(uint ino, const char *name, mode_t mode);
62int fs_unlink(uint parent, const char *name);
63int fs_link(uint ino, uint parent, const char *name);
64int fs_atime(uint ino, int32 time);
65int fs_mtime(uint ino, int32 time);
66int fs_uid(uint ino, int32 uid);
67int fs_gid(uint ino, int32 gid);
68
69void dcheck(void);