Reorder configuration stuff

This commit is contained in:
lostd 2014-10-07 15:36:29 +00:00 committed by lostd
parent 88fd8fcf8b
commit 10d2d18cb2

39
noice.c
View file

@ -26,6 +26,27 @@
#define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y))
#define ISODD(x) ((x) & 1) #define ISODD(x) ((x) & 1)
struct assoc {
char *ext; /* Extension */
char *bin; /* Program */
};
/* Configuration */
struct assoc assocs[] = {
{ ".avi", "mplayer" },
{ ".mp4", "mplayer" },
{ ".mkv", "mplayer" },
{ ".mp3", "mplayer" },
{ ".ogg", "mplayer" },
{ ".srt", "less" },
{ ".txt", "less" },
{ "README", "less" },
};
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
/* /*
* Layout: * Layout:
* .--------- * .---------
@ -49,20 +70,6 @@ struct entry {
char name[MAXNAMLEN + 1]; char name[MAXNAMLEN + 1];
}; };
struct assoc {
char *ext; /* Extension */
char *bin; /* Program */
} assocs[] = {
{ ".avi", "mplayer" },
{ ".mp4", "mplayer" },
{ ".mkv", "mplayer" },
{ ".mp3", "mplayer" },
{ ".ogg", "mplayer" },
{ ".srt", "less" },
{ ".txt", "less" },
{ "README", "less" },
};
char * char *
openwith(char *file) openwith(char *file)
{ {
@ -266,10 +273,6 @@ redraw:
DPRINTF_D(cur); DPRINTF_D(cur);
DPRINTF_S(path); DPRINTF_S(path);
#define CWD "cwd: "
#define CURSR " > "
#define EMPTY " "
/* No text wrapping in cwd line */ /* No text wrapping in cwd line */
cwd = malloc(COLS * sizeof(char)); cwd = malloc(COLS * sizeof(char));
strncpy(cwd, path, COLS); strncpy(cwd, path, COLS);