lib_LTLIBRARIES = libzakcgi.la
-libzakcgi_la_SOURCES = main.c \
+libzakcgi_la_SOURCES = \
+ form.c \
+ formelement.c \
+ main.c \
session.c \
tag.c \
url.c
libzakcgi_la_LDFLAGS = -no-undefined
-libzakcgi_include_HEADERS = libzakcgi.h \
+libzakcgi_include_HEADERS = \
+ libzakcgi.h \
+ form.h \
+ formelement.h \
main.h \
session.h \
tag.h \
--- /dev/null
+/*
+ * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <syslog.h>
+
+#include "form.h"
+
+static void zak_cgi_form_class_init (ZakCgiFormClass *class);
+static void zak_cgi_form_init (ZakCgiForm *zak_cgi_form);
+
+static void zak_cgi_form_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void zak_cgi_form_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void zak_cgi_form_dispose (GObject *gobject);
+static void zak_cgi_form_finalize (GObject *gobject);
+
+#define ZAK_CGI_FORM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_CGI_TYPE_FORM, ZakCgiFormPrivate))
+
+typedef struct _ZakCgiFormPrivate ZakCgiFormPrivate;
+struct _ZakCgiFormPrivate
+ {
+ ZakCgiMain *zakcgimain;
+ };
+
+G_DEFINE_TYPE (ZakCgiForm, zak_cgi_form, G_TYPE_OBJECT)
+
+static void
+zak_cgi_form_class_init (ZakCgiFormClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ object_class->set_property = zak_cgi_form_set_property;
+ object_class->get_property = zak_cgi_form_get_property;
+ object_class->dispose = zak_cgi_form_dispose;
+ object_class->finalize = zak_cgi_form_finalize;
+
+ g_type_class_add_private (object_class, sizeof (ZakCgiFormPrivate));
+}
+
+static void
+zak_cgi_form_init (ZakCgiForm *zak_cgi_form)
+{
+ ZakCgiFormPrivate *priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+
+ priv->zakcgimain = NULL;
+}
+
+/**
+ * zak_cgi_form_new:
+ * @zakcgimain:
+ *
+ * Returns: the newly created #ZakCgiForm object.
+ */
+ZakCgiForm
+*zak_cgi_form_new (ZakCgiMain *zakcgimain)
+{
+ ZakCgiForm *zak_cgi_form;
+ ZakCgiFormPrivate *priv;
+
+ zak_cgi_form = ZAK_CGI_FORM (g_object_new (zak_cgi_form_get_type (), NULL));
+
+ priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+ priv->zakcgimain = zakcgimain;
+
+ return zak_cgi_form;
+}
+
+/* PRIVATE */
+static void
+zak_cgi_form_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZakCgiForm *zak_cgi_form = (ZakCgiForm *)object;
+ ZakCgiFormPrivate *priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+zak_cgi_form_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZakCgiForm *zak_cgi_form = (ZakCgiForm *)object;
+ ZakCgiFormPrivate *priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+zak_cgi_form_dispose (GObject *gobject)
+{
+ ZakCgiForm *zak_cgi_form = (ZakCgiForm *)gobject;
+ ZakCgiFormPrivate *priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+
+
+ GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
+ parent_class->dispose (gobject);
+}
+
+static void
+zak_cgi_form_finalize (GObject *gobject)
+{
+ ZakCgiForm *zak_cgi_form = (ZakCgiForm *)gobject;
+ ZakCgiFormPrivate *priv = ZAK_CGI_FORM_GET_PRIVATE (zak_cgi_form);
+
+
+ GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
+ parent_class->finalize (gobject);
+}
--- /dev/null
+/*
+ * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __ZAK_CGI_FORM_H__
+#define __ZAK_CGI_FORM_H__
+
+
+#include <glib-object.h>
+
+#include "main.h"
+
+
+G_BEGIN_DECLS
+
+
+#define ZAK_CGI_TYPE_FORM (zak_cgi_form_get_type ())
+#define ZAK_CGI_FORM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZAK_CGI_TYPE_FORM, ZakCgiForm))
+#define ZAK_CGI_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZAK_CGI_TYPE_FORM, ZakCgiFormClass))
+#define ZAK_CGI_IS_FORM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZAK_CGI_TYPE_FORM))
+#define ZAK_CGI_IS_FORM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZAK_CGI_TYPE_FORM))
+#define ZAK_CGI_FORM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZAK_CGI_TYPE_FORM, ZakCgiFormClass))
+
+typedef struct _ZakCgiForm ZakCgiForm;
+typedef struct _ZakCgiFormClass ZakCgiFormClass;
+
+struct _ZakCgiForm
+ {
+ GObject parent_instance;
+ };
+
+struct _ZakCgiFormClass
+ {
+ GObjectClass parent_class;
+ };
+
+GType zak_cgi_form_get_type (void);
+
+
+ZakCgiForm *zak_cgi_form_new (ZakCgiMain *zakcgimain);
+
+
+G_END_DECLS
+
+
+#endif /* __ZAK_CGI_FORM_H__ */
--- /dev/null
+/*
+ * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+ #include <config.h>
+#endif
+
+#include <syslog.h>
+
+#include "formelement.h"
+
+static void zak_cgi_form_element_class_init (ZakCgiFormElementClass *class);
+static void zak_cgi_form_element_init (ZakCgiFormElement *zak_cgi_form_element);
+
+static void zak_cgi_form_element_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec);
+static void zak_cgi_form_element_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec);
+
+static void zak_cgi_form_element_dispose (GObject *gobject);
+static void zak_cgi_form_element_finalize (GObject *gobject);
+
+#define ZAK_CGI_FORM_ELEMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElementPrivate))
+
+typedef struct _ZakCgiFormElementPrivate ZakCgiFormElementPrivate;
+struct _ZakCgiFormElementPrivate
+ {
+ };
+
+G_DEFINE_TYPE (ZakCgiFormElement, zak_cgi_form_element, G_TYPE_OBJECT)
+
+static void
+zak_cgi_form_element_class_init (ZakCgiFormElementClass *class)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (class);
+
+ object_class->set_property = zak_cgi_form_element_set_property;
+ object_class->get_property = zak_cgi_form_element_get_property;
+ object_class->dispose = zak_cgi_form_element_dispose;
+ object_class->finalize = zak_cgi_form_element_finalize;
+
+ g_type_class_add_private (object_class, sizeof (ZakCgiFormElementPrivate));
+}
+
+static void
+zak_cgi_form_element_init (ZakCgiFormElement *zak_cgi_form_element)
+{
+ ZakCgiFormElementPrivate *priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+
+}
+
+/**
+ * zak_cgi_form_element_new:
+ *
+ * Returns: the newly created #ZakCgiFormElement object.
+ */
+ZakCgiFormElement
+*zak_cgi_form_element_new (void)
+{
+ ZakCgiFormElement *zak_cgi_form_element;
+ ZakCgiFormElementPrivate *priv;
+
+ zak_cgi_form_element = ZAK_CGI_FORM_ELEMENT (g_object_new (zak_cgi_form_element_get_type (), NULL));
+
+ priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+ return zak_cgi_form_element;
+}
+
+/* PRIVATE */
+static void
+zak_cgi_form_element_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ZakCgiFormElement *zak_cgi_form_element = (ZakCgiFormElement *)object;
+ ZakCgiFormElementPrivate *priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+zak_cgi_form_element_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ZakCgiFormElement *zak_cgi_form_element = (ZakCgiFormElement *)object;
+ ZakCgiFormElementPrivate *priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
+zak_cgi_form_element_dispose (GObject *gobject)
+{
+ ZakCgiFormElement *zak_cgi_form_element = (ZakCgiFormElement *)gobject;
+ ZakCgiFormElementPrivate *priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+
+ GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
+ parent_class->dispose (gobject);
+}
+
+static void
+zak_cgi_form_element_finalize (GObject *gobject)
+{
+ ZakCgiFormElement *zak_cgi_form_element = (ZakCgiFormElement *)gobject;
+ ZakCgiFormElementPrivate *priv = ZAK_CGI_FORM_ELEMENT_GET_PRIVATE (zak_cgi_form_element);
+
+
+
+ GObjectClass *parent_class = g_type_class_peek_parent (G_OBJECT_GET_CLASS (gobject));
+ parent_class->finalize (gobject);
+}
--- /dev/null
+/*
+ * Copyright (C) 2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef __ZAK_CGI_FORM_ELEMENT_H__
+#define __ZAK_CGI_FORM_ELEMENT_H__
+
+
+#include <glib-object.h>
+
+#include "main.h"
+
+
+G_BEGIN_DECLS
+
+
+#define ZAK_CGI_TYPE_FORM_ELEMENT (zak_cgi_form_element_get_type ())
+#define ZAK_CGI_FORM_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElement))
+#define ZAK_CGI_FORM_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElementClass))
+#define ZAK_CGI_IS_FORM_ELEMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZAK_CGI_TYPE_FORM_ELEMENT))
+#define ZAK_CGI_IS_FORM_ELEMENT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZAK_CGI_TYPE_FORM_ELEMENT))
+#define ZAK_CGI_FORM_ELEMENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZAK_CGI_TYPE_FORM_ELEMENT, ZakCgiFormElementClass))
+
+typedef struct _ZakCgiFormElement ZakCgiFormElement;
+typedef struct _ZakCgiFormElementClass ZakCgiFormElementClass;
+
+struct _ZakCgiFormElement
+ {
+ GObject parent_instance;
+ };
+
+struct _ZakCgiFormElementClass
+ {
+ GObjectClass parent_class;
+ };
+
+
+GType zak_cgi_form_element_get_type (void);
+
+ZakCgiFormElement *zak_cgi_form_element_new (void);
+
+
+G_END_DECLS
+
+
+#endif /* __ZAK_CGI_FORM_ELEMENT_H__ */
#define __LIBZAKCGI_H__
#include <libzakcgi/main.h>
+#include <libzakcgi/form.h>
#include <libzakcgi/session.h>
#include <libzakcgi/tag.h>
#include <libzakcgi/url.h>