From a18a8b783d71859e01c550b0acf6e0cefbef0d9f Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Wed, 7 Aug 2024 22:34:44 -0400 Subject: Working demo for loading groups and entries from lua config --- src/include/read_cfg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include') diff --git a/src/include/read_cfg.h b/src/include/read_cfg.h index df3e5bd..a76e55e 100644 --- a/src/include/read_cfg.h +++ b/src/include/read_cfg.h @@ -1,6 +1,8 @@ #ifndef READ_CFG_H #define READ_CFG_H +#include + #define BUF_LEN 1024 bool cfg_interp(char *path); -- cgit From 4e68f637300c0e360d49f8f672d0675d42da0d1f Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Sun, 11 Aug 2024 17:49:28 -0400 Subject: (Currently broken) reimplementation of group and entry --- src/include/entry.h | 18 +++--------------- src/include/group.h | 24 +++++++----------------- src/include/read_cfg.h | 17 +++++++++-------- 3 files changed, 19 insertions(+), 40 deletions(-) (limited to 'src/include') diff --git a/src/include/entry.h b/src/include/entry.h index 51e43ca..a46dc46 100644 --- a/src/include/entry.h +++ b/src/include/entry.h @@ -1,17 +1,11 @@ +#include + #ifndef ENTRY_H #define ENTRY_H typedef struct entry 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); +ENTRY *create_entry(const char *new_name, const char *new_path, const bool force); char *get_ename(ENTRY *e); @@ -19,10 +13,4 @@ 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); - #endif diff --git a/src/include/group.h b/src/include/group.h index ab6f409..dc74bcc 100644 --- a/src/include/group.h +++ b/src/include/group.h @@ -1,17 +1,13 @@ #ifndef GROUP_H #define GROUP_H -typedef struct group GROUP; - -GROUP *create_group(char *new_name); - -void group_add(char *gname, ENTRY *addme); +#include -void group_rm(GROUP *g); +#include "entry.h" -void clean_groups(); //remove empty groups from linked list +typedef struct group GROUP; -GROUP **get_groups(); +GROUP *create_group(const char *new_name, const int entry_count); char *get_gname(GROUP *g); @@ -23,18 +19,12 @@ char *get_gflags(GROUP *g); void set_gflags(GROUP *g, char *p); -ENTRY *get_ghead(GROUP *g); +ENTRY **get_gentries(GROUP *g); + +void set_gentry(GROUP *g, int entry_index, ENTRY *new_entry); 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 - #endif diff --git a/src/include/read_cfg.h b/src/include/read_cfg.h index a76e55e..fc40cc0 100644 --- a/src/include/read_cfg.h +++ b/src/include/read_cfg.h @@ -3,23 +3,24 @@ #include +#include "group.h" + #define BUF_LEN 1024 -bool cfg_interp(char *path); +GROUP **cfg_interp(char *path, int *group_count); 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); +//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); //functions that differ by os extern char sep; char *find_config(); void mkconfig_wizard(char *path); -void handle_fname(char *path, char *group, bool recurs, bool force, char *name, int ln); #endif -- cgit From b5dd0df1808429a3c0ed1f86256962512b8273f5 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Tue, 13 Aug 2024 21:06:03 -0400 Subject: Working implementation for lua config --- src/include/cache.h | 2 ++ src/include/draw.h | 5 ++++- src/include/group.h | 3 +++ src/include/read_cfg.h | 6 ------ 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/include') diff --git a/src/include/cache.h b/src/include/cache.h index 894e4e1..701691f 100644 --- a/src/include/cache.h +++ b/src/include/cache.h @@ -1,6 +1,8 @@ #ifndef CACHE_H #define CACHE_H +#include + void save_to_cache(int g_count, int g_hover, int *e_hover, int *e_offset, int true_hover, char *cfg_name); void load_cache(int g_count, int *g_hover, int **e_hover, int **e_offset, int *true_hover, char *new_cfg_name); diff --git a/src/include/draw.h b/src/include/draw.h index 387ced3..022abe5 100644 --- a/src/include/draw.h +++ b/src/include/draw.h @@ -5,11 +5,14 @@ #define BUF_LEN 1024 +// currently selected group extern int g_hover; +// array of currently selected entries for each group extern int *e_hover; +// array of groups (as loaded from the config) extern struct group **g; -extern struct entry **e; +// returns the command to run for the current entry char *get_launch(); //functions that differ between os diff --git a/src/include/group.h b/src/include/group.h index dc74bcc..89a8422 100644 --- a/src/include/group.h +++ b/src/include/group.h @@ -27,4 +27,7 @@ int get_ecount(GROUP *g); void set_ecount(GROUP *g, int new_count); //for use in hiding entries +// print all group and entry information +void group_debug(GROUP *g); + #endif diff --git a/src/include/read_cfg.h b/src/include/read_cfg.h index fc40cc0..29a36e7 100644 --- a/src/include/read_cfg.h +++ b/src/include/read_cfg.h @@ -11,12 +11,6 @@ GROUP **cfg_interp(char *path, int *group_count); 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); //functions that differ by os extern char sep; -- cgit From 243853cd1692c56cae8642dd6bb35c3c75ff54f7 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Wed, 14 Aug 2024 16:32:54 -0400 Subject: Working support for setting launcher --- src/include/group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/group.h b/src/include/group.h index 89a8422..751b629 100644 --- a/src/include/group.h +++ b/src/include/group.h @@ -13,7 +13,7 @@ char *get_gname(GROUP *g); char *get_gprog(GROUP *g); -void set_gprog(GROUP *g, char *p); +void set_gprog(GROUP *g, const char *p); char *get_gflags(GROUP *g); -- cgit From 9adae33d5ffa4a72771266ba127f9ccc9b4b5221 Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Wed, 14 Aug 2024 16:51:06 -0400 Subject: Working support for setting launcher flags --- src/include/group.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/group.h b/src/include/group.h index 751b629..bad33a5 100644 --- a/src/include/group.h +++ b/src/include/group.h @@ -17,7 +17,7 @@ void set_gprog(GROUP *g, const char *p); char *get_gflags(GROUP *g); -void set_gflags(GROUP *g, char *p); +void set_gflags(GROUP *g, const char *p); ENTRY **get_gentries(GROUP *g); -- cgit From 996d3097cfa00363f16ff972b6da347b65ead23f Mon Sep 17 00:00:00 2001 From: Louie Shprung Date: Sat, 17 Aug 2024 14:50:07 -0400 Subject: Remove foldcase and hr options --- src/include/read_cfg.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/include') diff --git a/src/include/read_cfg.h b/src/include/read_cfg.h index 29a36e7..1337e32 100644 --- a/src/include/read_cfg.h +++ b/src/include/read_cfg.h @@ -8,8 +8,6 @@ #define BUF_LEN 1024 GROUP **cfg_interp(char *path, int *group_count); -bool get_sort(); -bool get_case_sensitivity(); void refer_to_doc(); //functions that differ by os -- cgit