@@ -163,18 +163,6 @@ - (NSComparisonResult)serverNameCompare:(NSString *)string;
163163@end
164164
165165
166- @interface MMChannel : NSObject {
167- channel_T *channel;
168- int part;
169- CFSocketRef socket;
170- CFRunLoopSourceRef runLoopSource;
171- }
172-
173- - (id )initWithChannel : (channel_T *)c part : (int )p ;
174- - (void )read ;
175- @end
176-
177-
178166@interface MMBackend (Private)
179167- (void )clearDrawData ;
180168- (void )didChangeWholeLine ;
@@ -1685,19 +1673,6 @@ - (void)setImState:(BOOL)activated
16851673 [self flushQueue: YES ];
16861674}
16871675
1688- - (void *)addChannel : (channel_T *)channel part : (int )part
1689- {
1690- MMChannel *mmChannel =
1691- [[MMChannel alloc ] initWithChannel: channel part: part];
1692- return (void *)mmChannel;
1693- }
1694-
1695- - (void )removeChannel : (void *)cookie
1696- {
1697- MMChannel *mmChannel = (MMChannel *)cookie;
1698- [mmChannel release ];
1699- }
1700-
17011676#ifdef FEAT_BEVAL
17021677- (void )setLastToolTip : (NSString *)toolTip
17031678{
@@ -3409,68 +3384,3 @@ - (char_u *)vimStringSave
34093384}
34103385
34113386@end // NSString (VimStrings)
3412-
3413-
3414-
3415- @implementation MMChannel
3416-
3417- - (void )dealloc
3418- {
3419- CFSocketInvalidate (socket);
3420- CFRunLoopSourceInvalidate (runLoopSource);
3421- CFRelease (runLoopSource);
3422- CFRelease (socket);
3423- [super dealloc ];
3424- }
3425-
3426- static void socketReadCallback (CFSocketRef s,
3427- CFSocketCallBackType callbackType,
3428- CFDataRef address,
3429- const void *data,
3430- void *info)
3431- {
3432- MMChannel *mmChannel = (MMChannel *)info;
3433- [mmChannel read ];
3434- }
3435-
3436- - (id )initWithChannel : (channel_T *)c part : (int )p
3437- {
3438- self = [super init ];
3439- if (!self) return nil ;
3440-
3441- channel = c;
3442- part = p;
3443-
3444- // Tell CFRunLoop that we are interested in channel socket input.
3445- CFSocketContext ctx = {0 , (void *)self, NULL , NULL , NULL };
3446- socket = CFSocketCreateWithNative (kCFAllocatorDefault ,
3447- channel->ch_part [part].ch_fd ,
3448- kCFSocketReadCallBack ,
3449- &socketReadCallback,
3450- &ctx);
3451- CFOptionFlags opt = CFSocketGetSocketFlags (socket);
3452- opt &= ~(kCFSocketCloseOnInvalidate |kCFSocketLeaveErrors );
3453- CFSocketSetSocketFlags (socket, opt);
3454- runLoopSource = CFSocketCreateRunLoopSource (NULL ,
3455- socket,
3456- 0 );
3457- CFRunLoopAddSource (CFRunLoopGetCurrent (),
3458- runLoopSource,
3459- kCFRunLoopCommonModes );
3460-
3461- return self;
3462- }
3463-
3464- - (void )read
3465- {
3466- int fd = channel->ch_part [part].ch_fd ;
3467- fd_set fds;
3468- FD_ZERO (&fds);
3469- FD_SET (fd, &fds);
3470- struct timeval t;
3471- memset (&t, 0 , sizeof (t));
3472- if (select (FD_SETSIZE, &fds, NULL , NULL , &t) > 0 )
3473- channel_read (channel, part, " MMChannel_read" );
3474- }
3475-
3476- @end
0 commit comments