/*
- * Copyright (C) 2005-2013 Andrea Zagli <azagli@libero.it>
+ * Copyright (C) 2005-2015 Andrea Zagli <azagli@libero.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#endif
#include <stdio.h>
+#include <glib/gprintf.h>
-#include "libaute.h"
+#include "libzakauth.h"
-static void aute_class_init (AuteClass *class);
-static void aute_init (Aute *form);
+static void zak_auth_class_init (ZakAuthClass *class);
+static void zak_auth_init (ZakAuth *form);
-static void aute_set_property (GObject *object,
+static void zak_auth_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec);
-static void aute_get_property (GObject *object,
+static void zak_auth_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec);
-static void aute_finalize (GObject *object);
+static void zak_auth_finalize (GObject *object);
-GModule *aute_get_module_from_confi (Aute *aute);
+GModule *zak_auth_get_module_from_confi (ZakAuth *aute);
-#define AUTE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TYPE_AUTE, AutePrivate))
+#define ZAK_AUTH_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_TYPE_AUTH, ZakAuthPrivate))
-typedef struct _AutePrivate AutePrivate;
-struct _AutePrivate
+typedef struct _ZakAuthPrivate ZakAuthPrivate;
+struct _ZakAuthPrivate
{
GModule *module;
#endif
};
-G_DEFINE_TYPE (Aute, aute, G_TYPE_OBJECT)
+G_DEFINE_TYPE (ZakAuth, zak_auth, G_TYPE_OBJECT)
static void
-aute_class_init (AuteClass *class)
+zak_auth_class_init (ZakAuthClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
- object_class->set_property = aute_set_property;
- object_class->get_property = aute_get_property;
- object_class->finalize = aute_finalize;
+ object_class->set_property = zak_auth_set_property;
+ object_class->get_property = zak_auth_get_property;
+ object_class->finalize = zak_auth_finalize;
- g_type_class_add_private (object_class, sizeof (AutePrivate));
+ g_type_class_add_private (object_class, sizeof (ZakAuthPrivate));
}
static void
-aute_init (Aute *form)
+zak_auth_init (ZakAuth *form)
{
- AutePrivate *priv = AUTE_GET_PRIVATE (form);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (form);
priv->module = NULL;
priv->parameters = NULL;
}
/**
- * aute_new:
+ * zak_auth_new:
*
- * Returns: the newly created #Aute object.
+ * Returns: the newly created #ZakAuth object.
*/
-Aute
-*aute_new ()
+ZakAuth
+*zak_auth_new ()
{
- return AUTE (g_object_new (aute_get_type (), NULL));
+ return ZAK_AUTH (g_object_new (zak_auth_get_type (), NULL));
}
/*
- * aute_set_config:
- * @aute: an #Aute object.
+ * zak_auth_set_config:
+ * @aute: an #ZakAuth object.
* @parameters: a #GSList of config parameters.
*
*/
gboolean
-aute_set_config (Aute *aute, GSList *parameters)
+zak_auth_set_config (ZakAuth *aute, GSList *parameters)
{
gchar *module_name;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
g_return_val_if_fail (parameters != NULL && parameters->data != NULL, FALSE);
if (IS_CONFI (priv->parameters->data))
{
priv->confi = CONFI (priv->parameters->data);
- module_name = aute_get_module_from_confi (aute);
+ module_name = zak_auth_get_module_from_confi (aute);
}
#endif
}
/**
- * aute_autentica:
- * @aute:
+ * zak_auth_auth:
+ * @aute:
*
- * Returns: il nome utente se l'autenticazione va a buon fine;
+ * Returns: il nome utente se l'autenticazione va a buon fine;
* stringa vuota ("") se viene premuto "Annulla"; NULL in caso di errore.
*/
gchar
-*aute_autentica (Aute *aute)
+*zak_auth_auth (ZakAuth *aute)
{
gchar *(*autentica) (GSList *parameters);
gchar *ret;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
g_return_val_if_fail (priv->module != NULL, NULL);
}
/**
- * aute_autentica_get_password:
- * @aute:
+ * zak_auth_get_password:
+ * @aute:
* @password:
*
- * Returns: il nome utente se l'autenticazione va a buon fine;
+ * Returns: il nome utente se l'autenticazione va a buon fine;
* stringa vuota ("") se viene premuto "Annulla"; NULL in caso di errore.
* Nel parametro @password ritorna la password inserita.
*/
gchar
-*aute_autentica_get_password (Aute *aute, gchar **password)
+*zak_auth_get_password (ZakAuth *aute, gchar **password)
{
- gchar *(*autentica_get_password) (GSList *parameters, gchar **password);
+ gchar *(*zak_auth_plg_get_password) (GSList *parameters, gchar **password);
gchar *ret;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
g_return_val_if_fail (priv->module != NULL, NULL);
ret = NULL;
/* loading the function */
- if (!g_module_symbol (priv->module, "autentica_get_password", (gpointer *)&autentica_get_password))
+ if (!g_module_symbol (priv->module, "zak_auth_plg_get_password", (gpointer *)&zak_auth_plg_get_password))
{
/* TO DO */
- g_warning ("Error g_module_symbol: autentica_get_password.\n");
+ g_warning ("Error g_module_symbol: zak_auth_plg_get_password.\n");
- /* try aute_autentica */
- ret = aute_autentica (aute);
+ /* try zak_auth_auth */
+ ret = zak_auth_auth (aute);
}
else
{
/* calling plugin's function */
- ret = (*autentica_get_password) (priv->parameters, password);
+ ret = (*zak_auth_plg_get_password) (priv->parameters, password);
}
return ret;
}
/**
- * aute_autentica:
- * @aute:
+ * zak_auth_get_management_gui:
+ * @aute:
*
*/
GtkWidget
-*aute_get_management_gui (Aute *aute)
+*zak_auth_get_management_gui (ZakAuth *aute)
{
GtkWidget *(*get_management_gui) (GSList *parameters);
GtkWidget *ret;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
g_return_val_if_fail (priv->module != NULL, NULL);
/* PRIVATE */
static void
-aute_set_property (GObject *object,
+zak_auth_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
- Aute *aute = (Aute *)object;
+ ZakAuth *aute = (ZakAuth *)object;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
switch (property_id)
{
}
static void
-aute_get_property (GObject *object,
+zak_auth_get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
- Aute *aute = (Aute *)object;
+ ZakAuth *aute = (ZakAuth *)object;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
switch (property_id)
{
}
static void
-aute_finalize (GObject *object)
+zak_auth_finalize (GObject *object)
{
- Aute *aute = AUTE (object);
+ ZakAuth *aute = ZAK_AUTH (object);
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
/* closing the library */
if (priv->module != NULL)
}
/* Chain up to the parent class */
- G_OBJECT_CLASS (aute_parent_class)->finalize (object);
+ G_OBJECT_CLASS (zak_auth_parent_class)->finalize (object);
}
#ifdef HAVE_LIBCONFI
/**
- * aute_get_plugin_module:
- * @aute: un oggetto #Aute.
+ * zak_auth_get_plugin_module:
+ * @aute: un oggetto #ZakAuth.
*
* Returns: il nome, con il percorso, del plugin.
* Returns: il nome, con il percorso, del plugin.
*/
gchar
-*aute_get_module_from_confi (Aute *aute)
+*zak_auth_get_module_from_confi (ZakAuth *aute)
{
gchar *libname;
- AutePrivate *priv = AUTE_GET_PRIVATE (aute);
+ ZakAuthPrivate *priv = ZAK_AUTH_GET_PRIVATE (aute);
g_return_val_if_fail (IS_CONFI (priv->confi), NULL);
g_warning ("Valore nullo della configurazione per il plugin.");
return NULL;
}
- libname = g_strconcat (LIBAUTE_PLUGINS_DIR "/", libname, NULL);
+ libname = g_strconcat (LIB_ZAK_AUTH_PLUGINS_DIR "/", libname, NULL);
return libname;
}
+++ /dev/null
-/*
- * Copyright 2005-2013 Andrea Zagli <azagli@libero.it>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __AUTE_H__
-#define __AUTE_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gmodule.h>
-#include <gtk/gtk.h>
-
-G_BEGIN_DECLS
-
-#define TYPE_AUTE (aute_get_type ())
-#define AUTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_AUTE, Aute))
-#define AUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_AUTE, AuteClass))
-#define IS_AUTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_AUTE))
-#define IS_AUTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_AUTE))
-#define AUTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_AUTE, AuteClass))
-
-
-typedef struct _Aute Aute;
-typedef struct _AuteClass AuteClass;
-
-struct _Aute
- {
- GObject parent;
- };
-
-struct _AuteClass
- {
- GObjectClass parent_class;
- };
-
-GType aute_get_type (void) G_GNUC_CONST;
-
-Aute *aute_new (void);
-
-gboolean aute_set_config (Aute *aute, GSList *parameters);
-
-gchar *aute_autentica (Aute *aute);
-gchar *aute_autentica_get_password (Aute *aute, gchar **password);
-
-GtkWidget *aute_get_management_gui (Aute *aute);
-
-
-G_END_DECLS
-
-
-#endif /* __AUTE_H__ */
--- /dev/null
+/*
+ * Copyright 2005-2015 Andrea Zagli <azagli@libero.it>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __ZAKAUTH_H__
+#define __ZAKAUTH_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include <gmodule.h>
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define ZAK_TYPE_AUTH (zak_auth_get_type ())
+#define ZAK_AUTH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ZAK_TYPE_AUTH, ZakAuth))
+#define ZAK_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ZAK_TYPE_AUTH, ZakAuthClass))
+#define ZAK_IS_AUTH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ZAK_TYPE_AUTH))
+#define ZAK_IS_AUTH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ZAK_TYPE_AUTH))
+#define ZAKAUTH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ZAK_TYPE_AUTH, ZakAuthClass))
+
+
+typedef struct _ZakAuth ZakAuth;
+typedef struct _ZakAuthClass ZakAuthClass;
+
+struct _ZakAuth
+ {
+ GObject parent;
+ };
+
+struct _ZakAuthClass
+ {
+ GObjectClass parent_class;
+ };
+
+GType zak_auth_get_type (void) G_GNUC_CONST;
+
+ZakAuth *zak_auth_new (void);
+
+gboolean zak_auth_set_config (ZakAuth *zakauth, GSList *parameters);
+
+gchar *zak_auth_auth (ZakAuth *zakauth);
+gchar *zak_auth_get_password (ZakAuth *zakauth, gchar **password);
+
+GtkWidget *zak_auth_get_management_gui (ZakAuth *zakauth);
+
+
+G_END_DECLS
+
+
+#endif /* __ZAKAUTH_H__ */