clear all info from the map

2001-12-17  JP Rosevear  <jpr@ximian.com>

	* 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
This commit is contained in:
JP Rosevear
2001-12-19 15:15:22 +00:00
committed by JP Rosevear
parent eafe9dbcec
commit d7e3011f51
3 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2001-12-17 JP Rosevear <jpr@ximian.com>
* 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 <jpr@ximian.com>
* e-pilot-util.c (e_pilot_utf8_to_pchar): use UTF-8 instead of

View File

@ -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)
{

View File

@ -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 */