r1996: Cope slightly better with invalid filenames in various places (reported by
[rox-filer.git] / ROX-Filer / src / diritem.h
blob64d1784b444ac334987633f3291766c4694c0d42
1 /*
2 * $Id$
4 * Thomas Leonard, <tal197@users.sourceforge.net>
5 */
8 #ifndef _DIRITEM_H
9 #define _DIRITEM_H
11 #include <sys/types.h>
13 typedef enum
15 ITEM_FLAG_SYMLINK = 0x01, /* Is a symlink */
16 ITEM_FLAG_APPDIR = 0x02, /* Contains an AppRun */
17 ITEM_FLAG_MOUNT_POINT = 0x04, /* Is in mtab or fstab */
18 ITEM_FLAG_MOUNTED = 0x08, /* Is in /etc/mtab */
19 ITEM_FLAG_EXEC_FILE = 0x20, /* File, and has an X bit set */
20 ITEM_FLAG_MAY_DELETE = 0x40, /* Delete on finishing scan */
21 } ItemFlags;
23 struct _DirItem
25 char *leafname;
26 char *leafname_collate; /* Preprocessed for sorting */
27 gboolean may_delete; /* Not yet found, this scan */
28 int base_type;
29 int flags;
30 mode_t mode;
31 off_t size;
32 time_t atime, ctime, mtime;
33 MaskedPixmap *image; /* NULL => leafname only so far */
34 MIME_type *mime_type;
35 uid_t uid;
36 gid_t gid;
37 int lstat_errno; /* 0 if details are valid */
40 void diritem_init(void);
41 DirItem *diritem_new(const guchar *leafname);
42 void diritem_restat(const guchar *path, DirItem *item, struct stat *parent);
43 void diritem_free(DirItem *item);
45 #endif /* _DIRITEM_H */