summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/perl/weechat-perl-api.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-11-29 16:08:55 +0100
committerSebastien Helleu <flashcode@flashtux.org>2008-11-29 16:08:55 +0100
commitbc00946a0da47dbc16cefbb915ae7f94b0ac3abf (patch)
tree011ad7fad54e5997a8c749ccc57ae214c8bfa28d /src/plugins/scripts/perl/weechat-perl-api.c
parent364aa00ab775f0dfdfad897f68bdbce2cfd71088 (diff)
downloadweechat-bc00946a0da47dbc16cefbb915ae7f94b0ac3abf.zip
Add current_window function in plugin API, add window functions in english developer guide
Diffstat (limited to 'src/plugins/scripts/perl/weechat-perl-api.c')
-rw-r--r--src/plugins/scripts/perl/weechat-perl-api.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index 0c01452b1..f25824e3c 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -3173,7 +3173,7 @@ static XS (XS_weechat_api_current_buffer)
PERL_RETURN_EMPTY;
}
- result = script_ptr2str (weechat_current_buffer);
+ result = script_ptr2str (weechat_current_buffer ());
PERL_RETURN_STRING_FREE(result);
}
@@ -3365,6 +3365,30 @@ static XS (XS_weechat_api_buffer_set)
}
/*
+ * weechat::current_window: get current window
+ */
+
+static XS (XS_weechat_api_current_window)
+{
+ char *result;
+ dXSARGS;
+
+ /* make C compiler happy */
+ (void) items;
+ (void) cv;
+
+ if (!perl_current_script)
+ {
+ WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("current_window");
+ PERL_RETURN_EMPTY;
+ }
+
+ result = script_ptr2str (weechat_current_window ());
+
+ PERL_RETURN_STRING_FREE(result);
+}
+
+/*
* weechat::window_get_integer: get a window property as integer
*/
@@ -4633,6 +4657,7 @@ weechat_perl_api_init (pTHX)
newXS ("weechat::buffer_get_string", XS_weechat_api_buffer_get_string, "weechat");
newXS ("weechat::buffer_get_pointer", XS_weechat_api_buffer_get_pointer, "weechat");
newXS ("weechat::buffer_set", XS_weechat_api_buffer_set, "weechat");
+ newXS ("weechat::current_window", XS_weechat_api_current_window, "weechat");
newXS ("weechat::window_get_integer", XS_weechat_api_window_get_integer, "weechat");
newXS ("weechat::window_get_string", XS_weechat_api_window_get_string, "weechat");
newXS ("weechat::window_get_pointer", XS_weechat_api_window_get_pointer, "weechat");