#include <config.h>
#endif
+#include <stdio.h>
+
#include "main.h"
static void zak_cgi_main_class_init (ZakCgiMainClass *class);
return ht;
}
+/**
+ * zak_cgi_main_dump_env:
+ *
+ * Returns: an html table with each environment variables.
+ */
gchar
*zak_cgi_main_dump_env ()
{
return ht;
}
+/**
+ * zak_cgi_main_get_stdin:
+ *
+ * Returns: the stdin.
+ */
+gchar
+*zak_cgi_main_get_stdin (void)
+{
+ gchar *ret;
+
+ guint l;
+
+ ret = NULL;
+
+ l = strtol (g_getenv ("CONTENT_LENGTH"), NULL, 10);
+ if (l > 0)
+ {
+ ret = g_malloc (l + 1);
+ fread (ret, l, 1, stdin);
+ ret[l] = '\0';
+ }
+
+ return ret;
+}
+
/* PRIVATE */
static void
zak_cgi_main_set_property (GObject *object,
g_string_append_printf (str, "%s\n</body>", env);
g_free (env);
+ env = zak_cgi_main_get_stdin ();
+ if (env != NULL)
+ {
+ g_string_append_printf (str,
+ "<br/><hr/>\n"
+ "%s",
+ env);
+ g_free (env);
+ }
+
zak_cgi_main_out (str->str);
g_string_free (str, TRUE);