Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=fwsetup-ng.git;a=commitdiff;h=0665335f4ddea494b73b888ae46502fba0e6bfd8

commit 0665335f4ddea494b73b888ae46502fba0e6bfd8
Author: James Buren <[email protected]>
Date:   Fri Aug 10 17:28:24 2012 -0500

improve c++ a bit

diff --git a/fwsetup.c b/fwsetup.c
index f85a572..8f7c681 100644
--- a/fwsetup.c
+++ b/fwsetup.c
@@ -2,7 +2,9 @@

extern int main(void)
{
-  struct database db = {0};
+  struct database db;
+
+  memzero(&db,sizeof(struct database));

#ifdef NEWT
if(newtInit() != 0)
diff --git a/fwsetup.h b/fwsetup.h
index fdc8bc4..052ec9d 100644
--- a/fwsetup.h
+++ b/fwsetup.h
@@ -4,9 +4,13 @@
#include <stdio.h>
#include <stdbool.h>
#include <stdarg.h>
+#include <string.h>
#include <unistd.h>
#include <assert.h>

+#define _(S) S
+#define memzero(P,N) memset(P,0,N)
+
#ifdef NEWT
#include <newt.h>

@@ -23,9 +27,18 @@ struct database
#error "No known user interface is defined."
#endif

+enum order
+{
+  ORDER_NONE,
+  ORDER_ERROR,
+  ORDER_PREVIOUS,
+  ORDER_NEXT
+};
+
struct module
{
-  bool (*run) (struct database *);
+  const char *name;
+  enum order (*run) (struct database *);
};

extern void eprintf(const char *s,...) __attribute__((format(printf,1,2)));;
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to