RTEMS: cpukit/include/rtems/rfs/rtems-rfs-dir.h Source File

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
rtems-rfs-dir.h
Go to the documentation of this file.
1
13/*
14 * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
15 *
16 * The license and distribution terms for this file may be
17 * found in the file LICENSE in this distribution or at
18 * http://www.rtems.org/license/LICENSE.
19 */
20
21#if !defined (_RTEMS_RFS_DIR_H_)
22#define _RTEMS_RFS_DIR_H_
23
24#include <dirent.h>
25
26#include <rtems/libio_.h>
27
28#include <rtems/rfs/rtems-rfs-data.h>
29#include <rtems/rfs/rtems-rfs-file-system.h>
30#include <rtems/rfs/rtems-rfs-inode.h>
31
35#define RTEMS_RFS_DIR_ENTRY_INO (0)
37#define RTEMS_RFS_DIR_ENTRY_HASH (4)
42#define RTEMS_RFS_DIR_ENTRY_LEN (8)
48#define RTEMS_RFS_DIR_ENTRY_SIZE (4 + 4 + 2)
49
53#define RTEMS_RFS_DIR_ENTRY_EMPTY (0xffff)
54
62#define rtems_rfs_dir_entry_hash(_e) \
63 rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH)
64
72#define rtems_rfs_dir_set_entry_hash(_e, _h) \
73 rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH, _h)
74
82#define rtems_rfs_dir_entry_ino(_e) \
83 rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO)
84
92#define rtems_rfs_dir_set_entry_ino(_e, _i) \
93 rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO, _i)
94
102#define rtems_rfs_dir_entry_length(_e) \
103 rtems_rfs_read_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN)
104
111#define rtems_rfs_dir_set_entry_length(_e, _l) \
112 rtems_rfs_write_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN, _l)
113
130int rtems_rfs_dir_lookup_ino (rtems_rfs_file_system* fs,
131 rtems_rfs_inode_handle* inode,
132 const char* name,
133 int length,
134 rtems_rfs_ino* ino,
135 uint32_t* offset);
136
151int rtems_rfs_dir_add_entry (rtems_rfs_file_system* fs,
152 rtems_rfs_inode_handle* dir,
153 const char* name,
154 size_t length,
155 rtems_rfs_ino ino);
156
170int rtems_rfs_dir_del_entry (rtems_rfs_file_system* fs,
171 rtems_rfs_inode_handle* dir,
172 rtems_rfs_ino ino,
173 uint32_t offset);
174
190int rtems_rfs_dir_read (rtems_rfs_file_system* fs,
191 rtems_rfs_inode_handle* dir,
192 rtems_rfs_pos_rel offset,
193 struct dirent* dirent,
194 size_t* length);
195
206int rtems_rfs_dir_empty (rtems_rfs_file_system* fs,
207 rtems_rfs_inode_handle* dir);
208
209#endif
libio_.h
LibIO Internal Interface.
rtems-rfs-data.h
RTEMS File System Data.
rtems_rfs_dir_read
int rtems_rfs_dir_read(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir, rtems_rfs_pos_rel offset, struct dirent *dirent, size_t *length)
Definition: rtems-rfs-dir.c:526
rtems_rfs_dir_del_entry
int rtems_rfs_dir_del_entry(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir, rtems_rfs_ino ino, uint32_t offset)
Definition: rtems-rfs-dir.c:372
rtems_rfs_dir_empty
int rtems_rfs_dir_empty(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir)
Definition: rtems-rfs-dir.c:649
rtems_rfs_dir_add_entry
int rtems_rfs_dir_add_entry(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir, const char *name, size_t length, rtems_rfs_ino ino)
Definition: rtems-rfs-dir.c:225
rtems_rfs_dir_lookup_ino
int rtems_rfs_dir_lookup_ino(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *inode, const char *name, int length, rtems_rfs_ino *ino, uint32_t *offset)
Definition: rtems-rfs-dir.c:50
rtems-rfs-file-system.h
RTEMS File System Data.
rtems_rfs_pos_rel
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:95
rtems-rfs-inode.h
RTEMS File System Information Node.
rtems_rfs_ino
uint32_t rtems_rfs_ino
Definition: rtems-rfs-inode.h:78
_rtems_rfs_file_system
Definition: rtems-rfs-file-system.h:116
_rtems_rfs_inode_handle
Definition: rtems-rfs-inode.h:182