DVBCore  1.0
Open source DVB engine
platform/inc/stbhwdsk.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2004 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  * 
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  * 
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00024 // pre-processor mechanism so multiple inclusions don't cause compilation error
00025 
00026 #ifndef _STBHWDSK_H
00027 
00028 #define _STBHWDSK_H
00029 
00030 //---Constant and macro definitions for public use-----------------------------
00031 
00032 #define INVALID_DISK_ID       0xffff
00033 
00034 //---Enumerations for public use-----------------------------------------------
00035 
00036 typedef enum
00037 {
00038    FILE_MODE_READ,
00039    FILE_MODE_WRITE,
00040    FILE_MODE_OVERWRITE
00041 } E_STB_DSK_FILE_MODE;
00042 
00043 typedef enum
00044 {
00045    FILE_POSITION_START,
00046    FILE_POSITION_END,
00047    FILE_POSITION_CURRENT
00048 } E_STB_DSK_FILE_POSITION;
00049 
00050 typedef enum
00051 {
00052    DIR_ENTRY_FILE,
00053    DIR_ENTRY_DIRECTORY,
00054    DIR_ENTRY_OTHER
00055 } E_STB_DIR_ENTRY_TYPE;
00056 
00057 
00058 //---Global type defs for public use-------------------------------------------
00059 
00060 //---Global Function prototypes for public use---------------------------------
00064 void STB_DSKInitialise(void);
00065 
00070 U16BIT STB_DSKGetNumDisks(void);
00071 
00077 U16BIT STB_DSKGetDiskIdByIndex(U16BIT index);
00078 
00084 BOOLEAN STB_DSKIsRemoveable(U16BIT disk_id);
00085 
00091 BOOLEAN STB_DSKIsMounted(U16BIT disk_id);
00092 
00098 BOOLEAN STB_DSKMountDisk(U16BIT disk_id);
00099 
00105 BOOLEAN STB_DSKUnmountDisk(U16BIT disk_id);
00106 
00114 BOOLEAN STB_DSKGetDiskName(U16BIT disk_id, U8BIT *name, U16BIT name_len);
00115 
00120 void STB_DSKSetStandby(BOOLEAN state);
00121 
00128 void* STB_DSKOpenFile(U16BIT disk_id, U8BIT *name, E_STB_DSK_FILE_MODE mode);
00129 
00137 U32BIT STB_DSKReadFile(void *file, U8BIT *data, U32BIT size);
00138 
00146 U32BIT STB_DSKWriteFile(void *file, U8BIT *data, U32BIT size);
00147 
00155 BOOLEAN STB_DSKSeekFile(void *file, E_STB_DSK_FILE_POSITION position, S32BIT offset);
00156 
00163 BOOLEAN STB_DSKTellFile(void *file, U32BIT *offset);
00164 
00169 void STB_DSKCloseFile(void *file);
00170 
00177 BOOLEAN STB_DSKDeleteFile(U16BIT disk_id, U8BIT *filename);
00178 
00185 BOOLEAN STB_DSKFileExists(U16BIT disk_id, U8BIT *filename);
00186 
00194 BOOLEAN STB_DSKFileSize(U16BIT disk_id, U8BIT *filename, U32BIT *filesize);
00195 
00202 void* STB_DSKOpenDirectory(U16BIT disk_id, U8BIT *dir_name);
00203 
00213 BOOLEAN STB_DSKReadDirectory(void *dir, U8BIT *filename, U16BIT filename_len,
00214    E_STB_DIR_ENTRY_TYPE *entry_type);
00215 
00220 void STB_DSKCloseDirectory(void *dir);
00221 
00228 BOOLEAN STB_DSKCreateDirectory(U16BIT disk_id, U8BIT *dir_path);
00229 
00235 BOOLEAN STB_DSKDeleteDirectory(U16BIT disk_id, U8BIT *dir_name);
00236 
00247 BOOLEAN STB_DSKFullPathname(U16BIT disk_id, U8BIT *filename, U8BIT *pathname, U16BIT max_pathname_len);
00248 
00253 U32BIT STB_DSKGetSize(U16BIT disk_id);
00254 
00260 U32BIT STB_DSKGetUsed(U16BIT disk_id);
00261 
00266 void STB_DSKFormat(U16BIT disk_id);
00267 
00272 U8BIT STB_DSKGetFormatProgress(U16BIT disk_id);
00273 
00278 BOOLEAN STB_DSKIsFormatted(U16BIT disk_id);
00279 
00283 void STB_DSKRepair(U16BIT disk_id);
00284 
00289 U8BIT STB_DSKGetRepairProgress(U16BIT disk_id);
00290 
00295 BOOLEAN STB_DSKGetIntegrity(U16BIT disk_id);
00296 
00297 #endif //  _STBHWDSK_H
00298 
All Data Structures Files Functions Typedefs Defines