2 * \brief Header: directory routines
10 #include "lib/global.h"
13 /*** typedefs(not structures) and defined constants **********************************************/
16 #define RESIZE_STEPS 128
18 typedef int sortfn (const void *, const void *);
20 /*** enums ***************************************************************************************/
22 /*** structures declarations (and typedefs of structures)*****************************************/
30 /*** global variables defined in .c file *********************************************************/
32 /*** declarations of public functions ************************************************************/
34 int do_load_dir (const char *path
, dir_list
* list
, sortfn
* sort
, gboolean reverse
,
35 gboolean case_sensitive
, gboolean exec_ff
, const char *fltr
);
36 void do_sort (dir_list
* list
, sortfn
* sort
, int top
, gboolean reverse
,
37 gboolean case_sensitive
, gboolean exec_ff
);
38 int do_reload_dir (const char *path
, dir_list
* list
, sortfn
* sort
, int count
,
39 gboolean reverse
, gboolean case_sensitive
, gboolean exec_ff
, const char *fltr
);
40 void clean_dir (dir_list
* list
, int count
);
41 gboolean
set_zero_dir (dir_list
* list
);
42 int handle_path (dir_list
* list
, const char *path
, struct stat
*buf1
,
43 int next_free
, int *link_to_dir
, int *stale_link
);
45 /* Sorting functions */
46 int unsorted (file_entry
* a
, file_entry
* b
);
47 int sort_name (file_entry
* a
, file_entry
* b
);
48 int sort_vers (file_entry
* a
, file_entry
* b
);
49 int sort_ext (file_entry
* a
, file_entry
* b
);
50 int sort_time (file_entry
* a
, file_entry
* b
);
51 int sort_atime (file_entry
* a
, file_entry
* b
);
52 int sort_ctime (file_entry
* a
, file_entry
* b
);
53 int sort_size (file_entry
* a
, file_entry
* b
);
54 int sort_inode (file_entry
* a
, file_entry
* b
);
56 gboolean
if_link_is_exe (const char *full_name
, const file_entry
* file
);
58 /*** inline functions ****************************************************************************/
60 static inline gboolean
61 link_isdir (const file_entry
* file
)
63 return (gboolean
) file
->f
.link_to_dir
;
66 #endif /* MC__DIR_H */