Remove evil tabs in sources
This commit is contained in:
parent
309e8eadab
commit
eb56a98fc8
@ -39,10 +39,10 @@ run ()
|
||||
echo -n "Running \"$@\""
|
||||
eval $@ >$AUTOGEN_LOG 2>&1
|
||||
if [ $? = 0 ] ; then
|
||||
echo -e $OK
|
||||
echo -e $OK
|
||||
else
|
||||
echo -e $FAIL
|
||||
err
|
||||
echo -e $FAIL
|
||||
err
|
||||
fi
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ IF(HAVE_LIBINTL_H)
|
||||
ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD")
|
||||
|
||||
IF(LIBINTL_HAS_DGETTEXT)
|
||||
SET(GETTEXT_FOUND TRUE)
|
||||
SET(GETTEXT_FOUND TRUE)
|
||||
ENDIF(LIBINTL_HAS_DGETTEXT)
|
||||
ENDIF(LIBINTL_LIBRARY)
|
||||
ENDIF(LIBC_HAS_DGETTEXT)
|
||||
|
@ -61,8 +61,8 @@ ELSE(LUA51_INCLUDE_PATH AND LUA51_LIBRARY)
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
LUALIB50_LIBRARY NAMES lualib50 lualib5.0 lualib-5.0 lualib
|
||||
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
|
||||
LUALIB50_LIBRARY NAMES lualib50 lualib5.0 lualib-5.0 lualib
|
||||
PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib
|
||||
PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua
|
||||
)
|
||||
|
||||
|
100
configure.in
100
configure.in
@ -253,13 +253,13 @@ if test "x$ac_found_iconv_header" = "xyes" ; then
|
||||
fi
|
||||
AC_MSG_CHECKING(for iconv usability in programs)
|
||||
AC_TRY_RUN([
|
||||
#include <iconv.h>
|
||||
int main(int argc, char **argv) {
|
||||
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
|
||||
#include <iconv.h>
|
||||
int main(int argc, char **argv) {
|
||||
iconv_t conv = iconv_open("ISO8859-1", "UTF-8");
|
||||
if (conv != (iconv_t) -1) {
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
return 1;
|
||||
}],iconv_found="yes")
|
||||
if test "x$iconv_found" = "xno" ; then
|
||||
AC_MSG_RESULT(no)
|
||||
@ -318,8 +318,8 @@ if test "x$enable_aspell" = "xyes" ; then
|
||||
enable_aspell="no"
|
||||
not_found="$not_found aspell"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
|
||||
AC_MSG_RESULT(yes)
|
||||
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
|
||||
fi
|
||||
else
|
||||
not_asked="$not_asked aspell"
|
||||
@ -413,7 +413,7 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
enable_perl="no"
|
||||
not_found="$not_found perl"
|
||||
else
|
||||
PERL_VERSION=`perl -V:version | sed "s/version='\(.*\)';/\1/"`
|
||||
PERL_VERSION=`perl -V:version | sed "s/version='\(.*\)';/\1/"`
|
||||
AC_MSG_CHECKING(for Perl headers files)
|
||||
|
||||
PERL_HEADER_TEST=`PT=perltest.c ; echo "#include <EXTERN.h>" > $PT; echo "#include <perl.h>" >> $PT; echo "#include <XSUB.h>" >> $PT ; echo "int main() { return 0; }" >> $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ccopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
|
||||
@ -423,7 +423,7 @@ if test "x$enable_perl" = "xyes" ; then
|
||||
AC_MSG_RESULT(found)
|
||||
AC_MSG_CHECKING(for Perl library)
|
||||
PERL_LIB_TEST=`PT=perltest.c ; echo "int main() { return 0; }" > $PT ; $CC -Wall $PT -o $PT.out $($PERL -MExtUtils::Embed -e ldopts) 1>/dev/null 2>&1; echo $?; rm -f $PT $PT.out 1>/dev/null 2>&1`
|
||||
if test "x$PERL_LIB_TEST" = "x0" ; then
|
||||
if test "x$PERL_LIB_TEST" = "x0" ; then
|
||||
PERL_LFLAGS=`$PERL -MExtUtils::Embed -e ldopts`
|
||||
AC_MSG_RESULT(found)
|
||||
else
|
||||
@ -528,7 +528,7 @@ if test "x$enable_ruby" = "xyes" ; then
|
||||
enable_ruby="no"
|
||||
not_found="$not_found ruby"
|
||||
else
|
||||
RUBY_VERSION=`$RUBY -rrbconfig -e "puts Config::CONFIG[['ruby_version']]"`
|
||||
RUBY_VERSION=`$RUBY -rrbconfig -e "puts Config::CONFIG[['ruby_version']]"`
|
||||
if test "$RUBY_VERSION" = "1.9.0"; then
|
||||
AC_MSG_WARN([
|
||||
*** Ruby header files have been found, but they're of the version 1.9.0.
|
||||
@ -590,20 +590,20 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
PKGCONFIG=""
|
||||
AC_CHECK_PROGS(PKGCONFIG, pkg-config)
|
||||
if test "x$PKGCONFIG" != "x"; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
|
||||
echo
|
||||
for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
LUA_VERSION=`$PKGCONFIG --modversion lua$l`
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with pkg-config)
|
||||
echo
|
||||
for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do
|
||||
pkgconfig_lua_found=`$PKGCONFIG --exists lua$l 2>/dev/null`
|
||||
if test "x$?" = "x0" ; then
|
||||
LUA_VERSION=`$PKGCONFIG --modversion lua$l`
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lua$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lua$l`
|
||||
|
||||
pkgconfig_lualib_found=`$PKGCONFIG --exists lualib$l 2>/dev/null`
|
||||
if test "x$?" = "x0"; then
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
|
||||
fi
|
||||
pkgconfig_lualib_found=`$PKGCONFIG --exists lualib$l 2>/dev/null`
|
||||
if test "x$?" = "x0"; then
|
||||
LUA_CFLAGS="$LUA_CFLAGS "`$PKGCONFIG --cflags lualib$l`
|
||||
LUA_LFLAGS="$LUA_LFLAGS "`$PKGCONFIG --libs lualib$l`
|
||||
fi
|
||||
break
|
||||
fi
|
||||
done
|
||||
@ -615,16 +615,16 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
AC_CHECK_PROGS(LUACONFIG, lua-config lua-config51 lua-config5.1 lua-config50 lua-config5.0)
|
||||
if test "x$LUACONFIG" != "x" ; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies with lua-config)
|
||||
echo
|
||||
echo
|
||||
LUA_CFLAGS=`$LUACONFIG --include`
|
||||
LUA_LFLAGS=`$LUACONFIG --libs`
|
||||
LUA_VERSION="5.0.x"
|
||||
LUA_VERSION="5.0.x"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "x$LUA_CFLAGS" = "x" -o "x$LUA_LFLAGS" = "x" ; then
|
||||
AC_MSG_CHECKING(for Lua headers and librairies)
|
||||
echo
|
||||
echo
|
||||
AC_CHECK_HEADER(lua.h,ac_found_lua_header="yes",ac_found_lua_header="no")
|
||||
AC_CHECK_HEADER(lualib.h,ac_found_liblua_header="yes",ac_found_liblua_header="no")
|
||||
if test "x$ac_found_lua_header" = "xyes" -a "x$ac_found_liblua_header" = "xyes"; then
|
||||
@ -633,31 +633,31 @@ if test "x$enable_lua" = "xyes" ; then
|
||||
for l in "$lua_suffix" "" "51" "5.1" "50" "5.0" ; do
|
||||
AC_CHECK_LIB(lua$l,lua_call,ac_found_lua_lib="yes",ac_found_lua_lib="no")
|
||||
if test "x$ac_found_lua_lib" = "xyes" ; then
|
||||
LUA_VERSION=">=5.1.0"
|
||||
LUA_VERSION=">=5.1.0"
|
||||
|
||||
LUA_LFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
ac2_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
LUA_LFLAGS="$LDFLAGS -llua$l -lm"
|
||||
|
||||
ac2_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS -llua$l -lm"
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LDFLAGS="$LDFLAGS -ldl"
|
||||
fi
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LDFLAGS="$LDFLAGS -ldl"
|
||||
fi
|
||||
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
||||
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
||||
LUA_VERSION="5.0.x"
|
||||
|
||||
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LUA_LFLAGS="$LUA_LFLAGS -ldl"
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CHECK_LIB(lualib$l,luaL_openlib,ac_found_liblua_lib="yes",ac_found_liblua_lib="no")
|
||||
if test "x$ac_found_liblua_lib" = "xyes" ; then
|
||||
LUA_VERSION="5.0.x"
|
||||
|
||||
LUA_LFLAGS="$LUA_LFLAGS -llualib$l"
|
||||
|
||||
if echo "$host_os" | grep "^linux" 1>/dev/null 2>&1 ; then
|
||||
LUA_LFLAGS="$LUA_LFLAGS -ldl"
|
||||
fi
|
||||
fi
|
||||
|
||||
LDFLAGS="$ac2_save_LDFLAGS"
|
||||
break
|
||||
fi
|
||||
LDFLAGS="$ac2_save_LDFLAGS"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
@ -755,7 +755,7 @@ if test "x$enable_gnutls" = "xyes" ; then
|
||||
enable_gnutls="no"
|
||||
not_found="$not_found gnutls"
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_MSG_RESULT(yes)
|
||||
GNUTLS_CFLAGS=`pkg-config gnutls --cflags`
|
||||
GNUTLS_LFLAGS=`pkg-config gnutls --libs`
|
||||
AC_SUBST(GNUTLS_CFLAGS)
|
||||
@ -841,13 +841,13 @@ if test "x$enable_doc" = "xyes" ; then
|
||||
;;
|
||||
esac
|
||||
else
|
||||
enable_doc="no"
|
||||
enable_doc="no"
|
||||
fi
|
||||
if test -z "$ASCIIDOC"; then
|
||||
not_found="$not_found asciidoc"
|
||||
fi
|
||||
if test -z "$SOURCEHIGHLIGHT"; then
|
||||
not_found="$not_found source-highlight(needed by asciidoc)"
|
||||
not_found="$not_found source-highlight(needed by asciidoc)"
|
||||
fi
|
||||
AC_SUBST(DOC_ASCIIDOC8)
|
||||
AC_SUBST(ASCIIDOC)
|
||||
@ -919,7 +919,7 @@ netbsd*)
|
||||
fi
|
||||
CFLAGS="$CFLAGS $CPPFLAGS"
|
||||
;;
|
||||
gnu*)
|
||||
gnu*)
|
||||
LDFLAGS="$LDFLAGS -lpthread"
|
||||
;;
|
||||
*)
|
||||
|
@ -17,9 +17,9 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_faq.de.txt \
|
||||
weechat_quickstart.de.txt \
|
||||
weechat_tester.de.txt
|
||||
weechat_faq.de.txt \
|
||||
weechat_quickstart.de.txt \
|
||||
weechat_tester.de.txt
|
||||
|
||||
all-local: weechat_faq.de.html \
|
||||
weechat_quickstart.de.html \
|
||||
|
@ -17,14 +17,14 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_user.en.txt \
|
||||
weechat_plugin_api.en.txt \
|
||||
weechat_scripting.en.txt \
|
||||
weechat_faq.en.txt \
|
||||
weechat_quickstart.en.txt \
|
||||
weechat_tester.en.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
weechat_user.en.txt \
|
||||
weechat_plugin_api.en.txt \
|
||||
weechat_scripting.en.txt \
|
||||
weechat_faq.en.txt \
|
||||
weechat_quickstart.en.txt \
|
||||
weechat_tester.en.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
|
||||
all-local: weechat_user.en.html \
|
||||
weechat_plugin_api.en.html \
|
||||
|
@ -17,14 +17,14 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_user.fr.txt \
|
||||
weechat_plugin_api.fr.txt \
|
||||
weechat_scripting.fr.txt \
|
||||
weechat_faq.fr.txt \
|
||||
weechat_quickstart.fr.txt \
|
||||
weechat_tester.fr.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
weechat_user.fr.txt \
|
||||
weechat_plugin_api.fr.txt \
|
||||
weechat_scripting.fr.txt \
|
||||
weechat_faq.fr.txt \
|
||||
weechat_quickstart.fr.txt \
|
||||
weechat_tester.fr.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
|
||||
all-local: weechat_user.fr.html \
|
||||
weechat_plugin_api.fr.html \
|
||||
|
@ -17,12 +17,12 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_user.it.txt \
|
||||
weechat_faq.it.txt \
|
||||
weechat_quickstart.it.txt \
|
||||
weechat_tester.it.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
weechat_user.it.txt \
|
||||
weechat_faq.it.txt \
|
||||
weechat_quickstart.it.txt \
|
||||
weechat_tester.it.txt \
|
||||
$(wildcard autogen/user/*.txt) \
|
||||
$(wildcard autogen/plugin_api/*.txt)
|
||||
|
||||
all-local: weechat_user.it.html \
|
||||
weechat_faq.it.html \
|
||||
|
@ -17,7 +17,7 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_quickstart.ja.txt
|
||||
weechat_quickstart.ja.txt
|
||||
|
||||
all-local: weechat_quickstart.ja.html
|
||||
|
||||
|
@ -17,9 +17,9 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_faq.pl.txt \
|
||||
weechat_quickstart.pl.txt \
|
||||
weechat_tester.pl.txt
|
||||
weechat_faq.pl.txt \
|
||||
weechat_quickstart.pl.txt \
|
||||
weechat_tester.pl.txt
|
||||
|
||||
all-local: weechat_faq.pl.html \
|
||||
weechat_quickstart.pl.html \
|
||||
|
@ -17,7 +17,7 @@
|
||||
docdir = $(datadir)/doc/$(PACKAGE)
|
||||
|
||||
EXTRA_DIST = CMakeLists.txt \
|
||||
weechat_quickstart.ru.txt
|
||||
weechat_quickstart.ru.txt
|
||||
|
||||
all-local: weechat_quickstart.ru.html
|
||||
|
||||
|
@ -224,7 +224,7 @@ config_change_title (void *data, struct t_config_option *option)
|
||||
(void) option;
|
||||
|
||||
if (CONFIG_BOOLEAN(config_look_set_title))
|
||||
gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
|
||||
gui_window_set_title (PACKAGE_NAME " " PACKAGE_VERSION);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -614,8 +614,8 @@ network_connect_child (struct t_hook *hook_connect)
|
||||
freeaddrinfo (res);
|
||||
return;
|
||||
}
|
||||
|
||||
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_OK;
|
||||
|
||||
status_str[0] = '0' + WEECHAT_HOOK_CONNECT_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -940,65 +940,65 @@ string_split_command (const char *command, char separator)
|
||||
const char *ptr;
|
||||
|
||||
if (!command || !command[0])
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
nb_substr = 1;
|
||||
ptr = command;
|
||||
while ( (p = strchr(ptr, separator)) != NULL)
|
||||
{
|
||||
nb_substr++;
|
||||
ptr = ++p;
|
||||
nb_substr++;
|
||||
ptr = ++p;
|
||||
}
|
||||
|
||||
array = malloc ((nb_substr + 1) * sizeof (array[0]));
|
||||
if (!array)
|
||||
return NULL;
|
||||
return NULL;
|
||||
|
||||
buffer = malloc (strlen(command) + 1);
|
||||
if (!buffer)
|
||||
{
|
||||
free (array);
|
||||
return NULL;
|
||||
free (array);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = command;
|
||||
str_idx = 0;
|
||||
arr_idx = 0;
|
||||
while(*ptr != '\0')
|
||||
{
|
||||
type = 0;
|
||||
if (*ptr == ';')
|
||||
{
|
||||
if (ptr == command)
|
||||
type = 1;
|
||||
else if ( *(ptr-1) != '\\')
|
||||
type = 1;
|
||||
else if ( *(ptr-1) == '\\')
|
||||
type = 2;
|
||||
}
|
||||
if (type == 1)
|
||||
{
|
||||
buffer[str_idx] = '\0';
|
||||
str_idx = -1;
|
||||
p = buffer;
|
||||
/* strip white spaces a the begining of the line */
|
||||
while (*p == ' ') p++;
|
||||
if (p && p[0])
|
||||
array[arr_idx++] = strdup (p);
|
||||
}
|
||||
else if (type == 2)
|
||||
buffer[--str_idx] = *ptr;
|
||||
else
|
||||
buffer[str_idx] = *ptr;
|
||||
str_idx++;
|
||||
ptr++;
|
||||
while(*ptr != '\0')
|
||||
{
|
||||
type = 0;
|
||||
if (*ptr == ';')
|
||||
{
|
||||
if (ptr == command)
|
||||
type = 1;
|
||||
else if ( *(ptr-1) != '\\')
|
||||
type = 1;
|
||||
else if ( *(ptr-1) == '\\')
|
||||
type = 2;
|
||||
}
|
||||
if (type == 1)
|
||||
{
|
||||
buffer[str_idx] = '\0';
|
||||
str_idx = -1;
|
||||
p = buffer;
|
||||
/* strip white spaces a the begining of the line */
|
||||
while (*p == ' ') p++;
|
||||
if (p && p[0])
|
||||
array[arr_idx++] = strdup (p);
|
||||
}
|
||||
else if (type == 2)
|
||||
buffer[--str_idx] = *ptr;
|
||||
else
|
||||
buffer[str_idx] = *ptr;
|
||||
str_idx++;
|
||||
ptr++;
|
||||
}
|
||||
|
||||
buffer[str_idx] = '\0';
|
||||
p = buffer;
|
||||
while (*p == ' ') p++;
|
||||
if (p && p[0])
|
||||
array[arr_idx++] = strdup (p);
|
||||
array[arr_idx++] = strdup (p);
|
||||
|
||||
array[arr_idx] = NULL;
|
||||
|
||||
|
@ -449,12 +449,12 @@ gui_filter_free (struct t_gui_filter *filter)
|
||||
if (filter->regex_prefix)
|
||||
{
|
||||
regfree (filter->regex_prefix);
|
||||
free (filter->regex_prefix);
|
||||
free (filter->regex_prefix);
|
||||
}
|
||||
if (filter->regex_message)
|
||||
{
|
||||
regfree (filter->regex_message);
|
||||
free (filter->regex_message);
|
||||
free (filter->regex_message);
|
||||
}
|
||||
|
||||
/* remove filter from filters list */
|
||||
|
@ -55,38 +55,38 @@ gui_history_buffer_add (struct t_gui_buffer *buffer, const char *string)
|
||||
if (!buffer->history
|
||||
|| (buffer->history
|
||||
&& (strcmp (buffer->history->text, string) != 0)))
|
||||
{
|
||||
new_history = malloc (sizeof (*new_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
/*if (config_log_hide_nickserv_pwd)
|
||||
{
|
||||
new_history = malloc (sizeof (*new_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
/*if (config_log_hide_nickserv_pwd)
|
||||
irc_display_hide_password (new_history->text, 1);*/
|
||||
|
||||
if (buffer->history)
|
||||
buffer->history->prev_history = new_history;
|
||||
else
|
||||
buffer->last_history = new_history;
|
||||
new_history->next_history = buffer->history;
|
||||
new_history->prev_history = NULL;
|
||||
buffer->history = new_history;
|
||||
buffer->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((CONFIG_INTEGER(config_history_max_commands) > 0)
|
||||
&& (buffer->num_history > CONFIG_INTEGER(config_history_max_commands)))
|
||||
{
|
||||
ptr_history = buffer->last_history->prev_history;
|
||||
|
||||
if (buffer->history)
|
||||
buffer->history->prev_history = new_history;
|
||||
else
|
||||
buffer->last_history = new_history;
|
||||
new_history->next_history = buffer->history;
|
||||
new_history->prev_history = NULL;
|
||||
buffer->history = new_history;
|
||||
buffer->num_history++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((CONFIG_INTEGER(config_history_max_commands) > 0)
|
||||
&& (buffer->num_history > CONFIG_INTEGER(config_history_max_commands)))
|
||||
{
|
||||
ptr_history = buffer->last_history->prev_history;
|
||||
if (buffer->ptr_history == buffer->last_history)
|
||||
buffer->ptr_history = ptr_history;
|
||||
((buffer->last_history)->prev_history)->next_history = NULL;
|
||||
if (buffer->last_history->text)
|
||||
free (buffer->last_history->text);
|
||||
free (buffer->last_history);
|
||||
buffer->last_history = ptr_history;
|
||||
buffer->num_history++;
|
||||
}
|
||||
}
|
||||
((buffer->last_history)->prev_history)->next_history = NULL;
|
||||
if (buffer->last_history->text)
|
||||
free (buffer->last_history->text);
|
||||
free (buffer->last_history);
|
||||
buffer->last_history = ptr_history;
|
||||
buffer->num_history++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,37 +106,37 @@ gui_history_global_add (const char *string)
|
||||
|| (history_global
|
||||
&& (strcmp (history_global->text, string) != 0)))
|
||||
{
|
||||
new_history = malloc (sizeof (*new_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
/*if (config_log_hide_nickserv_pwd)
|
||||
new_history = malloc (sizeof (*new_history));
|
||||
if (new_history)
|
||||
{
|
||||
new_history->text = strdup (string);
|
||||
/*if (config_log_hide_nickserv_pwd)
|
||||
irc_display_hide_password (new_history->text, 1);*/
|
||||
|
||||
if (history_global)
|
||||
history_global->prev_history = new_history;
|
||||
else
|
||||
last_history_global = new_history;
|
||||
new_history->next_history = history_global;
|
||||
new_history->prev_history = NULL;
|
||||
history_global = new_history;
|
||||
num_history_global++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((CONFIG_INTEGER(config_history_max_commands) > 0)
|
||||
&& (num_history_global > CONFIG_INTEGER(config_history_max_commands)))
|
||||
{
|
||||
ptr_history = last_history_global->prev_history;
|
||||
|
||||
if (history_global)
|
||||
history_global->prev_history = new_history;
|
||||
else
|
||||
last_history_global = new_history;
|
||||
new_history->next_history = history_global;
|
||||
new_history->prev_history = NULL;
|
||||
history_global = new_history;
|
||||
num_history_global++;
|
||||
|
||||
/* remove one command if necessary */
|
||||
if ((CONFIG_INTEGER(config_history_max_commands) > 0)
|
||||
&& (num_history_global > CONFIG_INTEGER(config_history_max_commands)))
|
||||
{
|
||||
ptr_history = last_history_global->prev_history;
|
||||
if (history_global_ptr == last_history_global)
|
||||
history_global_ptr = ptr_history;
|
||||
(last_history_global->prev_history)->next_history = NULL;
|
||||
if (last_history_global->text)
|
||||
free (last_history_global->text);
|
||||
free (last_history_global);
|
||||
last_history_global = ptr_history;
|
||||
num_history_global--;
|
||||
}
|
||||
}
|
||||
(last_history_global->prev_history)->next_history = NULL;
|
||||
if (last_history_global->text)
|
||||
free (last_history_global->text);
|
||||
free (last_history_global);
|
||||
last_history_global = ptr_history;
|
||||
num_history_global--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,4 +24,4 @@ weechat_wxwidgets_LDADD = ../lib_weechat_gui_common.a \
|
||||
../../plugins/lib_weechat_plugins.a $(PLUGINS_LIBS)
|
||||
|
||||
weechat_wxwidgets_SOURCES = gui-display.c \
|
||||
gui-input.c
|
||||
gui-input.c
|
||||
|
@ -344,7 +344,7 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
|
||||
return WEECHAT_RC_ERROR;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
/* an alias can contain many commands separated by ';' */
|
||||
commands = weechat_string_split_command (ptr_alias->command, ';');
|
||||
if (commands)
|
||||
@ -499,7 +499,7 @@ alias_new (const char *name, const char *command)
|
||||
|
||||
while (name[0] == '/')
|
||||
{
|
||||
name++;
|
||||
name++;
|
||||
}
|
||||
|
||||
ptr_alias = alias_search (name);
|
||||
@ -530,7 +530,7 @@ alias_new (const char *name, const char *command)
|
||||
new_alias->hook = new_hook;
|
||||
new_alias->name = strdup (name);
|
||||
new_alias->command = strdup (command);
|
||||
new_alias->running = 0;
|
||||
new_alias->running = 0;
|
||||
|
||||
if (alias_list)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ fifo_remove_old_pipes ()
|
||||
buf_len = PATH_MAX;
|
||||
buf = malloc (buf_len);
|
||||
if (!buf)
|
||||
return;
|
||||
return;
|
||||
|
||||
weechat_home = weechat_info_get ("weechat_dir", "");
|
||||
dir_separator = weechat_info_get ("dir_separator", "");
|
||||
|
@ -1912,43 +1912,43 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (ptr_server->cmd_list_regexp)
|
||||
{
|
||||
regfree (ptr_server->cmd_list_regexp);
|
||||
free (ptr_server->cmd_list_regexp);
|
||||
ptr_server->cmd_list_regexp = NULL;
|
||||
regfree (ptr_server->cmd_list_regexp);
|
||||
free (ptr_server->cmd_list_regexp);
|
||||
ptr_server->cmd_list_regexp = NULL;
|
||||
}
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
ptr_server->cmd_list_regexp = malloc (sizeof (*ptr_server->cmd_list_regexp));
|
||||
if (ptr_server->cmd_list_regexp)
|
||||
{
|
||||
if ((ret = regcomp (ptr_server->cmd_list_regexp,
|
||||
ptr_server->cmd_list_regexp = malloc (sizeof (*ptr_server->cmd_list_regexp));
|
||||
if (ptr_server->cmd_list_regexp)
|
||||
{
|
||||
if ((ret = regcomp (ptr_server->cmd_list_regexp,
|
||||
argv_eol[1],
|
||||
REG_NOSUB | REG_ICASE)) != 0)
|
||||
{
|
||||
regerror (ret, ptr_server->cmd_list_regexp,
|
||||
{
|
||||
regerror (ret, ptr_server->cmd_list_regexp,
|
||||
buf, sizeof(buf));
|
||||
weechat_printf (ptr_server->buffer,
|
||||
weechat_printf (ptr_server->buffer,
|
||||
_("%s%s: \"%s\" is not a valid regular "
|
||||
"expression (%s)"),
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME,
|
||||
argv_eol, buf);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
else
|
||||
irc_server_sendf (ptr_server, 0, "LIST");
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (ptr_server->buffer,
|
||||
}
|
||||
else
|
||||
irc_server_sendf (ptr_server, 0, "LIST");
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (ptr_server->buffer,
|
||||
_("%s%s: not enough memory for regular "
|
||||
"expression"),
|
||||
weechat_prefix ("error"), IRC_PLUGIN_NAME);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
irc_server_sendf (ptr_server, 0, "LIST");
|
||||
irc_server_sendf (ptr_server, 0, "LIST");
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
@ -249,7 +249,7 @@ irc_ignore_free (struct t_irc_ignore *ignore)
|
||||
if (ignore->regex_mask)
|
||||
{
|
||||
regfree (ignore->regex_mask);
|
||||
free (ignore->regex_mask);
|
||||
free (ignore->regex_mask);
|
||||
}
|
||||
if (ignore->server)
|
||||
free (ignore->server);
|
||||
|
@ -1595,11 +1595,11 @@ irc_protocol_cmd_001 (struct t_irc_server *server, const char *command,
|
||||
ptr_command = IRC_SERVER_OPTION_STRING(server, IRC_SERVER_OPTION_COMMAND);
|
||||
if (ptr_command && ptr_command[0])
|
||||
{
|
||||
/* splitting command on ';' which can be escaped with '\;' */
|
||||
commands = weechat_string_split_command (ptr_command, ';');
|
||||
if (commands)
|
||||
{
|
||||
for (ptr_cmd = commands; *ptr_cmd; ptr_cmd++)
|
||||
/* splitting command on ';' which can be escaped with '\;' */
|
||||
commands = weechat_string_split_command (ptr_command, ';');
|
||||
if (commands)
|
||||
{
|
||||
for (ptr_cmd = commands; *ptr_cmd; ptr_cmd++)
|
||||
{
|
||||
vars_replaced = irc_protocol_replace_vars (server, NULL,
|
||||
*ptr_cmd);
|
||||
@ -1608,10 +1608,10 @@ irc_protocol_cmd_001 (struct t_irc_server *server, const char *command,
|
||||
if (vars_replaced)
|
||||
free (vars_replaced);
|
||||
}
|
||||
weechat_string_free_split_command (commands);
|
||||
}
|
||||
|
||||
if (IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_COMMAND_DELAY) > 0)
|
||||
weechat_string_free_split_command (commands);
|
||||
}
|
||||
|
||||
if (IRC_SERVER_OPTION_INTEGER(server, IRC_SERVER_OPTION_COMMAND_DELAY) > 0)
|
||||
server->command_time = time (NULL) + 1;
|
||||
else
|
||||
irc_server_autojoin_channels (server);
|
||||
|
@ -69,7 +69,7 @@ char *lua_action_remove_list = NULL;
|
||||
|
||||
void *
|
||||
weechat_lua_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function, char **argv)
|
||||
int ret_type, const char *function, char **argv)
|
||||
{
|
||||
void *ret_value;
|
||||
int argc, *ret_i;
|
||||
@ -128,10 +128,10 @@ weechat_lua_exec (struct t_plugin_script *script,
|
||||
|
||||
if (lua_pcall (lua_current_interpreter, argc, 1, 0) != 0)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to run function \"%s\""),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME, function);
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: error: %s"),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME,
|
||||
lua_tostring (lua_current_interpreter, -1));
|
||||
@ -140,19 +140,19 @@ weechat_lua_exec (struct t_plugin_script *script,
|
||||
}
|
||||
|
||||
if (ret_type == WEECHAT_SCRIPT_EXEC_STRING)
|
||||
ret_value = strdup ((char *) lua_tostring (lua_current_interpreter, -1));
|
||||
ret_value = strdup ((char *) lua_tostring (lua_current_interpreter, -1));
|
||||
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
|
||||
{
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = lua_tonumber (lua_current_interpreter, -1);
|
||||
ret_value = ret_i;
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = lua_tonumber (lua_current_interpreter, -1);
|
||||
ret_value = ret_i;
|
||||
}
|
||||
else
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGS(LUA_CURRENT_SCRIPT_NAME, function);
|
||||
lua_current_script = old_lua_current_script;
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lua_current_script = old_lua_current_script;
|
||||
@ -165,13 +165,13 @@ weechat_lua_load (const char *filename)
|
||||
{
|
||||
FILE *fp;
|
||||
char *weechat_lua_code = {
|
||||
"weechat_outputs = {\n"
|
||||
" write = function (self, str)\n"
|
||||
" weechat.print(\"\", \"lua: stdout/stderr: \" .. str)\n"
|
||||
"weechat_outputs = {\n"
|
||||
" write = function (self, str)\n"
|
||||
" weechat.print(\"\", \"lua: stdout/stderr: \" .. str)\n"
|
||||
" end\n"
|
||||
"}\n"
|
||||
"io.stdout = weechat_outputs\n"
|
||||
"io.stderr = weechat_outputs\n"
|
||||
"}\n"
|
||||
"io.stdout = weechat_outputs\n"
|
||||
"io.stderr = weechat_outputs\n"
|
||||
};
|
||||
|
||||
if ((fp = fopen (filename, "r")) == NULL)
|
||||
@ -235,7 +235,7 @@ weechat_lua_load (const char *filename)
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to load file \"%s\""),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: error: %s"),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME,
|
||||
lua_tostring (lua_current_interpreter, -1));
|
||||
@ -250,15 +250,15 @@ weechat_lua_load (const char *filename)
|
||||
weechat_gettext ("%s%s: unable to execute file "
|
||||
"\"%s\""),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: error: %s"),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME,
|
||||
lua_tostring (lua_current_interpreter, -1));
|
||||
lua_close (lua_current_interpreter);
|
||||
fclose (fp);
|
||||
/* if script was registered, removing from list */
|
||||
if (lua_current_script)
|
||||
script_remove (weechat_lua_plugin, &lua_scripts, &last_lua_script,
|
||||
/* if script was registered, removing from list */
|
||||
if (lua_current_script)
|
||||
script_remove (weechat_lua_plugin, &lua_scripts, &last_lua_script,
|
||||
lua_current_script);
|
||||
return 0;
|
||||
}
|
||||
@ -270,7 +270,7 @@ weechat_lua_load (const char *filename)
|
||||
weechat_gettext ("%s%s: function \"register\" not "
|
||||
"found (or failed) in file \"%s\""),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME, filename);
|
||||
lua_close (lua_current_interpreter);
|
||||
lua_close (lua_current_interpreter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -311,10 +311,10 @@ weechat_lua_unload (struct t_plugin_script *script)
|
||||
{
|
||||
r = weechat_lua_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
script->shutdown_func,
|
||||
lua_argv);
|
||||
if (r)
|
||||
free (r);
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
@ -452,7 +452,7 @@ XS (XS_weechat_api_list_new)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_list_new ());
|
||||
@ -475,7 +475,7 @@ XS (XS_weechat_api_list_add)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_add");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 4)
|
||||
@ -512,7 +512,7 @@ XS (XS_weechat_api_list_search)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_search");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -545,7 +545,7 @@ XS (XS_weechat_api_list_casesearch)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_casesearch");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -578,7 +578,7 @@ XS (XS_weechat_api_list_get)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_get");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -608,7 +608,7 @@ XS (XS_weechat_api_list_set)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_set");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -640,7 +640,7 @@ XS (XS_weechat_api_list_next)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_next");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -669,7 +669,7 @@ XS (XS_weechat_api_list_prev)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_prev");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -698,7 +698,7 @@ XS (XS_weechat_api_list_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -727,7 +727,7 @@ XS (XS_weechat_api_list_size)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_size");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -756,7 +756,7 @@ XS (XS_weechat_api_list_remove)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_remove");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -787,7 +787,7 @@ XS (XS_weechat_api_list_remove_all)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_remove_all");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -815,7 +815,7 @@ XS (XS_weechat_api_list_free)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "list_free");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -885,7 +885,7 @@ XS (XS_weechat_api_config_new)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -1143,7 +1143,7 @@ XS (XS_weechat_api_config_new_section)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_new_section");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 14)
|
||||
@ -1205,7 +1205,7 @@ XS (XS_weechat_api_config_search_section)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_search_section");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -1351,7 +1351,7 @@ XS (XS_weechat_api_config_new_option)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_new_option");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 17)
|
||||
@ -1416,7 +1416,7 @@ XS (XS_weechat_api_config_search_option)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_search_option");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -1451,7 +1451,7 @@ XS (XS_weechat_api_config_string_to_boolean)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_string_to_boolean");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1481,7 +1481,7 @@ XS (XS_weechat_api_config_option_reset)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_reset");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -1514,7 +1514,7 @@ XS (XS_weechat_api_config_option_set)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_set");
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -1549,7 +1549,7 @@ XS (XS_weechat_api_config_option_set_null)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_set_null");
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -1582,7 +1582,7 @@ XS (XS_weechat_api_config_option_unset)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_unset");
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1613,7 +1613,7 @@ XS (XS_weechat_api_config_option_rename)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_rename");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -1646,7 +1646,7 @@ XS (XS_weechat_api_config_option_is_null)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_is_null");
|
||||
PERL_RETURN_INT(1);
|
||||
PERL_RETURN_INT(1);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1676,7 +1676,7 @@ XS (XS_weechat_api_config_option_default_is_null)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_default_is_null");
|
||||
PERL_RETURN_INT(1);
|
||||
PERL_RETURN_INT(1);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1705,7 +1705,7 @@ XS (XS_weechat_api_config_boolean)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_boolean");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1734,7 +1734,7 @@ XS (XS_weechat_api_config_boolean_default)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_boolean_default");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1763,7 +1763,7 @@ XS (XS_weechat_api_config_integer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_integer");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1792,7 +1792,7 @@ XS (XS_weechat_api_config_integer_default)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_integer_default");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1821,7 +1821,7 @@ XS (XS_weechat_api_config_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1850,7 +1850,7 @@ XS (XS_weechat_api_config_string_default)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_string_default");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1879,7 +1879,7 @@ XS (XS_weechat_api_config_color)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_color");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1908,7 +1908,7 @@ XS (XS_weechat_api_config_color_default)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_color_default");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -1937,7 +1937,7 @@ XS (XS_weechat_api_config_write_option)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_write_option");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -1970,7 +1970,7 @@ XS (XS_weechat_api_config_write_line)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_write_line");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -2004,7 +2004,7 @@ XS (XS_weechat_api_config_write)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_write");
|
||||
PERL_RETURN_INT(-1);
|
||||
PERL_RETURN_INT(-1);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2033,7 +2033,7 @@ XS (XS_weechat_api_config_read)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_read");
|
||||
PERL_RETURN_INT(-1);
|
||||
PERL_RETURN_INT(-1);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2062,7 +2062,7 @@ XS (XS_weechat_api_config_reload)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_reload");
|
||||
PERL_RETURN_INT(-1);
|
||||
PERL_RETURN_INT(-1);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2090,7 +2090,7 @@ XS (XS_weechat_api_config_option_free)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_option_free");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2121,7 +2121,7 @@ XS (XS_weechat_api_config_section_free_options)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_section_free_options");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2151,7 +2151,7 @@ XS (XS_weechat_api_config_section_free)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_section_free");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2181,7 +2181,7 @@ XS (XS_weechat_api_config_free)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_free");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2212,7 +2212,7 @@ XS (XS_weechat_api_config_get)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_get");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2241,7 +2241,7 @@ XS (XS_weechat_api_config_get_plugin)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_get_plugin");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2307,7 +2307,7 @@ XS (XS_weechat_api_config_set_plugin)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_set_plugin");
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -2343,7 +2343,7 @@ XS (XS_weechat_api_config_unset_plugin)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "config_unset_plugin");
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
|
||||
PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -2614,7 +2614,7 @@ XS (XS_weechat_api_hook_command)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_command");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 7)
|
||||
@ -2702,7 +2702,7 @@ XS (XS_weechat_api_hook_command_run)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_command_run");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -2781,7 +2781,7 @@ XS (XS_weechat_api_hook_timer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_timer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 5)
|
||||
@ -2857,7 +2857,7 @@ XS (XS_weechat_api_hook_fd)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_fd");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 6)
|
||||
@ -3136,7 +3136,7 @@ XS (XS_weechat_api_hook_print)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_print");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 6)
|
||||
@ -3239,7 +3239,7 @@ XS (XS_weechat_api_hook_signal)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_signal");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -3278,7 +3278,7 @@ XS (XS_weechat_api_hook_signal_send)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_signal_send");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -3369,7 +3369,7 @@ XS (XS_weechat_api_hook_config)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_config");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -3453,7 +3453,7 @@ XS (XS_weechat_api_hook_completion)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_completion");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 4)
|
||||
@ -3493,7 +3493,7 @@ XS (XS_weechat_api_hook_completion_list_add)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_completion_list_add");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 4)
|
||||
@ -3559,7 +3559,7 @@ XS (XS_weechat_api_hook_modifier)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_modifier");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -3597,7 +3597,7 @@ XS (XS_weechat_api_hook_modifier_exec)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_modifier_exec");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -3659,7 +3659,7 @@ XS (XS_weechat_api_hook_info)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_info");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 4)
|
||||
@ -3735,7 +3735,7 @@ XS (XS_weechat_api_hook_infolist)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "hook_infolist");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 4)
|
||||
@ -3774,7 +3774,7 @@ XS (XS_weechat_api_unhook)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "unhook");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -3805,7 +3805,7 @@ XS (XS_weechat_api_unhook_all)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "unhook_all");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
script_api_unhook_all (perl_current_script);
|
||||
@ -3952,7 +3952,7 @@ XS (XS_weechat_api_buffer_search)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_search");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -3985,7 +3985,7 @@ XS (XS_weechat_api_buffer_search_main)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_search_main");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_buffer_search_main ());
|
||||
@ -4009,7 +4009,7 @@ XS (XS_weechat_api_current_buffer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "current_buffer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_current_buffer ());
|
||||
@ -4031,7 +4031,7 @@ XS (XS_weechat_api_buffer_clear)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_clear");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4059,7 +4059,7 @@ XS (XS_weechat_api_buffer_close)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_close");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4089,7 +4089,7 @@ XS (XS_weechat_api_buffer_merge)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_merge");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4118,7 +4118,7 @@ XS (XS_weechat_api_buffer_unmerge)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_unmerge");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4149,7 +4149,7 @@ XS (XS_weechat_api_buffer_get_integer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_get_integer");
|
||||
PERL_RETURN_INT(-1);
|
||||
PERL_RETURN_INT(-1);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4182,7 +4182,7 @@ XS (XS_weechat_api_buffer_get_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_get_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4214,7 +4214,7 @@ XS (XS_weechat_api_buffer_get_pointer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "buffer_get_pointer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4314,7 +4314,7 @@ XS (XS_weechat_api_current_window)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "current_window");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_current_window ());
|
||||
@ -4338,7 +4338,7 @@ XS (XS_weechat_api_window_get_integer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "window_get_integer");
|
||||
PERL_RETURN_INT(-1);
|
||||
PERL_RETURN_INT(-1);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4371,7 +4371,7 @@ XS (XS_weechat_api_window_get_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "window_get_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4403,7 +4403,7 @@ XS (XS_weechat_api_window_get_pointer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "window_get_pointer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4435,7 +4435,7 @@ XS (XS_weechat_api_window_set_title)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "window_set_title");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4464,7 +4464,7 @@ XS (XS_weechat_api_nicklist_add_group)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_add_group");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 5)
|
||||
@ -4502,7 +4502,7 @@ XS (XS_weechat_api_nicklist_search_group)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_search_group");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -4537,7 +4537,7 @@ XS (XS_weechat_api_nicklist_add_nick)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_add_nick");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 7)
|
||||
@ -4579,7 +4579,7 @@ XS (XS_weechat_api_nicklist_search_nick)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_search_nick");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -4614,7 +4614,7 @@ XS (XS_weechat_api_nicklist_remove_group)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_remove_group");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4647,7 +4647,7 @@ XS (XS_weechat_api_nicklist_remove_nick)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_remove_nick");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4679,7 +4679,7 @@ XS (XS_weechat_api_nicklist_remove_all)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "nicklist_remove_all");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -4708,7 +4708,7 @@ XS (XS_weechat_api_bar_item_search)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_item_search");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4773,7 +4773,7 @@ XS (XS_weechat_api_bar_item_new)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_item_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -4810,7 +4810,7 @@ XS (XS_weechat_api_bar_item_update)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_item_update");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4838,7 +4838,7 @@ XS (XS_weechat_api_bar_item_remove)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_item_remove");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4869,7 +4869,7 @@ XS (XS_weechat_api_bar_search)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_search");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -4900,7 +4900,7 @@ XS (XS_weechat_api_bar_new)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 15)
|
||||
@ -4959,7 +4959,7 @@ XS (XS_weechat_api_bar_set)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_set");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -4991,7 +4991,7 @@ XS (XS_weechat_api_bar_update)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_update");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5019,7 +5019,7 @@ XS (XS_weechat_api_bar_remove)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "bar_remove");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5084,7 +5084,7 @@ XS (XS_weechat_api_info_get)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "info_get");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -5117,7 +5117,7 @@ XS (XS_weechat_api_infolist_new)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
result = script_ptr2str (weechat_infolist_new ());
|
||||
@ -5140,7 +5140,7 @@ XS (XS_weechat_api_infolist_new_item)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new_item");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5171,7 +5171,7 @@ XS (XS_weechat_api_infolist_new_var_integer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new_var_integer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -5205,7 +5205,7 @@ XS (XS_weechat_api_infolist_new_var_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new_var_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -5240,7 +5240,7 @@ XS (XS_weechat_api_infolist_new_var_pointer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new_var_pointer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -5275,7 +5275,7 @@ XS (XS_weechat_api_infolist_new_var_time)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_new_var_time");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -5309,7 +5309,7 @@ XS (XS_weechat_api_infolist_get)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_get");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 3)
|
||||
@ -5344,7 +5344,7 @@ XS (XS_weechat_api_infolist_next)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_next");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5373,7 +5373,7 @@ XS (XS_weechat_api_infolist_prev)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_prev");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5402,7 +5402,7 @@ XS (XS_weechat_api_infolist_fields)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_fields");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
@ -5432,7 +5432,7 @@ XS (XS_weechat_api_infolist_integer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_integer");
|
||||
PERL_RETURN_INT(0);
|
||||
PERL_RETURN_INT(0);
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -5465,7 +5465,7 @@ XS (XS_weechat_api_infolist_string)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_string");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -5498,7 +5498,7 @@ XS (XS_weechat_api_infolist_pointer)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_pointer");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -5531,7 +5531,7 @@ XS (XS_weechat_api_infolist_time)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_time");
|
||||
PERL_RETURN_EMPTY;
|
||||
PERL_RETURN_EMPTY;
|
||||
}
|
||||
|
||||
if (items < 2)
|
||||
@ -5563,7 +5563,7 @@ XS (XS_weechat_api_infolist_free)
|
||||
if (!perl_current_script)
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_NOT_INIT(PERL_CURRENT_SCRIPT_NAME, "infolist_free");
|
||||
PERL_RETURN_ERROR;
|
||||
PERL_RETURN_ERROR;
|
||||
}
|
||||
|
||||
if (items < 1)
|
||||
|
@ -126,7 +126,7 @@ char *perl_weechat_code =
|
||||
|
||||
void *
|
||||
weechat_perl_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function, char **argv)
|
||||
int ret_type, const char *function, char **argv)
|
||||
{
|
||||
char *func;
|
||||
unsigned int count;
|
||||
@ -173,7 +173,7 @@ weechat_perl_exec (struct t_plugin_script *script,
|
||||
weechat_gettext ("%s%s: error: %s"),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME,
|
||||
SvPV_nolen (ERRSV));
|
||||
(void) POPs; /* poping the 'undef' */
|
||||
(void) POPs; /* poping the 'undef' */
|
||||
mem_err = 0;
|
||||
}
|
||||
else
|
||||
@ -302,7 +302,7 @@ weechat_perl_load (const char *filename)
|
||||
perl_construct (perl_current_interpreter);
|
||||
temp_script.interpreter = (PerlInterpreter *) perl_current_interpreter;
|
||||
perl_parse (perl_current_interpreter, weechat_perl_api_init,
|
||||
perl_args_count, perl_args, NULL);
|
||||
perl_args_count, perl_args, NULL);
|
||||
|
||||
eval_pv (perl_weechat_code, TRUE);
|
||||
perl_argv[0] = (char *)filename;
|
||||
@ -316,23 +316,23 @@ weechat_perl_load (const char *filename)
|
||||
perl_argv[2] = NULL;
|
||||
#endif
|
||||
eval = weechat_perl_exec (&temp_script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
"weechat_perl_load_eval_file",
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
"weechat_perl_load_eval_file",
|
||||
perl_argv);
|
||||
if (!eval)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: not enough memory to parse "
|
||||
"file \"%s\""),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME, filename);
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (*eval != 0)
|
||||
{
|
||||
if (*eval == 2)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
if (*eval == 2)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to parse file "
|
||||
"\"%s\""),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME,
|
||||
@ -351,42 +351,42 @@ weechat_perl_load (const char *filename)
|
||||
"weechat_perl_load_eval_file_error",
|
||||
FALSE), len));
|
||||
#endif
|
||||
}
|
||||
else if (*eval == 1)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
}
|
||||
else if (*eval == 1)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to run file \"%s\""),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME,
|
||||
filename);
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unknown error while "
|
||||
"loading file \"%s\""),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME,
|
||||
filename);
|
||||
}
|
||||
}
|
||||
#ifdef MULTIPLICITY
|
||||
perl_destruct (perl_current_interpreter);
|
||||
perl_destruct (perl_current_interpreter);
|
||||
perl_free (perl_current_interpreter);
|
||||
#endif
|
||||
if (perl_current_script && (perl_current_script != &temp_script))
|
||||
if (perl_current_script && (perl_current_script != &temp_script))
|
||||
{
|
||||
script_remove (weechat_perl_plugin,
|
||||
&perl_scripts, &last_perl_script,
|
||||
perl_current_script);
|
||||
}
|
||||
|
||||
free (eval);
|
||||
return 0;
|
||||
|
||||
free (eval);
|
||||
return 0;
|
||||
}
|
||||
|
||||
free (eval);
|
||||
|
||||
if (!perl_current_script)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"register\" not "
|
||||
"found (or failed) in file \"%s\""),
|
||||
weechat_prefix ("error"), PERL_PLUGIN_NAME, filename);
|
||||
@ -444,10 +444,10 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
{
|
||||
r = (int *) weechat_perl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
script->shutdown_func,
|
||||
perl_argv);
|
||||
if (r)
|
||||
free (r);
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
@ -464,7 +464,7 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
perl_free (interpreter);
|
||||
#else
|
||||
if (interpreter)
|
||||
free (interpreter);
|
||||
free (interpreter);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -794,7 +794,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
perl_construct (perl_main);
|
||||
perl_parse (perl_main, weechat_perl_api_init, perl_args_count,
|
||||
perl_args, NULL);
|
||||
perl_args, NULL);
|
||||
eval_pv (perl_weechat_code, TRUE);
|
||||
#endif
|
||||
|
||||
@ -841,9 +841,9 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
/* free perl intepreter */
|
||||
if (perl_main)
|
||||
{
|
||||
perl_destruct (perl_main);
|
||||
perl_free (perl_main);
|
||||
perl_main = NULL;
|
||||
perl_destruct (perl_main);
|
||||
perl_free (perl_main);
|
||||
perl_main = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -67,7 +67,7 @@ char python_buffer_output[128];
|
||||
|
||||
void *
|
||||
weechat_python_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function, char **argv)
|
||||
int ret_type, const char *function, char **argv)
|
||||
{
|
||||
struct t_plugin_script *old_python_current_script;
|
||||
PyThreadState *old_interpreter;
|
||||
@ -97,10 +97,10 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to run function \"%s\""),
|
||||
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, function);
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
if (old_interpreter)
|
||||
PyThreadState_Swap (old_interpreter);
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
python_current_script = script;
|
||||
@ -184,7 +184,7 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
because of '#define WEECHAT_RC_OK 0'
|
||||
*/
|
||||
if (rc == NULL)
|
||||
rc = PyInt_FromLong (0);
|
||||
rc = PyInt_FromLong (0);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
@ -193,19 +193,18 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
}
|
||||
else if (PyString_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_STRING))
|
||||
{
|
||||
if (PyString_AsString (rc))
|
||||
ret_value = strdup (PyString_AsString(rc));
|
||||
else
|
||||
ret_value = NULL;
|
||||
|
||||
Py_XDECREF(rc);
|
||||
if (PyString_AsString (rc))
|
||||
ret_value = strdup (PyString_AsString(rc));
|
||||
else
|
||||
ret_value = NULL;
|
||||
|
||||
Py_XDECREF(rc);
|
||||
}
|
||||
else if (PyInt_Check (rc) && (ret_type == WEECHAT_SCRIPT_EXEC_INT))
|
||||
{
|
||||
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = (int) PyInt_AsLong(rc);
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = (int) PyInt_AsLong(rc);
|
||||
ret_value = ret_i;
|
||||
|
||||
Py_XDECREF(rc);
|
||||
@ -253,39 +252,39 @@ weechat_python_output (PyObject *self, PyObject *args)
|
||||
if (!PyArg_ParseTuple (args, "s", &msg))
|
||||
{
|
||||
if (strlen(python_buffer_output) > 0)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: stdout/stderr: %s%s"),
|
||||
PYTHON_PLUGIN_NAME, python_buffer_output, "");
|
||||
python_buffer_output[0] = '\0';
|
||||
}
|
||||
python_buffer_output[0] = '\0';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m = msg;
|
||||
while ((p = strchr (m, '\n')) != NULL)
|
||||
{
|
||||
*p = '\0';
|
||||
if (strlen (m) + strlen (python_buffer_output) > 0)
|
||||
m = msg;
|
||||
while ((p = strchr (m, '\n')) != NULL)
|
||||
{
|
||||
*p = '\0';
|
||||
if (strlen (m) + strlen (python_buffer_output) > 0)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: stdout/stderr: %s%s"),
|
||||
PYTHON_PLUGIN_NAME, python_buffer_output, m);
|
||||
}
|
||||
*p = '\n';
|
||||
python_buffer_output[0] = '\0';
|
||||
m = ++p;
|
||||
}
|
||||
|
||||
if (strlen(m) + strlen(python_buffer_output) > sizeof(python_buffer_output))
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
*p = '\n';
|
||||
python_buffer_output[0] = '\0';
|
||||
m = ++p;
|
||||
}
|
||||
|
||||
if (strlen(m) + strlen(python_buffer_output) > sizeof(python_buffer_output))
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: stdout/stderr: %s%s"),
|
||||
PYTHON_PLUGIN_NAME, python_buffer_output, m);
|
||||
python_buffer_output[0] = '\0';
|
||||
}
|
||||
else
|
||||
strcat (python_buffer_output, m);
|
||||
python_buffer_output[0] = '\0';
|
||||
}
|
||||
else
|
||||
strcat (python_buffer_output, m);
|
||||
}
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
@ -361,7 +360,7 @@ weechat_python_load (const char *filename)
|
||||
"module"),
|
||||
weechat_prefix ("error"), PYTHON_PLUGIN_NAME);
|
||||
fclose (fp);
|
||||
|
||||
|
||||
Py_EndInterpreter (python_current_interpreter);
|
||||
/* PyEval_ReleaseLock (); */
|
||||
|
||||
@ -497,7 +496,7 @@ weechat_python_load (const char *filename)
|
||||
weechat_gettext ("%s%s: function \"register\" not "
|
||||
"found (or failed) in file \"%s\""),
|
||||
weechat_prefix ("error"), PYTHON_PLUGIN_NAME, filename);
|
||||
|
||||
|
||||
if (PyErr_Occurred ())
|
||||
PyErr_Print ();
|
||||
Py_EndInterpreter (python_current_interpreter);
|
||||
@ -543,9 +542,9 @@ weechat_python_unload (struct t_plugin_script *script)
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
script->shutdown_func, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
old_interpreter = PyThreadState_Swap (NULL);
|
||||
@ -914,9 +913,9 @@ weechat_plugin_end (struct t_weechat_plugin *plugin)
|
||||
/* free Python interpreter */
|
||||
if (python_mainThreadState != NULL)
|
||||
{
|
||||
/* PyEval_AcquireLock (); */
|
||||
/* PyEval_AcquireLock (); */
|
||||
PyThreadState_Swap (python_mainThreadState);
|
||||
/* PyEval_ReleaseLock (); */
|
||||
/* PyEval_ReleaseLock (); */
|
||||
python_mainThreadState = NULL;
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ weechat_ruby_print_exception (VALUE err)
|
||||
|
||||
void *
|
||||
weechat_ruby_exec (struct t_plugin_script *script,
|
||||
int ret_type, const char *function, char **argv)
|
||||
int ret_type, const char *function, char **argv)
|
||||
{
|
||||
VALUE rc, err;
|
||||
int ruby_error, *ret_i;
|
||||
@ -336,48 +336,48 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
|
||||
if (ruby_error)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to run function \"%s\""),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME, function);
|
||||
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
|
||||
return NULL;
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ((TYPE(rc) == T_STRING) && (ret_type == WEECHAT_SCRIPT_EXEC_STRING))
|
||||
{
|
||||
if (STR2CSTR (rc))
|
||||
ret_value = strdup (STR2CSTR (rc));
|
||||
else
|
||||
ret_value = NULL;
|
||||
if (STR2CSTR (rc))
|
||||
ret_value = strdup (STR2CSTR (rc));
|
||||
else
|
||||
ret_value = NULL;
|
||||
}
|
||||
else if ((TYPE(rc) == T_FIXNUM) && (ret_type == WEECHAT_SCRIPT_EXEC_INT))
|
||||
{
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = NUM2INT(rc);
|
||||
ret_value = ret_i;
|
||||
ret_i = malloc (sizeof (*ret_i));
|
||||
if (ret_i)
|
||||
*ret_i = NUM2INT(rc);
|
||||
ret_value = ret_i;
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"%s\" must return a "
|
||||
"valid value"),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME, function);
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
return WEECHAT_RC_OK;
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (ret_value == NULL)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: not enough memory in function "
|
||||
"\"%s\""),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME, function);
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
@ -402,32 +402,32 @@ weechat_ruby_output (VALUE self, VALUE str)
|
||||
m = msg;
|
||||
while ((p = strchr (m, '\n')) != NULL)
|
||||
{
|
||||
*p = '\0';
|
||||
if (strlen (m) + strlen (ruby_buffer_output) > 0)
|
||||
*p = '\0';
|
||||
if (strlen (m) + strlen (ruby_buffer_output) > 0)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: stdout/stderr: %s%s"),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME,
|
||||
ruby_buffer_output, m);
|
||||
}
|
||||
*p = '\n';
|
||||
ruby_buffer_output[0] = '\0';
|
||||
m = ++p;
|
||||
*p = '\n';
|
||||
ruby_buffer_output[0] = '\0';
|
||||
m = ++p;
|
||||
}
|
||||
|
||||
if (strlen(m) + strlen(ruby_buffer_output) > sizeof(ruby_buffer_output))
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: stdout/stderr: %s%s"),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME,
|
||||
ruby_buffer_output, m);
|
||||
ruby_buffer_output[0] = '\0';
|
||||
ruby_buffer_output[0] = '\0';
|
||||
}
|
||||
else
|
||||
strcat (ruby_buffer_output, m);
|
||||
strcat (ruby_buffer_output, m);
|
||||
|
||||
if (msg)
|
||||
free (msg);
|
||||
free (msg);
|
||||
|
||||
return Qnil;
|
||||
}
|
||||
@ -483,19 +483,19 @@ weechat_ruby_load (const char *filename)
|
||||
ruby_current_script_filename = filename;
|
||||
|
||||
ruby_retcode = rb_protect_funcall (curModule, rb_intern("load_eval_file"),
|
||||
&ruby_error, 1, rb_str_new2(filename));
|
||||
&ruby_error, 1, rb_str_new2(filename));
|
||||
|
||||
if (ruby_retcode == Qnil)
|
||||
{
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
return 0;
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (NUM2INT(ruby_retcode) != 0)
|
||||
{
|
||||
switch (NUM2INT(ruby_retcode))
|
||||
{
|
||||
switch (NUM2INT(ruby_retcode))
|
||||
{
|
||||
case 1:
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to read file "
|
||||
@ -518,14 +518,14 @@ weechat_ruby_load (const char *filename)
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME,
|
||||
filename);
|
||||
break;
|
||||
}
|
||||
|
||||
if (NUM2INT(ruby_retcode) == 1 || NUM2INT(ruby_retcode) == 2)
|
||||
{
|
||||
weechat_ruby_print_exception(rb_iv_get(curModule, "@load_eval_file_error"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (NUM2INT(ruby_retcode) == 1 || NUM2INT(ruby_retcode) == 2)
|
||||
{
|
||||
weechat_ruby_print_exception(rb_iv_get(curModule, "@load_eval_file_error"));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
ruby_retcode = rb_protect_funcall (curModule, rb_intern("weechat_init"),
|
||||
@ -533,27 +533,27 @@ weechat_ruby_load (const char *filename)
|
||||
|
||||
if (ruby_error)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: unable to eval function "
|
||||
"\"weechat_init\" in file \"%s\""),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME, filename);
|
||||
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
|
||||
if (ruby_current_script != NULL)
|
||||
|
||||
err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
|
||||
if (ruby_current_script != NULL)
|
||||
{
|
||||
script_remove (weechat_ruby_plugin,
|
||||
script_remove (weechat_ruby_plugin,
|
||||
&ruby_scripts, &last_ruby_script,
|
||||
ruby_current_script);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (ruby_current_script == NULL)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"register\" not "
|
||||
"found (or failed) in file \"%s\""),
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME, filename);
|
||||
@ -598,10 +598,10 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
{
|
||||
r = (int *) weechat_ruby_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
script->shutdown_func,
|
||||
ruby_argv);
|
||||
if (r)
|
||||
free (r);
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
@ -614,7 +614,7 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
script);
|
||||
|
||||
if (interpreter)
|
||||
rb_gc_unregister_address (interpreter);
|
||||
rb_gc_unregister_address (interpreter);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -651,7 +651,7 @@ weechat_ruby_unload_all ()
|
||||
{
|
||||
while (ruby_scripts)
|
||||
{
|
||||
weechat_ruby_unload (ruby_scripts);
|
||||
weechat_ruby_unload (ruby_scripts);
|
||||
}
|
||||
}
|
||||
|
||||
@ -927,7 +927,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
" rescue => e\n"
|
||||
" return 1\n"
|
||||
" end\n"
|
||||
"\n"
|
||||
"\n"
|
||||
" begin\n"
|
||||
" module_eval(lines)\n"
|
||||
" rescue Exception => e\n"
|
||||
@ -991,7 +991,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
weechat_prefix ("error"), RUBY_PLUGIN_NAME);
|
||||
VALUE err = rb_gv_get("$!");
|
||||
weechat_ruby_print_exception(err);
|
||||
return WEECHAT_RC_ERROR;
|
||||
return WEECHAT_RC_ERROR;
|
||||
}
|
||||
|
||||
ruby_quiet = 1;
|
||||
|
@ -481,7 +481,7 @@ xfer_network_connect (struct t_xfer *xfer)
|
||||
{
|
||||
/* listen to socket */
|
||||
if (fcntl (xfer->sock, F_SETFL, O_NONBLOCK) == -1)
|
||||
return 0;
|
||||
return 0;
|
||||
if (listen (xfer->sock, 1) == -1)
|
||||
return 0;
|
||||
if (fcntl (xfer->sock, F_SETFL, 0) == -1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user