Changeset 5388

Show
Ignore:
Timestamp:
03/14/08 16:22:42 (4 months ago)
Author:
morris
Message:

Sync with libwired

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wired/trunk/wired/accounts.c

    r4985 r5388  
    185185        } 
    186186         
    187         wi_file_write(file, WI_STR("%#@:%#@:%#@:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%u:%u:%u:%u:%d:%#@\n"), 
    188                                 account->name, 
    189                                 account->password, 
    190                                 account->group, 
    191                                 account->get_user_info, 
    192                                 account->broadcast, 
    193                                 account->post_news, 
    194                                 account->clear_news, 
    195                                 account->download, 
    196                                 account->upload, 
    197                                 account->upload_anywhere, 
    198                                 account->create_folders, 
    199                                 account->alter_files, 
    200                                 account->delete_files, 
    201                                 account->view_dropboxes, 
    202                                 account->create_accounts, 
    203                                 account->edit_accounts, 
    204                                 account->delete_accounts, 
    205                                 account->elevate_privileges, 
    206                                 account->kick_users, 
    207                                 account->ban_users, 
    208                                 account->cannot_be_kicked, 
    209                                 account->download_speed, 
    210                                 account->upload_speed, 
    211                                 account->download_limit, 
    212                                 account->upload_limit, 
    213                                 account->set_topic, 
    214                                 account->files); 
     187        wi_file_write_format(file, WI_STR("%#@:%#@:%#@:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%u:%u:%u:%u:%d:%#@\n"), 
     188                                                account->name, 
     189                                                account->password, 
     190                                                account->group, 
     191                                                account->get_user_info, 
     192                                                account->broadcast, 
     193                                                account->post_news, 
     194                                                account->clear_news, 
     195                                                account->download, 
     196                                                account->upload, 
     197                                                account->upload_anywhere, 
     198                                                account->create_folders, 
     199                                                account->alter_files, 
     200                                                account->delete_files, 
     201                                                account->view_dropboxes, 
     202                                                account->create_accounts, 
     203                                                account->edit_accounts, 
     204                                                account->delete_accounts, 
     205                                                account->elevate_privileges, 
     206                                                account->kick_users, 
     207                                                account->ban_users, 
     208                                                account->cannot_be_kicked, 
     209                                                account->download_speed, 
     210                                                account->upload_speed, 
     211                                                account->download_limit, 
     212                                                account->upload_limit, 
     213                                                account->set_topic, 
     214                                                account->files); 
    215215         
    216216        result = true; 
     
    238238        } 
    239239         
    240         wi_file_write(file, WI_STR("%#@:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%u:%u:%u:%u:%d:%#@\n"), 
    241                                 account->name, 
    242                                 account->get_user_info, 
    243                                 account->broadcast, 
    244                                 account->post_news, 
    245                                 account->clear_news, 
    246                                 account->download, 
    247                                 account->upload, 
    248                                 account->upload_anywhere, 
    249                                 account->create_folders, 
    250                                 account->alter_files, 
    251                                 account->delete_files, 
    252                                 account->view_dropboxes, 
    253                                 account->create_accounts, 
    254                                 account->edit_accounts, 
    255                                 account->delete_accounts, 
    256                                 account->elevate_privileges, 
    257                                 account->kick_users, 
    258                                 account->ban_users, 
    259                                 account->cannot_be_kicked, 
    260                                 account->download_speed, 
    261                                 account->upload_speed, 
    262                                 account->download_limit, 
    263                                 account->upload_limit, 
    264                                 account->set_topic, 
    265                                 account->files); 
     240        wi_file_write_format(file, WI_STR("%#@:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%u:%u:%u:%u:%d:%#@\n"), 
     241                                                account->name, 
     242                                                account->get_user_info, 
     243                                                account->broadcast, 
     244                                                account->post_news, 
     245                                                account->clear_news, 
     246                                                account->download, 
     247                                                account->upload, 
     248                                                account->upload_anywhere, 
     249                                                account->create_folders, 
     250                                                account->alter_files, 
     251                                                account->delete_files, 
     252                                                account->view_dropboxes, 
     253                                                account->create_accounts, 
     254                                                account->edit_accounts, 
     255                                                account->delete_accounts, 
     256                                                account->elevate_privileges, 
     257                                                account->kick_users, 
     258                                                account->ban_users, 
     259                                                account->cannot_be_kicked, 
     260                                                account->download_speed, 
     261                                                account->upload_speed, 
     262                                                account->download_limit, 
     263                                                account->upload_limit, 
     264                                                account->set_topic, 
     265                                                account->files); 
    266266         
    267267        result = true; 
     
    406406         
    407407        while((string = wi_file_read_line(file))) 
    408                 wi_file_write(tmpfile, WI_STR("%@\n"), string); 
     408                wi_file_write_format(tmpfile, WI_STR("%@\n"), string); 
    409409         
    410410        wi_file_truncate(file, 0); 
     
    422422                } 
    423423                         
    424                 wi_file_write(file, WI_STR("%@\n"), string); 
     424                wi_file_write_format(file, WI_STR("%@\n"), string); 
    425425        } 
    426426         
     
    542542        while((string = wi_file_read_line(file))) { 
    543543                if(wi_string_length(string) == 0 || wi_string_has_prefix(string, WI_STR("#"))) { 
    544                         wi_file_write(tmpfile, WI_STR("%@\n"), string); 
     544                        wi_file_write_format(tmpfile, WI_STR("%@\n"), string); 
    545545                } else { 
    546546                        array = wi_string_components_separated_by_string(string, WI_STR(":")); 
     
    549549                                result = true; 
    550550                        else 
    551                                 wi_file_write(tmpfile, WI_STR("%@\n"), string); 
     551                                wi_file_write_format(tmpfile, WI_STR("%@\n"), string); 
    552552                } 
    553553        } 
     
    557557         
    558558        while((string = wi_file_read(tmpfile, WI_FILE_BUFFER_SIZE))) 
    559                 wi_file_write(file, WI_STR("%@"), string); 
     559                wi_file_write_format(file, WI_STR("%@"), string); 
    560560         
    561561        return result; 
  • wired/trunk/wired/files.c

    r5357 r5388  
    857857 
    858858                if(wi_file_rename(path, wd_settings.index)) { 
    859                         wi_file_write(file, WI_STR("%s%c%u%c%llu"), 
     859                        wi_file_write_format(file, WI_STR("%s%c%u%c%llu"), 
    860860                                "/",                                    WD_FIELD_SEPARATOR, 
    861861                                wd_files_unique_count,  WD_FIELD_SEPARATOR, 
     
    10021002                string = wi_date_iso8601_string(wi_date_with_time(sb.mtime)); 
    10031003                 
    1004                 wi_file_write(file, WI_STR("%#s%c%#s%#@%c%u%c%llu%c%#@%c%#@\n"), 
    1005                                         p->fts_name,                        WD_FIELD_SEPARATOR, 
    1006                                         pathprefix, 
    1007                                         virtualpath,                        WD_FIELD_SEPARATOR, 
    1008                                         type,                                       WD_FIELD_SEPARATOR, 
    1009                                         size,                                       WD_FIELD_SEPARATOR, 
    1010                                         string,                             WD_FIELD_SEPARATOR, 
    1011                                         string); 
    1012  
     1004                wi_file_write_format(file, WI_STR("%#s%c%#s%#@%c%u%c%llu%c%#@%c%#@\n"), 
     1005                                                        p->fts_name,                  WD_FIELD_SEPARATOR, 
     1006                                                        pathprefix, 
     1007                                                        virtualpath,                  WD_FIELD_SEPARATOR, 
     1008                                                        type,                                 WD_FIELD_SEPARATOR, 
     1009                                                        size,                                 WD_FIELD_SEPARATOR, 
     1010                                                        string,                               WD_FIELD_SEPARATOR, 
     1011                                                        string); 
     1012                 
    10131013                /* track unique inodes */ 
    10141014                set = wi_hash_data_for_key(wd_files_index_hash, (void *) sb.dev); 
     
    12301230         
    12311231        if(comment && wi_string_length(comment) > 0) { 
    1232                 wi_file_write(tmpfile, WI_STR("%#@%s%#@%s"), 
    1233                                         name,               WD_FILES_COMMENT_FIELD_SEPARATOR, 
    1234                                         comment,    WD_FILES_COMMENT_SEPARATOR); 
     1232                wi_file_write_format(tmpfile, WI_STR("%#@%s%#@%s"), 
     1233                                                        name,         WD_FILES_COMMENT_FIELD_SEPARATOR, 
     1234                                                        comment,      WD_FILES_COMMENT_SEPARATOR); 
    12351235                comments++; 
    12361236        } 
     
    12381238        while(wd_files_read_comment(file, &eachname, &eachcomment)) { 
    12391239                if(!wi_is_equal(name, eachname)) { 
    1240                         wi_file_write(tmpfile, WI_STR("%#@%s%#@%s"), 
    1241                                                 eachname,           WD_FILES_COMMENT_FIELD_SEPARATOR, 
    1242                                                 eachcomment,        WD_FILES_COMMENT_SEPARATOR); 
     1240                        wi_file_write_format(tmpfile, WI_STR("%#@%s%#@%s"), 
     1241                                                                eachname,             WD_FILES_COMMENT_FIELD_SEPARATOR, 
     1242                                                                eachcomment,  WD_FILES_COMMENT_SEPARATOR); 
    12431243                } 
    12441244                 
     
    12511251         
    12521252                while((string = wi_file_read(tmpfile, WI_FILE_BUFFER_SIZE))) 
    1253                         wi_file_write(file, WI_STR("%@"), string); 
     1253                        wi_file_write_format(file, WI_STR("%@"), string); 
    12541254 
    12551255                wi_file_close(file); 
  • wired/trunk/wired/news.c

    r4750 r5388  
    107107                                                                 news); 
    108108         
    109         wi_file_write(tmpfile, WI_STR("%#@%s"), post, WD_NEWS_SEPARATOR); 
     109        wi_file_write_format(tmpfile, WI_STR("%#@%s"), post, WD_NEWS_SEPARATOR); 
    110110         
    111111        while((string = wi_file_read(file, WI_FILE_BUFFER_SIZE))) 
    112                 wi_file_write(tmpfile, WI_STR("%@"), string); 
     112                wi_file_write_format(tmpfile, WI_STR("%@"), string); 
    113113         
    114114        wi_file_truncate(file, 0); 
     
    119119        while((string = wi_file_read_to_string(tmpfile, separator))) { 
    120120                if(!first) 
    121                         wi_file_write(file, WI_STR("%s"), WD_NEWS_SEPARATOR); 
     121                        wi_file_write_format(file, WI_STR("%s"), WD_NEWS_SEPARATOR); 
    122122                 
    123                 wi_file_write(file, WI_STR("%@"), string); 
     123                wi_file_write_format(file, WI_STR("%@"), string); 
    124124 
    125125                first = false;