diff options
author | JP Rosevear <jpr@ximian.com> | 2001-01-23 07:10:22 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2001-01-23 07:10:22 +0800 |
commit | fa5982c96a3d17d6c61027e2ab4e7456d11348ef (patch) | |
tree | 906ca87c1ada387914724019160f34405ee76301 /e-util/e-pilot-map.c | |
parent | 38ae9b4005a01b869947dc075b6300dabd8769f7 (diff) | |
download | gsoc2013-evolution-fa5982c96a3d17d6c61027e2ab4e7456d11348ef.tar.gz gsoc2013-evolution-fa5982c96a3d17d6c61027e2ab4e7456d11348ef.tar.zst gsoc2013-evolution-fa5982c96a3d17d6c61027e2ab4e7456d11348ef.zip |
New function, can't use strlen on the md5 hash because it might have null
2001-01-22 JP Rosevear <jpr@ximian.com>
* e-dbhash.c (md5_to_dbt): New function, can't use strlen on the md5
hash because it might have null chars in it.
(e_dbhash_add): use md5_to_dbt
svn path=/trunk/; revision=7726
Diffstat (limited to 'e-util/e-pilot-map.c')
-rw-r--r-- | e-util/e-pilot-map.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c index 4f985ccace..67aacdcf2a 100644 --- a/e-util/e-pilot-map.c +++ b/e-util/e-pilot-map.c @@ -162,6 +162,45 @@ e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archi g_hash_table_insert (map->uid_map, new_uid, unode); } +void +e_pilot_map_remove_by_pid (EPilotMap *map, guint32 pid) +{ + EPilotMapPidNode *pnode; + EPilotMapUidNode *unode; + + pnode = g_hash_table_lookup (map->pid_map, &pid); + if (!pnode) + return; + + unode = g_hash_table_lookup (map->uid_map, pnode->uid); + + g_hash_table_remove (map->pid_map, &pid); + g_hash_table_remove (map->uid_map, pnode->uid); + + g_free (pnode); + g_free (unode); +} + +void +e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid) +{ + EPilotMapPidNode *pnode; + EPilotMapUidNode *unode; + + unode = g_hash_table_lookup (map->uid_map, uid); + if (!unode) + return; + + pnode = g_hash_table_lookup (map->pid_map, &unode->pid); + + g_hash_table_remove (map->uid_map, uid); + g_hash_table_remove (map->pid_map, &unode->pid); + + g_free (unode); + g_free (pnode); +} + + guint32 e_pilot_map_lookup_pid (EPilotMap *map, const char *uid) { |