wm: teppich

ref: 48cc33b5b8717b83c4dea9130c4396b451480c56
dir: /include/vfs.h/

View raw version
#pragma once
#include <u.h>

#define NAME_MAX 64
#define PATH_MAX 64

enum
{
	NOTREADY = 0,
	READY
}FS_STATE;

typedef struct
{
	uint32 fid;
	uint32 size;

	uint16 owner;
	uint16 group;
	uint16 muser;
	
	uint16 perms;
	
	uint32 mtime;
	uint32 ctime;

	char *name;
	char *path;

	char *buf;
	
}file_t;

typedef struct
{
	uint32 fid;

	uint8 state; /* FS_TYPES */
	
	ll_t *users;
	ll_t *files;
}fs_t;

typedef struct
{
	char *name;
	fs_t* (*init)();
}mnt_t;

ll_t* dirread(fs_t *fs, file_t *dir);
char* dirname(char *s, char c);

file_t* pathtofile(fs_t *fs, char *path, char *name);
fs_t* getfs(char *path);