RTEMS 6.1-rc6
Loading...
Searching...
No Matches
rtems-rfs-dir.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
15/*
16 * COPYRIGHT (c) 2010 Chris Johns <chrisj@rtems.org>
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#if !defined (_RTEMS_RFS_DIR_H_)
41#define _RTEMS_RFS_DIR_H_
42
43#include <dirent.h>
44
45#include <rtems/libio_.h>
46
50
54#define RTEMS_RFS_DIR_ENTRY_INO (0)
56#define RTEMS_RFS_DIR_ENTRY_HASH (4)
61#define RTEMS_RFS_DIR_ENTRY_LEN (8)
67#define RTEMS_RFS_DIR_ENTRY_SIZE (4 + 4 + 2)
68
72#define RTEMS_RFS_DIR_ENTRY_EMPTY (0xffff)
73
81#define rtems_rfs_dir_entry_hash(_e) \
82 rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH)
83
91#define rtems_rfs_dir_set_entry_hash(_e, _h) \
92 rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_HASH, _h)
93
101#define rtems_rfs_dir_entry_ino(_e) \
102 rtems_rfs_read_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO)
103
111#define rtems_rfs_dir_set_entry_ino(_e, _i) \
112 rtems_rfs_write_u32 (_e + RTEMS_RFS_DIR_ENTRY_INO, _i)
113
121#define rtems_rfs_dir_entry_length(_e) \
122 rtems_rfs_read_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN)
123
130#define rtems_rfs_dir_set_entry_length(_e, _l) \
131 rtems_rfs_write_u16 (_e + RTEMS_RFS_DIR_ENTRY_LEN, _l)
132
151 const char* name,
152 int length,
153 rtems_rfs_ino* ino,
154 uint32_t* offset);
155
172 const char* name,
173 size_t length,
174 rtems_rfs_ino ino);
175
191 rtems_rfs_ino ino,
192 uint32_t offset);
193
211 rtems_rfs_pos_rel offset,
212 struct dirent* dirent,
213 size_t* length);
214
227
228#endif
LibIO Internal Interface.
RTEMS File System Data.
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:545
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:391
int rtems_rfs_dir_empty(rtems_rfs_file_system *fs, rtems_rfs_inode_handle *dir)
Definition: rtems-rfs-dir.c:668
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:244
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:69
RTEMS File System Data.
int64_t rtems_rfs_pos_rel
Definition: rtems-rfs-file-system.h:114
RTEMS File System Information Node.
uint32_t rtems_rfs_ino
Definition: rtems-rfs-inode.h:97
Definition: rtems-rfs-file-system.h:135
Definition: rtems-rfs-inode.h:201