58 lines
1.4 KiB
C
58 lines
1.4 KiB
C
|
/***** vfs.h *********************************************************
|
||
|
* (c) 2010 CTA Systems Inc. All rights reserved. Glory To God *
|
||
|
* *
|
||
|
* Virtual File System (VFS) Implementation *
|
||
|
* ======================================== *
|
||
|
* *
|
||
|
************************************************************ cta os */
|
||
|
#ifndef __VFS__H___
|
||
|
#define __VFS__H___
|
||
|
|
||
|
#include <time.h>
|
||
|
|
||
|
typedef enum {
|
||
|
FileTypeInvalid,
|
||
|
FileTypeFile,
|
||
|
FileTypeDirectory,
|
||
|
FileTypeSymbolicLink
|
||
|
} FileType;
|
||
|
|
||
|
enum FileFlags {
|
||
|
FileFlagReadOnly = 0x1,
|
||
|
FileFlagHidden = 0x2,
|
||
|
FileFlagSystem = 0x4,
|
||
|
FileFlagVolumeID = 0x8,
|
||
|
FileFlagDirectory = 0x10,
|
||
|
FileFlagArchive = 0x20
|
||
|
};
|
||
|
|
||
|
|
||
|
typedef struct {
|
||
|
char Name[256];
|
||
|
FileType Type;
|
||
|
unsigned Flags;
|
||
|
unsigned Length;
|
||
|
unsigned EndOfFile;
|
||
|
unsigned ID;
|
||
|
unsigned Position, CurrentCluster;
|
||
|
unsigned Device;
|
||
|
TIME Created;
|
||
|
DATE LastAccessed;
|
||
|
TIME LastModified;
|
||
|
} File, *FilePointer;
|
||
|
|
||
|
|
||
|
typedef struct {
|
||
|
char Name[256];
|
||
|
|
||
|
File (*Directory) (const char* DirectoryName);
|
||
|
void (*Mount) ();
|
||
|
void (*Read) (FilePointer, unsigned char*, unsigned);
|
||
|
void (*Close) (FilePointer);
|
||
|
FILE (*Open) (const char*);
|
||
|
|
||
|
} FileSystem, *FileSystemPointer;
|
||
|
|
||
|
|
||
|
#endif
|