Changeset 3291

Show
Ignore:
Timestamp:
04/27/08 14:49:21 (3 months ago)
Author:
dgollub
Message:

Port osyncdump to new osync_hashtable API

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/osyncdump.c

    r2566 r3291  
    103103} 
    104104 
     105static void print_hashtable(const char *uid, const char *hash, void *user_data) 
     106{ 
     107        printf("UID: %s\tHASH:%s\n", uid, hash); 
     108} 
     109 
    105110static void dump_hash(OSyncGroupEnv *env, const char *objtype, const char *groupname, char *memberid) 
    106111{ 
     
    126131        g_free(path); 
    127132         
    128         int i; 
    129         char *uid; 
    130         char *hash; 
    131         for (i = 0; i < osync_hashtable_num_entries(table); i++) { 
    132                 osync_hashtable_nth_entry(table, i, &uid, &hash); 
    133                 printf("UID: %s HASH: %s\n", uid, hash); 
    134                 g_free(hash); 
    135                 g_free(uid); 
    136         } 
    137          
    138         osync_hashtable_free(table); 
     133        osync_hashtable_foreach(table, print_hashtable, NULL); 
     134 
     135        osync_hashtable_unref(table); 
    139136         
    140137        return;