+#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;
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;
/* Public Routines
***************************************/
-
void* gc_alloc(size_t sz)
{
sz = (sz / sizeof(intptr_t)) + ((sz % sizeof(intptr_t)) ? 1 : 0);
/* Private Routines
***************************************/
-
static void gc_scan_region(hash_t* oldzct, intptr_t* p_beg, intptr_t* p_end)
{
/* scan the region word by word */
/* Hashtable Routines
***************************************/
-
static uint64_t hash64(uint64_t key)
{
key = (~key) + (key << 21);
}
else
{
+ printf(" --%s=%s\n", lname, arg);
set_option(sname, lname, arg);
}
}
{
fatal("expected argument for option: '%s'", flag);
}
- handle_option(od->sname, od->lname, arg);
+ set_option(od->sname, od->lname, arg);
*currp += 1;
break;
}
}
else
{
- handle_option(od->sname, od->lname, NULL);
+ set_option(od->sname, od->lname, NULL);
}
}
*currp += 1;
--- /dev/null
+#include <liba.h>
+
+void opts_setoption(int sname, char* lname, char* arg)
+{
+ (void)sname;
+ (void)lname;
+ (void)arg;
+}
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