Changeset 4766
- Timestamp:
- 05/14/07 01:11:38 (1 year ago)
- Files:
-
- wired/trunk/wired/files.c (modified) (3 diffs)
- wired/trunk/wired/users.c (modified) (13 diffs)
- wired/trunk/wired/users.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wired/trunk/wired/files.c
r4763 r4766 1155 1155 name, WD_FILES_COMMENT_FIELD_SEPARATOR, 1156 1156 comment, WD_FILES_COMMENT_SEPARATOR); 1157 1158 comments++; 1157 1159 } 1158 1160 … … 1167 1169 } 1168 1170 1169 if(comments > 1 || (comment && wi_string_length(comment) > 0)) {1171 if(comments > 1) { 1170 1172 wi_file_truncate(file, 0); 1171 1173 wi_file_seek(tmpfile, 0); … … 1254 1256 wi_string_resolve_aliases_in_path(realpath); 1255 1257 1256 dirpath = wi_autorelease(wi_copy(path)); 1257 wi_string_delete_last_path_component(dirpath); 1258 1258 dirpath = wi_string_by_deleting_last_path_component(path); 1259 1259 array = wi_string_path_components(dirpath); 1260 1260 count = wi_array_count(array); wired/trunk/wired/users.c
r4763 r4766 52 52 WI_STMT_END 53 53 54 #define WD_USER_SET_ OBJECT(user, dst, src)\54 #define WD_USER_SET_INSTANCE(user, dst, src) \ 55 55 WI_STMT_START \ 56 56 wi_recursive_lock_lock((user)->user_lock); \ … … 72 72 WI_STMT_END 73 73 74 #define WD_USER_RETURN_ OBJECT(user, src) \74 #define WD_USER_RETURN_INSTANCE(user, src) \ 75 75 WI_STMT_START \ 76 typeof(src) _ object; \76 typeof(src) _instance; \ 77 77 \ 78 78 wi_recursive_lock_lock((user)->user_lock); \ 79 _ object = wi_autorelease(wi_retain((src)));\79 _instance = wi_autorelease(wi_retain((src))); \ 80 80 wi_recursive_lock_unlock((user)->user_lock); \ 81 81 \ 82 return _ object;\82 return _instance; \ 83 83 WI_STMT_END 84 84 … … 439 439 440 440 void wd_user_set_account(wd_user_t *user, wd_account_t *account) { 441 WD_USER_SET_ OBJECT(user, user->account, account);441 WD_USER_SET_INSTANCE(user, user->account, account); 442 442 } 443 443 … … 445 445 446 446 wd_account_t * wd_user_account(wd_user_t *user) { 447 WD_USER_RETURN_ OBJECT(user, user->account);447 WD_USER_RETURN_INSTANCE(user, user->account); 448 448 } 449 449 … … 451 451 452 452 void wd_user_set_nick(wd_user_t *user, wi_string_t *nick) { 453 WD_USER_SET_ OBJECT(user, user->nick, nick);453 WD_USER_SET_INSTANCE(user, user->nick, nick); 454 454 } 455 455 … … 457 457 458 458 wi_string_t * wd_user_nick(wd_user_t *user) { 459 WD_USER_RETURN_ OBJECT(user, user->nick);459 WD_USER_RETURN_INSTANCE(user, user->nick); 460 460 } 461 461 … … 463 463 464 464 void wd_user_set_login(wd_user_t *user, wi_string_t *login) { 465 WD_USER_SET_ OBJECT(user, user->login, login);465 WD_USER_SET_INSTANCE(user, user->login, login); 466 466 } 467 467 … … 469 469 470 470 wi_string_t * wd_user_login(wd_user_t *user) { 471 WD_USER_RETURN_ OBJECT(user, user->login);471 WD_USER_RETURN_INSTANCE(user, user->login); 472 472 } 473 473 … … 475 475 476 476 void wd_user_set_version(wd_user_t *user, wi_string_t *version) { 477 WD_USER_SET_ OBJECT(user, user->version, version);477 WD_USER_SET_INSTANCE(user, user->version, version); 478 478 } 479 479 … … 481 481 482 482 wi_string_t * wd_user_version(wd_user_t *user) { 483 WD_USER_RETURN_ OBJECT(user, user->version);483 WD_USER_RETURN_INSTANCE(user, user->version); 484 484 } 485 485 … … 487 487 488 488 void wd_user_set_status(wd_user_t *user, wi_string_t *status) { 489 WD_USER_SET_ OBJECT(user, user->status, status);489 WD_USER_SET_INSTANCE(user, user->status, status); 490 490 } 491 491 … … 493 493 494 494 wi_string_t * wd_user_status(wd_user_t *user) { 495 WD_USER_RETURN_ OBJECT(user, user->status);495 WD_USER_RETURN_INSTANCE(user, user->status); 496 496 } 497 497 … … 499 499 500 500 void wd_user_set_image(wd_user_t *user, wi_string_t *image) { 501 WD_USER_SET_ OBJECT(user, user->image, image);501 WD_USER_SET_INSTANCE(user, user->image, image); 502 502 } 503 503 504 504 505 505 wi_string_t * wd_user_image(wd_user_t *user) { 506 WD_USER_RETURN_ OBJECT(user, user->image);506 WD_USER_RETURN_INSTANCE(user, user->image); 507 507 } 508 508 wired/trunk/wired/users.h
r4754 r4766 38 38 39 39 40 enum wd_user_state {41 WD_USER_CONNECTED = 0,40 enum _wd_user_state { 41 WD_USER_CONNECTED = 0, 42 42 WD_USER_SAID_HELLO, 43 43 WD_USER_GAVE_USER, … … 45 45 WD_USER_DISCONNECTED 46 46 }; 47 typedef enum wd_user_state wd_user_state_t;47 typedef enum _wd_user_state wd_user_state_t; 48 48 49 49
