dfs_romfs.h 731 字节
Newer Older
M
Ming, Bai 已提交
1
/*
B
Bernard Xiong 已提交
2
 * Copyright (c) 2006-2019, RT-Thread Development Team
M
Ming, Bai 已提交
3
 *
4
 * SPDX-License-Identifier: Apache-2.0
M
Ming, Bai 已提交
5 6 7
 *
 * Change Logs:
 * Date           Author       Notes
B
Bernard Xiong 已提交
8
 * 2019/01/13     Bernard      code cleanup
M
Ming, Bai 已提交
9 10 11 12 13 14 15
 */

#ifndef __DFS_ROMFS_H__
#define __DFS_ROMFS_H__

#include <rtthread.h>

16 17
#define ROMFS_DIRENT_FILE   0x00
#define ROMFS_DIRENT_DIR    0x01
M
Ming, Bai 已提交
18 19 20

struct romfs_dirent
{
B
Bernard Xiong 已提交
21
    rt_uint32_t      type;  /* dirent type */
M
Ming, Bai 已提交
22

B
Bernard Xiong 已提交
23 24 25
    const char       *name; /* dirent name */
    const rt_uint8_t *data; /* file date ptr */
    rt_size_t        size;  /* file size */
M
Ming, Bai 已提交
26 27
};

28 29 30 31 32 33
struct root_data
{
    struct romfs_dirent *dirent;  /* root dirent */
    long long offset;
};

M
Ming, Bai 已提交
34 35 36 37
int dfs_romfs_init(void);
extern const struct romfs_dirent romfs_root;

#endif