Enable silent-rules for compilation
[fsviewer.git] / src / files.h
blobe340193bf7ab3a1c3d138fdf5a66b57f0d5bdaf0
1 #ifndef FILES_H_
2 #define FILES_H_
4 typedef enum FileType {
5 S_LINK,
6 DIRECTORY,
7 NORMAL,
8 ROOT,
9 HOME,
10 NONE
11 } FileType;
13 typedef struct SLL {
14 char *data;
15 struct SLL *next;
16 enum FileType fileType;
17 } SLL;
19 typedef enum AppEvent {
20 AppExec,
21 AppView,
22 AppEdit
23 } AppEvent;
25 typedef enum FileAction {
26 FileCopy,
27 FileDelete,
28 FileMove,
29 FileRename,
30 FileLink,
31 FileSync
32 } FileAction;
34 typedef struct FileInfo
36 /* path name */
37 char *path;
39 /* a file name */
40 char *name;
42 /* File Extension */
43 char *extn;
45 /* an abbreviated file name*/
46 char *abbrev;
48 char *imgName;
50 /* ?? */
51 /* char *linkname; */
53 /* ?? */
54 /* unsigned int linkmode; */
56 /* ?? */
57 /* int linkok; */
59 struct stat *st;
60 /* file type */
61 enum FileType fileType;
63 struct FileInfo *next;
65 } FileInfo;
67 #define DIR_STR "DIRECTORY"
68 #define ROOT_STR "ROOT"
69 #define HOME_STR "HOME"
70 #define DEFAULT_STR "DEFAULT_IMG"
71 #define NULL_STR "NULL"
73 char *GetFileAbbrev(char *fileName);
74 char *GetPathFromPathname(char* pathname);
75 char *GetPathnameFromPathName(char* path, char *name);
76 char *GetNameFromPathname(char* pathname);
77 char *GetFileImgName(char *fileName, enum FileType fileType);
78 void GetFileInfo(char* path, char *name, FileInfo* fileInfo);
79 FileInfo *GetDirList(char *path);
80 char *GetFileExtn(char *filename);
81 Bool isDirectory(enum FileType fileType);
82 char *RemoveFileExtension(char* filename);
83 /* Bool DisplayFile(const char *str); */
84 Bool DisplayFile(char *str, char *filter, FileType fileType);
85 void FSToggleDisplayHiddenFiles();
86 void FSToggleSort();
87 FileInfo *FSCreateFileInfo();
88 FileInfo *FSGetFileInfo(char* pathname);
89 void FSFreeFileInfo(FileInfo *fileInfo);
90 void FSCopyFileInfo(FileInfo *src, FileInfo *dest);
91 int FSCreateNewFile(char *path, mode_t mode);
92 int FSCreateNewDirectory(char *path, mode_t mode);
93 int FSRCopy(char *oldpath, char *newpath);
94 int FSRDel(char *path);
95 void FSCopy(FileInfo *src, FileInfo *dest);
96 void FSDelete(FileInfo *item);
97 void FSMove(FileInfo *src, FileInfo *dest);
98 void FSRename(FileInfo *src, FileInfo *dest);
99 void FSLink(FileInfo *src, FileInfo *dest);
101 #endif