(query_dialog): add horizontal line.
[midnight-commander.git] / src / filemanager / dir.h
blobbbfac7327711faa378c936a35dad52dc3a244351
1 /** \file dir.h
2 * \brief Header: directory routines
3 */
5 #ifndef MC__DIR_H
6 #define MC__DIR_H
8 #include <sys/stat.h>
10 #include "lib/global.h"
11 #include "lib/util.h"
12 #include "lib/vfs/vfs.h"
14 /*** typedefs(not structures) and defined constants **********************************************/
16 #define MIN_FILES 128
17 #define RESIZE_STEPS 128
19 typedef int sortfn (const void *, const void *);
21 /*** enums ***************************************************************************************/
23 /*** structures declarations (and typedefs of structures)*****************************************/
25 typedef struct
27 file_entry *list;
28 int size;
29 } dir_list;
31 /*** global variables defined in .c file *********************************************************/
33 /*** declarations of public functions ************************************************************/
35 int do_load_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, gboolean reverse,
36 gboolean case_sensitive, gboolean exec_ff, const char *fltr);
37 void do_sort (dir_list * list, sortfn * sort, int top, gboolean reverse,
38 gboolean case_sensitive, gboolean exec_ff);
39 int do_reload_dir (const vfs_path_t * vpath, dir_list * list, sortfn * sort, int count,
40 gboolean reverse, gboolean case_sensitive, gboolean exec_ff, const char *fltr);
41 void clean_dir (dir_list * list, int count);
42 gboolean set_zero_dir (dir_list * list);
43 int handle_path (dir_list * list, const char *path, struct stat *buf1,
44 int next_free, int *link_to_dir, int *stale_link);
46 /* Sorting functions */
47 int unsorted (file_entry * a, file_entry * b);
48 int sort_name (file_entry * a, file_entry * b);
49 int sort_vers (file_entry * a, file_entry * b);
50 int sort_ext (file_entry * a, file_entry * b);
51 int sort_time (file_entry * a, file_entry * b);
52 int sort_atime (file_entry * a, file_entry * b);
53 int sort_ctime (file_entry * a, file_entry * b);
54 int sort_size (file_entry * a, file_entry * b);
55 int sort_inode (file_entry * a, file_entry * b);
57 gboolean if_link_is_exe (const vfs_path_t * full_name, const file_entry * file);
59 /*** inline functions ****************************************************************************/
61 static inline gboolean
62 link_isdir (const file_entry * file)
64 return (gboolean) file->f.link_to_dir;
67 #endif /* MC__DIR_H */