Squash a function that is only called in a callback into the

callback function.
This commit is contained in:
Nicholas Marriott 2010-04-06 21:58:33 +00:00
parent 67300e9524
commit 091db41bc9
2 changed files with 14 additions and 22 deletions

3
tmux.h
View File

@ -1,4 +1,4 @@
/* $Id: tmux.h,v 1.553 2010-04-06 21:45:36 nicm Exp $ */ /* $Id: tmux.h,v 1.554 2010-04-06 21:58:33 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -1828,7 +1828,6 @@ void window_pane_alternate_off(
int window_pane_set_mode( int window_pane_set_mode(
struct window_pane *, const struct window_mode *); struct window_pane *, const struct window_mode *);
void window_pane_reset_mode(struct window_pane *); void window_pane_reset_mode(struct window_pane *);
void window_pane_parse(struct window_pane *);
void window_pane_key(struct window_pane *, struct client *, int); void window_pane_key(struct window_pane *, struct client *, int);
void window_pane_mouse(struct window_pane *, void window_pane_mouse(struct window_pane *,
struct client *, struct mouse_event *); struct client *, struct mouse_event *);

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.128 2010-03-15 22:03:38 nicm Exp $ */ /* $Id: window.c,v 1.129 2010-04-06 21:58:33 nicm Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -584,9 +584,19 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
void void
window_pane_read_callback(unused struct bufferevent *bufev, void *data) window_pane_read_callback(unused struct bufferevent *bufev, void *data)
{ {
struct window_pane *wp = data; struct window_pane *wp = data;
char *new_data;
size_t new_size;
window_pane_parse(wp); new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off;
if (wp->pipe_fd != -1 && new_size > 0) {
new_data = EVBUFFER_DATA(wp->event->input);
bufferevent_write(wp->pipe_event, new_data, new_size);
}
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
} }
/* ARGSUSED */ /* ARGSUSED */
@ -733,23 +743,6 @@ window_pane_reset_mode(struct window_pane *wp)
wp->flags |= PANE_REDRAW; wp->flags |= PANE_REDRAW;
} }
void
window_pane_parse(struct window_pane *wp)
{
char *data;
size_t new_size;
new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off;
if (wp->pipe_fd != -1 && new_size > 0) {
data = EVBUFFER_DATA(wp->event->input);
bufferevent_write(wp->pipe_event, data, new_size);
}
input_parse(wp);
wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
}
void void
window_pane_key(struct window_pane *wp, struct client *c, int key) window_pane_key(struct window_pane *wp, struct client *c, int key)
{ {