1 /*             ----> DO NOT REMOVE THE FOLLOWING NOTICE <----
2  *
3  *                 Copyright (c) 2014-2015 Datalight, Inc.
4  *                     All Rights Reserved Worldwide.
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License as published by
8  *  the Free Software Foundation; use version 2 of the License.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but "AS-IS," WITHOUT ANY WARRANTY; without even the implied warranty
12  *  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License along
16  *  with this program; if not, write to the Free Software Foundation, Inc.,
17  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 /*  Businesses and individuals that for commercial or other reasons cannot
21  *  comply with the terms of the GPLv2 license may obtain a commercial license
22  *  before incorporating Reliance Edge into proprietary software for
23  *  distribution in any form.  Visit http://www.datalight.com/reliance-edge for
24  *  more information.
25  */
26 
27 /** @file
28  */
29 #ifndef REDCOREAPI_H
30 #define REDCOREAPI_H
31 
32 
33 #include <redstat.h>
34 
35 
36 REDSTATUS RedCoreInit( void );
37 REDSTATUS RedCoreUninit( void );
38 
39 REDSTATUS RedCoreVolSetCurrent( uint8_t bVolNum );
40 
41 #if FORMAT_SUPPORTED
42     REDSTATUS RedCoreVolFormat( void );
43 #endif
44 #if REDCONF_CHECKER == 1
45     REDSTATUS RedCoreVolCheck( void );
46 #endif
47 REDSTATUS RedCoreVolMount( void );
48 REDSTATUS RedCoreVolUnmount( void );
49 #if REDCONF_READ_ONLY == 0
50     REDSTATUS RedCoreVolTransact( void );
51 #endif
52 #if REDCONF_API_POSIX == 1
53     REDSTATUS RedCoreVolStat( REDSTATFS * pStatFS );
54 #endif
55 
56 #if ( REDCONF_READ_ONLY == 0 ) && ( ( REDCONF_API_POSIX == 1 ) || ( REDCONF_API_FSE_TRANSMASKSET == 1 ) )
57     REDSTATUS RedCoreTransMaskSet( uint32_t ulEventMask );
58 #endif
59 #if ( REDCONF_API_POSIX == 1 ) || ( REDCONF_API_FSE_TRANSMASKGET == 1 )
60     REDSTATUS RedCoreTransMaskGet( uint32_t * pulEventMask );
61 #endif
62 
63 #if ( REDCONF_READ_ONLY == 0 ) && ( REDCONF_API_POSIX == 1 )
64     REDSTATUS RedCoreCreate( uint32_t ulPInode,
65                              const char * pszName,
66                              bool fDir,
67                              uint32_t * pulInode );
68 #endif
69 #if ( REDCONF_READ_ONLY == 0 ) && ( REDCONF_API_POSIX == 1 ) && ( REDCONF_API_POSIX_LINK == 1 )
70     REDSTATUS RedCoreLink( uint32_t ulPInode,
71                            const char * pszName,
72                            uint32_t ulInode );
73 #endif
74 #if ( REDCONF_READ_ONLY == 0 ) && ( REDCONF_API_POSIX == 1 ) && ( ( REDCONF_API_POSIX_UNLINK == 1 ) || ( REDCONF_API_POSIX_RMDIR == 1 ) )
75     REDSTATUS RedCoreUnlink( uint32_t ulPInode,
76                              const char * pszName );
77 #endif
78 #if REDCONF_API_POSIX == 1
79     REDSTATUS RedCoreLookup( uint32_t ulPInode,
80                              const char * pszName,
81                              uint32_t * pulInode );
82 #endif
83 #if ( REDCONF_READ_ONLY == 0 ) && ( REDCONF_API_POSIX == 1 ) && ( REDCONF_API_POSIX_RENAME == 1 )
84     REDSTATUS RedCoreRename( uint32_t ulSrcPInode,
85                              const char * pszSrcName,
86                              uint32_t ulDstPInode,
87                              const char * pszDstName );
88 #endif
89 #if REDCONF_API_POSIX == 1
90     REDSTATUS RedCoreStat( uint32_t ulInode,
91                            REDSTAT * pStat );
92 #endif
93 #if REDCONF_API_FSE == 1
94     REDSTATUS RedCoreFileSizeGet( uint32_t ulInode,
95                                   uint64_t * pullSize );
96 #endif
97 
98 REDSTATUS RedCoreFileRead( uint32_t ulInode,
99                            uint64_t ullStart,
100                            uint32_t * pulLen,
101                            void * pBuffer );
102 #if REDCONF_READ_ONLY == 0
103     REDSTATUS RedCoreFileWrite( uint32_t ulInode,
104                                 uint64_t ullStart,
105                                 uint32_t * pulLen,
106                                 const void * pBuffer );
107 #endif
108 #if TRUNCATE_SUPPORTED
109     REDSTATUS RedCoreFileTruncate( uint32_t ulInode,
110                                    uint64_t ullSize );
111 #endif
112 
113 #if ( REDCONF_API_POSIX == 1 ) && ( REDCONF_API_POSIX_READDIR == 1 )
114     REDSTATUS RedCoreDirRead( uint32_t ulInode,
115                               uint32_t * pulPos,
116                               char * pszName,
117                               uint32_t * pulInode );
118 #endif
119 
120 
121 #endif /* ifndef REDCOREAPI_H */
122