Import backup from 2004-04-03
This commit is contained in:
1 parent
7110307896
commit
6236c341dd
21 files changed
+1778
-82
No files matched your search
@@ -0,0 +1,22 @@
|
||||
// loop.c
|
||||
// Author: Josh Holtrop
|
||||
// Date: 03/16/04
|
||||
// Provides a loop-back device for mounting files on existing volumes as new volumes
|
||||
|
||||
#include "hos_defines.h"
|
||||
#include "loop.h"
|
||||
#include "fs/vfs.h"
|
||||
|
||||
int loop_readSector(LoopDevice *ld, dword sector, byte *buffer)
|
||||
{
|
||||
return vfs_readFileBlock(ld->vol, ld->filePath, sector * LOOP_SECTOR_SIZE, buffer, LOOP_SECTOR_SIZE);
|
||||
}
|
||||
|
||||
|
||||
int loop_writeSector(LoopDevice *ld, dword sector, byte *buffer)
|
||||
{
|
||||
return vfs_writeFileBlock(ld->vol, ld->filePath, sector * LOOP_SECTOR_SIZE, buffer, LOOP_SECTOR_SIZE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// loop.h
|
||||
// Author: Josh Holtrop
|
||||
// Date: 03/16/04
|
||||
// Provides a loop-back device for mounting files on existing volumes as new volumes
|
||||
|
||||
#ifndef __HOS_LOOP__
|
||||
#define __HOS_LOOP__ __HOS_LOOP__
|
||||
|
||||
#include "hos_includes.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Volume *vol;
|
||||
char filePath[256];
|
||||
} LoopDevice;
|
||||
|
||||
int loop_readSector(LoopDevice *ld, dword sector, byte *buffer);
|
||||
int loop_writeSector(LoopDevice *ld, dword sector, byte *buffer);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user