X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=test.fcgi.c;h=097c55cfee70700ea48e6622686f2bacc445c36f;hb=477b8a38dc1b3d0ae5e726f765722c962b2fcb46;hp=e8d9bcb87ccd54f1a327f1f122f4f6421651c1df;hpb=7e8bef2ff6fcec4812a6075cd7e690d9b13bec0d;p=collection4.git diff --git a/test.fcgi.c b/test.fcgi.c index e8d9bcb..097c55c 100644 --- a/test.fcgi.c +++ b/test.fcgi.c @@ -9,9 +9,6 @@ #include #include -#include -#include - #include "common.h" #include "graph_list.h" #include "utils_params.h" @@ -19,6 +16,11 @@ #include "action_graph.h" #include "action_list_graphs.h" +/* Include this last, so the macro magic of doesn't interfere + * with our own header files. */ +#include +#include + struct action_s { const char *name; @@ -26,15 +28,6 @@ struct action_s }; typedef struct action_s action_t; -#if 0 -struct str_array_s -{ - char **ptr; - size_t size; -}; -typedef struct str_array_s str_array_t; -#endif - static int action_usage (void); static const action_t actions[] = @@ -45,56 +38,6 @@ static const action_t actions[] = }; static const size_t actions_num = sizeof (actions) / sizeof (actions[0]); -#if 0 -static str_array_t *array_alloc (void) /* {{{ */ -{ - str_array_t *a; - - a = malloc (sizeof (*a)); - if (a == NULL) - return (NULL); - - memset (a, 0, sizeof (*a)); - a->ptr = NULL; - a->size = 0; - - return (a); -} /* }}} str_array_t *array_alloc */ - -static void array_free (str_array_t *a) /* {{{ */ -{ - if (a == NULL) - return; - - free (a->ptr); - a->ptr = NULL; - a->size = 0; - - free (a); -} /* }}} void array_free */ - -static int array_add (const char *entry, void *user_data) /* {{{ */ -{ - str_array_t *a = user_data; - char **ptr; - - if ((entry == NULL) || (a == NULL)) - return (EINVAL); - - ptr = realloc (a->ptr, sizeof (*a->ptr) * (a->size + 1)); - if (ptr == NULL) - return (ENOMEM); - a->ptr = ptr; - ptr = a->ptr + a->size; - - *ptr = strdup (entry); - if (*ptr == NULL) - return (ENOMEM); - - a->size++; - return (0); -} /* }}} int array_add */ -#endif static int action_usage (void) /* {{{ */ {