&& test -d $srcdir/src \
&& test -f $srcdir/src/libzakauthe.h) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
- echo " top-level libaute directory"
+ echo " top-level libzakauthe directory"
exit 1
}
# Checks for libraries.
have_libconfi=no
-PKG_CHECK_MODULES(LIBAUTE, [gmodule-2.0 >= 2.10.0
- gtk+-3.0 >= 3.0.0])
+PKG_CHECK_MODULES(LIBZAKAUTHE, [gmodule-2.0 >= 2.10.0
+ gtk+-3.0 >= 3.0.0])
-AC_SUBST(LIBAUTE_CFLAGS)
-AC_SUBST(LIBAUTE_LIBS)
+AC_SUBST(LIBZAKAUTHE_CFLAGS)
+AC_SUBST(LIBZAKAUTHE_LIBS)
-PKG_CHECK_MODULES(LIBCONFI, [libconfi >= 0.0.2], [AC_DEFINE(HAVE_LIBCONFI, [1], [libconfi is present]), have_libconfi=yes], have_libconfi=no)
+PKG_CHECK_MODULES(LIBZAKCONFI, [libzakconfi >= 0.0.2], [AC_DEFINE(HAVE_LIBZAKCONFI, [1], [libzakconfi is present]), have_libzakconfi=yes], have_libzakconfi=no)
-AM_CONDITIONAL(HAVE_LIBCONFI, test x"$have_libconfi" = "xyes")
-AC_SUBST(LIBCONFI_CFLAGS)
-AC_SUBST(LIBCONFI_LIBS)
+AM_CONDITIONAL(HAVE_LIBZAKCONFI, test x"$have_libzakconfi" = "xyes")
+AC_SUBST(LIBZAKCONFI_CFLAGS)
+AC_SUBST(LIBZAKCONFI_LIBS)
-if test x"$have_libconfi" = "xyes"
+if test x"$have_libzakconfi" = "xyes"
then
- AC_SUBST(PKGCONFIG_DEPEND, [", libconfi"])
+ AC_SUBST(PKGCONFIG_DEPEND, [", libzakconfi"])
fi
# Checks for header files.
# of using the various options.
# The name of the module, e.g. 'glib'.
-DOC_MODULE=libaute
+DOC_MODULE=libzakauthe
# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
SCANGOBJ_OPTIONS=
# Extra options to supply to gtkdoc-scan.
-# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS=
# Extra options to supply to gtkdoc-mkdb.
# signals and properties.
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
-INCLUDES=-I$(top_srcdir) -I($top_builddir) $(LIBAUTE_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/src/libaute.la $(LIBAUTE_LIBS)
+INCLUDES=-I$(top_srcdir) -I($top_builddir) $(LIBZAKAUTHE_CFLAGS)
+GTKDOC_LIBS=$(top_builddir)/src/libzakauthe.la $(LIBZAKAUTHE_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
-AM_CPPFLAGS = $(LIBAUTE_CFLAGS) \
- $(LIBCONFI_CFLAGS) \
+AM_CPPFLAGS = $(LIBZAKAUTHE_CFLAGS) \
+ $(LIBZAKCONFI_CFLAGS) \
-DLIB_ZAK_AUTHE_PLUGINS_DIR=\""$(libdir)/libzakauthe/plugins"\"
-LIBS = $(LIBAUTE_LIBS) \
- $(LIBCONFI_LIBS)
+LIBS = $(LIBZAKAUTHE_LIBS) \
+ $(LIBZAKCONFI_LIBS)
lib_LTLIBRARIES = libzakauthe.la
#include <stdio.h>
#include <glib/gprintf.h>
+#ifdef HAVE_LIBZAKCONFI
+ #include <libzakconfi/libzakconfi.h>
+#endif
+
#include "libzakauthe.h"
static void zak_authe_class_init (ZakAutheClass *class);
GParamSpec *pspec);
static void zak_authe_finalize (GObject *object);
-GModule *zak_authe_get_module_from_confi (ZakAuthe *aute);
+static gchar *zak_authe_get_module_from_confi (ZakAuthe *aute);
#define ZAK_AUTHE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), ZAK_TYPE_AUTHE, ZakAuthePrivate))
GSList *parameters;
-#ifdef HAVE_LIBCONFI
- Confi *confi;
+#ifdef HAVE_LIBZAKCONFI
+ ZakConfi *confi;
#endif
};
priv->module = NULL;
priv->parameters = NULL;
-#ifdef HAVE_LIBCONFI
+#ifdef HAVE_LIBZAKCONFI
priv->confi = NULL;
#endif
}
module_name = NULL;
-#ifdef HAVE_LIBCONFI
- /* the first and only parameters must be a Confi object */
- Confi *confi;
-
- if (IS_CONFI (priv->parameters->data))
+#ifdef HAVE_LIBZAKCONFI
+ /* the first and only parameters must be a ZakConfi object */
+ if (g_strcmp0 ((gchar *)priv->parameters->data, "{libzakconfi}") == 0)
{
- priv->confi = CONFI (priv->parameters->data);
- module_name = zak_authe_get_module_from_confi (aute);
+ if (ZAK_IS_CONFI ((ZakConfi *)g_slist_nth_data (priv->parameters, 1)))
+ {
+ priv->confi = ZAK_CONFI ((ZakConfi *)g_slist_nth_data (priv->parameters, 1));
+ module_name = zak_authe_get_module_from_confi (aute);
+ }
}
#endif
return FALSE;
}
+ g_free (module_name);
+
return TRUE;
}
* zak_authe_authe:
* @aute:
*
- * Returns: il nome utente se l'autenticazione va a buon fine;
- * stringa vuota ("") se viene premuto "Annulla"; NULL in caso di errore.
+ * Returns: the user name if authentication is successfull;
+ * empty string ("") if it is clicked the "Cancel" button; #NULL on error.
*/
gchar
*zak_authe_authe (ZakAuthe *aute)
G_OBJECT_CLASS (zak_authe_parent_class)->finalize (object);
}
-#ifdef HAVE_LIBCONFI
+#ifdef HAVE_LIBZAKCONFI
/**
* zak_authe_get_plugin_module:
- * @aute: un oggetto #ZakAuthe.
+ * @aute: a #ZakAuthe object.
*
- * Returns: il nome, con il percorso, del plugin.
- * Returns: il nome, con il percorso, del plugin.
+ * Returns: plugin path.
*/
-gchar
+static gchar
*zak_authe_get_module_from_confi (ZakAuthe *aute)
{
gchar *libname;
ZakAuthePrivate *priv = ZAK_AUTHE_GET_PRIVATE (aute);
- g_return_val_if_fail (IS_CONFI (priv->confi), NULL);
+ g_return_val_if_fail (ZAK_IS_CONFI (priv->confi), NULL);
- libname = confi_path_get_value (priv->confi, "aute/plugin");
+ libname = zak_confi_path_get_value (priv->confi, "libzakauthe/plugin");
if (libname == NULL)
{
/* TO DO */
- g_warning ("Valore nullo della configurazione per il plugin.");
+ g_warning ("No config libzakauthe/plugin value found.");
return NULL;
}
- libname = g_strconcat (LIB_ZAK_AUTHE_PLUGINS_DIR "/", libname, NULL);
- return libname;
+ return g_strdup (libname);
}
#endif