Changeset 4423
- Timestamp:
- 01/25/07 15:08:18 (2 years ago)
- Files:
-
- wire/trunk/wire/chats.c (modified) (6 diffs)
- wire/trunk/wire/client.c (modified) (11 diffs)
- wire/trunk/wire/client.h (modified) (3 diffs)
- wire/trunk/wire/commands.c (modified) (14 diffs)
- wire/trunk/wire/files.c (modified) (7 diffs)
- wire/trunk/wire/files.h (modified) (1 diff)
- wire/trunk/wire/ignores.c (modified) (1 diff)
- wire/trunk/wire/ignores.h (modified) (1 diff)
- wire/trunk/wire/main.c (modified) (7 diffs)
- wire/trunk/wire/main.h (modified) (1 diff)
- wire/trunk/wire/server.h (modified) (1 diff)
- wire/trunk/wire/terminal.c (modified) (1 diff)
- wire/trunk/wire/transfers.c (modified) (2 diffs)
- wire/trunk/wire/transfers.h (modified) (4 diffs)
- wire/trunk/wire/users.c (modified) (1 diff)
- wire/trunk/wire/users.h (modified) (1 diff)
- wire/trunk/wire/windows.c (modified) (13 diffs)
- wire/trunk/wire/windows.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wire/trunk/wire/chats.c
r4399 r4423 99 99 100 100 void wr_chats_add_chat(wr_chat_t *chat) { 101 wi_hash_set_data_for_key(wr_chats, chat, wi_number_with_int 32(chat->cid));101 wi_hash_set_data_for_key(wr_chats, chat, wi_number_with_integer(chat->cid)); 102 102 } 103 103 … … 105 105 106 106 void wr_chats_remove_chat(wr_chat_t *chat) { 107 wi_hash_remove_data_for_key(wr_chats, wi_number_with_int 32(chat->cid));107 wi_hash_remove_data_for_key(wr_chats, wi_number_with_integer(chat->cid)); 108 108 } 109 109 … … 111 111 112 112 wr_chat_t * wr_chats_chat_with_cid(wr_cid_t cid) { 113 return wi_hash_data_for_key(wr_chats, wi_number_with_int 32(cid));113 return wi_hash_data_for_key(wr_chats, wi_number_with_integer(cid)); 114 114 } 115 115 … … 212 212 void wr_chat_add_user(wr_chat_t *chat, wr_user_t *user) { 213 213 wi_array_add_data(chat->users_array, user); 214 wi_hash_set_data_for_key(chat->users_hash, user, wi_number_with_int 32(wr_user_id(user)));214 wi_hash_set_data_for_key(chat->users_hash, user, wi_number_with_integer(wr_user_id(user))); 215 215 } 216 216 … … 219 219 void wr_chat_remove_user(wr_chat_t *chat, wr_user_t *user) { 220 220 wi_array_remove_data(chat->users_array, user); 221 wi_hash_remove_data_for_key(chat->users_hash, wi_number_with_int 32(wr_user_id(user)));221 wi_hash_remove_data_for_key(chat->users_hash, wi_number_with_integer(wr_user_id(user))); 222 222 } 223 223 … … 232 232 233 233 wr_user_t * wr_chat_user_with_uid(wr_chat_t *chat, wr_uid_t uid) { 234 return wi_hash_data_for_key(chat->users_hash, wi_number_with_int 32(uid));234 return wi_hash_data_for_key(chat->users_hash, wi_number_with_integer(uid)); 235 235 } 236 236 wire/trunk/wire/client.c
r4399 r4423 42 42 #include "windows.h" 43 43 44 static intwr_runloop_server_callback(wi_socket_t *);45 46 static intwr_parse_message(wi_string_t *);44 static wi_integer_t wr_runloop_server_callback(wi_socket_t *); 45 46 static uint32_t wr_parse_message(wi_string_t *); 47 47 48 48 static void wr_msg_200(wi_array_t *); … … 81 81 82 82 wi_string_t *wr_host; 83 unsigned int wr_port;83 wi_uinteger_t wr_port; 84 84 85 85 wr_server_t *wr_server; … … 147 147 uint64_t wr_transferred_bytes; 148 148 149 intwr_news_count;150 intwr_news_limit;149 wi_integer_t wr_news_count; 150 wi_integer_t wr_news_limit; 151 151 152 152 wi_time_interval_t wr_ping_time; … … 157 157 158 158 void wr_client_init(void) { 159 intoptions;159 wi_integer_t options; 160 160 161 161 wr_socket_context = wi_socket_context_init(wi_socket_context_alloc()); … … 181 181 #pragma mark - 182 182 183 void wr_connect(wi_string_t *hostname, unsigned int port, wi_string_t *login, wi_string_t *password) {183 void wr_connect(wi_string_t *hostname, wi_uinteger_t port, wi_string_t *login, wi_string_t *password) { 184 184 wi_enumerator_t *enumerator; 185 185 wi_array_t *addresses; … … 285 285 #pragma mark - 286 286 287 static int wr_runloop_server_callback(wi_socket_t *socket) {287 static wi_integer_t wr_runloop_server_callback(wi_socket_t *socket) { 288 288 wi_string_t *string; 289 intmessage = 0;289 uint32_t message = 0; 290 290 291 291 string = wi_socket_read_to_string(wr_socket, 0.0, WI_STR(WR_MESSAGE_SEPARATOR_STR)); … … 307 307 #pragma mark - 308 308 309 static int wr_parse_message(wi_string_t *buffer) {309 static uint32_t wr_parse_message(wi_string_t *buffer) { 310 310 wi_array_t *arguments; 311 311 wi_string_t *string; 312 unsigned int message;312 wi_uinteger_t message; 313 313 314 314 string = wi_string_by_converting_encoding(buffer, wr_server_string_encoding, wr_client_string_encoding); … … 434 434 wi_boolean_t wr_send_command(wi_string_t *fmt, ...) { 435 435 wi_string_t *string; 436 intresult;436 wi_integer_t result; 437 437 va_list ap; 438 438 … … 455 455 wi_boolean_t wr_send_command_on_socket(wi_socket_t *socket, wi_string_t *fmt, ...) { 456 456 wi_string_t *string; 457 intresult;457 wi_integer_t result; 458 458 va_list ap; 459 459 … … 491 491 wr_server->startdate = wi_date_init_with_iso8601_string(wi_date_alloc(), WI_ARRAY(arguments, 4)); 492 492 wr_server->files = wi_string_uint32(WI_ARRAY(arguments, 4)); 493 wr_server->size = wi_string_uint 32(WI_ARRAY(arguments, 5));493 wr_server->size = wi_string_uint64(WI_ARRAY(arguments, 5)); 494 494 495 495 wr_draw_divider(); … … 732 732 wi_array_t *array, *transfers; 733 733 wi_string_t *string, *interval, *name, *transferred, *size, *speed; 734 uint32_tn;734 wi_uinteger_t n; 735 735 wi_boolean_t first; 736 736 wire/trunk/wire/client.h
r4399 r4423 52 52 void wr_client_init(void); 53 53 54 void wr_connect(wi_string_t *, unsigned int, wi_string_t *, wi_string_t *);54 void wr_connect(wi_string_t *, wi_uinteger_t, wi_string_t *, wi_string_t *); 55 55 void wr_disconnect(void); 56 56 … … 63 63 64 64 extern wi_string_t *wr_host; 65 extern unsigned intwr_port;65 extern wi_uinteger_t wr_port; 66 66 67 67 extern wr_server_t *wr_server; … … 79 79 extern uint64_t wr_transferred_bytes; 80 80 81 extern intwr_news_count;82 extern intwr_news_limit;81 extern wi_integer_t wr_news_count; 82 extern wi_integer_t wr_news_limit; 83 83 84 84 extern wi_time_interval_t wr_ping_time; wire/trunk/wire/commands.c
r4412 r4423 53 53 54 54 wi_boolean_t connected; 55 unsigned int optargs;56 intoptindex;55 wi_uinteger_t optargs; 56 wi_integer_t optindex; 57 57 wr_completer_t completer; 58 58 … … 62 62 63 63 64 static unsigned intwr_command_index(wi_string_t *);64 static wi_uinteger_t wr_command_index(wi_string_t *); 65 65 static void wr_command_usage(wi_string_t *); 66 66 … … 371 371 wi_array_t *array = NULL; 372 372 wi_string_t *command = NULL, *arguments; 373 unsigned int index;373 wi_uinteger_t index; 374 374 375 375 if(chat && !wi_string_has_prefix(buffer, WI_STR("/"))) … … 408 408 409 409 410 static unsigned int wr_command_index(wi_string_t *command) {410 static wi_uinteger_t wr_command_index(wi_string_t *command) { 411 411 const char *cstring; 412 unsigned int i, max, length;412 wi_uinteger_t i, max, length; 413 413 414 414 cstring = wi_string_cstring(command); … … 427 427 428 428 static void wr_command_usage(wi_string_t *command) { 429 unsigned int index;429 wi_uinteger_t index; 430 430 431 431 index = wr_command_index(command); … … 446 446 wi_string_t *command, *arguments; 447 447 wr_completer_t completer; 448 unsigned int index;448 wi_uinteger_t index; 449 449 450 450 /* complete nicks if empty */ … … 478 478 479 479 char * wr_readline_command_generator(const char *text, int state) { 480 static int i, max, length;481 const char *name;482 char *match;483 intbytes;484 wi_boolean_t help;480 static wi_integer_t i, max, length; 481 const char *name; 482 char *match; 483 wi_integer_t bytes; 484 wi_boolean_t help; 485 485 486 486 if(state == 0) { … … 580 580 wi_string_encoding_t *encoding; 581 581 wi_string_t *charset; 582 intoptions;582 wi_integer_t options; 583 583 584 584 charset = WI_ARRAY(arguments, 0); … … 650 650 wi_array_t *paths; 651 651 wi_string_t *path, *comment; 652 uint32_ti, count;652 wi_uinteger_t i, count; 653 653 654 654 count = wi_array_count(arguments); … … 728 728 wi_string_t *string; 729 729 wi_size_t size; 730 unsigned int i, x, max, length, max_length;730 wi_uinteger_t i, x, max, length, max_length; 731 731 732 732 if(wi_array_count(arguments) > 0) { … … 1077 1077 wi_string_t *frompath, *topath; 1078 1078 wi_boolean_t directory; 1079 uint32_ti, count;1079 wi_uinteger_t i, count; 1080 1080 1081 1081 if(wi_array_count(arguments) == 2) { … … 1137 1137 wr_news_limit = -1; 1138 1138 else 1139 wr_news_limit = wi_string_int 32(value);1139 wr_news_limit = wi_string_integer(value); 1140 1140 1141 1141 if(wr_news_limit == 0) { … … 1181 1181 wi_url_t *url; 1182 1182 const char **argv; 1183 unsigned int argc, i, port;1183 wi_uinteger_t argc, i, port; 1184 1184 int ch; 1185 1185 … … 1200 1200 1201 1201 case 'P': 1202 port = wi_string_uint 32(wi_string_with_cstring(optarg));1202 port = wi_string_uinteger(wi_string_with_cstring(optarg)); 1203 1203 break; 1204 1204 wire/trunk/wire/files.c
r4409 r4423 61 61 wi_string_t *path; 62 62 struct dirent **entries; 63 uint32_tcount, offset;63 wi_uinteger_t count, offset; 64 64 }; 65 65 typedef struct _wr_files_glob_dir wr_files_glob_dir_t; … … 119 119 char * wr_readline_filename_generator(const char *text, int state) { 120 120 static wi_string_t *directory_path; 121 static uint32_tindex;121 static wi_uinteger_t index; 122 122 wi_string_t *path, *full_path, *name; 123 123 wr_file_t *file; 124 124 char *cname; 125 125 wi_boolean_t root; 126 uint32_tcount;126 wi_uinteger_t count; 127 127 128 128 cname = ((*rl_filename_dequoting_function) ((char *) text, 0)); … … 244 244 245 245 246 wi_string_t * wr_files_string_for_count( unsigned int count) {246 wi_string_t * wr_files_string_for_count(wi_uinteger_t count) { 247 247 return wi_string_with_format(WI_STR("%u %@"), 248 248 count, … … 262 262 wi_array_t *array; 263 263 glob_t gl; 264 uint32_ti;264 wi_uinteger_t i; 265 265 266 266 gl.gl_opendir = wr_files_glob_opendir; … … 278 278 array = wi_array_init_with_capacity(wi_array_alloc(), gl.gl_pathc); 279 279 280 for(i = 0; i < ( uint32_t) gl.gl_pathc; i++)280 for(i = 0; i < (wi_uinteger_t) gl.gl_pathc; i++) 281 281 wi_array_add_data(array, wi_string_with_cstring(gl.gl_pathv[i])); 282 282 … … 293 293 wr_files_glob_dir_t *dir; 294 294 wr_file_t *file; 295 uint32_ti;295 wi_uinteger_t i; 296 296 297 297 dir = wi_malloc(sizeof(wr_files_glob_dir_t)); … … 333 333 static void wr_files_glob_closedir(void *p) { 334 334 wr_files_glob_dir_t *dir = p; 335 uint32_ti;335 wi_uinteger_t i; 336 336 337 337 wi_release(dir->path); wire/trunk/wire/files.h
r4399 r4423 65 65 wi_array_t * wr_files_full_paths(wi_array_t *); 66 66 wi_string_t * wr_files_string_for_size(wi_file_offset_t); 67 wi_string_t * wr_files_string_for_count( unsigned int);67 wi_string_t * wr_files_string_for_count(wi_uinteger_t); 68 68 69 69 wr_file_t * wr_file_alloc(void); wire/trunk/wire/ignores.c
r4399 r4423 88 88 89 89 char * wr_readline_ignore_generator(const char *text, int state) { 90 static uint32_tindex;90 static wi_uinteger_t index; 91 91 wi_string_t *name; 92 92 wr_ignore_t *ignore; 93 uint32_tcount;93 wi_uinteger_t count; 94 94 95 95 if(state == 0) wire/trunk/wire/ignores.h
r4399 r4423 30 30 #define WR_IGNORES_H 1 31 31 32 typedef uint32_twr_iid_t;32 typedef wi_uinteger_t wr_iid_t; 33 33 34 34 typedef struct _wr_ignore wr_ignore_t; wire/trunk/wire/main.c
r4411 r4423 59 59 static void wr_wi_log_callback(wi_string_t *); 60 60 61 static intwr_runloop(wi_array_t *, wi_time_interval_t);62 static intwr_runloop_stdin_callback(wi_socket_t *);61 static wi_integer_t wr_runloop(wi_array_t *, wi_time_interval_t); 62 static wi_integer_t wr_runloop_stdin_callback(wi_socket_t *); 63 63 64 64 … … 264 264 char * wr_readline_bookmark_generator(const char *text, int state) { 265 265 static wi_array_t *bookmarks; 266 static unsigned intindex, count, length;266 static wi_uinteger_t index, count, length; 267 267 wi_string_t *path, *string, *bookmark; 268 268 char *match = NULL; … … 323 323 wi_socket_t *socket; 324 324 wi_time_interval_t interval, ping_interval; 325 unsigned int i = 0;326 intresult;325 wi_uinteger_t i = 0; 326 wi_integer_t result; 327 327 328 328 pool = wi_pool_init(wi_pool_alloc()); … … 365 365 366 366 367 void wr_runloop_run_for_socket(wi_socket_t *socket, wi_time_interval_t timeout, unsigned int message) {367 void wr_runloop_run_for_socket(wi_socket_t *socket, wi_time_interval_t timeout, wi_uinteger_t message) { 368 368 wi_array_t *array; 369 intresult;369 wi_integer_t result; 370 370 371 371 array = wi_array_init_with_data(wi_array_alloc(), socket, NULL); … … 374 374 result = wr_runloop(array, timeout); 375 375 376 if(result < 0 || ( unsigned int) result == message || (result >= 500 && result < 600))376 if(result < 0 || (wi_uinteger_t) result == message || (result >= 500 && result < 600)) 377 377 break; 378 378 } … … 385 385 #pragma mark - 386 386 387 static int wr_runloop(wi_array_t *array, wi_time_interval_t timeout) {387 static wi_integer_t wr_runloop(wi_array_t *array, wi_time_interval_t timeout) { 388 388 wi_socket_t *socket; 389 389 wr_runloop_callback_func_t *callback; … … 402 402 403 403 404 static int wr_runloop_stdin_callback(wi_socket_t *socket) {404 static wi_integer_t wr_runloop_stdin_callback(wi_socket_t *socket) { 405 405 wr_readline_read(); 406 406 wire/trunk/wire/main.h
r4399 r4423 58 58 59 59 void wr_runloop_run(void); 60 void wr_runloop_run_for_socket(wi_socket_t *, wi_time_interval_t, unsigned int);60 void wr_runloop_run_for_socket(wi_socket_t *, wi_time_interval_t, wi_uinteger_t); 61 61 62 62 wire/trunk/wire/server.h
r4399 r4423 38 38 wi_string_t *description; 39 39 wi_date_t *startdate; 40 u nsigned intfiles;40 uint32_t files; 41 41 wi_file_offset_t size; 42 42 }; wire/trunk/wire/terminal.c
r4399 r4423 305 305 wr_completer_t completer; 306 306 #endif 307 unsigned int i;307 wi_uinteger_t i; 308 308 wi_boolean_t add; 309 309 wire/trunk/wire/transfers.c
r4399 r4423 73 73 #pragma mark - 74 74 75 int wr_runloop_download_callback(wi_socket_t *socket) {75 wi_integer_t wr_runloop_download_callback(wi_socket_t *socket) { 76 76 wi_string_t *path; 77 77 wr_transfer_t *transfer; 78 78 char buf[8192]; 79 intbytes;79 wi_integer_t bytes; 80 80 81 81 bytes = wi_socket_read_buffer(socket, 15.0, buf, sizeof(buf)); … … 120 120 121 121 122 int wr_runloop_upload_callback(wi_socket_t *socket) {122 wi_integer_t wr_runloop_upload_callback(wi_socket_t *socket) { 123 123 wr_transfer_t *transfer; 124 124 char buf[8192]; 125 intbytes;125 wi_integer_t bytes; 126 126 127 127 transfer = wr_transfers_transfer_with_socket(socket); wire/trunk/wire/transfers.h
r4399 r4423 48 48 49 49 50 typedef uint32_twr_tid_t;50 typedef wi_uinteger_t wr_tid_t; 51 51 52 52 struct _wr_transfer { … … 67 67 wi_string_t *checksum; 68 68 69 u nsigned intqueue;69 uint32_t queue; 70 70 wi_time_interval_t start_time; 71 71 … … 73 73 wi_file_offset_t size; 74 74 wi_file_offset_t transferred; 75 u nsigned intspeed;75 uint32_t speed; 76 76 }; 77 77 typedef struct _wr_transfer wr_transfer_t; … … 81 81 void wr_transfers_clear(void); 82 82 83 intwr_runloop_download_callback(wi_socket_t *);84 intwr_runloop_upload_callback(wi_socket_t *);83 wi_integer_t wr_runloop_download_callback(wi_socket_t *); 84 wi_integer_t wr_runloop_upload_callback(wi_socket_t *); 85 85 86 86 void wr_transfers_download(wi_string_t *); wire/trunk/wire/users.c
r4399 r4423 86 86 87 87 char * wr_readline_nickname_generator(const char *text, int state) { 88 static uint32_tindex;88 static wi_uinteger_t index; 89 89 wi_array_t *users; 90 90 wi_string_t *name; 91 91 char *cname; 92 92 wr_user_t *user; 93 uint32_tcount;93 wi_uinteger_t count; 94 94 95 95 if(!wr_window_is_chat(wr_current_window)) wire/trunk/wire/users.h
r4399 r4423 30 30 #define WR_USERS_H 1 31 31 32 typedef uint32_twr_uid_t;33 typedef uint32_twr_icon_t;32 typedef wi_uinteger_t wr_uid_t; 33 typedef wi_uinteger_t wr_icon_t; 34 34 35 35 typedef struct _wr_user wr_user_t; wire/trunk/wire/windows.c
r4399 r4423 75 75 void wr_windows_clear(void) { 76 76 wr_window_t *window; 77 uint32_ti, count;77 wi_uinteger_t i, count; 78 78 79 79 count = wi_array_count(wr_windows); … … 114 114 115 115 void wr_windows_close_window(wr_window_t *window) { 116 uint32_tindex, previous_index;116 wi_uinteger_t index, previous_index; 117 117 118 118 index = wi_array_index_of_data(wr_windows, window); … … 165 165 166 166 void wr_windows_show_next(void) { 167 uint32_tindex, next_index;167 wi_uinteger_t index, next_index; 168 168 169 169 index = wi_array_index_of_data(wr_windows, wr_current_window); … … 181 181 182 182 void wr_windows_show_previous(void) { 183 uint32_tindex, previous_index;183 wi_uinteger_t index, previous_index; 184 184 185 185 index = wi_array_index_of_data(wr_windows, wr_current_window); … … 239 239 240 240 void wr_window_update_status(wr_window_t *window) { 241 uint32_tline, lines;241 wi_uinteger_t line, lines; 242 242 243 243 line = wi_terminal_buffer_current_line(window->buffer); … … 449 449 wi_string_t *prefix; 450 450 const char *color; 451 unsigned int length;451 wi_uinteger_t length; 452 452 453 453 length = wi_string_length(wr_nick); … … 486 486 wi_string_t *prefix; 487 487 const char *color; 488 unsigned int length;488 wi_uinteger_t length; 489 489 490 490 length = wi_string_length(wr_nick); … … 578 578 wi_array_t *users; 579 579 wr_user_t *user; 580 unsigned int max_length = 0;580 wi_uinteger_t max_length = 0; 581 581 582 582 if(window->chat == wr_public_chat) … … 599 599 600 600 601 void wr_print_user(wr_user_t *user, unsigned int max_length) {601 void wr_print_user(wr_user_t *user, wi_uinteger_t max_length) { 602 602 const char *color; 603 603 … … 625 625 wi_enumerator_t *enumerator; 626 626 wr_file_t *file; 627 unsigned int max_length = 0;627 wi_uinteger_t max_length = 0; 628 628 629 629 enumerator = wi_array_data_enumerator(wr_files); … … 640 640 641 641 642 void wr_print_file(wr_file_t *file, wi_boolean_t path, unsigned int max_length) {642 void wr_print_file(wr_file_t *file, wi_boolean_t path, wi_uinteger_t max_length) { 643 643 wi_string_t *name, *size; 644 644 const char *color; … … 716 716 wr_transfer_t *transfer; 717 717 wi_time_interval_t interval; 718 unsigned int i = 0;718 wi_uinteger_t i = 0; 719 719 720 720 interval = wi_time_interval(); … … 779 779 wi_point_t location; 780 780 const char *color; 781 unsigned int users, line, lines, windows;781 wi_uinteger_t users, line, lines, windows; 782 782 783 783 string = wi_string_with_format(WI_STR("%s%@"), WR_PREFIX, wr_nick); wire/trunk/wire/windows.h
r4399 r4423 83 83 84 84 85 typedef uint32_twr_wid_t;85 typedef wi_uinteger_t wr_wid_t; 86 86 87 87 … … 137 137 void wr_print_topic(void); 138 138 void wr_print_users(wr_window_t *); 139 void wr_print_user(wr_user_t *, unsigned int);139 void wr_print_user(wr_user_t *, wi_uinteger_t); 140 140 void wr_print_files(void); 141 void wr_print_file(wr_file_t *, wi_boolean_t, unsigned int);141 void wr_print_file(wr_file_t *, wi_boolean_t, wi_uinteger_t); 142 142 143 143 void wr_draw_header(void);
