summaryrefslogtreecommitdiff
path: root/src/search.h
blob: 8b5f502e2d25b0375d4051dff1da2b4d3f7bec73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef __SLOTS__SEARCH_H__4612270218569
#define __SLOTS__SEARCH_H__4612270218569

#include <sys/types.h>
#include <dirent.h>

// Wrapper for stat's S_ISDIR(mode) macro. Implemented as: return S_ISDIR(mode)
int S_ISDIR_WRAPPER(mode_t mode);

// Wrapper for stat's S_ISREG(mode) macro. Implemented as: return S_ISREG(mode)
int S_ISREG_WRAPPER(mode_t mode);

// Sort out nodes in a scanned directory using one of stat's S_IS--- functions
int nodesort(const struct dirent *node, int (*S_IS_CALLBACK)(mode_t));
int foldersort(const struct dirent *node);                              // Only display folders when using scandir
int filesort(const struct dirent *node);                                // Only display files when using scandir


#endif