file.h
ubixos/types.h
ubixfs/dirCache.h
vfs/mount.h
src/sys/include/devfs/devfs.h
src/sys/include/sys/kern_descrip.h
src/sys/include/ubixos/sched.h
src/sys/include/ubixos/syscalls.h
src/sys/include/vfs/vfs.h
src/sys/kernel/syscall.c
src/sys/net/netif/tcpdump.c
src/sys/ubixfs/block.c
src/sys/ubixfs/directory.c
src/sys/vfs/file.c
sys/thread.h
ubixos/types.h
sys/_types.h
src/sys/include/vfs/file.h
vfs/vfs.h
vfs/mount.h
ubixfs/dirCache.h
sys/sysproto.h
sys/signal.h
src/sys/ufs/ffs.c
src/sys/include/ufs/ufs.h
src/sys/include/ubixos/sched.h
src/sys/pci/hd.c
src/sys/net/netif/tcpdump.c
src/sys/include/ufs/ffs.h
src/sys/include/ubixos/endtask.h
src/sys/net/net/sys_arch.c
src/sys/kernel/vitals.c
src/sys/include/devfs/devfs.h
src/sys/mpi/message.c
src/sys/kmods/kmod.c
src/sys/mpi/system.c
src/sys/kernel/kern_sysctl.c
src/sys/include/ubixos/vitals.h
src/sys/kernel/pipe.c
src/sys/lib/kmalloc.c
src/sys/vmm/paging.c
src/sys/ubixfs/directory.c
src/sys/ufs/ufs.c
src/sys/kernel/kern_sig.c
src/sys/kernel/ubthread.c
src/sys/kernel/systemtask.c
src/sys/net/netif/ethernetif.c
src/sys/lib/ogprintf.cc
src/sys/kernel/ld.c
src/sys/include/vfs/file.h
src/sys/kernel/fork.c
src/sys/net/api/tcpip.c
src/sys/ubixfs/block.c
src/sys/kernel/sched.c
src/sys/net/net/shell.c
src/sys/include/mpi/mpi.h
src/sys/include/ubixos/fork.h
src/sys/ubixfs/dirCache.c
src/sys/ubixfs/ubixfs.c
src/sys/net/net/init.c
src/sys/include/vfs/vfs.h
src/sys/include/vfs/mount.h
src/sys/init/main.c
src/sys/include/ubixfs/ubixfs.h
src/sys/kernel/bioscall.c
src/sys/include/sys/kern_descrip.h
src/sys/include/ubixos/ubthread.h
src/sys/kernel/syscall.c
src/sys/isa/ne2k.c
src/sys/include/ubixos/exec.h
src/sys/include/ubixos/syscalls.h
src/sys/include/pci/hd.h
src/sys/isa/atkbd.c
src/sys/vmm/pagefault.c
src/sys/ubixfs/thread.c
src/sys/include/ubixos/init.h
src/sys/vfs/mount.c
src/sys/devfs/devfs.c
src/sys/kernel/time.c
src/sys/vmm/vmm_memory.c
src/sys/kernel/spinlock.c
src/sys/kernel/kern_descrip.c
src/sys/kernel/endtask.c
src/sys/vfs/file.c
src/sys/sys/idt.c
src/sys/kernel/gen_calls.c
src/sys/kernel/syscall_new.c
src/sys/kernel/exec.c
src/sys/include/sys/buf.h
src/sys/isa/fdc.c
src/sys/vmm/getfreevirtualpage.c
src/sys/vfs/vfs.c
dmadat
fileDescriptorStruct
userFileDescriptorStruct
DEV_BSHIFT
9
DEV_BSIZE
(1<<DEV_BSHIFT)
SBLOCKSIZE
8192
SEEK_SET
0x0
DiskFS::read
DiskFS::write
VBLKSHIFT
12
fsread
VBLKSIZE
(1 << VBLKSHIFT)
fsread
fileDescriptorStruct typedef struct fileDescriptorStruct fileDescriptor fileDescriptor
userFileDescriptorStruct typedef struct userFileDescriptorStruct userFileDescriptor userFileDescriptor
void void chDir (const char *path) chDir const char * path
int int fclose (fileDescriptor *) fclose fileDescriptor * assert fdTable fdTable_lock kfree fileDescriptor::next NULL vitalsStruct::openFiles fileDescriptor::prev spinLock spinUnlock systemVitals x1 dev_ramDestroy dev_ramDrive execFile kmod_load ldEnable bTree::Save sysExec sysFclose sysMkDir systemTask
int int feof (fileDescriptor *fd) feof fileDescriptor * fd fdEof
int int fgetc (fileDescriptor *fd) fgetc fileDescriptor * fd fileDescriptor::offset sysFgetc
fileDescriptor * fileDescriptor* fopen (const char *, const char *) fopen const char * const char * fdOpen fdTable fdTable_lock fileAppend fileBinary fileRead fileWrite kfree kmalloc kprintf fileDescriptor::next NULL fileDescriptor::offset vitalsStruct::openFiles fileDescriptor::prev spinLock spinUnlock sprintf strcpy strstr strtok systemVitals vfs_findMount dev_ramDestroy dev_ramDrive DiskFS::DiskFS execFile kmod_load ldEnable bTree::Save sys_open sysExec sysFopen sysMkDir tcpdump_init
size_t size_t fread (void *ptr, size_t size, size_t nmemb, fileDescriptor *fd) fread void * ptr size_t size size_t nmemb fileDescriptor * fd assert fileDescriptor::offset dev_ramDrive execFile kmod_load ldEnable DiskFS::read read sysExec sysFread
int int fseek (fileDescriptor *, long, int) fseek fileDescriptor * long int fileDescriptor::offset execFile kmod_load ldEnable DiskFS::read sysExec DiskFS::write
size_t size_t fwrite (void *ptr, int size, int nmemb, fileDescriptor *fd) fwrite void * ptr int size int nmemb fileDescriptor * fd fileDescriptor::offset dev_ramDestroy bTree::Save sysFwrite DiskFS::write
void void sysChDir (const char *path) sysChDir const char * path _current osInfo::cwd taskStruct::oInfo sprintf strstr
void void sysFseek (userFileDescriptor *, long, int) sysFseek userFileDescriptor * long int userFileDescriptorStruct::fd NULL fileDescriptorStruct::offset
int int unlink (const char *path) unlink const char * path vfs_mountPoint::fs vfs_mountPoint::mountPoint NULL strtok vfs_findMount fileSystem::vfsUnlink sysUnlink
char * char* verifyDir (const char *path) verifyDir const char * path
fileDescriptor * fileDescriptor* fdTable fdTable fclose fopen

    /**************************************************************************************
    Copyright(c)2002TheUbixOSProject
    Allrightsreserved.

    Redistributionanduseinsourceandbinaryforms,withorwithoutmodification,arepermittedprovidedthatthefollowingconditionsaremet:

    Redistributionsofsourcecodemustretaintheabovecopyrightnotice,thislistofconditions,thefollowingdisclaimerandthelistofauthors.
    Redistributionsinbinaryformmustreproducetheabovecopyrightnotice,thislistofconditions,thefollowingdisclaimerandthelistofauthors
    inthedocumentationand/orothermaterialsprovidedwiththedistribution.NeitherthenameoftheUbixOSProjectnorthenamesofits
    contributorsmaybeusedtoendorseorpromoteproductsderivedfromthissoftwarewithoutspecificpriorwrittenpermission.

    THISSOFTWAREISPROVIDEDBYTHECOPYRIGHTHOLDERSANDCONTRIBUTORS"ASIS"ANDANYEXPRESSORIMPLIED
    WARRANTIES,INCLUDING,BUTNOTLIMITEDTO,THEIMPLIEDWARRANTIESOFMERCHANTABILITYANDFITNESSFORAPARTICULAR
    PURPOSEAREDISCLAIMED.INNOEVENTSHALLTHECOPYRIGHTOWNERORCONTRIBUTORSBELIABLEFORANYDIRECT,INDIRECT,
    INCIDENTAL,SPECIAL,EXEMPLARY,ORCONSEQUENTIALDAMAGES(INCLUDING,BUTNOTLIMITEDTO,PROCUREMENTOFSUBSTITUTE
    GOODSORSERVICES;LOSSOFUSE,DATA,ORPROFITS;ORBUSINESSINTERRUPTION)HOWEVERCAUSEDANDONANYTHEORY
    OFLIABILITY,WHETHERINCONTRACT,STRICTLIABILITY,ORTORT(INCLUDINGNEGLIGENCEOROTHERWISE)ARISINGINANYWAY
    OUTOFTHEUSEOFTHISSOFTWARE,EVENIFADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGE.

    $Id: include_2vfs_2file_8h.xml 88 2016-01-12 00:11:29Z reddawg $

    **************************************************************************************/

    #ifndef_FILE_H
    #define_FILE_H

    #include<ubixos/types.h>
    #include<ubixfs/dirCache.h>
    #include<vfs/mount.h>

    #defineSEEK_SET0x0

    #defineVBLKSHIFT12
    #defineVBLKSIZE(1<<VBLKSHIFT)
    #defineSBLOCKSIZE8192
    #defineDEV_BSHIFT9/*log2(DEV_BSIZE)*/
    #defineDEV_BSIZE(1<<DEV_BSHIFT)

    structdmadat{
    charblkbuf[VBLKSIZE];/*filesystemblocks*/
    charindbuf[VBLKSIZE];/*indirblocks*/
    charsbbuf[SBLOCKSIZE];/*superblock*/
    charsecbuf[DEV_BSIZE];/*forMBR/disklabel*/
    };

    typedefstructfileDescriptorStruct{
    structfileDescriptorStruct*prev;
    structfileDescriptorStruct*next;
    structvfs_mountPoint*mp;
    uInt16status;
    uInt16mode;
    uInt32offset;
    uInt32size;
    uInt16length;
    uInt32start;
    charfileName[512];
    char*buffer;
    uInt32ino;
    structcacheNode*cacheNode;
    uInt32perms;
    structdmadat*dmadat;
    intdsk_meta;
    uInt32resid;
    }fileDescriptor;

    typedefstructuserFileDescriptorStruct{
    structfileDescriptorStruct*fd;
    uInt32fdSize;
    }userFileDescriptor;

    externfileDescriptor*fdTable;

    fileDescriptor*fopen(constchar*,constchar*);
    intfclose(fileDescriptor*);

    /*UBU*/

    intunlink(constchar*path);
    intfeof(fileDescriptor*fd);
    intfgetc(fileDescriptor*fd);
    size_tfread(void*ptr,size_tsize,size_tnmemb,fileDescriptor*fd);
    size_tfwrite(void*ptr,intsize,intnmemb,fileDescriptor*fd);
    intfseek(fileDescriptor*,long,int);

    voidsysFseek(userFileDescriptor*,long,int);

    //Good
    voidsysChDir(constchar*path);
    voidchDir(constchar*path);
    char*verifyDir(constchar*path);

    #endif