2024-11-20 09:28:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef SOURCEFS_H
|
|
|
|
#define SOURCEFS_H
|
|
|
|
|
2024-12-03 18:10:50 +01:00
|
|
|
#include <dirent.h>
|
2024-11-20 10:32:33 +01:00
|
|
|
#include <sys/stat.h>
|
|
|
|
|
2024-11-20 09:28:20 +01:00
|
|
|
/**
|
|
|
|
* Initializes the source file handling.
|
|
|
|
*
|
|
|
|
* @param root_path The root of the source files folder.
|
2024-12-03 18:10:50 +01:00
|
|
|
* @return 0 on success, -1 on failure.
|
2024-11-20 09:28:20 +01:00
|
|
|
*/
|
|
|
|
int source_init(const char *root_path);
|
|
|
|
|
2024-11-20 10:32:33 +01:00
|
|
|
/**
|
|
|
|
* `stat()`, but for source files.
|
|
|
|
*
|
|
|
|
* @see `stat()`
|
|
|
|
*/
|
|
|
|
int source_stat(const char *restrict pathname, struct stat *restrict statbuf);
|
|
|
|
|
2024-12-03 18:10:50 +01:00
|
|
|
/**
|
|
|
|
* `readdir()`, but for source files.
|
|
|
|
*
|
|
|
|
* @see `readdir(3)`
|
|
|
|
*/
|
|
|
|
struct dirent *source_readdir(DIR *dirp);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* `opendir()`, but for source files.
|
|
|
|
*
|
|
|
|
* @see `opendir()`
|
|
|
|
*/
|
|
|
|
DIR *source_opendir(const char *filename);
|
|
|
|
|
2024-11-20 09:28:20 +01:00
|
|
|
#endif // !SOURCEFS_H
|