]> git.mdlowis.com Git - proto/aos.git/commitdiff
resolved conflict
authorMichael D. Lowis <mike.lowis@gentex.com>
Wed, 15 Dec 2021 14:05:57 +0000 (09:05 -0500)
committerMichael D. Lowis <mike.lowis@gentex.com>
Wed, 15 Dec 2021 14:05:57 +0000 (09:05 -0500)
bin/edit.c
inc/libui.h
lib/a/gc.c
lib/a/opts_parse.c
lib/a/opts_setoption.c [new file with mode: 0644]
tools/build.sh

index cbfdb1c54dad327ce77458d25d3268bcbaddbe3c..3ea9348677813dcdd93ec3ae81456f349a860e38 100644 (file)
@@ -1,3 +1,16 @@
+#include <liba.h>
+
+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;
index f3e2bc91d6c7f91c860489c53aa57885d9832c78..2e2ed3e174ae40da24f131d15a8374a4243b4a60 100644 (file)
@@ -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;
index 5c0699dbbc5938f95d23667d6c7f2fdd32625416..c2937106dd68318d074066595b2fe096f7d921c0 100644 (file)
@@ -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);
index 91db57c8500327a43ab3d3d5f7cd602ee351de7f..71c2924798e88dab817c401947c189917b32b8fb 100644 (file)
@@ -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 (file)
index 0000000..f2deb6a
--- /dev/null
@@ -0,0 +1,8 @@
+#include <liba.h>
+
+void opts_setoption(int sname, char* lname, char* arg)
+{
+    (void)sname;
+    (void)lname;
+    (void)arg;
+}
index 112e9dba85da381a831396bea4efd6d8b51172b7..fd5141f009b67486a306f501fe3c7cc83e0afc89 100755 (executable)
@@ -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