From 3d7f882173dd82ce9c3fb1c14d4eb8190bed8db9 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Tue, 15 Oct 2013 15:57:48 +0200 Subject: [PATCH] Added function Aute::autentica_get_password. --- configure.ac | 2 +- src/aute.c | 37 ++++++++++++++++++++++++++++++++++++- src/libaute.h | 3 ++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 5343476..e46f2ef 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT([libaute], [0.1.0], [azagli@libero.it]) +AC_INIT([libaute], [0.1.1], [azagli@libero.it]) AC_CONFIG_SRCDIR([src/aute.c]) AC_CONFIG_HEADER([config.h]) diff --git a/src/aute.c b/src/aute.c index ba8b6b4..6004d63 100644 --- a/src/aute.c +++ b/src/aute.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2010 Andrea Zagli + * Copyright (C) 2005-2013 Andrea Zagli * * 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 @@ -178,6 +178,41 @@ gchar return ret; } +/** + * aute_autentica_get_password: + * @aute: + * @password: + * + * 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) +{ + gchar *(*autentica_get_password) (GSList *parameters, gchar **password); + gchar *ret; + + AutePrivate *priv = AUTE_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)) + { + /* TO DO */ + g_warning ("Error g_module_symbol\n"); + return NULL; + } + + /* calling plugin's function */ + ret = (*autentica_get_password) (priv->parameters, password); + + return ret; +} + /** * aute_autentica: * @aute: diff --git a/src/libaute.h b/src/libaute.h index bc3606c..7de5cc7 100644 --- a/src/libaute.h +++ b/src/libaute.h @@ -1,5 +1,5 @@ /* - * Copyright 2005-2010 Andrea Zagli + * Copyright 2005-2013 Andrea Zagli * * 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 @@ -54,6 +54,7 @@ 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); -- 2.49.0