From 9fa266e62dc0782f7c2125f18fed2668ea414b29 Mon Sep 17 00:00:00 2001 From: louie Date: Mon, 28 Dec 2020 15:04:49 -0800 Subject: Cleaned up headers --- draw.c | 14 +++++++------- entry.c | 12 ------------ group.c | 18 ------------------ group.h | 6 +++--- read_cfg.c | 25 +++++++------------------ read_cfg.h | 14 +++++++------- unix/draw.c | 3 +-- unix/read_cfg.c | 5 +---- unix/read_cfg.h | 2 +- windows/draw.c | 1 + windows/read_cfg.c | 5 +---- windows/read_cfg.h | 2 +- 12 files changed, 30 insertions(+), 77 deletions(-) diff --git a/draw.c b/draw.c index 2a09332..b9d73d9 100644 --- a/draw.c +++ b/draw.c @@ -1,4 +1,9 @@ -//Windows Compatability +#include +#include +#include +#include + +//Windows/Unix Compatability #if defined _WIN32 || defined _WIN64 #include #include "windows/draw.h" @@ -9,14 +14,10 @@ #include "unix/read_cfg.h" #endif -#include -#include -#include -#include #include "entry.h" #include "group.h" #include "read_cfg.h" -#define BUF_LEN 1024 +#include "draw.h" #define MAX_LEN 6 #define GAP_SIZE 1 #define WIDTH (getmaxx(stdscr)) //width of the entire term @@ -31,7 +32,6 @@ void update_col(int mode, int hl_where, bool resize); //0 = last, 1 = first; 0 = void switch_col(); void trav_col(int new_i); int locateChar(char input); -char *get_launch(); WINDOW *group_win = NULL; WINDOW *entry_win = NULL; diff --git a/entry.c b/entry.c index 188a2de..89bed22 100644 --- a/entry.c +++ b/entry.c @@ -18,18 +18,6 @@ typedef struct entry{ struct entry *next; } ENTRY; -ENTRY *create_entry(char *new_name, char *new_path, bool force); -void entry_rm(ENTRY *e, ENTRY *prev); -void clear_entries(ENTRY *head); -int entry_add(ENTRY *head, ENTRY *tail, ENTRY *add); -ENTRY **get_entries(ENTRY *head, int count); -char *get_ename(ENTRY *e); -char *get_epath(ENTRY *e); -bool get_eforce(ENTRY *e); -void set_hide(ENTRY *e, bool status); -bool get_hide(ENTRY *e); -void entry_debug(ENTRY *trav); - ENTRY *create_entry(char *new_name, char *new_path, bool force){ ENTRY *new; diff --git a/group.c b/group.c index a34556f..b7c7de0 100644 --- a/group.c +++ b/group.c @@ -20,24 +20,6 @@ typedef struct group{ bool launcher_quotes; //set by a group option whether or not the launcher should be wrapped by quotes } GROUP; -GROUP *create_group(char *new_name); -void group_add(char *gname, ENTRY *addme); -void group_rm(GROUP *g); -void clean_groups(); //remove empty groups from linked list -GROUP **get_groups(); -char *get_gname(GROUP *g); -char *get_gprog(GROUP *g); -void set_gprog(GROUP *g, char *p); -char *get_gflags(GROUP *g); -void set_gflags(GROUP *g, char *p); -ENTRY *get_ghead(GROUP *g); -int get_ecount(GROUP *g); -void set_ecount(GROUP *g, int new_count); //for use in hiding entries -void set_gquotes(GROUP *g, bool b); -bool get_gquotes(GROUP *g); -int get_gcount(); -void group_debug(); //debug function to output all groups - GROUP *groups_head; GROUP *gp; //pointer to remember last group that was looked at int group_count = 0; diff --git a/group.h b/group.h index 03db702..ab6f409 100644 --- a/group.h +++ b/group.h @@ -9,7 +9,7 @@ void group_add(char *gname, ENTRY *addme); void group_rm(GROUP *g); -void clean_groups(); +void clean_groups(); //remove empty groups from linked list GROUP **get_groups(); @@ -27,7 +27,7 @@ ENTRY *get_ghead(GROUP *g); int get_ecount(GROUP *g); -void set_ecount(GROUP *g, int new_count); +void set_ecount(GROUP *g, int new_count); //for use in hiding entries void set_gquotes(GROUP *g, bool b); @@ -35,6 +35,6 @@ bool get_gquotes(GROUP *g); int get_gcount(); -void group_debug(); +void group_debug(); //debug function to output all groups #endif diff --git a/read_cfg.c b/read_cfg.c index 8a4f902..78df6a4 100644 --- a/read_cfg.c +++ b/read_cfg.c @@ -1,32 +1,21 @@ +#include +#include +#include +#include +#include + #if defined _WIN32 || defined _WIN64 #include "windows/read_cfg.h" #else #include "unix/read_cfg.h" #endif -#include -#include -#include -#include -#include #include "entry.h" #include "group.h" -#define BUF_LEN 1024 +#include "read_cfg.h" #define MAX_ARGS 5 #define OPTION_CNT 14 -//public -void cfg_interp(char *path); -bool get_sort(); -bool get_case_sensitivity(); -void refer_to_doc(); -void addme(char *path, char *group, bool force, char *name); -int search_ch(char *str, char c); -int search_last_ch(char *str, char c); -int wild_cmp(char *wild, char *literal); -char *strip_quotes(char *str); -void error_mes(int ln, char *message); - //private void check_line(char *buffer, char **options, int ln); int check_option(char *arg, char **options); diff --git a/read_cfg.h b/read_cfg.h index d29bdd2..abb31cc 100644 --- a/read_cfg.h +++ b/read_cfg.h @@ -3,7 +3,7 @@ #define BUF_LEN 1024 -void cfg_interp(); +void cfg_interp(char *path); bool get_sort(); @@ -11,16 +11,16 @@ bool get_case_sensitivity(); void refer_to_doc(); -void addme(); +void addme(char *path, char *group, bool force, char *name); -int search_ch(); +int search_ch(char *str, char c); -int search_last_ch(); +int search_last_ch(char *str, char c); -int wild_cmp(); +int wild_cmp(char *wild, char *literal); -char *strip_quotes(); +char *strip_quotes(char *str); -void error_mes(); +void error_mes(int ln, char *message); #endif diff --git a/unix/draw.c b/unix/draw.c index f6424d0..b35b695 100644 --- a/unix/draw.c +++ b/unix/draw.c @@ -2,8 +2,7 @@ #include #include "../draw.h" - -void launch(); +#include "draw.h" void launch(){ char full_command[BUF_LEN]; diff --git a/unix/read_cfg.c b/unix/read_cfg.c index daa31f8..fab91b4 100644 --- a/unix/read_cfg.c +++ b/unix/read_cfg.c @@ -10,10 +10,7 @@ #include "../read_cfg.h" #include "../entry.h" - -char *find_config(); -void mkconfig_wizard(); -void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln); +#include "read_cfg.h" char sep = '/'; diff --git a/unix/read_cfg.h b/unix/read_cfg.h index ce0ad88..029cb05 100644 --- a/unix/read_cfg.h +++ b/unix/read_cfg.h @@ -7,6 +7,6 @@ char *find_config(); void mkconfig_wizard(); -void handle_fname(); +void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln); #endif diff --git a/windows/draw.c b/windows/draw.c index 5a69b09..dd13cc8 100644 --- a/windows/draw.c +++ b/windows/draw.c @@ -4,6 +4,7 @@ #include "../draw.h" #include "../entry.h" #include "../group.h" +#include "draw.h" void launch(){ char *program = get_gprog(g[g_hover]); diff --git a/windows/read_cfg.c b/windows/read_cfg.c index 7194e44..88f190f 100644 --- a/windows/read_cfg.c +++ b/windows/read_cfg.c @@ -10,10 +10,7 @@ #include "../read_cfg.h" #include "../entry.h" - -char *find_config(); -void mkconfig_wizard(); -void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln); +#include "read_cfg.h" char sep = '\\'; diff --git a/windows/read_cfg.h b/windows/read_cfg.h index 37684af..19df23e 100644 --- a/windows/read_cfg.h +++ b/windows/read_cfg.h @@ -7,6 +7,6 @@ char *find_config(); void mkconfig_wizard(); -void handle_fname(); +void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln); #endif -- cgit