Harlequin RIP SDK

Simple API for managing an in-memory, virtual file system. More...

#include "std.h"
#include "swdevice.h"

Data Structures

struct  _MFSFILE
 Describes a file. More...
 
struct  _MFSDIR
 Describes a directory. More...
 
struct  _MFSNODE
 Describes a node, which is a named entry within the filesystem, and is either a file or a directory. More...
 
struct  _MFSITERELEMENT
 Helper structure for storing the state of an iteration. More...
 
struct  _MFSITERSTATE
 Encapsulates the current state of an iteration. More...
 

Macros

#define COMPRESS_NEW_FILES   TRUE
 Tune this to decide whether compression should be applied to new files created at run-time. More...
 

Typedefs

typedef struct _MFSFILE MFSFILE
 Describes a file.
 
typedef struct _MFSDIR MFSDIR
 Describes a directory.
 
typedef struct _MFSNODE MFSNODE
 Describes a node, which is a named entry within the filesystem, and is either a file or a directory. More...
 
typedef struct _MFSFILEDESC MFSFILEDESC
 Encapsulates the information required to control access to an open file.
 
typedef struct _MFSITERELEMENT MFSITERELEMENT
 Helper structure for storing the state of an iteration.
 
typedef struct _MFSITERSTATE MFSITERSTATE
 Encapsulates the current state of an iteration. More...
 

Enumerations

enum  { MFS_File , MFS_Directory }
 A node within the filesystem is either a file or a directory, and we use these markers to indicate which. More...
 

Functions

MFSNODEMFSFindRelative (MFSNODE *pRoot, char *pszFilename, MFSNODE **ppParent, uint32 *pIndex, DEVICE_result *err)
 Locate a file node, relative to the given root, according to its pathname. More...
 
HqBool MFSOpen (MFSNODE *pRoot, char *pszFilename, int32 openFlags, MFSFILEDESC **ppDesc, DEVICE_result *err)
 Open or create a file for reading and/or writing. More...
 
HqBool MFSClose (MFSFILEDESC *pDesc)
 Close a file that was previously opened with MFSOpen(). More...
 
MFSFILEMFSGetFile (MFSFILEDESC *pDesc)
 Return the underlying file from its open descriptor. More...
 
int32 MFSRead (MFSFILEDESC *pDesc, uint8 *buffer, int32 cbLen, DEVICE_result *err)
 Read a specified number of bytes from the current location of an open file. More...
 
int32 MFSWrite (MFSFILEDESC *pDesc, uint8 *buffer, int32 cbLen, DEVICE_result *err)
 Write a specified number of bytes to an open file at the current location, expanding the file as necessary. More...
 
int32 MFSWriteString (MFSFILEDESC *pDesc, char *pszString, DEVICE_result *err)
 Write a specified NUL-terminated character string to an open file at the current location, expanding the file as necessary. The terminating NUL character itself is not written. More...
 
HqBool MFSSeek (MFSFILEDESC *pDesc, Hq32x2 *pDestination, int32 flags, DEVICE_result *err)
 Set (or query) the current the position in an open file. More...
 
HqBool MFSAvail (MFSFILEDESC *pDesc, Hq32x2 *pAvail, int32 reasonFlag)
 Determine the number of bytes that are currently available to be read from an open file. More...
 
HqBool MFSSetCompression (MFSFILEDESC *pDesc, HqBool fCompress)
 Controls whether the file's data buffer will be compressed (or re-compressed) when the file is closed. More...
 
int32 MFSDelete (MFSNODE *pRoot, char *pszFilename, DEVICE_result *err)
 Delete a file or directory, and completely release all of its associated memory resources. More...
 
int32 MFSRename (MFSNODE *pRoot, char *pszFromName, char *pszToName, DEVICE_result *err)
 Rename a file, preserving all of its contents and other properties. More...
 
MFSITERSTATEMFSIterBegin (MFSNODE *pRoot, void *pPrivate)
 Begin an iteration over all or part of the file system. More...
 
HqBool MFSIterNext (MFSITERSTATE *pState)
 Proceed to the first (or next) file in an iteration sequence. More...
 
void MFSIterEnd (MFSITERSTATE *pState)
 Close an iteration sequence. More...
 
MFSNODEMFSIterNode (MFSITERSTATE *pState)
 Obtain a direct pointer to the MFS_File node of the current iteration step. More...
 
uint32 MFSIterNameLength (MFSITERSTATE *pState, HqBool fLeadingSlash)
 Obtain the pathname length of the file at the current iteration step. More...
 
HqBool MFSIterName (MFSITERSTATE *pState, char *pszFilenameBuf, uint32 bufLen, HqBool fLeadingSlash)
 Obtain the pathname of the file at the current iteration step. More...
 
MFSNODEMFSNewRoot (char *pszRootName)
 Construct and return a completely new root directory node. More...
 
MFSNODEMFSCopyTree (MFSNODE *pMFSRoot, HqBool fCopyFileData)
 Construct and return a completely new filesystem tree by making a recursive copy of the given tree. More...
 
void MFSReleaseRoot (MFSNODE *pMFSRoot)
 Destroy the given root node, and the entire virtual filesystem descended from it. More...
 
void MFSMemUsage (MFSNODE *pNode, uint32 *pROMSize, uint32 *pRAMSize)
 Calculate the amount of memory currently in use by the virtual filesystem descended from the given node. More...
 

Detailed Description

Simple API for managing an in-memory, virtual file system.