aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-passwords.c56
2 files changed, 56 insertions, 6 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 3fd28a0093..258477a117 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-04 Dan Winship <danw@ximian.com>
+
+ * e-passwords.c (e_passwords_add_password): Make this dup the
+ strings it's passed.
+ (*) Add lots of docs.
+
2001-10-03 Rodrigo Moya <rodrigo@ximian.com>
* e-url.c (e_uri_new): default protocol to file: if not specified
diff --git a/e-util/e-passwords.c b/e-util/e-passwords.c
index f9c8780180..6e87bd96bc 100644
--- a/e-util/e-passwords.c
+++ b/e-util/e-passwords.c
@@ -44,6 +44,12 @@ static GHashTable *passwords = NULL;
static int base64_encode_close(unsigned char *in, int inlen, gboolean break_lines, unsigned char *out, int *state, int *save);
static int base64_encode_step(unsigned char *in, int len, gboolean break_lines, unsigned char *out, int *state, int *save);
+/**
+ * e_passwords_init:
+ *
+ * Initializes the e_passwords routines. Must be called before any other
+ * e_passwords_* function.
+ **/
void
e_passwords_init ()
{
@@ -73,6 +79,11 @@ free_entry (gpointer key, gpointer value, gpointer user_data)
return TRUE;
}
+/**
+ * e_passwords_shutdown:
+ *
+ * Cleanup routine to call before exiting.
+ **/
void
e_passwords_shutdown ()
{
@@ -83,6 +94,11 @@ e_passwords_shutdown ()
}
+/**
+ * e_passwords_forget_passwords:
+ *
+ * Forgets all cached passwords, in memory and on disk.
+ **/
void
e_passwords_forget_passwords ()
{
@@ -118,12 +134,25 @@ maybe_remember_password (gpointer key, gpointer password, gpointer url)
g_free (pass64);
}
+/**
+ * e_passwords_remember_password:
+ * @key: the key
+ *
+ * Saves the password associated with @key to disk.
+ **/
void
-e_passwords_remember_password (const char *url)
+e_passwords_remember_password (const char *key)
{
- g_hash_table_foreach (passwords, maybe_remember_password, (gpointer)url);
+ g_hash_table_foreach (passwords, maybe_remember_password, (gpointer)key);
}
+/**
+ * e_passwords_forget_password:
+ * @key: the key
+ *
+ * Forgets the password associated with @key for the rest of the session,
+ * but does not affect the on-disk cache.
+ **/
void
e_passwords_forget_password (const char *key)
{
@@ -137,16 +166,30 @@ e_passwords_forget_password (const char *key)
}
}
+/**
+ * e_passwords_get_password:
+ * @key: the key
+ *
+ * Return value: the password associated with @key, or %NULL.
+ **/
const char *
e_passwords_get_password (const char *key)
{
return g_hash_table_lookup (passwords, key);
}
+/**
+ * e_passwords_add_password:
+ * @key: a key
+ * @passwd: the password for @key
+ *
+ * This stores the @key/@passwd pair in the current session's password
+ * hash.
+ **/
void
e_passwords_add_password (const char *key, const char *passwd)
{
- g_hash_table_insert (passwords, (gpointer)key, (gpointer)passwd);
+ g_hash_table_insert (passwords, g_strdup (key), g_strdup (passwd));
}
@@ -164,9 +207,10 @@ e_passwords_add_password (const char *key, const char *passwd)
*
* Asks the user for a password.
*
- * Return value: the password, or %NULL if the user cancelled the
- * operation. *@remember will be set if the return value is non-%NULL
- * and @remember_type is not E_PASSWORDS_DO_NOT_REMEMBER.
+ * Return value: the password, which the caller must free, or %NULL if
+ * the user cancelled the operation. *@remember will be set if the
+ * return value is non-%NULL and @remember_type is not
+ * E_PASSWORDS_DO_NOT_REMEMBER.
**/
char *
e_passwords_ask_password (const char *title, const char *key,
tr> * Fix for # 333725Boby Wang2006-04-283-8/+15 * Fix for #332821Boby Wang2006-04-276-0/+235 * reviewed by: Harish Krishnaswamy <kharish@novell.com>Rajeev ramanathan2006-04-242-1/+9 * Fix for #319308Boby Wang2006-03-202-5/+22 * Fix for 331550.Harry Lu2006-03-063-0/+14 * reviewed by: Harish Krishnaswamy <kharish@novell.com>Kjartan Maraas2006-01-2711-66/+34 * use e_utf8_strftime() inSimon Zheng2006-01-102-1/+7 * Use g_ascii_strcasecmp() instead of g_strcasecmp() for well-definedness.Tor Lillqvist2005-12-172-1/+7 * Fix for #316351Harry Lu2005-09-282-0/+10 * Fixes #313514. For the code change in gnopernicus, we should useLi Yuan2005-08-172-4/+9 * Fixes #310136 #310138. The first items of e-table are column-header. So weLi Yuan2005-07-192-7/+17 * Added widgets in INCLUDES.Kaushal Kumar2005-06-231-2/+2 * Cosmetics.Tor Lillqvist2005-06-191-4/+4 * Makefile.am addressbook/Makefile.am calendar/Makefile.am UseTor Lillqvist2005-06-195-5/+7 * Makefile.am addressbook/Makefile.am calendar/Makefile.am Use the fakeTor Lillqvist2005-06-188-72/+102 * Remove stray trailing slash from -I path, confuses gcc on Win32.Tor Lillqvist2005-06-182-2/+3 * Remove stray trailing slash from -I path, confuses gcc on Win32.Tor Lillqvist2005-06-182-1/+6 * Retired GAL from Head. The relevant files have moved inside evolution.Kaushal Kumar2005-06-1735-80/+165 * add two files to sort table items. add table header. ditto.Li Yuan2005-05-204-10/+264 * Port to Windows, initial commit:Tor Lillqvist2005-04-2919-89/+109 * return FALSE to let GTK run "F6" handler.Li Yuan2005-04-281-1/+1 * change the order of the code to avoid a crash.Li Yuan2005-04-253-2/+12 * return proper atk_object name and atk_stateset to avoid crash.Yu Mengjie2005-04-073-4/+24 * New function to reset focus object. (eti_rows_deleted),Harry Lu2005-03-241-43/+45 * Fix for 72897 and 72797. no need to output the information. add instanceLi Yuan2005-02-255-22/+132 * Fix for 72793.Harry Lu2005-02-241-0/+7 * Fix for 72781Harry Lu2005-02-223-2/+10 * Fix for 72088.Harry Lu2005-02-042-1/+20 * Some code clean work.Harry Lu2005-02-049-16/+60 * Fix for 71924, 71926, 71932 Don't split sentences that need translation.Harry Lu2005-02-025-75/+72 * Fixes #71929Rodrigo Moya2005-01-313-4/+12 * fix a typo present in the string tooSivaiah Nallagatla2005-01-292-1/+7 * use ngetext instead of splitting the the sentence to take care ofSivaiah Nallagatla2005-01-282-14/+16 * add gal-a11y-e-cell-vbox.h and gal-a11y-e-cell-vbox.cLi Yuan2005-01-2714-452/+990 * use E_CALENDAR_VIEW, not E_CAL_VIEWJP Rosevear2005-01-163-33/+14 * add ea-combo-button.[ch] to Makefile.Harry Lu2005-01-046-1/+224 * Fix a warning.Harry Lu2004-12-092-2/+8 * Change e_minicard_activiate_editor to e_minicard_activate_editor.Hao Sheng2004-12-022-1/+7 * Implement accessible feature for e-minicard and e-mini-card-view. AddSteven Zhang2004-11-086-52/+447 * use ngettext for n_events. ditto.Li Yuan2004-11-033-12/+11 * for calendar_get_text_for_folder_bar_label has been removed formLi Yuan2004-10-295-5/+124 * Make accessibility name and description translatable.Li Yuan2004-09-3013-55/+401 * Fixes 59047.Eric Zhao2004-06-211-3/+51 * added castRadek Doulik2004-06-111-6/+6 * fixes to get rid of compiler warningsRadek Doulik2004-06-1110-47/+30 * clean code to avoid compiler warningsRadek Doulik2004-06-101-2/+4 * Add $(top_srcdir)/widgets/misc for the e-activity-handler.h stuffRodney Dawes2004-04-302-4/+10 * If the week view has no spans, there is no visible events in the view.Kidd Wang2004-04-232-0/+9 * Fixes #48974.Eric Zhao2004-04-221-1/+4