| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
#define WCServerProtocolVersion 1.1 |
|---|
| 30 |
#define WCTrackerProtocolVersion 1.0 |
|---|
| 31 |
|
|---|
| 32 |
#define WCControlPort 2000 |
|---|
| 33 |
#define WCTransferPort 2001 |
|---|
| 34 |
#define WCTrackerPort 2002 |
|---|
| 35 |
|
|---|
| 36 |
#define WCBonjourName @"_wired._tcp." |
|---|
| 37 |
|
|---|
| 38 |
#define WCDefaultLogin @"guest" |
|---|
| 39 |
|
|---|
| 40 |
#define WCMessageSeparator @"\4" |
|---|
| 41 |
#define WCFieldSeparator @"\34" |
|---|
| 42 |
#define WCGroupSeparator @"\35" |
|---|
| 43 |
#define WCRecordSeparator @"\36" |
|---|
| 44 |
|
|---|
| 45 |
#define WCMessageLength 3 |
|---|
| 46 |
|
|---|
| 47 |
#define WCBanCommand @"BAN" |
|---|
| 48 |
#define WCBannerCommand @"BANNER" |
|---|
| 49 |
#define WCBroadcastCommand @"BROADCAST" |
|---|
| 50 |
#define WCCategoriesCommand @"CATEGORIES" |
|---|
| 51 |
#define WCClearNewsCommand @"CLEARNEWS" |
|---|
| 52 |
#define WCClientCommand @"CLIENT" |
|---|
| 53 |
#define WCCommentCommand @"COMMENT" |
|---|
| 54 |
#define WCCreateUserCommand @"CREATEUSER" |
|---|
| 55 |
#define WCCreateGroupCommand @"CREATEGROUP" |
|---|
| 56 |
#define WCDeclineCommand @"DECLINE" |
|---|
| 57 |
#define WCDeleteCommand @"DELETE" |
|---|
| 58 |
#define WCDeleteUserCommand @"DELETEUSER" |
|---|
| 59 |
#define WCDeleteGroupCommand @"DELETEGROUP" |
|---|
| 60 |
#define WCDumpCommand @"DUMP" |
|---|
| 61 |
#define WCEditUserCommand @"EDITUSER" |
|---|
| 62 |
#define WCEditGroupCommand @"EDITGROUP" |
|---|
| 63 |
#define WCFolderCommand @"FOLDER" |
|---|
| 64 |
#define WCGetCommand @"GET" |
|---|
| 65 |
#define WCGroupsCommand @"GROUPS" |
|---|
| 66 |
#define WCHelloCommand @"HELLO" |
|---|
| 67 |
#define WCIconCommand @"ICON" |
|---|
| 68 |
#define WCInfoCommand @"INFO" |
|---|
| 69 |
#define WCInviteCommand @"INVITE" |
|---|
| 70 |
#define WCJoinCommand @"JOIN" |
|---|
| 71 |
#define WCKickCommand @"KICK" |
|---|
| 72 |
#define WCLeaveCommand @"LEAVE" |
|---|
| 73 |
#define WCListCommand @"LIST" |
|---|
| 74 |
#define WCListRecursiveCommand @"LISTRECURSIVE" |
|---|
| 75 |
#define WCMeCommand @"ME" |
|---|
| 76 |
#define WCMoveCommand @"MOVE" |
|---|
| 77 |
#define WCMessageCommand @"MSG" |
|---|
| 78 |
#define WCNewsCommand @"NEWS" |
|---|
| 79 |
#define WCNickCommand @"NICK" |
|---|
| 80 |
#define WCPassCommand @"PASS" |
|---|
| 81 |
#define WCPingCommand @"PING" |
|---|
| 82 |
#define WCPostCommand @"POST" |
|---|
| 83 |
#define WCPrivateChatCommand @"PRIVCHAT" |
|---|
| 84 |
#define WCPrivilegesCommand @"PRIVILEGES" |
|---|
| 85 |
#define WCPutCommand @"PUT" |
|---|
| 86 |
#define WCReadUserCommand @"READUSER" |
|---|
| 87 |
#define WCReadGroupCommand @"READGROUP" |
|---|
| 88 |
#define WCSayCommand @"SAY" |
|---|
| 89 |
#define WCSearchCommand @"SEARCH" |
|---|
| 90 |
#define WCServersCommand @"SERVERS" |
|---|
| 91 |
#define WCStatCommand @"STAT" |
|---|
| 92 |
#define WCStatusCommand @"STATUS" |
|---|
| 93 |
#define WCTopicCommand @"TOPIC" |
|---|
| 94 |
#define WCTransferCommand @"TRANSFER" |
|---|
| 95 |
#define WCTypeCommand @"TYPE" |
|---|
| 96 |
#define WCUserCommand @"USER" |
|---|
| 97 |
#define WCUsersCommand @"USERS" |
|---|
| 98 |
#define WCWhoCommand @"WHO" |
|---|
| 99 |
|
|---|
| 100 |
#define WCConnectionDidConnect @"WCConnectionDidConnect" |
|---|
| 101 |
#define WCConnectionDidClose @"WCConnectionDidClose" |
|---|
| 102 |
#define WCConnectionWillTerminate @"WCConnectionWillTerminate" |
|---|
| 103 |
#define WCConnectionShouldTerminate @"WCConnectionShouldTerminate" |
|---|
| 104 |
#define WCConnectionDidTerminate @"WCConnectionDidTerminate" |
|---|
| 105 |
|
|---|
| 106 |
#define WCConnectionReceivedMessage @"WCConnectionReceivedMessage" |
|---|
| 107 |
#define WCConnectionReceivedError @"WCConnectionReceivedError" |
|---|
| 108 |
#define WCConnectionSentCommand @"WCConnectionSentCommand" |
|---|
| 109 |
|
|---|
| 110 |
#define WCArgumentsKey @"WCArgumentsKey" |
|---|
| 111 |
#define WCMessageKey @"WCMessageKey" |
|---|
| 112 |
#define WCErrorKey @"WCErrorKey" |
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
typedef uint32_t WCProtocolInt32; |
|---|
| 116 |
typedef uint64_t WCProtocolInt64; |
|---|
| 117 |
|
|---|
| 118 |
typedef WCProtocolInt32 WCProtocolMessage; |
|---|
| 119 |
typedef WCProtocolInt32 WCUserID; |
|---|
| 120 |
typedef WCProtocolInt32 WCChatID; |
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
@protocol WCConnection <NSObject> |
|---|
| 124 |
|
|---|
| 125 |
- (void)addObserver:(id)target selector:(SEL)action name:(NSString *)name; |
|---|
| 126 |
- (void)removeObserver:(id)target; |
|---|
| 127 |
- (void)removeObserver:(id)target name:(NSString *)name; |
|---|
| 128 |
- (void)postNotificationName:(NSString *)name; |
|---|
| 129 |
- (void)postNotificationName:(NSString *)name object:(id)object; |
|---|
| 130 |
- (void)postNotificationName:(NSString *)name object:(id)object userInfo:(NSDictionary *)userInfo; |
|---|
| 131 |
|
|---|
| 132 |
- (void)sendCommand:(NSString *)command; |
|---|
| 133 |
- (void)sendCommand:(NSString *)command withArgument:(NSString *)argument1; |
|---|
| 134 |
- (void)sendCommand:(NSString *)command withArgument:(NSString *)argument1 withArgument:(NSString *)argument2; |
|---|
| 135 |
- (void)sendCommand:(NSString *)command withArgument:(NSString *)argument1 withArgument:(NSString *)argument2 withArgument:(NSString *)argument3; |
|---|
| 136 |
- (void)sendCommand:(NSString *)command withArguments:(NSArray *)arguments; |
|---|
| 137 |
- (void)ignoreError:(WCProtocolMessage)error; |
|---|
| 138 |
|
|---|
| 139 |
- (void)connect; |
|---|
| 140 |
- (void)disconnect; |
|---|
| 141 |
- (void)terminate; |
|---|
| 142 |
|
|---|
| 143 |
- (WIURL *)URL; |
|---|
| 144 |
- (WISocket *)socket; |
|---|
| 145 |
- (BOOL)isConnected; |
|---|
| 146 |
- (double)protocol; |
|---|
| 147 |
|
|---|
| 148 |
@end |
|---|