Embedded TCP/IP stack  4.7.0
fnet_fs_rom.h
1 /**************************************************************************
2 *
3 * Copyright 2008-2018 by Andrey Butok. FNET Community.
4 *
5 ***************************************************************************
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 ***************************************************************************
20 *
21 * FNET ROM FS API.
22 *
23 ***************************************************************************/
24 #ifndef _FNET_FS_ROM_H_
25 
26 #define _FNET_FS_ROM_H_
27 
28 #if (FNET_CFG_FS && FNET_CFG_FS_ROM) || defined(__DOXYGEN__)
29 
30 #include "fnet_fs.h"
31 
101 /**************************************************************************/
106 typedef struct fnet_fs_rom_node
107 {
108  const fnet_char_t *name;
110  const fnet_uint8_t *data;
120 
121 /**************************************************************************/
124 typedef struct fnet_fs_rom_image
125 {
126  const fnet_char_t *name;
128  fnet_uint32_t version;
136 
137 /**************************************************************************/
140 #define FNET_FS_ROM_NAME "fnet_rom"
141 
142 /**************************************************************************/
145 #define FNET_FS_ROM_VERSION (2u)
146 
147 #if defined(__cplusplus)
148 extern "C" {
149 #endif
150 
151 /***************************************************************************/
162 void fnet_fs_rom_register(void);
163 
164 /***************************************************************************/
175 void fnet_fs_rom_unregister(void);
176 
177 #if defined(__cplusplus)
178 }
179 #endif
180 
183 #endif /* FNET_CFG_FS && FNET_CFG_FS_ROM */
184 
185 
186 #endif /* _FNET_FS_ROM_H_ */
struct fnet_fs_rom_node fnet_fs_rom_node_t
FNET ROM file-system node. The node represents a file or a directory.
const fnet_fs_rom_node_t * nodes
Array of file-system nodes. The last node element must have all fields set to zero as the end-of-arra...
Definition: fnet_fs_rom.h:130
FNET ROM file-system image.
Definition: fnet_fs_rom.h:124
fnet_size_t data_size
Size of the file buffer pointed to by the data field. For a directory this field must be set to 0...
Definition: fnet_fs_rom.h:112
void fnet_fs_rom_unregister(void)
Unregisters the FNET ROM file system.
unsigned long fnet_size_t
Unsigned integer type representing the size in bytes.
Definition: fnet_stdlib.h:55
const fnet_uint8_t * data
Pointer to a file-content buffer. For a directory this field must be set to 0.
Definition: fnet_fs_rom.h:110
const fnet_char_t * name
Name of a file or directory (null-terminated string).
Definition: fnet_fs_rom.h:108
fnet_uint32_t version
File-system version the FS image was generated for.
Definition: fnet_fs_rom.h:128
void fnet_fs_rom_register(void)
Registers the FNET ROM file system.
const fnet_char_t * name
File-system name (null-terminated string). Should be set to the FNET_FS_ROM_NAME. ...
Definition: fnet_fs_rom.h:126
char fnet_char_t
Type representing the charecter.
Definition: fnet_stdlib.h:75
struct fnet_fs_rom_image fnet_fs_rom_image_t
FNET ROM file-system image.
FNET ROM file-system node. The node represents a file or a directory.
Definition: fnet_fs_rom.h:106
const struct fnet_fs_rom_node * parent_node
Pointer to the parent directory. For the root directory this field must be set to 0...
Definition: fnet_fs_rom.h:115

© 2005-2020 by Andrej Butok. http://fnet.sourceforge.net