* view.c (view_update_bytes_per_line): Don't use vertical bars
[midnight-commander.git] / src / dir.h
bloba93e704ec4cfd673f0a16aa701729fe9c3199617
1 #ifndef __DIR_H
2 #define __DIR_H
4 #define MIN_FILES 128
5 #define RESIZE_STEPS 128
7 #include <sys/stat.h>
8 typedef struct {
10 /* File attributes */
12 int fnamelen;
13 char *fname;
14 struct stat buf;
16 /* Flags */
17 struct {
18 unsigned int marked:1; /* File marked in pane window */
19 unsigned int link_to_dir:1; /* If this is a link, does it point to directory? */
20 unsigned int stalled_link:1; /* If this is a symlink and points to Charon's land */
21 unsigned int dir_size_computed:1; /* Size of directory was computed with dirsizes_cmd */
22 } f;
23 } file_entry;
25 typedef struct {
26 file_entry *list;
27 int size;
28 } dir_list;
30 typedef int sortfn (const void *, const void *);
32 int do_load_dir (dir_list *list, sortfn *sort,
33 int reverse, int case_sensitive, char *filter);
34 void do_sort (dir_list *list, sortfn *sort, int top,
35 int reverse, int case_sensitive);
36 dir_list *do_collect_stat (dir_list *dir, int top);
37 int do_reload_dir (dir_list *list, sortfn *sort, int count,
38 int reverse, int case_sensitive, char *filter);
39 void clean_dir (dir_list *list, int count);
40 int set_zero_dir (dir_list *list);
42 #ifdef DIR_H_INCLUDE_HANDLE_DIRENT
43 int handle_dirent (dir_list *list, char *filter, struct dirent *dp,
44 struct stat *buf1, int next_free, int *link_to_dir, int *stalled_link);
45 int handle_path (dir_list *list, char *path, struct stat *buf1, int next_free,
46 int *link_to_dir, int *stalled_link);
47 #endif
49 /* Sorting functions */
50 int unsorted (const file_entry *a, const file_entry *b);
51 int sort_name (const file_entry *a, const file_entry *b);
52 int sort_ext (const file_entry *a, const file_entry *b);
53 int sort_time (const file_entry *a, const file_entry *b);
54 int sort_atime (const file_entry *a, const file_entry *b);
55 int sort_ctime (const file_entry *a, const file_entry *b);
56 int sort_size (const file_entry *a, const file_entry *b);
57 int sort_inode (const file_entry *a, const file_entry *b);
58 int sort_type (const file_entry *a, const file_entry *b);
59 int sort_links (const file_entry *a, const file_entry *b);
60 int sort_nuid (const file_entry *a, const file_entry *b);
61 int sort_ngid (const file_entry *a, const file_entry *b);
62 int sort_owner (const file_entry *a, const file_entry *b);
63 int sort_group (const file_entry *a, const file_entry *b);
65 /* SORT_TYPES is used to build the nice dialog box entries */
66 #define SORT_TYPES 8
68 /* This is the number of sort types not available in that dialog box */
69 #define SORT_TYPES_EXTRA 6
71 /* The total nnumber of sort types */
72 #define SORT_TYPES_TOTAL (SORT_TYPES + SORT_TYPES_EXTRA)
74 typedef struct {
75 char *sort_name;
76 int (*sort_fn)(const file_entry *, const file_entry *);
77 } sort_orders_t;
79 extern sort_orders_t sort_orders [SORT_TYPES_TOTAL];
81 int link_isdir (file_entry *);
82 int if_link_is_exe (char *full_name, file_entry *file);
84 extern int show_backups;
85 extern int show_dot_files;
86 extern int show_backups;
87 extern int mix_all_files;
89 #endif /* __DIR_H */