diff --git a/src/plugins/api.c b/src/plugins/api.c index 9ed16a66..439814f9 100644 --- a/src/plugins/api.c +++ b/src/plugins/api.c @@ -156,13 +156,6 @@ api_win_focus(const char *tag) ui_switch_win(num); } -void -api_win_process_line(const char *tag, const char * const line) -{ - PluginWindowCallback *window = callbacks_get_window_handler(tag); - window->callback_func(window, tag, line); -} - void api_win_show(const char *tag, const char *line) { diff --git a/src/plugins/api.h b/src/plugins/api.h index 382358ce..f68e8836 100644 --- a/src/plugins/api.h +++ b/src/plugins/api.h @@ -46,7 +46,6 @@ int api_win_exists(const char *tag); void api_win_create(const char *tag, void *callback, void(*callback_func)(PluginWindowCallback *window_callback, char *tag, char *line)); void api_win_focus(const char *tag); -void api_win_process_line(const char *tag, const char * const line); void api_win_show(const char *tag, const char *line); void api_win_show_green(const char *tag, const char *line); void api_win_show_red(const char *tag, const char *line); diff --git a/src/plugins/c_api.c b/src/plugins/c_api.c index 582d555b..2dad2fff 100644 --- a/src/plugins/c_api.c +++ b/src/plugins/c_api.c @@ -135,12 +135,6 @@ c_api_win_focus(char *tag) api_win_focus(tag); } -void -c_api_win_process_line(char *tag, char *line) -{ - api_win_process_line(tag, line); -} - void c_api_win_show(char *tag, char *line) { @@ -212,7 +206,6 @@ c_api_init(void) prof_win_exists = c_api_win_exists; prof_win_create = c_api_win_create; prof_win_focus = c_api_win_focus; - prof_win_process_line = c_api_win_process_line; prof_win_show = c_api_win_show; prof_win_show_green = c_api_win_show_green; prof_win_show_red = c_api_win_show_red; diff --git a/src/plugins/lua_api.c b/src/plugins/lua_api.c index c8b0e112..be64e21c 100644 --- a/src/plugins/lua_api.c +++ b/src/plugins/lua_api.c @@ -183,15 +183,6 @@ lua_api_win_focus(lua_State *L) return 0; } -static int -lua_api_win_process_line(lua_State *L) -{ - const char *tag = lua_tostring(L, -2); - const char *line = lua_tostring(L, -1); - api_win_process_line(tag, strdup(line)); - return 0; -} - static int lua_api_win_show(lua_State *L) { @@ -348,6 +339,4 @@ lua_api_init(lua_State *L) lua_setglobal(L, "prof_win_show_cyan"); lua_pushcfunction(L, lua_api_win_show_yellow); lua_setglobal(L, "prof_win_show_yellow"); - lua_pushcfunction(L, lua_api_win_process_line); - lua_setglobal(L, "prof_win_process_line"); } diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c index 0124f0f4..be6ac182 100644 --- a/src/plugins/plugins.c +++ b/src/plugins/plugins.c @@ -160,7 +160,8 @@ plugins_get_lang_string(ProfPlugin *plugin) void plugins_win_process_line(char *win, const char * const line) { - api_win_process_line(win, line); + PluginWindowCallback *window = callbacks_get_window_handler(win); + window->callback_func(window, win, line); } void diff --git a/src/plugins/profapi.c b/src/plugins/profapi.c index 2806aafd..f28f801b 100644 --- a/src/plugins/profapi.c +++ b/src/plugins/profapi.c @@ -48,7 +48,6 @@ void (*prof_log_error)(const char *message) = NULL; int (*prof_win_exists)(PROF_WIN_TAG win) = NULL; void (*prof_win_create)(PROF_WIN_TAG win, void(*input_handler)(PROF_WIN_TAG win, char *line)) = NULL; void (*prof_win_focus)(PROF_WIN_TAG win) = NULL; -void (*prof_win_process_line)(PROF_WIN_TAG win, char *line) = NULL; void (*prof_win_show)(PROF_WIN_TAG win, char *line) = NULL; void (*prof_win_show_green)(PROF_WIN_TAG win, char *line) = NULL; void (*prof_win_show_red)(PROF_WIN_TAG win, char *line) = NULL; diff --git a/src/plugins/profapi.h b/src/plugins/profapi.h index a9ac87a5..31804195 100644 --- a/src/plugins/profapi.h +++ b/src/plugins/profapi.h @@ -48,7 +48,6 @@ void (*prof_log_error)(const char *message); int (*prof_win_exists)(PROF_WIN_TAG win); void (*prof_win_create)(PROF_WIN_TAG win, void(*input_handler)(PROF_WIN_TAG win, char *line)); void (*prof_win_focus)(PROF_WIN_TAG win); -void (*prof_win_process_line)(PROF_WIN_TAG win, char *line); void (*prof_win_show)(PROF_WIN_TAG win, char *line); void (*prof_win_show_green)(PROF_WIN_TAG win, char *line); void (*prof_win_show_red)(PROF_WIN_TAG win, char *line); diff --git a/src/plugins/python_api.c b/src/plugins/python_api.c index 7e5b8a1e..8c45d348 100644 --- a/src/plugins/python_api.c +++ b/src/plugins/python_api.c @@ -217,20 +217,6 @@ python_api_win_focus(PyObject *self, PyObject *args) return Py_BuildValue(""); } -static PyObject * -python_api_win_process_line(PyObject *self, PyObject *args) -{ - char *tag = NULL; - char *line = NULL; - - if (!PyArg_ParseTuple(args, "ss", &tag, &line)) { - return Py_BuildValue(""); - } - - api_win_process_line(tag, line); - return Py_BuildValue(""); -} - static PyObject * python_api_win_show(PyObject *self, PyObject *args) { @@ -388,7 +374,6 @@ static PyMethodDef apiMethods[] = { { "win_show_red", python_api_win_show_red, METH_VARARGS, "Show red text in the window." }, { "win_show_cyan", python_api_win_show_cyan, METH_VARARGS, "Show cyan text in the window." }, { "win_show_yellow", python_api_win_show_yellow, METH_VARARGS, "Show yellow text in the window." }, - { "win_process_line", python_api_win_process_line, METH_VARARGS, "Send a line of input to a window." }, { NULL, NULL, 0, NULL } }; diff --git a/src/plugins/ruby_api.c b/src/plugins/ruby_api.c index 680a5463..6e7d5512 100644 --- a/src/plugins/ruby_api.c +++ b/src/plugins/ruby_api.c @@ -182,16 +182,6 @@ ruby_api_win_focus(VALUE self, VALUE v_tag) return Qnil; } -static VALUE -ruby_api_win_process_line(VALUE self, VALUE v_tag, VALUE v_line) -{ - char *tag = STR2CSTR(v_tag); - char *line = STR2CSTR(v_line); - - api_win_process_line(tag, line); - return Qnil; -} - static VALUE ruby_api_win_show(VALUE self, VALUE v_tag, VALUE v_line) { @@ -306,7 +296,6 @@ ruby_api_init(void) rb_define_module_function(prof_module, "win_exists", RUBY_METHOD_FUNC(ruby_api_win_exists), 1); rb_define_module_function(prof_module, "win_create", RUBY_METHOD_FUNC(ruby_api_win_create), 2); rb_define_module_function(prof_module, "win_focus", RUBY_METHOD_FUNC(ruby_api_win_focus), 1); - rb_define_module_function(prof_module, "win_process_line", RUBY_METHOD_FUNC(ruby_api_win_process_line), 2); rb_define_module_function(prof_module, "win_show", RUBY_METHOD_FUNC(ruby_api_win_show), 2); rb_define_module_function(prof_module, "win_show_green", RUBY_METHOD_FUNC(ruby_api_win_show_green), 2); rb_define_module_function(prof_module, "win_show_red", RUBY_METHOD_FUNC(ruby_api_win_show_red), 2);