Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

uromfs.h File Reference

Micro-ROM file system definitions. More...

#include <sys/types.h>

Go to the source code of this file.

Data Structures

struct  _ROMENTRY
 Mikro-ROM directory entry structure. More...

struct  _ROMFILE
 Mikro-ROM file information structure. More...


Typedefs

typedef _ROMENTRY ROMENTRY
 Mikro-ROM directory entry type.

typedef _ROMFILE ROMFILE
 Mikro-ROM file information type.


Functions

ROMFILENutRomFileOpen (char *name)
 Opens an existing file for reading.

int NutRomFileClose (ROMFILE *romf)
 Close a previously opened file.

int NutRomFileRead (ROMFILE *romf, void *data, size_t size)
 Read data from a file.

int NutRomFileSize (ROMFILE *romf)
 Retrieve the size of a file.

int NutRomFileSeek (ROMFILE *romf, int pos)
 Move the file pointer to a new position.


Variables

ROMENTRYromEntryList
 Linked list of all microROM files.


Detailed Description

Micro-ROM file system definitions.


Function Documentation

int NutRomFileClose ROMFILE   romf
 

Close a previously opened file.

Parameters:
romf  Identifies the file to close. This pointer must have been created by calling NutRomFileOpen().
Returns:
0 if the function is successful, -1 otherwise.

ROMFILE* NutRomFileOpen char *    name
 

Opens an existing file for reading.

Parameters:
name  Points to a string that specifies the name of the file to open. The name must exactly match the full pathname of the file.
Returns:
A pointer to a ROMFILE structure that can be used to read from the file and retrieve information about the file.

int NutRomFileRead ROMFILE   romf,
void *    data,
size_t    size
 

Read data from a file.

Read up to a specified number of bytes of data from a file into a buffer. The function may read fewer than the specified number of bytes if it reaches the end of the file.

Parameters:
romf  Identifies the file to read from. This pointer must have been created by calling NutRomFileOpen().
data  Points to the buffer that receives the data.
size  Specifies the number of bytes to read from the file.
Returns:
The number of bytes read from the file or -1 if an error occured.

int NutRomFileSeek ROMFILE   romf,
int    pos
 

Move the file pointer to a new position.

The file pointer is maintained by Nut/OS. It points to the next byte to be read from a file. The file pointer is automatically incremented for each byte read. When the file is opened, it is at position 0, the beginning of the file.

Parameters:
romf  Identifies the file to seek. This pointer must have been created by calling NutRomFileOpen().
pos  Specifies the new absolute position of the file pointer.
Returns:
0 if the function is successful, -1 otherwise.

int NutRomFileSize ROMFILE   romf
 

Retrieve the size of a file.

Parameters:
romf  Identifies the file to query. This pointer must have been created by calling NutRomFileOpen().
Returns:
The number of bytes in this file or -1 if an error occured.


Generated on Thu Jan 30 22:30:55 2003 for EduNet by doxygen1.2.18