summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile18
-rw-r--r--draw.c15
-rw-r--r--entry.c8
-rw-r--r--group.c8
-rw-r--r--include/draw.h (renamed from draw.h)0
-rw-r--r--include/draw_extend.h6
-rw-r--r--include/entry.h (renamed from entry.h)0
-rw-r--r--include/group.h (renamed from group.h)0
-rw-r--r--include/read_cfg.h (renamed from read_cfg.h)0
-rw-r--r--include/read_cfg_extend.h (renamed from unix/read_cfg.h)4
-rw-r--r--read_cfg.c9
-rw-r--r--unix/draw.c5
-rw-r--r--unix/draw.h6
-rw-r--r--unix/read_cfg.c6
-rw-r--r--windows/draw.c9
-rw-r--r--windows/draw.h6
-rw-r--r--windows/read_cfg.c6
-rw-r--r--windows/read_cfg.h12
18 files changed, 51 insertions, 67 deletions
diff --git a/Makefile b/Makefile
index ad0bdab..46ca905 100644
--- a/Makefile
+++ b/Makefile
@@ -9,25 +9,23 @@ ifeq ($(OS),Windows_NT)
$(NAME): draw.o read_cfg.o group.o entry.o windows/draw.o windows/read_cfg.o
$(CC) -o $(NAME) draw.o read_cfg.o group.o entry.o windows/draw.o windows/read_cfg.o $(LIBS)
-draw.o: draw.c read_cfg.h group.h entry.h windows/draw.h windows/read_cfg.h
-windows/draw.o: windows/draw.c windows/draw.h draw.h
-read_cfg.o: read_cfg.c group.o entry.o windows/read_cfg.h
-windows/read_cfg.o: windows/read_cfg.c windows/read_cfg.h read_cfg.h
+windows/draw.o: windows/draw.c include/draw.h include/draw_extend.h
+windows/read_cfg.o: windows/read_cfg.c include/read_cfg.h include/read_cfg_extend.h
else
$(NAME): draw.o read_cfg.o group.o entry.o unix/draw.o unix/read_cfg.o
$(CC) -o $(NAME) draw.o read_cfg.o group.o entry.o unix/draw.o unix/read_cfg.o $(LIBS)
-draw.o: draw.c read_cfg.h group.h entry.h unix/draw.h unix/read_cfg.h
-unix/draw.o: unix/draw.c unix/draw.h draw.h
-read_cfg.o: read_cfg.c group.o entry.o unix/read_cfg.h
-windows/read_cfg.o: unix/read_cfg.c unix/read_cfg.h read_cfg.h
+unix/draw.o: unix/draw.c include/draw.h include/draw_extend.h
+unix/read_cfg.o: unix/read_cfg.c include/read_cfg.h include/read_cfg_extend.h
endif
-group.o: group.c group.h entry.h
-entry.o: entry.c entry.h read_cfg.h group.h
+draw.o: draw.c include/draw.h include/draw_extend.h include/entry.h include/group.h include/read_cfg.h include/read_cfg_extend.h
+read_cfg.o: read_cfg.c include/entry.h include/group.h include/read_cfg_extend.h
+group.o: group.c include/entry.h include/group.h include/read_cfg.h
+entry.o: entry.c include/entry.h include/group.h include/read_cfg.h
.PHONY: clean
diff --git a/draw.c b/draw.c
index b9d73d9..dd0eb89 100644
--- a/draw.c
+++ b/draw.c
@@ -6,18 +6,17 @@
//Windows/Unix Compatability
#if defined _WIN32 || defined _WIN64
#include <ncurses/ncurses.h>
-#include "windows/draw.h"
-#include "windows/read_cfg.h"
#else
#include <ncurses.h>
-#include "unix/draw.h"
-#include "unix/read_cfg.h"
#endif
-#include "entry.h"
-#include "group.h"
-#include "read_cfg.h"
-#include "draw.h"
+//*_extend.h headers handle differences in os (i.e. windows vs unix)
+#include "include/draw.h"
+#include "include/draw_extend.h"
+#include "include/entry.h"
+#include "include/group.h"
+#include "include/read_cfg.h"
+#include "include/read_cfg_extend.h"
#define MAX_LEN 6
#define GAP_SIZE 1
#define WIDTH (getmaxx(stdscr)) //width of the entire term
diff --git a/entry.c b/entry.c
index 89bed22..6dc5699 100644
--- a/entry.c
+++ b/entry.c
@@ -5,10 +5,10 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "entry.h"
-#include "group.h"
-#include "read_cfg.h"
-#define BUF_LEN 1024
+
+#include "include/entry.h"
+#include "include/group.h"
+#include "include/read_cfg.h"
typedef struct entry{
char name[BUF_LEN];
diff --git a/group.c b/group.c
index b7c7de0..0c0d5a0 100644
--- a/group.c
+++ b/group.c
@@ -4,10 +4,10 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "entry.h"
-#include "group.h"
-#include "read_cfg.h"
-#define BUF_LEN 1024
+
+#include "include/entry.h"
+#include "include/group.h"
+#include "include/read_cfg.h"
typedef struct group{
char name[BUF_LEN];
diff --git a/draw.h b/include/draw.h
index 275b8bb..275b8bb 100644
--- a/draw.h
+++ b/include/draw.h
diff --git a/include/draw_extend.h b/include/draw_extend.h
new file mode 100644
index 0000000..6876512
--- /dev/null
+++ b/include/draw_extend.h
@@ -0,0 +1,6 @@
+#ifndef DRAW_EXTEND_H
+#define DRAW_EXTEND_H
+
+void launch();
+
+#endif
diff --git a/entry.h b/include/entry.h
index 51e43ca..51e43ca 100644
--- a/entry.h
+++ b/include/entry.h
diff --git a/group.h b/include/group.h
index ab6f409..ab6f409 100644
--- a/group.h
+++ b/include/group.h
diff --git a/read_cfg.h b/include/read_cfg.h
index abb31cc..abb31cc 100644
--- a/read_cfg.h
+++ b/include/read_cfg.h
diff --git a/unix/read_cfg.h b/include/read_cfg_extend.h
index 029cb05..3c9cb24 100644
--- a/unix/read_cfg.h
+++ b/include/read_cfg_extend.h
@@ -1,5 +1,5 @@
-#ifndef UNIX_READ_CFG_H
-#define UNIX_READ_CFG_H
+#ifndef READ_CFG_EXTEND_H
+#define READ_CFG_EXTEND_H
extern char sep;
diff --git a/read_cfg.c b/read_cfg.c
index 78df6a4..0213800 100644
--- a/read_cfg.c
+++ b/read_cfg.c
@@ -4,15 +4,18 @@
#include <stdlib.h>
#include <string.h>
+/*
#if defined _WIN32 || defined _WIN64
#include "windows/read_cfg.h"
#else
#include "unix/read_cfg.h"
#endif
+*/
-#include "entry.h"
-#include "group.h"
-#include "read_cfg.h"
+#include "include/entry.h"
+#include "include/group.h"
+#include "include/read_cfg.h"
+#include "include/read_cfg_extend.h"
#define MAX_ARGS 5
#define OPTION_CNT 14
diff --git a/unix/draw.c b/unix/draw.c
index b35b695..1037b4e 100644
--- a/unix/draw.c
+++ b/unix/draw.c
@@ -1,8 +1,9 @@
+#include <ncurses.h>
#include <stdlib.h>
#include <string.h>
-#include "../draw.h"
-#include "draw.h"
+#include "../include/draw.h"
+#include "../include/draw_extend.h"
void launch(){
char full_command[BUF_LEN];
diff --git a/unix/draw.h b/unix/draw.h
deleted file mode 100644
index b8e1c24..0000000
--- a/unix/draw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef UNIX_DRAW_H
-#define UNIX_DRAW_H
-
-void launch();
-
-#endif
diff --git a/unix/read_cfg.c b/unix/read_cfg.c
index fab91b4..b7fe45b 100644
--- a/unix/read_cfg.c
+++ b/unix/read_cfg.c
@@ -8,9 +8,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include "../read_cfg.h"
-#include "../entry.h"
-#include "read_cfg.h"
+#include "../include/read_cfg.h"
+#include "../include/entry.h"
+#include "../include/read_cfg_extend.h"
char sep = '/';
diff --git a/windows/draw.c b/windows/draw.c
index dd13cc8..b264a6b 100644
--- a/windows/draw.c
+++ b/windows/draw.c
@@ -1,10 +1,11 @@
+#include <ncurses/ncurses.h>
#include <stdbool.h>
#include <windows.h>
-#include "../draw.h"
-#include "../entry.h"
-#include "../group.h"
-#include "draw.h"
+#include "../include/draw.h"
+#include "../include/draw_extend.h"
+#include "../include/entry.h"
+#include "../include/group.h"
void launch(){
char *program = get_gprog(g[g_hover]);
diff --git a/windows/draw.h b/windows/draw.h
deleted file mode 100644
index acde6ee..0000000
--- a/windows/draw.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef WINDOWS_DRAW_H
-#define WINDOWS_DRAW_H
-
-void launch();
-
-#endif
diff --git a/windows/read_cfg.c b/windows/read_cfg.c
index 88f190f..70e4515 100644
--- a/windows/read_cfg.c
+++ b/windows/read_cfg.c
@@ -8,9 +8,9 @@
#include <sys/types.h>
#include <unistd.h>
-#include "../read_cfg.h"
-#include "../entry.h"
-#include "read_cfg.h"
+#include "../include/entry.h"
+#include "../include/read_cfg.h"
+#include "../include/read_cfg_extend.h"
char sep = '\\';
diff --git a/windows/read_cfg.h b/windows/read_cfg.h
deleted file mode 100644
index 19df23e..0000000
--- a/windows/read_cfg.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#ifndef WINDOWS_READ_CFG_H
-#define WINDOWS_READ_CFG_H
-
-extern char sep;
-
-char *find_config();
-
-void mkconfig_wizard();
-
-void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln);
-
-#endif