r4537: Updated Russian Translation (Nikita E. Shalaev):
[rox-filer/translations.git] / ROX-Filer / src / diritem.h
blobef111803fcf3cfe11ceb628b249e79d2b0a62182
1 /*
2 * ROX-Filer, filer for the ROX desktop project
3 * Thomas Leonard, <tal197@users.sourceforge.net>
4 */
7 #ifndef _DIRITEM_H
8 #define _DIRITEM_H
10 #include <sys/types.h>
12 extern time_t diritem_recent_time;
14 typedef enum
16 ITEM_FLAG_SYMLINK = 0x01, /* Is a symlink */
17 ITEM_FLAG_APPDIR = 0x02, /* Contains an AppRun */
18 ITEM_FLAG_MOUNT_POINT = 0x04, /* Is mounted or in fstab */
19 ITEM_FLAG_MOUNTED = 0x08, /* Is mounted */
20 ITEM_FLAG_EXEC_FILE = 0x20, /* File, and has an X bit set (or is a .desktop)*/
21 ITEM_FLAG_MAY_DELETE = 0x40, /* Delete on finishing scan */
22 ITEM_FLAG_RECENT = 0x80, /* [MC]-time is around now */
24 /* DirItems are created with this flag set. Restatting or queuing an
25 * item in this state clears the flag. This is to prevent an item
26 * being added to the queue more than once at a time.
28 ITEM_FLAG_NEED_RESCAN_QUEUE = 0x100,
30 ITEM_FLAG_HAS_XATTR = 0x200, /* Has extended attributes set */
31 } ItemFlags;
33 struct _DirItem
35 char *leafname;
36 CollateKey *leafname_collate; /* Preprocessed for sorting */
37 gboolean may_delete; /* Not yet found, this scan */
38 int base_type;
39 int flags;
40 mode_t mode;
41 off_t size;
42 time_t atime, ctime, mtime;
43 MaskedPixmap *_image; /* NULL => leafname only so far */
44 MIME_type *mime_type;
45 uid_t uid;
46 gid_t gid;
47 int lstat_errno; /* 0 if details are valid */
50 void diritem_init(void);
51 DirItem *diritem_new(const guchar *leafname);
52 void diritem_restat(const guchar *path, DirItem *item, struct stat *parent);
53 void _diritem_get_image(DirItem *item);
54 void diritem_free(DirItem *item);
56 static inline MaskedPixmap *di_image(DirItem *item)
58 if (!item->_image && item->base_type != TYPE_UNKNOWN)
59 _diritem_get_image(item);
60 return item->_image;
63 #endif /* _DIRITEM_H */