MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
stb_nvm.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2014 Ocean Blue Software Ltd
4  *
5  * This file is part of a DTVKit Software Component
6  * You are permitted to copy, modify or distribute this file subject to the terms
7  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
8  *
9  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
10  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
11  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
12  *
13  * If you or your organisation is not a member of DTVKit then you have access
14  * to this source code outside of the terms of the licence agreement
15  * and you are expected to delete this and any associated files immediately.
16  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
17  *******************************************************************************/
25 #ifndef _STB_NVM_H
26 #define _STB_NVM_H
27 
28 #include "techtype.h"
29 
30 /*---Constant and macro definitions for public use-----------------------------*/
31 
32 /*---Enumerations for public use-----------------------------------------------*/
33 
34 typedef enum
35 {
36  FILE_MODE_READ,
37  FILE_MODE_WRITE,
38  FILE_MODE_OVERWRITE
39 } E_STB_DSK_FILE_MODE;
40 
41 typedef enum
42 {
43  FILE_POSITION_START,
44  FILE_POSITION_END,
45  FILE_POSITION_CURRENT
46 } E_STB_DSK_FILE_POSITION;
47 
48 typedef enum
49 {
50  DIR_ENTRY_FILE,
51  DIR_ENTRY_DIRECTORY,
52  DIR_ENTRY_OTHER
53 } E_STB_DIR_ENTRY_TYPE;
54 
55 
56 /*---Global type defs for public use-------------------------------------------*/
57 
58 /*---Global Function prototypes for public use---------------------------------*/
59 
66 BOOLEAN STB_NVMFileSize(U8BIT *filename, U32BIT *filesize);
67 
76 void* STB_NVMOpenFile(U8BIT *name, E_STB_DSK_FILE_MODE mode);
77 
82 void STB_NVMCloseFile(void *file);
83 
91 U32BIT STB_NVMReadFile(void *file, U8BIT *data, U32BIT size);
92 
100 U32BIT STB_NVMWriteFile(void *file, U8BIT *data, U32BIT size);
101 
107 BOOLEAN STB_NVMDeleteFile(U8BIT *filename);
108 
114 void* STB_NVMOpenDirectory(U8BIT *dir_name);
115 
126 BOOLEAN STB_NVMReadDirectory(void *dir, U8BIT *filename, U16BIT filename_len,
127  E_STB_DIR_ENTRY_TYPE *entry_type);
128 
133 void STB_NVMCloseDirectory(void *dir);
134 
142 BOOLEAN STB_NVMMoveFile(U8BIT* oldname,U8BIT* newname);
143 
144 #endif /*_STB_NVM_H*/
void * STB_NVMOpenFile(U8BIT *name, E_STB_DSK_FILE_MODE mode)
Opens an existing file or creates a new one.
void STB_NVMCloseDirectory(void *dir)
Closes the directory for reading.
BOOLEAN STB_NVMMoveFile(U8BIT *oldname, U8BIT *newname)
Move/Rename a file or a directory. The original name and the new name may contain a path - the last e...
void STB_NVMCloseFile(void *file)
Flushes and closes an open file.
BOOLEAN STB_NVMFileSize(U8BIT *filename, U32BIT *filesize)
Returns the size in KB of the given file.
void * STB_NVMOpenDirectory(U8BIT *dir_name)
Opens a directory in order to read the entries.
U32BIT STB_NVMReadFile(void *file, U8BIT *data, U32BIT size)
Reads data from an open file.
System Wide Global Technical Data Type Definitions.
BOOLEAN STB_NVMReadDirectory(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...
U32BIT STB_NVMWriteFile(void *file, U8BIT *data, U32BIT size)
Writes data to an open file.
BOOLEAN STB_NVMDeleteFile(U8BIT *filename)
Deletes the file.