action graph: Initial code.
authorFlorian Forster <ff@octo.it>
Sun, 2 May 2010 07:29:08 +0000 (09:29 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sun, 2 May 2010 07:29:08 +0000 (09:29 +0200)
Makefile
action_graph.c [new file with mode: 0644]
action_graph.h [new file with mode: 0644]
test.fcgi.c

index beef56c..54c269a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,12 +15,14 @@ graph_list.o: graph_list.c graph_list.h
 
 utils_params.o: utils_params.c utils_params.h
 
+action_graph.o: action_graph.c action_graph.h
+
 action_list_graphs.o: action_list_graphs.c action_list_graphs.h
 
 test: test.c utils_params.o
 
 test.fcgi: LDLIBS = -lfcgi
-test.fcgi: test.fcgi.c common.o graph_list.o utils_params.o action_list_graphs.o
+test.fcgi: test.fcgi.c common.o graph_list.o utils_params.o action_graph.o action_list_graphs.o
 
 .PHONY: clean
 
diff --git a/action_graph.c b/action_graph.c
new file mode 100644 (file)
index 0000000..afad488
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <fcgiapp.h>
+#include <fcgi_stdio.h>
+
+#include "action_graph.h"
+#include "graph_list.h"
+#include "utils_params.h"
+
+int action_graph (void)
+{
+  printf ("Content-Type: text/plain\n\n"
+      "Hello, this is %s\n", __func__);
+
+  return (0);
+} /* }}} int action_graph */
+
+/* vim: set sw=2 sts=2 et fdm=marker : */
diff --git a/action_graph.h b/action_graph.h
new file mode 100644 (file)
index 0000000..712f398
--- /dev/null
@@ -0,0 +1,7 @@
+#ifndef ACTION_GRAPH_H
+#define ACTION_GRAPH_H 1
+
+int action_graph (void);
+
+#endif /* ACTION_GRAPH_H */
+/* vim: set sw=2 sts=2 et fdm=marker : */
index d8edea7..e8d9bcb 100644 (file)
@@ -16,6 +16,7 @@
 #include "graph_list.h"
 #include "utils_params.h"
 
+#include "action_graph.h"
 #include "action_list_graphs.h"
 
 struct action_s
@@ -38,6 +39,7 @@ static int action_usage (void);
 
 static const action_t actions[] =
 {
+  { "graph",       action_graph },
   { "list_graphs", action_list_graphs },
   { "usage",       action_usage }
 };