From d7e3011f5135db26ab911a65e8e5d6ad4faa45df Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 19 Dec 2001 15:15:22 +0000 Subject: clear all info from the map 2001-12-17 JP Rosevear * e-pilot-map.c (e_pilot_map_clear): clear all info from the map * e-pilot-map.h: add proto svn path=/trunk/; revision=15177 --- e-util/ChangeLog | 6 ++++++ e-util/e-pilot-map.c | 13 ++++++++++++- e-util/e-pilot-map.h | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'e-util') diff --git a/e-util/ChangeLog b/e-util/ChangeLog index 1b7dcf1da4..178ec7aa8b 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,9 @@ +2001-12-17 JP Rosevear + + * e-pilot-map.c (e_pilot_map_clear): clear all info from the map + + * e-pilot-map.h: add proto + 2001-12-10 JP Rosevear * e-pilot-util.c (e_pilot_utf8_to_pchar): use UTF-8 instead of diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c index 93ec68c050..a113427da3 100644 --- a/e-util/e-pilot-map.c +++ b/e-util/e-pilot-map.c @@ -275,7 +275,6 @@ e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid) EPilotMapPidNode *pnode = NULL; EPilotMapUidNode *unode = NULL; gpointer pkey, ukey; - gboolean found; g_return_if_fail (map != NULL); g_return_if_fail (uid != NULL); @@ -425,6 +424,18 @@ foreach_remove (gpointer key, gpointer value, gpointer data) return TRUE; } +void +e_pilot_map_clear (EPilotMap *map) +{ + g_return_if_fail (map != NULL); + + g_hash_table_foreach_remove (map->pid_map, foreach_remove, NULL); + g_hash_table_foreach_remove (map->uid_map, foreach_remove, NULL); + + map->since = 0; + map->write_touched_only = FALSE; +} + void e_pilot_map_destroy (EPilotMap *map) { diff --git a/e-util/e-pilot-map.h b/e-util/e-pilot-map.h index ddb1e043c8..ff02994645 100644 --- a/e-util/e-pilot-map.h +++ b/e-util/e-pilot-map.h @@ -51,6 +51,8 @@ const char * e_pilot_map_lookup_uid (EPilotMap *map, guint32 pid, gboolean touch int e_pilot_map_read (const char *filename, EPilotMap **map); int e_pilot_map_write (const char *filename, EPilotMap *map); +void e_pilot_map_clear (EPilotMap *map); + void e_pilot_map_destroy (EPilotMap *map); #endif /* E_PILOT_MAP_H */ -- cgit v1.2.3