]> saetta.ns0.it Git - zakform/tests/commitdiff
Updated with libzakformcgi.
authorAndrea Zagli <azagli@libero.it>
Mon, 12 Dec 2016 09:21:50 +0000 (10:21 +0100)
committerAndrea Zagli <azagli@libero.it>
Mon, 12 Dec 2016 09:21:50 +0000 (10:21 +0100)
configure.ac
src/cgi_ini.c

index a92f037558b320d10820f7b7672874223670b502..e8cbd143a0b7bf794cdd1121095b55410907a47c 100644 (file)
@@ -37,7 +37,8 @@ PKG_CHECK_MODULES(ZAKFORMTESTS, [libzakform
                                  libzakformgtk
                                  libzakformgdaex
                                  libzakformini
-                                 libzakcgi])
+                                 libzakcgi
+                                 libzakformcgi])
 
 AC_SUBST(ZAKFORMTESTS_CFLAGS)
 AC_SUBST(ZAKFORMTESTS_LIBS)
index 0ab6bbe379caae54c881098f905e087de6eda4ec..6668ec4d96a6387632165d4d1eebf86c949cf68a 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <libzakcgi/libzakcgi.h>
 #include <libzakform/libzakform.h>
+#include <libzakformcgi/libzakformcgi.h>
 #include <libzakformini/libzakformini.h>
 
 int
@@ -37,7 +38,7 @@ main (int argc, char *argv[])
        GValue *val;
        gchar *filename;
 
-       ZakCgiForm *form;
+       ZakFormCgiForm *form;
 
        ZakFormIniProvider *provider;
 
@@ -62,7 +63,7 @@ main (int argc, char *argv[])
        val = zak_cgi_main_get_parameter (zakcgimain, "filename");
        filename = (gchar *)g_value_get_string (val);
 
-       form = zak_cgi_form_new (zakcgimain,
+       form = zak_form_cgi_form_new (zakcgimain,
                                                         "method", "post",
                                                         "action", g_strdup_printf ("cgi_ini?filename=%s", filename),
                                                         NULL);
@@ -72,7 +73,7 @@ main (int argc, char *argv[])
                        if (zak_cgi_main_is_post (zakcgimain))
                                {
                                        /* validating the form */
-                                       zak_cgi_form_bind (form);
+                                       zak_form_cgi_form_bind (form);
                                        if (zak_form_form_is_valid (ZAK_FORM_FORM (form)))
                                                {
                                                        g_string_append (str, "<div class=\"alert alert-success\" role=\"alert\">Form is valid!!!</div>");
@@ -104,13 +105,13 @@ main (int argc, char *argv[])
 
                                                        g_string_append (str, "</div>");
 
-                                                       g_string_append (str, zak_cgi_form_render (form));
+                                                       g_string_append (str, zak_form_cgi_form_render (form));
                                                }
                                }
                        else
                                {
                                        zak_form_form_clear (ZAK_FORM_FORM (form));
-                                       g_string_append (str, zak_cgi_form_render (form));
+                                       g_string_append (str, zak_form_cgi_form_render (form));
                                }
                }