35 #include <sys/ioctl.h>
37 #include <sys/types.h>
43 #define errno (*__errno_location ())
47 #define CONF_FILE "extension.conf"
48 #define USER_CONF ".config/nffm/"
49 #define COLOR_FILE "color.conf"
51 #define SYSTEM_CONF "/etc/nffm/"
52 #define FILEMAX 30 //The number of files listed
53 #define MAXBEGIN 20 //Max number of characters allowed to set file begin with option.
54 #define MAXDIGIT 3 //not more than 999
55 #define MAXDIRECTORY 80 //Max Length of directory name
56 #define MAXDIRLIST 3000
57 #define MAXEXTENSION 380
58 #define MAXFILELIST 3000
59 #define MAXMENUSIZE 3000 //Max number of menu items
60 #define MENUHT 30 //The height of menu + header
61 #define MENUMAX 30 //The number of directories listed
62 #define MENUW 45 //The width of the directory and file listing.
66 #define WINFILEW 46 //The width of file window
67 #define WINTRANSITW 35 //The width of the temporary display area of selected files
69 enum nffm_colors{MAGENTA_BLACK=1, YELLOW_BLACK=2, GREEN_BLACK=3, RED_BLACK=4};
87 char fullpath[MAXDIRECTORY];
93 enum direction {UP=-1, DOWN=1, SAME=0};
115 char file_begin[MAXBEGIN+1];
121 }color[MAXEXTENSION];
123 WINDOW *winheader, *winfooter, *windirinfo, *winmenu,
124 *winscrollable, *currentwin, *winfileinfo, *wintransit;
126 FILE * file_open(
const char *filename,
const char *mode);
128 bool UnmarkFile(
struct filemarker **filelist,
const char *filepath);
129 bool begins_with(
const char *
string,
const char *begins);
130 bool ends_with(
const char *
string,
const char *ends);
131 bool findMarkedFile(
struct filemarker *filelist,
char *filepath);
132 bool isHiddenFile(
char s[]);
133 char * getFileExtension(
const char *filename);
134 char *GetUserDir(
void);
135 char *delimLong(
long nbr);
136 char *delimStr(
char nbr[]);
137 char *dtg(time_t *tm);
138 char *getUserText(
const char *question);
139 char *join(
const char s1[],
const char s2[]);
140 char *join_words(
int n,
char *delim, ...);
141 char *printCursor(
cursor c);
142 char *printCursor(
cursor c);
143 cursor setCursor(
int direction,
int selection,
cursor c);
144 directories DoDirectoryList(
char adir[],
char *directory_list[],
char *file_list[],
options opt);
145 int ReadLine(
char c,
char aLine[]);
146 int addslash(
char adir[]);
147 int createDir(
const char *parentDir,
const char *childDir);
148 int createFile(
const char *filepath);
149 int deleteFile(
const char *filepath,
bool confirmDeleteMany);
150 int deleteMarkedFile(
struct filemarker **filelist);
151 int displayList(
struct filemarker *filelist);
152 int drawmenu(
char *list[],
char *item, WINDOW *w,
int fromline);
153 int filterfile(
const struct dirent *d);
154 int findItemIndex(
const char *item,
char **itemList);
155 int find_color(
char *ext);
156 int getNumber(WINDOW *w);
157 int gzCompress(
char *infile,
char *outfile);
158 int moveSelectedFiles(
const char *newpath,
struct filemarker **f);
159 int readlscolor(
void);
160 int renameSelectedFile(
const char *currentPath,
const char *oldName);
161 int split(
char delim,
char *stringtosplit);
162 int tarOneFile(
char tarFileName[],
char tarPathname[],
char tarSaveName[]);
163 int xdgFile(
char *file);
164 int YesOrNo(
const char *question);
165 int zipMarkedFiles(
char *destDir,
char *zipathname,
struct filemarker **f);
167 struct stat fileStat(char filepath[]);
168 void logger(
const char *logger);
169 void markOneMoreFile(
struct filemarker **filelist,
char *filepath);
170 void message(
char *msg);
171 void my_tolower(
char *s);
172 void nffm_init_color(
void);
173 void normalColor(WINDOW *w,
cursor c,
char *item);
175 void refreshFileInfo(
char currentDir[],
char currentFile[]);
177 int toStringFileType(mode_t perm,
char *ft);
178 int toStringPerms(mode_t perm,
char sp[]);