|
DVBCore
1.0
Open source DVB engine
|
Function prototypes for disk functions. More...

Go to the source code of this file.
Defines | |
| #define | INVALID_DISK_ID 0xffff |
Enumerations | |
| enum | E_STB_DSK_FILE_MODE { FILE_MODE_READ, FILE_MODE_WRITE, FILE_MODE_OVERWRITE } |
| enum | E_STB_DSK_FILE_POSITION { FILE_POSITION_START, FILE_POSITION_END, FILE_POSITION_CURRENT } |
| enum | E_STB_DIR_ENTRY_TYPE { DIR_ENTRY_FILE, DIR_ENTRY_DIRECTORY, DIR_ENTRY_OTHER } |
Functions | |
| void | STB_DSKInitialise (void) |
| Initialise the hard disk component. | |
| U16BIT | STB_DSKGetNumDisks (void) |
| Returns the number of disks currently detected. | |
| U16BIT | STB_DSKGetDiskIdByIndex (U16BIT index) |
| Returns the id of the disk at the given index. | |
| BOOLEAN | STB_DSKIsRemoveable (U16BIT disk_id) |
| Checks if the given disk is removeable. | |
| BOOLEAN | STB_DSKIsMounted (U16BIT disk_id) |
| Checks if the given disk is mounted. | |
| BOOLEAN | STB_DSKMountDisk (U16BIT disk_id) |
| Attempts to mount the given disk, if it isn't already mounted. | |
| BOOLEAN | STB_DSKUnmountDisk (U16BIT disk_id) |
| Attempts to unmount the given disk, if it isn't already unmounted. | |
| BOOLEAN | STB_DSKGetDiskName (U16BIT disk_id, U8BIT *name, U16BIT name_len) |
| Gets the name of a disk and copies it into the array provided. | |
| void | STB_DSKSetStandby (BOOLEAN state) |
| Put all disks into or out of standby mode. | |
| void * | STB_DSKOpenFile (U16BIT disk_id, U8BIT *name, E_STB_DSK_FILE_MODE mode) |
| Opens an existing file or creates a new one. | |
| U32BIT | STB_DSKReadFile (void *file, U8BIT *data, U32BIT size) |
| Reads data from an open file. | |
| U32BIT | STB_DSKWriteFile (void *file, U8BIT *data, U32BIT size) |
| Writes data to an open file. | |
| BOOLEAN | STB_DSKSeekFile (void *file, E_STB_DSK_FILE_POSITION position, S32BIT offset) |
| Sets the read/write position of an open file. | |
| BOOLEAN | STB_DSKTellFile (void *file, U32BIT *offset) |
| Gets the current position in an open file. | |
| void | STB_DSKCloseFile (void *file) |
| Flushes and closes an open file. | |
| BOOLEAN | STB_DSKDeleteFile (U16BIT disk_id, U8BIT *filename) |
| Deletes the file from the given disk. | |
| BOOLEAN | STB_DSKFileExists (U16BIT disk_id, U8BIT *filename) |
| Checks whether a file/directory will the given name exists. | |
| BOOLEAN | STB_DSKFileSize (U16BIT disk_id, U8BIT *filename, U32BIT *filesize) |
| Returns the size in KB of the given file. | |
| void * | STB_DSKOpenDirectory (U16BIT disk_id, U8BIT *dir_name) |
| Opens a directory in order to read the entries. | |
| BOOLEAN | STB_DSKReadDirectory (void *dir, U8BIT *filename, U16BIT filename_len, E_STB_DIR_ENTRY_TYPE *entry_type) |
| Reads the next entry from the directory, returning the name of the entry and the type of the entry. | |
| void | STB_DSKCloseDirectory (void *dir) |
| Closes the directory for reading. | |
| BOOLEAN | STB_DSKCreateDirectory (U16BIT disk_id, U8BIT *dir_path) |
| Creates a directory with the given name. | |
| BOOLEAN | STB_DSKDeleteDirectory (U16BIT disk_id, U8BIT *dir_name) |
| Deletes a directory and all it contents, so use with care! | |
| BOOLEAN | STB_DSKFullPathname (U16BIT disk_id, U8BIT *filename, U8BIT *pathname, U16BIT max_pathname_len) |
| Copies the full pathname for the given filename, including the mount directory, to the given string array. | |
| U32BIT | STB_DSKGetSize (U16BIT disk_id) |
| Returns the size (capacity) of the disk. | |
| U32BIT | STB_DSKGetUsed (U16BIT disk_id) |
| Returns the amount of space used on the disk. | |
| void | STB_DSKFormat (U16BIT disk_id) |
| Initiates formatting and partitioning of the hard disk. This will erase all data on the disk! | |
| U8BIT | STB_DSKGetFormatProgress (U16BIT disk_id) |
| Gets the progress of the format operation. | |
| BOOLEAN | STB_DSKIsFormatted (U16BIT disk_id) |
| Queries whether the disk is formatted. | |
| void | STB_DSKRepair (U16BIT disk_id) |
| Initiates a data repair of the hard disk. This *may* cause the disk to become unreadable. | |
| U8BIT | STB_DSKGetRepairProgress (U16BIT disk_id) |
| Gets the progress of the repair operation. | |
| BOOLEAN | STB_DSKGetIntegrity (U16BIT disk_id) |
| Returns a summary of the disk integrity. | |
Function prototypes for disk functions.
| void STB_DSKCloseDirectory | ( | void * | dir | ) |
Closes the directory for reading.
| dir | directory handle |
| void STB_DSKCloseFile | ( | void * | file | ) |
Flushes and closes an open file.
| file | The file handle |
| BOOLEAN STB_DSKCreateDirectory | ( | U16BIT | disk_id, |
| U8BIT * | dir_path | ||
| ) |
Creates a directory with the given name.
| disk_id | disk on which the directory is to be created |
| dir_name | name of the directory to be created |
| BOOLEAN STB_DSKDeleteDirectory | ( | U16BIT | disk_id, |
| U8BIT * | dir_name | ||
| ) |
Deletes a directory and all it contents, so use with care!
| disk_id | disk |
| dir_name | name of the directory to be deleted |
| BOOLEAN STB_DSKDeleteFile | ( | U16BIT | disk_id, |
| U8BIT * | filename | ||
| ) |
Deletes the file from the given disk.
| disk_id | disk ID |
| filename | pathname on the disk of the file to be deleted |
| BOOLEAN STB_DSKFileExists | ( | U16BIT | disk_id, |
| U8BIT * | filename | ||
| ) |
Checks whether a file/directory will the given name exists.
| disk_id | disk ID |
| filename | pathname on the disk of the file |
| BOOLEAN STB_DSKFileSize | ( | U16BIT | disk_id, |
| U8BIT * | filename, | ||
| U32BIT * | filesize | ||
| ) |
Returns the size in KB of the given file.
| disk_id | disk on which the file exists |
| filename | name of the file on disk |
| filesize | returned value giving the file size in KB |
| BOOLEAN STB_DSKFullPathname | ( | U16BIT | disk_id, |
| U8BIT * | filename, | ||
| U8BIT * | pathname, | ||
| U16BIT | max_pathname_len | ||
| ) |
Copies the full pathname for the given filename, including the mount directory, to the given string array.
| disk_id | disk |
| filename | name of the file on the disk |
| pathname | array into which the full pathname will be copied |
| max_pathname_len | size of the pathname array |
| U16BIT STB_DSKGetDiskIdByIndex | ( | U16BIT | index | ) |
Returns the id of the disk at the given index.
| index | zero based index |
| BOOLEAN STB_DSKGetDiskName | ( | U16BIT | disk_id, |
| U8BIT * | name, | ||
| U16BIT | name_len | ||
| ) |
Gets the name of a disk and copies it into the array provided.
| disk_id | ID of the disk |
| name | array of U8BIT into which the name will be copied |
| name_len | max number of characters in the name |
| U8BIT STB_DSKGetFormatProgress | ( | U16BIT | disk_id | ) |
Gets the progress of the format operation.
| BOOLEAN STB_DSKGetIntegrity | ( | U16BIT | disk_id | ) |
Returns a summary of the disk integrity.
| U16BIT STB_DSKGetNumDisks | ( | void | ) |
Returns the number of disks currently detected.
| U8BIT STB_DSKGetRepairProgress | ( | U16BIT | disk_id | ) |
Gets the progress of the repair operation.
| U32BIT STB_DSKGetSize | ( | U16BIT | disk_id | ) |
Returns the size (capacity) of the disk.
| U32BIT STB_DSKGetUsed | ( | U16BIT | disk_id | ) |
Returns the amount of space used on the disk.
| disk_id | ID of the disk |
| BOOLEAN STB_DSKIsFormatted | ( | U16BIT | disk_id | ) |
Queries whether the disk is formatted.
| BOOLEAN STB_DSKIsMounted | ( | U16BIT | disk_id | ) |
Checks if the given disk is mounted.
| disk_id | ID of the disk to be checked |
| BOOLEAN STB_DSKIsRemoveable | ( | U16BIT | disk_id | ) |
Checks if the given disk is removeable.
| disk_id | ID of the disk to be checked |
| BOOLEAN STB_DSKMountDisk | ( | U16BIT | disk_id | ) |
Attempts to mount the given disk, if it isn't already mounted.
| disk_id | ID of the disk to be mounted |
| void* STB_DSKOpenDirectory | ( | U16BIT | disk_id, |
| U8BIT * | dir_name | ||
| ) |
Opens a directory in order to read the entries.
| disk_id | disk containing to the directory to be read |
| dir_name | name of the directory to open |
| void* STB_DSKOpenFile | ( | U16BIT | disk_id, |
| U8BIT * | name, | ||
| E_STB_DSK_FILE_MODE | mode | ||
| ) |
Opens an existing file or creates a new one.
| name | The filename (including path) |
| mode | The access mode |
| BOOLEAN STB_DSKReadDirectory | ( | void * | dir, |
| U8BIT * | filename, | ||
| U16BIT | filename_len, | ||
| E_STB_DIR_ENTRY_TYPE * | entry_type | ||
| ) |
Reads the next entry from the directory, returning the name of the entry and the type of the entry.
| dir | handle returned when the directory was opened |
| filename | array in which the name is returned |
| filename_len | size of the filename array |
| entry_type | type of entry |
| U32BIT STB_DSKReadFile | ( | void * | file, |
| U8BIT * | data, | ||
| U32BIT | size | ||
| ) |
Reads data from an open file.
| file | The file handle |
| data | The caller's buffer |
| size | Number of bytes to be read |
| BOOLEAN STB_DSKSeekFile | ( | void * | file, |
| E_STB_DSK_FILE_POSITION | position, | ||
| S32BIT | offset | ||
| ) |
Sets the read/write position of an open file.
| file | The file handle |
| position | Position to move relative to, i.e. start,end,current |
| offset | Where to move to relative to position |
| void STB_DSKSetStandby | ( | BOOLEAN | state | ) |
Put all disks into or out of standby mode.
| state | standby mode, TRUE=Standby FALSE=On |
| BOOLEAN STB_DSKTellFile | ( | void * | file, |
| U32BIT * | offset | ||
| ) |
Gets the current position in an open file.
| file | The file handle |
| offset | Variable to contain result (byte position in file) |
| BOOLEAN STB_DSKUnmountDisk | ( | U16BIT | disk_id | ) |
Attempts to unmount the given disk, if it isn't already unmounted.
| disk_id | ID of the disk to be unmounted |
| U32BIT STB_DSKWriteFile | ( | void * | file, |
| U8BIT * | data, | ||
| U32BIT | size | ||
| ) |
Writes data to an open file.
| file | The file handle |
| data | Pointer to the data to be written |
| size | Number of bytes to write |