Changeset 3289

Show
Ignore:
Timestamp:
04/27/08 14:47:12 (5 months ago)
Author:
dgollub
Message:

Make use of OSyncList in Archive

Make use of OSyncList instead of GList, since osync_db_query makes also
use of OSyncList. osync_db_exists got renamed t osync_db_table_exists.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/opensync/archive/opensync_archive.c

    r2800 r3289  
    5858 
    5959        char *tbl_changes = g_strdup_printf("tbl_changes_%s", objtype); 
    60         int ret = osync_db_exists(db, tbl_changes, error); 
     60        int ret = osync_db_table_exists(db, tbl_changes, error); 
    6161        g_free(tbl_changes); 
    6262 
     
    9595 
    9696        char *tbl_changelog = g_strdup_printf("tbl_changelog_%s", objtype); 
    97         int ret = osync_db_exists(db, tbl_changelog, error); 
     97        int ret = osync_db_table_exists(db, tbl_changelog, error); 
    9898        g_free(tbl_changelog); 
    9999 
     
    131131 
    132132        char *tbl_archive = g_strdup_printf("tbl_archive_%s", objtype); 
    133         int ret = osync_db_exists(db, tbl_archive, error); 
     133        int ret = osync_db_table_exists(db, tbl_archive, error); 
    134134        g_free(tbl_archive); 
    135135 
     
    426426        osync_assert(memberids); 
    427427 
    428         GList *result = NULL, *row = NULL; 
     428        OSyncList *result = NULL, *row = NULL; 
    429429 
    430430        if (!osync_archive_create_changes(archive->db, objtype, error)) 
     
    441441 
    442442        for (row = result; row; row = row->next) {  
    443                 GList *column = row->data; 
    444  
    445                 long long int id = g_ascii_strtoull(g_list_nth_data(column, 0), NULL, 0); 
    446                 const char *uid = g_list_nth_data(column, 1);  
    447                 long long int mappingid = g_ascii_strtoull(g_list_nth_data(column, 2), NULL, 0); 
    448                 long long int memberid = g_ascii_strtoull(g_list_nth_data(column, 3), NULL, 0); 
     443                OSyncList *column = row->data; 
     444 
     445                long long int id = g_ascii_strtoull(osync_list_nth_data(column, 0), NULL, 0); 
     446                const char *uid = osync_list_nth_data(column, 1);  
     447                long long int mappingid = g_ascii_strtoull(osync_list_nth_data(column, 2), NULL, 0); 
     448                long long int memberid = g_ascii_strtoull(osync_list_nth_data(column, 3), NULL, 0); 
    449449                 
    450450                *ids = osync_list_append((*ids), GINT_TO_POINTER((int)id)); 
     
    519519        osync_assert(changetypes); 
    520520 
    521         GList *result = NULL; 
    522         GList *row = NULL; 
     521        OSyncList *result = NULL; 
     522        OSyncList *row = NULL; 
    523523 
    524524        if (!osync_archive_create_changelog(archive->db, objtype, error)) 
     
    535535 
    536536        for (row = result; row; row = row->next) {  
    537                 GList *column = row->data; 
    538  
    539                 long long int id = g_ascii_strtoull(g_list_nth_data(column, 0), NULL, 0); 
    540                 int changetype = atoi(g_list_nth_data(column, 1)); 
     537                OSyncList *column = row->data; 
     538 
     539                long long int id = g_ascii_strtoull(osync_list_nth_data(column, 0), NULL, 0); 
     540                int changetype = atoi(osync_list_nth_data(column, 1)); 
    541541                 
    542542                *ids = osync_list_append((*ids), GINT_TO_POINTER((int)id));