summaryrefslogtreecommitdiff
path: root/new/test.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 22:38:11 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 22:38:11 -0400
commit50a227058a8d72f1fb885458b882cedb0e0d7f79 (patch)
treec68e86810a6036645278b707430532d9f767c7cc /new/test.c
parentd9315e6d8f528840dd396fbbeb96cb22c8a5df98 (diff)
Changed the allocation logging from a compile-time setting to the first initialization option.
Diffstat (limited to 'new/test.c')
-rw-r--r--new/test.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/new/test.c b/new/test.c
index e63ed89..991b62b 100644
--- a/new/test.c
+++ b/new/test.c
@@ -1,6 +1,7 @@
// 6 april 2015
#include "ui.h"
#include <stdio.h>
+#include <string.h>
int onClosing(uiWindow *w, void *data)
{
@@ -111,10 +112,21 @@ static void showSpaced(uiControl *c, void *data)
int main(int argc, char *argv[])
{
+ uiInitOptions o;
+ int i;
uiInitError *err;
uiControl *getButton, *setButton;
- err = uiInit(NULL);
+ memset(&o, 0, sizeof (uiInitOptions));
+ for (i = 1; i < argc; i++)
+ if (strcmp(argv[i], "leaks") == 0)
+ o.debugLogAllocations = 1;
+ else {
+ fprintf(stderr, "%s: unrecognized option %s\n", argv[0], argv[i]);
+ return 1;
+ }
+
+ err = uiInit(&o);
if (err != NULL) {
fprintf(stderr, "error initializing ui: %s\n", uiInitErrorMessage(err));
uiInitErrorFree(err);