Crinit -- Configurable Rootfs Init
Loading...
Searching...
No Matches
fseries.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
6#ifndef __FSERIES_H__
7#define __FSERIES_H__
8
9#ifdef CRINIT_FSERIES_TESTING
10#define TESTABLE __attribute__((weak))
11#else
12#define TESTABLE
13#endif
14
15#include <stdbool.h>
16#include <stddef.h>
17
21typedef struct crinitFileSeries_t {
22 char **fnames;
24 size_t size;
25 char *baseDir;
27
42int crinitFileSeriesFromDir(crinitFileSeries_t *fse, const char *path, const char *fileSuffix, bool followLinks);
58int crinitFileSeriesFromStrArr(crinitFileSeries_t *fse, const char *baseDir, char **strArr);
77TESTABLE int crinitInitFileSeries(crinitFileSeries_t *fse, size_t numElements, const char *baseDir);
90int crinitResizeFileSeries(crinitFileSeries_t *fse, size_t numElements);
91
92#endif /* __FSERIES_H__ */
const char * fileSuffix
The extension of the files we want to scan for.
Definition fseries.c:33
bool followLinks
Definition fseries.c:34
void crinitDestroyFileSeries(crinitFileSeries_t *fse)
Definition fseries.c:81
#define TESTABLE
Definition fseries.h:12
TESTABLE int crinitInitFileSeries(crinitFileSeries_t *fse, size_t numElements, const char *baseDir)
Definition fseries.c:96
int crinitResizeFileSeries(crinitFileSeries_t *fse, size_t numElements)
Definition fseries.c:114
int crinitFileSeriesFromStrArr(crinitFileSeries_t *fse, const char *baseDir, char **strArr)
Definition fseries.c:254
int crinitFileSeriesFromDir(crinitFileSeries_t *fse, const char *path, const char *fileSuffix, bool followLinks)
Definition fseries.c:140
Definition fseries.h:21
char * baseDir
The dirname of the filenames in fnames.
Definition fseries.h:25
char ** fnames
Definition fseries.h:22
size_t size
Number of valid (allocated and non-NULL) pointers in fnames.
Definition fseries.h:24