diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-11 11:43:25 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2020-02-11 11:43:25 -0500 |
commit | 9bd603b639d7dd08fbe0af7e8669358bd066b7cd (patch) | |
tree | 8207b9680cc33846ff7d9ce0c8917aa052766c43 /include/fs.h | |
parent | b828cc647f63de48c6e24f5a1043e052eb99b2a2 (diff) | |
download | spmc-9bd603b639d7dd08fbe0af7e8669358bd066b7cd.tar.gz |
Refactor project structure:
* Move prototypes and definitions to respective header files
* Renamed strings.h to str.h to avoid collision with standard library header
Diffstat (limited to 'include/fs.h')
-rw-r--r-- | include/fs.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/include/fs.h b/include/fs.h new file mode 100644 index 0000000..7987e33 --- /dev/null +++ b/include/fs.h @@ -0,0 +1,29 @@ +#ifndef SPM_FSTREE_H +#define SPM_FSTREE_H + +#define SPM_FSTREE_FLT_NONE 1 << 0 +#define SPM_FSTREE_FLT_CONTAINS 1 << 1 +#define SPM_FSTREE_FLT_ENDSWITH 1 << 2 +#define SPM_FSTREE_FLT_STARTSWITH 1 << 3 + +typedef struct { + char *root; + char **dirs; + size_t dirs_length; + char **files; + size_t files_length; +} FSTree; + +int _fstree_compare(const FTSENT **a, const FTSENT **b); +void fstree_free(FSTree *fsdata); +FSTree *fstree(const char *_path, char **filter_by, unsigned int filter_mode); +int rmdirs(const char *_path); +long int get_file_size(const char *filename); +int mkdirs(const char *_path, mode_t mode); +char *dirname(const char *_path); +char *basename(char *path); +int rsync(const char *_args, const char *_source, const char *_destination); +char *human_readable_size(uint64_t n); + + +#endif //SPM_FSTREE_H |