/*
* Tell Windows we are interested in receiving message when there
* is input on the editor connection socket.
- * TODO: change WM_NETBEANS to something related to the channel index.
*/
if (channel->ch_inputHandler == -1)
channel->ch_inputHandler =
#endif
}
+# if defined(FEAT_GUI_W32) || defined(PROTO)
+/*
+ * Lookup the channel index from the socket.
+ * Returns -1 when the socket isn't found.
+ */
+ int
+channel_socket2idx(sock_T fd)
+{
+ int i;
+
+ if (fd >= 0)
+ for (i = 0; i < channel_count; ++i)
+ if (channels[i].ch_fd == fd)
+ return i;
+ return -1;
+}
+# endif
+
/*
* Write "buf" (NUL terminated string) to channel "idx".
* When "fun" is not NULL an error message might be given.
#ifdef FEAT_CHANNEL
if (msg.message == WM_NETBEANS)
{
- /* TODO: channel_read(idx) */
- netbeans_read();
+ int channel_idx = channel_socket2idx((sock_T)msg.wParam);
+
+ if (channel_idx >= 0)
+ channel_read(channel_idx);
return;
}
#endif
}
}
-/* TODO: remove */
- void
-netbeans_read()
-{
- if (nb_channel_idx >= 0)
- channel_read(nb_channel_idx);
-}
-
/*
* Handle one NUL terminated command.
*
int channel_collapse(int idx);
void channel_clear(int idx);
void channel_read(int idx);
+int channel_socket2idx(sock_T fd);
void channel_send(int idx, char_u *buf, char *fun);
int channel_poll_setup(int nfd_in, void *fds_in);
int channel_poll_check(int ret_in, void *fds_in);
/* netbeans.c */
void netbeans_parse_messages(void);
-void netbeans_read(void);
int isNetbeansBuffer(buf_T *bufp);
int isNetbeansModified(buf_T *bufp);
void netbeans_end(void);
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1187,
/**/
1186,
/**/