From f2165d30c7749fcd9d4f42ca571023a96ad38a4a Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 15 Dec 2021 09:05:57 -0500 Subject: [PATCH] resolved conflict --- bin/edit.c | 13 +++++++++++++ inc/libui.h | 10 ++++++++++ lib/a/gc.c | 3 --- lib/a/opts_parse.c | 5 +++-- lib/a/opts_setoption.c | 8 ++++++++ tools/build.sh | 2 +- 6 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 lib/a/opts_setoption.c diff --git a/bin/edit.c b/bin/edit.c index cbfdb1c..3ea9348 100644 --- a/bin/edit.c +++ b/bin/edit.c @@ -1,3 +1,16 @@ +#include + +char* Usage = "edit [FLAGS...] [FILES...]"; +Option_T Options[] = { + { "v,verbose", "enable verbose mode" }, + { ":f,flag", "flag with an arg" }, + { "F,noflag", "flag without an arg" }, + { "a,noflag", "flag without an arg" }, + { "b,noflag", "flag without an arg" }, + { "c,noflag", "flag without an arg" }, + { 0, 0 } +}; + int main(int argc, char** argv) { (void)argc; diff --git a/inc/libui.h b/inc/libui.h index f3e2bc9..2e2ed3e 100644 --- a/inc/libui.h +++ b/inc/libui.h @@ -13,3 +13,13 @@ void ui_begin(UIWin* win); void ui_end(UIWin* win); +typedef struct Attr { + struct Attr* next; + char* name; + char* value; +} Attr; + +typedef struct Widget { + Attr* attributes; + void (*render)(struct Widget* w); +} Widget; diff --git a/lib/a/gc.c b/lib/a/gc.c index 5c0699d..c293710 100644 --- a/lib/a/gc.c +++ b/lib/a/gc.c @@ -65,7 +65,6 @@ static unsigned int Primes[] = { /* Public Routines ***************************************/ - void* gc_alloc(size_t sz) { sz = (sz / sizeof(intptr_t)) + ((sz % sizeof(intptr_t)) ? 1 : 0); @@ -96,7 +95,6 @@ int main(int argc, char** argv) /* Private Routines ***************************************/ - static void gc_scan_region(hash_t* oldzct, intptr_t* p_beg, intptr_t* p_end) { /* scan the region word by word */ @@ -232,7 +230,6 @@ static void obj_delref(object_t* obj) /* Hashtable Routines ***************************************/ - static uint64_t hash64(uint64_t key) { key = (~key) + (key << 21); diff --git a/lib/a/opts_parse.c b/lib/a/opts_parse.c index 91db57c..71c2924 100644 --- a/lib/a/opts_parse.c +++ b/lib/a/opts_parse.c @@ -9,6 +9,7 @@ static void handle_option(int sname, char* lname, char* arg) } else { + printf(" --%s=%s\n", lname, arg); set_option(sname, lname, arg); } } @@ -106,7 +107,7 @@ static void parse_shortopt(int optc, OptionDescriptor_T* optv, int* currp, char* { fatal("expected argument for option: '%s'", flag); } - handle_option(od->sname, od->lname, arg); + set_option(od->sname, od->lname, arg); *currp += 1; break; } @@ -117,7 +118,7 @@ static void parse_shortopt(int optc, OptionDescriptor_T* optv, int* currp, char* } else { - handle_option(od->sname, od->lname, NULL); + set_option(od->sname, od->lname, NULL); } } *currp += 1; diff --git a/lib/a/opts_setoption.c b/lib/a/opts_setoption.c new file mode 100644 index 0000000..f2deb6a --- /dev/null +++ b/lib/a/opts_setoption.c @@ -0,0 +1,8 @@ +#include + +void opts_setoption(int sname, char* lname, char* arg) +{ + (void)sname; + (void)lname; + (void)arg; +} diff --git a/tools/build.sh b/tools/build.sh index 112e9db..fd5141f 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -3,4 +3,4 @@ if [ "tools/build.c" -nt "tools/build.bin" ]; then cc -Wall -Wextra -Werror -o tools/build.bin tools/build.c fi -./tools/build.bin \ No newline at end of file +./tools/build.bin -- 2.52.0