TARFS
0.1.5
Read-only TAR filesystem for ESP32
Toggle main menu visibility
Loading...
Searching...
No Matches
dir.h
Go to the documentation of this file.
1
/*
2
* TARFS - Immutable (read-only) filesystem for embedded systems.
3
*
4
* Copyright (c) 2026 Viacheslav Logunov
5
* SPDX-License-Identifier: MMIT
6
*
7
* Author:
8
* Viacheslav Logunov <vvb333007@gmail.com>
9
*
10
* Project:
11
* https://github.com/vvb333007/tarfs
12
*
13
* @file dir.h
14
* @brief Public directory API
15
*/
16
17
#pragma once
18
42
43
#ifdef __CYGWIN__
44
/* Glibc-based systems dont expose DIR so we use a placeholder */
45
typedef
struct
{
int
a;
int
b; } fake_DIR;
46
# undef DIR
47
# define DIR fake_DIR
48
#endif
49
50
51
#ifdef __cplusplus
52
extern
"C"
{
53
#endif
54
55
73
DIR*
tard_fdopendir
(
void
* ctx,
int
fd);
74
75
76
89
DIR*
tard_opendir
(
void
* ctx,
const
char
*
name
);
90
102
int
tard_closedir
(
void
* ctx, DIR* pdir);
103
117
struct
dirent*
tard_readdir
(
void
* ctx, DIR* pdir);
118
130
long
tard_telldir
(
void
* ctx, DIR* pdir);
131
142
void
tard_seekdir
(
void
* ctx, DIR* pdir,
long
offset);
143
144
158
int
tard_dirfd
(
void
* ctx, DIR *pdir);
159
160
161
#ifdef __cplusplus
162
};
163
#endif
tard_telldir
long tard_telldir(void *ctx, DIR *pdir)
Return the current directory position.
Definition
dir.c:357
tard_closedir
int tard_closedir(void *ctx, DIR *pdir)
Close a directory stream.
Definition
dir.c:260
tard_fdopendir
DIR * tard_fdopendir(void *ctx, int fd)
TARFS Directory API: tard_opendir(), tard_fdopendir(), tard_closedir(), tard_telldir(),...
Definition
dir.c:166
tard_readdir
struct dirent * tard_readdir(void *ctx, DIR *pdir)
Read the next directory entry.
Definition
dir.c:293
tard_dirfd
int tard_dirfd(void *ctx, DIR *pdir)
The function dirfd() returns the file descriptor associated with the directory stream pdir.
Definition
dir.c:397
tard_opendir
DIR * tard_opendir(void *ctx, const char *name)
Open a directory for reading.
Definition
dir.c:233
tard_seekdir
void tard_seekdir(void *ctx, DIR *pdir, long offset)
Reposition a directory stream.
Definition
dir.c:371
name
const char name[100]
Definition
tar.h:1
src
dir.h
Generated by
1.17.0