RTEMS  5.1
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 
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 
131  rtems_rfs_inode_handle* inode,
132  const char* name,
133  int length,
134  rtems_rfs_ino* ino,
135  uint32_t* offset);
136 
153  const char* name,
154  size_t length,
155  rtems_rfs_ino ino);
156 
172  rtems_rfs_ino ino,
173  uint32_t offset);
174 
192  rtems_rfs_pos_rel offset,
193  struct dirent* dirent,
194  size_t* length);
195 
208 
209 #endif
RTEMS File System Data.
RTEMS File System Data.
Definition: rtems-rfs-file-system.h:123
uint32_t rtems_rfs_ino
Definition: rtems-rfs-inode.h:78
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
Definition: rtems-rfs-inode.h:181
RTEMS File System Information Node.
int rtems_rfs_dir_empty(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir)
Definition: rtems-rfs-dir.c:649
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
LibIO Internal Interface.
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
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:95
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