diff options
author | louie <lshprung@yahoo.com> | 2020-12-28 15:04:49 -0800 |
---|---|---|
committer | louie <lshprung@yahoo.com> | 2020-12-28 15:04:49 -0800 |
commit | 9fa266e62dc0782f7c2125f18fed2668ea414b29 (patch) | |
tree | 03c6d839fcb373a8877a4d66fc0c077bd629d90a | |
parent | d7fa91b54c7dcce8dedbe32f37cf849f530f8864 (diff) |
Cleaned up headers
-rw-r--r-- | draw.c | 14 | ||||
-rw-r--r-- | entry.c | 12 | ||||
-rw-r--r-- | group.c | 18 | ||||
-rw-r--r-- | group.h | 6 | ||||
-rw-r--r-- | read_cfg.c | 25 | ||||
-rw-r--r-- | read_cfg.h | 14 | ||||
-rw-r--r-- | unix/draw.c | 3 | ||||
-rw-r--r-- | unix/read_cfg.c | 5 | ||||
-rw-r--r-- | unix/read_cfg.h | 2 | ||||
-rw-r--r-- | windows/draw.c | 1 | ||||
-rw-r--r-- | windows/read_cfg.c | 5 | ||||
-rw-r--r-- | windows/read_cfg.h | 2 |
12 files changed, 30 insertions, 77 deletions
@@ -1,4 +1,9 @@ -//Windows Compatability +#include <stdbool.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +//Windows/Unix Compatability #if defined _WIN32 || defined _WIN64 #include <ncurses/ncurses.h> #include "windows/draw.h" @@ -9,14 +14,10 @@ #include "unix/read_cfg.h" #endif -#include <stdbool.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> #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; @@ -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; @@ -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; @@ -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 @@ -1,32 +1,21 @@ +#include <assert.h> +#include <stdbool.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + #if defined _WIN32 || defined _WIN64 #include "windows/read_cfg.h" #else #include "unix/read_cfg.h" #endif -#include <assert.h> -#include <stdbool.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> #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); @@ -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 <string.h> #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 |