fuse/include/fuse.h

64 lines
1.2 KiB
C

#ifndef FUSE_H
#define FUSE_H
#include <sys/types.h>
#define DEFAULTINODEMAX 128
#define DEFAULTBLOCKSIZE 512 // Size in bytes
typedef struct fuseArgStruct
{
int create;
int list;
int add;
int remove;
int extract;
char* toAdd;
char* toRemove;
char* toExtract;
char* fsname;
int fd;
int newfs;
int filefsname;
} fuseArgStruct;
typedef struct BlockStruct
{
char byte[DEFAULTBLOCKSIZE];
} BlockStruct;
typedef struct InodeStruct
{
char filePath[256];
off_t fileSize;
BlockStruct dataBlock;
} InodeStruct;
typedef struct SuperBlockStruct
{
blksize_t blockSize;
blkcnt_t blockCount;
} SuperBlockStruct;
typedef struct FBLStruct
{
int freeList[DEFAULTINODEMAX/32];
} FBLStruct;
typedef struct FileSystemStruct
{
SuperBlockStruct superBlock;
FBLStruct fbl;
InodeStruct inodes[DEFAULTINODEMAX];
} FileSystemStruct;
void Fuse(int argc, char* argv[]);
void FuseGetArgs(int argc, char* argv[], fuseArgStruct* fuseArgs);
void FuseGivenTest(fuseArgStruct* fuseArgs, char* programPath);
void FuseStructInit(fuseArgStruct* fuseStruct);
void FuseUsageError(char* programPath);
int zerosize(int fd);
int FindEmptyBitPosition(int number);
#endif