From: Andrea Zagli Date: Wed, 26 Aug 2015 15:40:23 +0000 (+0200) Subject: Added Form::render_start. X-Git-Tag: v0.1.0~3^2~48 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=17d9488720b7ac71fadfb09f6272d11c3179ed2a;p=libzakcgi Added Form::render_start. --- diff --git a/src/form.c b/src/form.c index 0e154fd..b860475 100644 --- a/src/form.c +++ b/src/form.c @@ -136,6 +136,34 @@ zak_cgi_form_add_element (ZakCgiForm *zakcgiform, ZakCgiFormElement *element) return ret; } +/** + * zak_cgi_form_render_start: + * @zakcgiform: + * + * Returns: + */ +gchar +*zak_cgi_form_render_start (ZakCgiForm *zakcgiform) +{ + gchar *ret; + + GString *str; + + ZakCgiFormPrivate *priv; + + priv = ZAK_CGI_FORM_GET_PRIVATE (zakcgiform); + + str = g_string_new ("ht_attrs); + g_string_append_printf (str, "%s>", ret); + g_free (ret); + + ret = g_strdup (str->str); + + return ret; +} + /** * zak_cgi_form_render: * @zakcgiform: @@ -157,10 +185,10 @@ gchar priv = ZAK_CGI_FORM_GET_PRIVATE (zakcgiform); - str = g_string_new ("ht_attrs); - g_string_append_printf (str, "%s>", tmp); + tmp = zak_cgi_form_render_start (zakcgiform); + g_string_append (str, tmp); g_free (tmp); g_hash_table_iter_init (&iter, priv->ht_elems); diff --git a/src/form.h b/src/form.h index 107a1c0..f14b14d 100644 --- a/src/form.h +++ b/src/form.h @@ -56,6 +56,7 @@ ZakCgiForm *zak_cgi_form_new (ZakCgiMain *zakcgimain, ...); gboolean zak_cgi_form_add_element (ZakCgiForm *zakcgiform, ZakCgiFormElement *element); +gchar *zak_cgi_form_render_start (ZakCgiForm *zakcgiform); gchar *zak_cgi_form_render (ZakCgiForm *zakcgiform);