diff options
Diffstat (limited to 'doc/en')
80 files changed, 11391 insertions, 18053 deletions
diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt new file mode 100644 index 000000000..d946ee93a --- /dev/null +++ b/doc/en/CMakeLists.txt @@ -0,0 +1,83 @@ +# Copyright (c) 2003-2009 FlashCode <flashcode@flashtux.org> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# + +# user's guide +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_user.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_user.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_user.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_user.en.txt + ${CMAKE_CURRENT_SOURCE_DIR}/autogen/user/*.txt + COMMENT "Building weechat_user.en.html" +) +ADD_CUSTOM_TARGET(doc-user-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_user.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_user.en.html DESTINATION share/doc/${PROJECT_NAME}) + +# plugin API reference +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_plugin_api.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_plugin_api.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_plugin_api.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_plugin_api.en.txt + ${CMAKE_CURRENT_SOURCE_DIR}/autogen/plugin_api/*.txt + COMMENT "Building weechat_plugin_api.en.html" +) +ADD_CUSTOM_TARGET(doc-plugin-api-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_plugin_api.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_plugin_api.en.html DESTINATION share/doc/${PROJECT_NAME}) + +# scripting guide +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_scripting.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_scripting.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_scripting.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_scripting.en.txt + COMMENT "Building weechat_scripting.en.html" +) +ADD_CUSTOM_TARGET(doc-scripting-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_scripting.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_scripting.en.html DESTINATION share/doc/${PROJECT_NAME}) + +# FAQ +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_faq.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_faq.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_faq.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_faq.en.txt + COMMENT "Building weechat_faq.en.html" +) +ADD_CUSTOM_TARGET(doc-faq-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_faq.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_faq.en.html DESTINATION share/doc/${PROJECT_NAME}) + +# quickstart +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_quickstart.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_quickstart.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_quickstart.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_quickstart.en.txt + COMMENT "Building weechat_quickstart.en.html" +) +ADD_CUSTOM_TARGET(doc-quickstart-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_quickstart.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_quickstart.en.html DESTINATION share/doc/${PROJECT_NAME}) + +# tester's guide +ADD_CUSTOM_COMMAND( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/weechat_tester.en.html + COMMAND ${ASCIIDOC} ARGS -a toc -a date=`date "+%F"` -a revision="${VERSION}" -n -o ${CMAKE_CURRENT_BINARY_DIR}/weechat_tester.en.html ${CMAKE_CURRENT_SOURCE_DIR}/weechat_tester.en.txt + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/weechat_tester.en.txt + COMMENT "Building weechat_tester.en.html" +) +ADD_CUSTOM_TARGET(doc-tester-en ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/weechat_tester.en.html) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat_tester.en.html DESTINATION share/doc/${PROJECT_NAME}) diff --git a/doc/en/Makefile.am b/doc/en/Makefile.am index e732941e7..9f309e4cd 100644 --- a/doc/en/Makefile.am +++ b/doc/en/Makefile.am @@ -14,202 +14,56 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -LANGCODE = en - -BOOK_AUTOGEN_INCLUDE = ../include_autogen.xml \ - autogen/alias_commands.xml \ - autogen/aspell_commands.xml \ - autogen/aspell_options.xml \ - autogen/charset_commands.xml \ - autogen/charset_options.xml \ - autogen/completions.xml \ - autogen/demo_commands.xml \ - autogen/irc_commands.xml \ - autogen/irc_options.xml \ - autogen/infos.xml \ - autogen/infolists.xml \ - autogen/jabber_commands.xml \ - autogen/jabber_options.xml \ - autogen/logger_commands.xml \ - autogen/logger_options.xml \ - autogen/lua_commands.xml \ - autogen/perl_commands.xml \ - autogen/python_commands.xml \ - autogen/ruby_commands.xml \ - autogen/tcl_commands.xml \ - autogen/weechat_commands.xml \ - autogen/weechat_options.xml \ - autogen/xfer_commands.xml \ - autogen/xfer_options.xml - -BOOK_COMMON_INCLUDE = authors.$(LANGCODE).xml \ - intro.$(LANGCODE).xml - -BOOK_USER = weechat_user.$(LANGCODE) -BOOK_USER_INCLUDE = user/install.$(LANGCODE).xml \ - user/usage.$(LANGCODE).xml \ - user/plugins.$(LANGCODE).xml \ - user/plugin_alias.$(LANGCODE).xml \ - user/plugin_aspell.$(LANGCODE).xml \ - user/plugin_charset.$(LANGCODE).xml \ - user/plugin_fifo.$(LANGCODE).xml \ - user/plugin_irc.$(LANGCODE).xml \ - user/plugin_jabber.$(LANGCODE).xml \ - user/plugin_logger.$(LANGCODE).xml \ - user/plugin_scripts.$(LANGCODE).xml \ - user/plugin_xfer.$(LANGCODE).xml - -BOOK_DEV = weechat_dev.$(LANGCODE) -BOOK_DEV_INCLUDE = dev/plugins.$(LANGCODE).xml \ - dev/plugin_api.$(LANGCODE).xml \ - dev/plugin_c_api.$(LANGCODE).xml \ - dev/plugin_script_api.$(LANGCODE).xml - -FAQ = weechat_faq.$(LANGCODE).txt -QUICKSTART = weechat_quickstart.$(LANGCODE).txt -TESTER = weechat_tester.$(LANGCODE).txt - -EXTRA_DIST = $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) \ - user/$(BOOK_USER).xml $(BOOK_USER_INCLUDE) \ - dev/$(BOOK_DEV).xml $(BOOK_DEV_INCLUDE) \ - $(FAQ) $(QUICKSTART) $(TESTER) - -if DBLATEX_FOUND -PDF = user-pdf-stamp dev-pdf-stamp -endif - docdir = $(datadir)/doc/$(PACKAGE) -all-local: user-html-stamp dev-html-stamp $(PDF) - -# user's guide, HTML output with chunks (many pages) - -user-html: user-html-stamp - -user-html-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) user/$(BOOK_USER).xml $(BOOK_USER_INCLUDE) ../weechat-html.xsl ../weechat-doc.css ../include_autogen.xml - rm -rf build/user-html/autogen/ - mkdir -p build/user-html/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/user-html/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/user-html/ - cp user/$(BOOK_USER).xml build/user-html/ - cp $(BOOK_USER_INCLUDE) build/user-html/ - cp ../include_autogen.xml build/user-html/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/user-html/date.xml - rm -rf html/user/ - mkdir -p html/user/ - cd build/user-html/ ; xsltproc -o ../../html/user/ ../../../weechat-html.xsl $(BOOK_USER).xml || true - cp ../weechat-doc.css html/user/ - touch user-html-stamp - -# user's guide, HTML output, all in one page - -user-html1: user-html1-stamp - -user-html1-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) user/$(BOOK_USER).xml $(BOOK_USER_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css ../include_autogen.xml - rm -rf build/user-html1/autogen/ - mkdir -p build/user-html1/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/user-html1/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/user-html1/ - cp user/$(BOOK_USER).xml build/user-html1/ - cp $(BOOK_USER_INCLUDE) build/user-html1/ - cp ../include_autogen.xml build/user-html1/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/user-html1/date.xml - rm -rf html1/user/ - mkdir -p html1/user/ - cd build/user-html1/ ; xsltproc -o ../../html1/user/$(BOOK_USER).html ../../../weechat-html-one.xsl $(BOOK_USER).xml || true - cp ../weechat-doc.css html1/user/ - touch user-html1-stamp - -# user's guide, PDF output - -user-pdf: user-pdf-stamp - -user-pdf-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) user/$(BOOK_USER).xml $(BOOK_USER_INCLUDE) ../include_autogen.xml - rm -rf build/user-pdf/autogen/ - mkdir -p build/user-pdf/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/user-pdf/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/user-pdf/ - cp user/$(BOOK_USER).xml build/user-pdf/ - cp $(BOOK_USER_INCLUDE) build/user-pdf/ - cp ../include_autogen.xml build/user-pdf/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/user-pdf/date.xml - rm -rf pdf/user/ - mkdir -p pdf/user/ - cd build/user-pdf/ ; dblatex -o ../../pdf/user/$(BOOK_USER).pdf -P draft.mode=no -c ../../../dblatex.conf $(BOOK_USER).xml || true - touch user-pdf-stamp - -# developer's guide, HTML output with chunks (many pages) - -dev-html: dev-html-stamp - -dev-html-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) dev/$(BOOK_DEV).xml $(BOOK_DEV_INCLUDE) ../weechat-html.xsl ../weechat-doc.css ../include_autogen.xml - rm -rf build/dev-html/autogen/ - mkdir -p build/dev-html/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/dev-html/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/dev-html/ - cp dev/$(BOOK_DEV).xml build/dev-html/ - cp $(BOOK_DEV_INCLUDE) build/dev-html/ - cp ../include_autogen.xml build/dev-html/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/dev-html/date.xml - rm -rf html/dev/ - mkdir -p html/dev/ - cd build/dev-html/ ; xsltproc -o ../../html/dev/ ../../../weechat-html.xsl $(BOOK_DEV).xml || true - cp ../weechat-doc.css html/dev/ - touch dev-html-stamp - -# developer's guide, HTML output, all in one page - -dev-html1: dev-html1-stamp - -dev-html1-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) dev/$(BOOK_DEV).xml $(BOOK_DEV_INCLUDE) ../weechat-html-one.xsl ../weechat-doc.css ../include_autogen.xml - rm -rf build/dev-html1/autogen/ - mkdir -p build/dev-html1/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/dev-html1/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/dev-html1/ - cp dev/$(BOOK_DEV).xml build/dev-html1/ - cp $(BOOK_DEV_INCLUDE) build/dev-html1/ - cp ../include_autogen.xml build/dev-html1/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/dev-html1/date.xml - rm -rf html1/dev/ - mkdir -p html1/dev/ - cd build/dev-html1/ ; xsltproc -o ../../html1/dev/$(BOOK_DEV).html ../../../weechat-html-one.xsl $(BOOK_DEV).xml || true - cp ../weechat-doc.css html1/dev/ - touch dev-html1-stamp - -# developer's guide, PDF output - -dev-pdf: dev-pdf-stamp - -dev-pdf-stamp: $(BOOK_AUTOGEN_INCLUDE) $(BOOK_COMMON_INCLUDE) dev/$(BOOK_DEV).xml $(BOOK_DEV_INCLUDE) ../include_autogen.xml - rm -rf build/dev-pdf/autogen/ - mkdir -p build/dev-pdf/autogen/ - cp $(BOOK_AUTOGEN_INCLUDE) build/dev-pdf/autogen/ - cp $(BOOK_COMMON_INCLUDE) build/dev-pdf/ - cp dev/$(BOOK_DEV).xml build/dev-pdf/ - cp $(BOOK_DEV_INCLUDE) build/dev-pdf/ - cp ../include_autogen.xml build/dev-pdf/ - echo "<pubdate>`date '+%F %T'`</pubdate>" >build/dev-pdf/date.xml - rm -rf pdf/dev/ - mkdir -p pdf/dev/ - cd build/dev-pdf/ ; dblatex -o ../../pdf/dev/$(BOOK_DEV).pdf -P draft.mode=no -c ../../../dblatex.conf $(BOOK_DEV).xml || true - touch dev-pdf-stamp +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) + +all-local: weechat_user.en.html \ + weechat_plugin_api.en.html \ + weechat_scripting.en.html \ + weechat_faq.en.html \ + weechat_quickstart.en.html \ + weechat_tester.en.html + +# user's guide +weechat_user.en.html: weechat_user.en.txt $(wildcard autogen/user/*.txt) + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_user.en.html weechat_user.en.txt + +# plugin API reference +weechat_plugin_api.en.html: weechat_plugin_api.en.txt $(wildcard autogen/plugin_api/*.txt) + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_plugin_api.en.html weechat_plugin_api.en.txt + +# scripting guide +weechat_scripting.en.html: weechat_scripting.en.txt + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_scripting.en.html weechat_scripting.en.txt + +# FAQ +weechat_faq.en.html: weechat_faq.en.txt + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_faq.en.html weechat_faq.en.txt + +# quickstart +weechat_quickstart.en.html: weechat_quickstart.en.txt + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_quickstart.en.html weechat_quickstart.en.txt + +# tester's guide +weechat_tester.en.html: weechat_tester.en.txt + $(ASCIIDOC) -a toc -a date=`date "+%F"` -a revision="$(VERSION)" -n -o weechat_tester.en.html weechat_tester.en.txt # install docs install-data-hook: - $(mkinstalldirs) $(DESTDIR)$(docdir)/html/$(LANGCODE)/user/ $(DESTDIR)$(docdir)/html/$(LANGCODE)/dev/ - $(INSTALL_DATA) html/user/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/user/ - $(INSTALL_DATA) html/dev/* $(DESTDIR)$(docdir)/html/$(LANGCODE)/dev/ - $(INSTALL_DATA) $(FAQ) $(DESTDIR)$(docdir)/ - $(INSTALL_DATA) $(QUICKSTART) $(DESTDIR)$(docdir)/ - $(INSTALL_DATA) $(TESTER) $(DESTDIR)$(docdir)/ -if DBLATEX_FOUND - $(INSTALL_DATA) pdf/user/$(BOOK_USER).pdf $(DESTDIR)$(docdir)/ - $(INSTALL_DATA) pdf/dev/$(BOOK_DEV).pdf $(DESTDIR)$(docdir)/ -endif + $(mkinstalldirs) $(DESTDIR)$(docdir)/ + $(INSTALL_DATA) *.html $(DESTDIR)$(docdir)/ # clean clean-local: - -rm -rf html/ html1/ pdf/ build/ - -rm -f user-html-stamp user-html1-stamp user-pdf-stamp dev-html-stamp dev-html1-stamp dev-pdf-stamp + -rm -f *.html diff --git a/doc/en/authors.en.xml b/doc/en/authors.en.xml deleted file mode 100644 index 7d57ba868..000000000 --- a/doc/en/authors.en.xml +++ /dev/null @@ -1,183 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapAuthorsSupport"> - <title>Authors / Support</title> - - <para> - This chapter lists authors and contributors for WeeChat, and - shows ways to get support. - </para> - - <section id="secAuthors"> - <title>Authors</title> - - <para> - WeeChat is developed by: - <itemizedlist> - <listitem> - <para> - <emphasis>FlashCode (Sébastien Helleu)</emphasis> - <email>flashcode AT flashtux.org</email> - - main developer - </para> - </listitem> - <listitem> - <para> - <emphasis>kolter (Emmanuel Bouthenot)</emphasis> - <email>kolter AT openics.org</email> - - developer, Debian packager - </para> - </listitem> - </itemizedlist> - </para> - - </section> - - <section id="secContributors"> - <title>Contributors</title> - - <para> - Following people contributed to WeeChat: - <itemizedlist> - <listitem> - <para> - <emphasis>Ptitlouis</emphasis> - - first debian packager - </para> - </listitem> - <listitem> - <para> - <emphasis>Jiri Golembiovsky</emphasis> - - czech translation, patches - </para> - </listitem> - <listitem> - <para> - <emphasis>Pavel Shevchuk</emphasis> - - russian translation - </para> - </listitem> - <listitem> - <para> - <emphasis>Frank Zacharias</emphasis> - - german translation - </para> - </listitem> - <listitem> - <para> - <emphasis>voroskoi</emphasis> - - hungarian translation - </para> - </listitem> - <listitem> - <para> - <emphasis>Rudolf Polzer</emphasis> - - patches - </para> - </listitem> - <listitem> - <para> - <emphasis>Jim Ramsay</emphasis> - - patches - </para> - </listitem> - <listitem> - <para> - <emphasis>Odin</emphasis> - - SuSE RPM - </para> - </listitem> - <listitem> - <para> - <emphasis>Pistos</emphasis> - - patches - </para> - </listitem> - <listitem> - <para> - <emphasis>Gwenn</emphasis> - - patches - </para> - </listitem> - </itemizedlist> - </para> - - </section> - - <section id="secSupport"> - <title>Get support</title> - - <para> - Before asking for support, be sure you've read documentation and FAQ - provided with WeeChat (documentation is this document, if you don't - read all lines until this sentence, you can start again!) - </para> - - <para> - <itemizedlist> - <listitem> - <para> - IRC: server "<literal>irc.freenode.net</literal>", - channel "<literal>#weechat</literal>" - </para> - </listitem> - <listitem> - <para> - WeeChat forum: - <ulink url="http://forums.flashtux.org/"> - http://forums.flashtux.org/ - </ulink> - </para> - </listitem> - <listitem> - <para> - Mailing list: - <itemizedlist> - <listitem> - <para> - To subscribe: - <ulink url="http://mail.nongnu.org/mailman/listinfo/weechat-support"> - http://mail.nongnu.org/mailman/listinfo/weechat-support - </ulink> - </para> - </listitem> - <listitem> - <para> - To send a mail on mailing list: - <email>weechat-support@nongnu.org</email> - </para> - </listitem> - </itemizedlist> - Mailing list archives are available here: - <ulink url="http://mail.nongnu.org/archive/html/weechat-support"> - http://mail.nongnu.org/archive/html/weechat-support - </ulink> - </para> - </listitem> - </itemizedlist> - </para> - - </section> - -</chapter> diff --git a/doc/en/autogen/alias_commands.xml b/doc/en/autogen/alias_commands.xml deleted file mode 100644 index 2f98d18c8..000000000 --- a/doc/en/autogen/alias_commands.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/alias [alias_name [command [arguments]]]</command> -<programlisting> -create an alias for a command - -alias_name: name of alias - command: command name (many commands can be separated by semicolons) - arguments: arguments for command - -Without argument, this command lists all defined alias. - -Note: in command, special variables $1, $2,..,$9 are replaced by arguments given by user, and $* is replaced by all arguments. -Variables $nick, $channel and $server are replaced by current nick/channel/server. -</programlisting> - diff --git a/doc/en/autogen/aspell_commands.xml b/doc/en/autogen/aspell_commands.xml deleted file mode 100644 index 14ff38431..000000000 --- a/doc/en/autogen/aspell_commands.xml +++ /dev/null @@ -1,20 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/aspell dictlist | enable lang | disable | addword [lang] word</command> -<programlisting> -aspell plugin configuration - -dictlist: show installed dictionaries - enable: enable aspell on current buffer - disable: disable aspell on current buffer - addword: add a word in your personal aspell dictionary - -Input line beginning with a '/' is not checked, except for some commands. -</programlisting> - diff --git a/doc/en/autogen/aspell_options.xml b/doc/en/autogen/aspell_options.xml deleted file mode 100644 index 4977904a8..000000000 --- a/doc/en/autogen/aspell_options.xml +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>aspell.check.commands</command>: comma separated list of commands for which spell checking is enabled (spell checking is disabled for all other commands) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic')</para> - </listitem> -</itemizedlist> - -<command>aspell.check.default_dict</command>: default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable aspell on buffers for which you didn't explicitely enabled it) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>aspell.check.during_search</command>: check words during text search in buffer -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>aspell.check.real_time</command>: real-time spell checking of words (slower, disabled by default: words are checked only if there's delimiter after) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>aspell.check.word_min_length</command>: minimum length for a word to be spell checked (use 0 to check all words) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 2)</para> - </listitem> -</itemizedlist> - -<command>aspell.look.color</command>: color used for mispelled words -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/charset_commands.xml b/doc/en/autogen/charset_commands.xml deleted file mode 100644 index a5d76d6d7..000000000 --- a/doc/en/autogen/charset_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/charset [[decode | encode] charset] | [reset]</command> -<programlisting> -change charset for current buffer - - decode: change decoding charset - encode: change encoding charset -charset: new charset for current buffer - reset: reset charsets for current buffer -</programlisting> - diff --git a/doc/en/autogen/charset_options.xml b/doc/en/autogen/charset_options.xml deleted file mode 100644 index 42c44d271..000000000 --- a/doc/en/autogen/charset_options.xml +++ /dev/null @@ -1,28 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>charset.default.decode</command>: global decoding charset -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'iso-8859-1')</para> - </listitem> -</itemizedlist> - -<command>charset.default.encode</command>: global encoding charset -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/completions.xml b/doc/en/autogen/completions.xml deleted file mode 100644 index 73af89c2d..000000000 --- a/doc/en/autogen/completions.xml +++ /dev/null @@ -1,208 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<row> - <entry>alias</entry> - <entry>alias</entry> - <entry>list of alias</entry> -</row> -<row> - <entry>aspell</entry> - <entry>aspell_langs</entry> - <entry>list of supported langs for aspell</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_channel</entry> - <entry>current IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_channel_nicks_hosts</entry> - <entry>nicks and hostnames of current IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_channel_topic</entry> - <entry>topic of current IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_channels</entry> - <entry>IRC channels (on all servers)</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_ignores_numbers</entry> - <entry>numbers for defined ignores</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_msg_part</entry> - <entry>default part message for IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_privates</entry> - <entry>IRC privates (on all servers)</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_server</entry> - <entry>current IRC server</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_server_nick</entry> - <entry>nick on current IRC server</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_server_nicks</entry> - <entry>nicks on all channels of current IRC server</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_servers</entry> - <entry>IRC servers (internal names)</entry> -</row> -<row> - <entry>irc</entry> - <entry>nick</entry> - <entry>nicks of current IRC channel</entry> -</row> -<row> - <entry>lua</entry> - <entry>lua_script</entry> - <entry>list of scripts</entry> -</row> -<row> - <entry>perl</entry> - <entry>perl_script</entry> - <entry>list of scripts</entry> -</row> -<row> - <entry>python</entry> - <entry>python_script</entry> - <entry>list of scripts</entry> -</row> -<row> - <entry>ruby</entry> - <entry>ruby_script</entry> - <entry>list of scripts</entry> -</row> -<row> - <entry>tcl</entry> - <entry>tcl_script</entry> - <entry>list of scripts</entry> -</row> -<row> - <entry>weechat</entry> - <entry>bars_names</entry> - <entry>names of bars</entry> -</row> -<row> - <entry>weechat</entry> - <entry>bars_options</entry> - <entry>options for bars</entry> -</row> -<row> - <entry>weechat</entry> - <entry>buffers_names</entry> - <entry>names of buffers</entry> -</row> -<row> - <entry>weechat</entry> - <entry>buffers_numbers</entry> - <entry>numbers of buffers</entry> -</row> -<row> - <entry>weechat</entry> - <entry>buffers_plugins_names</entry> - <entry>names of buffers (including plugins names)</entry> -</row> -<row> - <entry>weechat</entry> - <entry>commands</entry> - <entry>commands (weechat and plugins)</entry> -</row> -<row> - <entry>weechat</entry> - <entry>config_files</entry> - <entry>configuration files</entry> -</row> -<row> - <entry>weechat</entry> - <entry>config_option_values</entry> - <entry>values for a configuration option</entry> -</row> -<row> - <entry>weechat</entry> - <entry>config_options</entry> - <entry>configuration options</entry> -</row> -<row> - <entry>weechat</entry> - <entry>filename</entry> - <entry>filename</entry> -</row> -<row> - <entry>weechat</entry> - <entry>filters_names</entry> - <entry>names of filters</entry> -</row> -<row> - <entry>weechat</entry> - <entry>infolists</entry> - <entry>names of infolists hooked</entry> -</row> -<row> - <entry>weechat</entry> - <entry>infos</entry> - <entry>names of infos hooked</entry> -</row> -<row> - <entry>weechat</entry> - <entry>keys_codes</entry> - <entry>key codes</entry> -</row> -<row> - <entry>weechat</entry> - <entry>nicks</entry> - <entry>nicks in nicklist of current buffer</entry> -</row> -<row> - <entry>weechat</entry> - <entry>plugins_commands</entry> - <entry>commands defined by plugins</entry> -</row> -<row> - <entry>weechat</entry> - <entry>plugins_names</entry> - <entry>names of plugins</entry> -</row> -<row> - <entry>weechat</entry> - <entry>proxies_names</entry> - <entry>names of proxies</entry> -</row> -<row> - <entry>weechat</entry> - <entry>proxies_options</entry> - <entry>options for proxies</entry> -</row> -<row> - <entry>weechat</entry> - <entry>weechat_commands</entry> - <entry>weechat commands</entry> -</row> -<row> - <entry>xfer</entry> - <entry>nick</entry> - <entry>nicks of DCC chat</entry> -</row> diff --git a/doc/en/autogen/demo_commands.xml b/doc/en/autogen/demo_commands.xml deleted file mode 100644 index d4f62de1c..000000000 --- a/doc/en/autogen/demo_commands.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/demo_buffer name</command> -<programlisting> -open a new buffer -</programlisting> - -<command>/demo_buffer_set property value</command> -<programlisting> -set a buffer property -</programlisting> - -<command>/demo_info [info [arguments]]</command> -<programlisting> -get and display an info - - info: info to display -arguments: optional arguments for info - -Without argument, this command displays list of available infos -</programlisting> - -<command>/demo_infolist [infolist [arguments]]</command> -<programlisting> -get and display an infolist - - infolist: infolist to display -arguments: optional arguments for infolist - -Without argument, this command displays list of available infolists -</programlisting> - -<command>/demo_printf [text]</command> -<programlisting> -print some messages on current ubffer - -text: write this text -</programlisting> - diff --git a/doc/en/autogen/infolists.xml b/doc/en/autogen/infolists.xml deleted file mode 100644 index b57b8cf29..000000000 --- a/doc/en/autogen/infolists.xml +++ /dev/null @@ -1,138 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<row> - <entry>alias</entry> - <entry>alias</entry> - <entry>list of alias</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_channel</entry> - <entry>list of channels for an IRC server</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_ignore</entry> - <entry>list of IRC ignore</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_nick</entry> - <entry>list of nicks for an IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_server</entry> - <entry>list of IRC servers</entry> -</row> -<row> - <entry>logger</entry> - <entry>logger_buffer</entry> - <entry>list of logger buffers</entry> -</row> -<row> - <entry>lua</entry> - <entry>lua_script</entry> - <entry>list of lua scripts</entry> -</row> -<row> - <entry>perl</entry> - <entry>perl_script</entry> - <entry>list of perl scripts</entry> -</row> -<row> - <entry>python</entry> - <entry>python_script</entry> - <entry>list of python scripts</entry> -</row> -<row> - <entry>relay</entry> - <entry>relay</entry> - <entry>list of relay clients</entry> -</row> -<row> - <entry>ruby</entry> - <entry>ruby_script</entry> - <entry>list of ruby scripts</entry> -</row> -<row> - <entry>tcl</entry> - <entry>tcl_script</entry> - <entry>list of tcl scripts</entry> -</row> -<row> - <entry>weechat</entry> - <entry>bar</entry> - <entry>list of bars</entry> -</row> -<row> - <entry>weechat</entry> - <entry>bar_item</entry> - <entry>list of bar items</entry> -</row> -<row> - <entry>weechat</entry> - <entry>bar_window</entry> - <entry>list of bar windows</entry> -</row> -<row> - <entry>weechat</entry> - <entry>buffer</entry> - <entry>list of buffers</entry> -</row> -<row> - <entry>weechat</entry> - <entry>buffer_lines</entry> - <entry>lines of a buffer</entry> -</row> -<row> - <entry>weechat</entry> - <entry>filter</entry> - <entry>list of filters</entry> -</row> -<row> - <entry>weechat</entry> - <entry>hook</entry> - <entry>list of hooks</entry> -</row> -<row> - <entry>weechat</entry> - <entry>hotlist</entry> - <entry>list of buffers in hotlist</entry> -</row> -<row> - <entry>weechat</entry> - <entry>key</entry> - <entry>list of key bindings</entry> -</row> -<row> - <entry>weechat</entry> - <entry>nicklist</entry> - <entry>nicks in nicklist for a buffer</entry> -</row> -<row> - <entry>weechat</entry> - <entry>option</entry> - <entry>list of options</entry> -</row> -<row> - <entry>weechat</entry> - <entry>plugin</entry> - <entry>list of plugins</entry> -</row> -<row> - <entry>weechat</entry> - <entry>window</entry> - <entry>list of windows</entry> -</row> -<row> - <entry>xfer</entry> - <entry>xfer</entry> - <entry>list of xfer</entry> -</row> diff --git a/doc/en/autogen/infos.xml b/doc/en/autogen/infos.xml deleted file mode 100644 index a24894f69..000000000 --- a/doc/en/autogen/infos.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<row> - <entry>fifo</entry> - <entry>fifo_filename</entry> - <entry>name of FIFO pipe</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_buffer</entry> - <entry>get buffer pointer for an IRC server/channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_current_server</entry> - <entry>currently selected server (only if one buffer is used for all servers)</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_is_channel</entry> - <entry>1 if string is an IRC channel</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_nick</entry> - <entry>get current nick on a server</entry> -</row> -<row> - <entry>irc</entry> - <entry>irc_nick_from_host</entry> - <entry>get nick from IRC host</entry> -</row> -<row> - <entry>weechat</entry> - <entry>charset_internal</entry> - <entry>WeeChat internal charset</entry> -</row> -<row> - <entry>weechat</entry> - <entry>charset_terminal</entry> - <entry>terminal charset</entry> -</row> -<row> - <entry>weechat</entry> - <entry>date</entry> - <entry>WeeChat compilation date</entry> -</row> -<row> - <entry>weechat</entry> - <entry>dir_separator</entry> - <entry>directory separator</entry> -</row> -<row> - <entry>weechat</entry> - <entry>filters_enabled</entry> - <entry>1 if filters are enabled</entry> -</row> -<row> - <entry>weechat</entry> - <entry>inactivity</entry> - <entry>keyboard inactivity (seconds)</entry> -</row> -<row> - <entry>weechat</entry> - <entry>version</entry> - <entry>WeeChat version</entry> -</row> -<row> - <entry>weechat</entry> - <entry>weechat_dir</entry> - <entry>WeeChat directory</entry> -</row> -<row> - <entry>weechat</entry> - <entry>weechat_libdir</entry> - <entry>WeeChat "lib" directory</entry> -</row> -<row> - <entry>weechat</entry> - <entry>weechat_localedir</entry> - <entry>WeeChat "locale" directory</entry> -</row> -<row> - <entry>weechat</entry> - <entry>weechat_sharedir</entry> - <entry>WeeChat "share" directory</entry> -</row> diff --git a/doc/en/autogen/irc_commands.xml b/doc/en/autogen/irc_commands.xml deleted file mode 100644 index a7ec7a23f..000000000 --- a/doc/en/autogen/irc_commands.xml +++ /dev/null @@ -1,535 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/admin [target]</command> -<programlisting> -find information about the administrator of the server - -target: server -</programlisting> - -<command>/ame message</command> -<programlisting> -send a CTCP action to all channels of all connected servers - -message: message to send -</programlisting> - -<command>/amsg text</command> -<programlisting> -send message to all channels of all connected servers - -text: text to send -</programlisting> - -<command>/away [-all] [message]</command> -<programlisting> -toggle away status - - -all: toggle away status on all connected servers -message: message for away (if no message is given, away status is removed) -</programlisting> - -<command>/ban [channel] [nickname [nickname ...]]</command> -<programlisting> -ban nicks or hosts - - channel: channel for ban -nickname: user or host to ban -</programlisting> - -<command>/connect [-all [-nojoin] | servername [servername ...] [-nojoin] | hostname [-port port] [-ipv6] [-ssl]]</command> -<programlisting> -connect to IRC server(s) - - -all: connect to all servers -servername: internal server name to connect - -nojoin: do not join any channel (even if autojoin is enabled on server) - hostname: hostname to connect - port: port for server (integer, default is 6667) - ipv6: use IPv6 protocol - ssl: use SSL protocol -</programlisting> - -<command>/ctcp receiver type [arguments]</command> -<programlisting> -send a CTCP message (Client-To-Client Protocol) - - receiver: nick or channel to send CTCP to - type: CTCP type (examples: "version", "ping", ..) -arguments: arguments for CTCP -</programlisting> - -<command>/cycle [channel[,channel]] [part_message]</command> -<programlisting> -leave and rejoin a channel - - channel: channel name for cycle -part_message: part message (displayed to other users) -</programlisting> - -<command>/dcc action [nickname [file]]</command> -<programlisting> -start DCC (file or chat) - - action: 'send' (file) or 'chat' -nickname: nickname to send file or chat - file: filename (on local host) -</programlisting> - -<command>/dehalfop [nickname [nickname]]</command> -<programlisting> -remove half channel operator status from nickname(s) -</programlisting> - -<command>/deop [nickname [nickname]]</command> -<programlisting> -remove channel operator status from nickname(s) -</programlisting> - -<command>/devoice [nickname [nickname]]</command> -<programlisting> -remove voice from nickname(s) -</programlisting> - -<command>/die</command> -<programlisting> -shutdown the server -</programlisting> - -<command>/disconnect [-all | servername [servername ...]]</command> -<programlisting> -disconnect from IRC server(s) - - -all: disconnect from all servers -servername: server name to disconnect -</programlisting> - -<command>/halfop [nickname [nickname]]</command> -<programlisting> -give half channel operator status to nickname(s) -</programlisting> - -<command>/ignore [list] | [add [re:]nick/host [server [channel]]] | [del number|-all]</command> -<programlisting> -ignore nicks/hosts from servers or channels - - list: list all ignore - add: add a ignore - del: del a ignore - number: number of ignore to delete (look at list to find it) - -all: delete all ignore -nick/host: nick or host to ignore: syntax is "re:regex" or "mask" (a mask is a string with some "*" to replace one or more chars) - server: internal server name where ignore is working - channel: channel name where ignore is working - -Examples: - ignore nick "toto" everywhere: - /ignore add toto - ignore host "toto@domain.com" on freenode server: - /ignore add toto@domain.com freenode - ignore host "toto*@*.domain.com" on freenode/#weechat: - /ignore add toto*@*.domain.com freenode #weechat -</programlisting> - -<command>/info [target]</command> -<programlisting> -get information describing the server - -target: server name -</programlisting> - -<command>/invite nickname channel</command> -<programlisting> -invite a nick on a channel - -nickname: nick to invite - channel: channel to invite -</programlisting> - -<command>/ison nickname [nickname ...]</command> -<programlisting> -check if a nickname is currently on IRC - -nickname: nickname -</programlisting> - -<command>/join channel[,channel] [key[,key]]</command> -<programlisting> -join a channel - -channel: channel name to join - key: key to join the channel -</programlisting> - -<command>/kick [channel] nickname [comment]</command> -<programlisting> -forcibly remove a user from a channel - - channel: channel where user is -nickname: nickname to kick - comment: comment for kick -</programlisting> - -<command>/kickban [channel] nickname [comment]</command> -<programlisting> -kicks and bans a nick from a channel - - channel: channel where user is -nickname: nickname to kick and ban - comment: comment for kick -</programlisting> - -<command>/kill nickname comment</command> -<programlisting> -close client-server connection - -nickname: nickname - comment: comment for kill -</programlisting> - -<command>/links [[server] server_mask]</command> -<programlisting> -list all servernames which are known by the server answering the query - - server: this server should answer the query -server_mask: list of servers must match this mask -</programlisting> - -<command>/list [channel[,channel] [server]]</command> -<programlisting> -list channels and their topic - -channel: channel to list (a regexp is allowed) -server: server name -</programlisting> - -<command>/lusers [mask [target]]</command> -<programlisting> -get statistics about the size of the IRC network - - mask: servers matching the mask only -target: server for forwarding request -</programlisting> - -<command>/me message</command> -<programlisting> -send a CTCP action to the current channel - -message: message to send -</programlisting> - -<command>/mode { [channel] {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | { nickname {[+|-]|i|w|s|o} }</command> -<programlisting> -change channel or user mode - -channel modes: - channel: channel name to modify (default is current one) - o: give/take channel operator privileges - p: private channel flag - s: secret channel flag - i: invite-only channel flag - t: topic settable by channel operator only flag - n: no messages to channel from clients on the outside - m: moderated channel - l: set the user limit to channel - b: set a ban mask to keep users out - e: set exception mask - v: give/take the ability to speak on a moderated channel - k: set a channel key (password) -user modes: - nickname: nickname to modify - i: mark a user as invisible - s: mark a user for receive server notices - w: user receives wallops - o: operator flag -</programlisting> - -<command>/motd [target]</command> -<programlisting> -get the "Message Of The Day" - -target: server name -</programlisting> - -<command>/msg [-server server] receiver[,receiver] text</command> -<programlisting> -send message to a nick or channel - - server: send to this server (internal name) -receiver: nick or channel (may be mask, '*' = current channel) - text: text to send -</programlisting> - -<command>/names [channel[,channel]]</command> -<programlisting> -list nicknames on channels - -channel: channel name -</programlisting> - -<command>/nick [-all] nickname</command> -<programlisting> -change current nickname - - -all: set new nickname for all connected servers -nickname: new nickname -</programlisting> - -<command>/notice [-server server] nickname text</command> -<programlisting> -send notice message to user - - server: send to this server (internal name) -nickname: user to send notice to - text: text to send -</programlisting> - -<command>/op nickname [nickname]</command> -<programlisting> -give channel operator status to nickname(s) -</programlisting> - -<command>/oper user password</command> -<programlisting> -get operator privileges - -user/password: used to get privileges on current IRC server -</programlisting> - -<command>/part [channel[,channel]] [part_message]</command> -<programlisting> -leave a channel - - channel: channel name to leave -part_message: part message (displayed to other users) -</programlisting> - -<command>/ping server1 [server2]</command> -<programlisting> -ping server - -server1: server to ping -server2: forward ping to this server -</programlisting> - -<command>/pong daemon [daemon2]</command> -<programlisting> -answer to a ping message - - daemon: daemon who has responded to Ping message -daemon2: forward message to this daemon -</programlisting> - -<command>/query [-server server] nickname [text]</command> -<programlisting> -send a private message to a nick - - server: send to this server (internal name) -nickname: nickname for private conversation - text: text to send -</programlisting> - -<command>/quote [-server server] data</command> -<programlisting> -send raw data to server without parsing - -server: send to this server (internal name) -data: raw data to send -</programlisting> - -<command>/reconnect [-all [-nojoin] | servername [servername ...] [-nojoin]]</command> -<programlisting> -reconnect to server(s) - - -all: reconnect to all servers -servername: server name to reconnect - -nojoin: do not join any channel (even if autojoin is enabled on server) -</programlisting> - -<command>/rehash</command> -<programlisting> -tell the server to reload its config file -</programlisting> - -<command>/restart</command> -<programlisting> -tell the server to restart itself -</programlisting> - -<command>/server [list [servername]] | [listfull [servername]] | [add servername hostname[/port] [-auto | -noauto] [-ipv6] [-ssl]] | [copy servername newservername] | [rename servername newservername] | [keep servername] | [del servername] | [deloutq] | [raw] | [switch]</command> -<programlisting> -list, add or remove IRC servers - - list: list servers (no parameter implies this list) - listfull: list servers with detailed info for each server - add: create a new server -servername: server name, for internal and display use - hostname: name or IP address of server, with optional port (default: 6667) - auto: automatically connect to server when WeeChat starts - noauto: do not connect to server when WeeChat starts (default) - ipv6: use IPv6 protocol - ssl: use SSL protocol - copy: duplicate a server - rename: rename a server - keep: keep server in config file (for temporary servers only) - del: delete a server - deloutq: delete messages out queue for all servers (all messages WeeChat is currently sending) - raw: open buffer with raw IRC data - switch: switch active server (when one buffer is used for all servers, default key: alt-s on server buffer) - -Examples: - /server listfull - /server add oftc irc.oftc.net/6697 -ssl - /server add oftc6 irc6.oftc.net/6697 -ipv6 -ssl - /server add freenode2 chat.eu.freenode.net/6667,chat.us.freenode.net/6667 - /server copy oftc oftcbis - /server rename oftc newoftc - /server del freenode - /server deloutq - /server switch -</programlisting> - -<command>/service nickname reserved distribution type reserved info</command> -<programlisting> -register a new service - -distribution: visibility of service - type: reserved for future usage -</programlisting> - -<command>/servlist [mask [type]]</command> -<programlisting> -list services currently connected to the network - -mask: list only services matching this mask -type: list only services of this type -</programlisting> - -<command>/squery service text</command> -<programlisting> -deliver a message to a service - -service: name of service -text: text to send -</programlisting> - -<command>/squit server comment</command> -<programlisting> -disconnect server links - -server: server name -comment: comment for quit -</programlisting> - -<command>/stats [query [server]]</command> -<programlisting> -query statistics about server - - query: c/h/i/k/l/m/o/y/u (see RFC1459) -server: server name -</programlisting> - -<command>/summon user [target [channel]]</command> -<programlisting> -give users who are on a host running an IRC server a message asking them to please join IRC - - user: username -target: server name -channel: channel name -</programlisting> - -<command>/time [target]</command> -<programlisting> -query local time from server - -target: query time from specified server -</programlisting> - -<command>/topic [channel] [topic]</command> -<programlisting> -get/set channel topic - -channel: channel name -topic: new topic for channel (if topic is "-delete" then topic is deleted) -</programlisting> - -<command>/trace [target]</command> -<programlisting> -find the route to specific server - -target: server -</programlisting> - -<command>/unban [channel] nickname [nickname ...]</command> -<programlisting> -unban nicks or hosts - - channel: channel for unban -nickname: user or host to unban -</programlisting> - -<command>/userhost nickname [nickname ...]</command> -<programlisting> -return a list of information about nicknames - -nickname: nickname -</programlisting> - -<command>/users [target]</command> -<programlisting> -list of users logged into the server - -target: server -</programlisting> - -<command>/version [server | nickname]</command> -<programlisting> -give the version info of nick or server (current or specified) - - server: server name -nickname: nickname -</programlisting> - -<command>/voice [nickname [nickname]]</command> -<programlisting> -give voice to nickname(s) -</programlisting> - -<command>/wallops text</command> -<programlisting> -send a message to all currently connected users who have set the 'w' user mode for themselves - -text to send -</programlisting> - -<command>/who [mask ["o"]]</command> -<programlisting> -generate a query which returns a list of information - -mask: only information which match this mask - o: only operators are returned according to the mask supplied -</programlisting> - -<command>/whois [server] nickname[,nickname]</command> -<programlisting> -query information about user(s) - - server: server name -nickname: nickname (may be a mask) -</programlisting> - -<command>/whowas nickname [,nickname [,nickname ...]] [count [target]]</command> -<programlisting> -ask for information about a nickname which no longer exists - -nickname: nickname to search - count: number of replies to return (full search if negative number) - target: reply should match this mask -</programlisting> - diff --git a/doc/en/autogen/irc_options.xml b/doc/en/autogen/irc_options.xml deleted file mode 100644 index 9f4e7ac6f..000000000 --- a/doc/en/autogen/irc_options.xml +++ /dev/null @@ -1,488 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>irc.color.input_nick</command>: color for nick in input bar -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>irc.color.message_join</command>: color for text in join messages -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>irc.color.message_quit</command>: color for text in part/quit messages -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: red)</para> - </listitem> -</itemizedlist> - -<command>irc.look.color_nicks_in_server_messages</command>: use nick color in messages from server -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.display_away</command>: display message when (un)marking as away -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: off, local, channel (default value: local)</para> - </listitem> -</itemizedlist> - -<command>irc.look.display_channel_modes</command>: display channel modes in "buffer_name" bar item -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.display_nick_modes</command>: display nick modes in "input_prompt" bar item -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.display_old_topic</command>: display old topic when channel topic is changed -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.hide_nickserv_pwd</command>: hide password displayed by nickserv -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.highlight_tags</command>: comma separated list of tags for messages that may produce highlight (usually any message from another user, not server messages,..) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'irc_privmsg,irc_notice')</para> - </listitem> -</itemizedlist> - -<command>irc.look.nick_completion_smart</command>: smart completion for nicks (completes first with last speakers) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: off, speakers, speakers_highlights (default value: speakers)</para> - </listitem> -</itemizedlist> - -<command>irc.look.nick_prefix</command>: text to display before nick in chat window -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.look.nick_suffix</command>: text to display after nick in chat window -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.look.notice_as_pv</command>: display notices as private messages -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.look.one_server_buffer</command>: use same buffer for all servers -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.look.open_near_server</command>: open new channels/privates near server -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.look.raw_messages</command>: number of IRC raw messages to save in memory when raw data buffer is closed (messages will be displayed when opening raw data buffer) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 65535 (default value: 256)</para> - </listitem> -</itemizedlist> - -<command>irc.look.show_away_once</command>: show remote away message only once in private -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.look.smart_filter</command>: filter join/part/quit messages for a nick if not speaking for some minutes on channel (you must create a filter on tag "irc_smart_filter") -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.look.smart_filter_delay</command>: delay for filtering join/part/quit messages (in minutes) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 10080 (default value: 5)</para> - </listitem> -</itemizedlist> - -<command>irc.look.topic_strip_colors</command>: strip colors in topic (used only when displaying buffer title) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.network.anti_flood</command>: anti-flood: # seconds between two user messages (0 = no anti-flood) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 5 (default value: 2)</para> - </listitem> -</itemizedlist> - -<command>irc.network.away_check</command>: interval between two checks for away (in minutes, 0 = never check) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>irc.network.away_check_max_nicks</command>: do not check away nicks on channels with high number of nicks (0 = unlimited) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>irc.network.colors_receive</command>: when off, colors codes are ignored in incoming messages -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.network.colors_send</command>: allow user to send colors with special codes (^Cb=bold, ^Ccxx=color, ^Ccxx,yy=color+background, ^Cu=underline, ^Cr=reverse) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.network.default_msg_part</command>: default part message (leaving channel) ('%v' will be replaced by WeeChat version in string) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'WeeChat %v')</para> - </listitem> -</itemizedlist> - -<command>irc.network.default_msg_quit</command>: default quit message (disconnecting from server) ('%v' will be replaced by WeeChat version in string) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'WeeChat %v')</para> - </listitem> -</itemizedlist> - -<command>irc.network.lag_check</command>: interval between two checks for lag (in seconds, 0 = never check) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 60)</para> - </listitem> -</itemizedlist> - -<command>irc.network.lag_disconnect</command>: disconnect after important lag (in minutes, 0 = never disconnect) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>irc.network.lag_min_show</command>: minimum lag to show (in seconds) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 1)</para> - </listitem> -</itemizedlist> - -<command>irc.network.send_unknown_commands</command>: send unknown commands to server -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.addresses</command>: list of hostname/port or IP/port for server (separated by comma) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.autoconnect</command>: automatically connect to server when WeeChat is starting -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.autojoin</command>: comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 key1,key2") -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.autoreconnect</command>: automatically reconnect to server when disconnected -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.autoreconnect_delay</command>: delay (in seconds) before trying again to reconnect to server -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 65535 (default value: 30)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.autorejoin</command>: automatically rejoin channels when kicked -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.command</command>: command(s) to run when connected to server (many commands should be separated by ';', use '\;' for a semicolon, special variables $nick, $channel and $server are replaced by their value) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.command_delay</command>: delay (in seconds) after command was executed (example: give some time for authentication) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 3600 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.ipv6</command>: use IPv6 protocol for server communication -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.local_hostname</command>: custom local hostname/IP for server (optional, if empty local hostname is used) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.nicks</command>: nicknames to use on server (separated by comma) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.password</command>: password for server -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.proxy</command>: proxy used for this server (optional) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.realname</command>: real name to use on server -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.ssl</command>: use SSL for server communication -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>irc.server_default.username</command>: user name to use on server -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/jabber_commands.xml b/doc/en/autogen/jabber_commands.xml deleted file mode 100644 index f49eca28b..000000000 --- a/doc/en/autogen/jabber_commands.xml +++ /dev/null @@ -1,69 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/jabber [list [servername]] | [listfull [servername]] | [add servername username hostname[/port] password [-auto | -noauto] [-ipv6] [-tls] [-sasl]] | [copy servername newservername] | [rename servername newservername] | [keep servername] | [del servername] | [switch]</command> -<programlisting> -list, add or remove Jabber servers - - list: list servers (no parameter implies this list) - listfull: list servers with detailed info for each server - add: create a new server -servername: server name, for internal and display use - username: username to use on server - hostname: name or IP address of server, with optional port (default: 5222) - password: password for username on server - auto: automatically connect to server when WeeChat starts - noauto: do not connect to server when WeeChat starts (default) - ipv6: use IPv6 protocol - tls: use TLS cryptographic protocol - sasl: use SASL for authentication - copy: duplicate a server - rename: rename a server - keep: keep server in config file (for temporary servers only) - del: delete a server - switch: switch active server (when one buffer is used for all servers, default key: alt-s on server buffer) - -Examples: - /jabber listfull - /jabber add jabberfr user jabber.fr/5222 password -tls - /jabber copy jabberfr jabberfr2 - /jabber rename jabberfr jabbfr - /jabber del jabberfr - /jabber switch -</programlisting> - -<command>/jchat buddy [text]</command> -<programlisting> -chat with a buddy - -buddy: buddy name for chat - text: text to send -</programlisting> - -<command>/jconnect [-all [-nojoin] | servername [servername ...] [-nojoin] | hostname [-port port] [-ipv6] [-tls] [-sasl]]</command> -<programlisting> -connect to Jabber server(s) - - -all: connect to all servers -servername: internal server name to connect - -nojoin: do not join any MUC (even if autojoin is enabled on server) - hostname: hostname to connect - port: port for server (integer, default is 6667) - ipv6: use IPv6 protocol - tls: use TLS cryptographic protocol - saal: use SASL for authentication -</programlisting> - -<command>/jdisconnect [-all | servername [servername ...]]</command> -<programlisting> -disconnect from Jabber server(s) - - -all: disconnect from all servers -servername: server name to disconnect -</programlisting> - diff --git a/doc/en/autogen/jabber_options.xml b/doc/en/autogen/jabber_options.xml deleted file mode 100644 index 72a51ce60..000000000 --- a/doc/en/autogen/jabber_options.xml +++ /dev/null @@ -1,418 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>jabber.color.input_nick</command>: color for nick in input bar -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>jabber.color.message_join</command>: color for text in join messages -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>jabber.color.message_quit</command>: color for text in part/quit messages -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: red)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.color_nicks_in_server_messages</command>: use nick color in messages from server -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.display_away</command>: display message when (un)marking as away -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: off, local, muc (default value: local)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.display_muc_modes</command>: display MUC modes in "buffer_name" bar item -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.display_nick_modes</command>: display nick modes in "input_prompt" bar item -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.highlight_tags</command>: comma separated list of tags for messages that may produce highlight (usually any message from another user, not server messages,..) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'jabber_chat_msg,jabber_notice')</para> - </listitem> -</itemizedlist> - -<command>jabber.look.nick_completion_smart</command>: smart completion for nicks (completes with last speakers first) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.nick_prefix</command>: text to display before nick in chat window -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.look.nick_suffix</command>: text to display after nick in chat window -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.look.one_server_buffer</command>: use same buffer for all servers -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.open_near_server</command>: open new MUCs/privates near server -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.show_away_once</command>: show remote away message only once in private -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.smart_filter</command>: filter join/part/quit messages for a nick if not speaking for some minutes on MUC (you must create a filter on tag "jabber_smart_filter") -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.look.smart_filter_delay</command>: delay for filtering join/part/quit messages (in minutes) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 10080 (default value: 5)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.anti_flood</command>: anti-flood: # seconds between two user messages (0 = no anti-flood) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 5 (default value: 2)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.colors_receive</command>: when off, colors codes are ignored in incoming messages -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.colors_send</command>: allow user to send colors with special codes (^Cb=bold, ^Ccxx=color, ^Ccxx,yy=color+background, ^Cu=underline, ^Cr=reverse) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.default_msg_part</command>: default part message (leaving MUC) ('%v' will be replaced by WeeChat version in string) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'WeeChat %v')</para> - </listitem> -</itemizedlist> - -<command>jabber.network.default_msg_quit</command>: default quit message (disconnecting from server) ('%v' will be replaced by WeeChat version in string) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'WeeChat %v')</para> - </listitem> -</itemizedlist> - -<command>jabber.network.lag_check</command>: interval between two checks for lag (in seconds, 0 = never check) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 60)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.lag_disconnect</command>: disconnect after important lag (in minutes, 0 = never disconnect) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 5)</para> - </listitem> -</itemizedlist> - -<command>jabber.network.lag_min_show</command>: minimum lag to show (in seconds) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 1)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.autoconnect</command>: automatically connect to server when WeeChat is starting -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.autojoin</command>: comma separated list of MUCs to join when connected to server (example: "#chan1,#chan2,#chan3 key1,key2") -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.autoreconnect</command>: automatically reconnect to server when disconnected -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.autoreconnect_delay</command>: delay (in seconds) before trying again to reconnect to server -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 65535 (default value: 10)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.autorejoin</command>: automatically rejoin MUCs when kicked -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.command</command>: command(s) to run when connected to server (many commands should be separated by ';', use '\;' for a semicolon, special variables $nick, $muc and $server are replaced by their value) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.command_delay</command>: delay (in seconds) after command was executed (example: give some time for authentication) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 3600 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.ipv6</command>: use IPv6 protocol for server communication -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.local_alias</command>: local alias -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.local_hostname</command>: custom local hostname/IP for server (optional, if empty local hostname is used) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.password</command>: password -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.proxy</command>: proxy used for this server (optional) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.resource</command>: resource (for example: Home or Work) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.sasl</command>: use SASL for authentication -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.server</command>: hostname/port or IP/port for server -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.tls</command>: use TLS cryptographic protocol for server communication -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>jabber.server_default.username</command>: user name to use on server -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/logger_commands.xml b/doc/en/autogen/logger_commands.xml deleted file mode 100644 index 3f8d17256..000000000 --- a/doc/en/autogen/logger_commands.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/logger [list | set level | disable]</command> -<programlisting> -logger plugin configuration - - list: show logging status for opened buffers - set: set logging level on current buffer - level: level for messages to be logged (0 = logging disabled, 1 = a few messages (most important) .. 9 = all messages) -disable: disable logging on current buffer (set level to 0) - -Options "logger.level.*" and "logger.mask.*" can be used to set level or mask for a buffer, or buffers beginning with name. - -Examples: - set level to 5 for current buffer: - /logger set 5 - disable logging for current buffer: - /logger disable - - set level to 3 for all IRC buffers: - /set logger.level.irc 3 - disable logging for main WeeChat buffer: - /set logger.level.core.weechat 0 - use a directory per IRC server and a file per channel inside: - /set logger.mask.irc "$server/$channel.weechatlog" - -Log levels used by IRC plugin: - 1: user message, notice, private - 2: nick change - 3: server message - 4: join/part/quit - 9: all other messages -</programlisting> - diff --git a/doc/en/autogen/logger_options.xml b/doc/en/autogen/logger_options.xml deleted file mode 100644 index 3c9d39793..000000000 --- a/doc/en/autogen/logger_options.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>logger.file.auto_log</command>: automatically save content of buffers to files (unless a buffer disables log) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>logger.file.info_lines</command>: write information line in log file when log starts or ends for a buffer -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>logger.file.mask</command>: default file name mask for log files (format is 'directory/to/file' or 'file', without first '/' because 'path' option is used to build complete path to file); local buffer variables are permitted -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '$plugin.$name.weechatlog')</para> - </listitem> -</itemizedlist> - -<command>logger.file.name_lower_case</command>: use only lower case for log filenames -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>logger.file.path</command>: path for WeeChat log files ('%h' will be replaced by WeeChat home, ~/.weechat by default) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%h/logs/')</para> - </listitem> -</itemizedlist> - -<command>logger.file.time_format</command>: timestamp used in log files (see man strftime for date/time specifiers) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%Y-%m-%d %H:%M:%S')</para> - </listitem> -</itemizedlist> - -<command>logger.look.backlog</command>: maximum number of lines to display from log file when creating new buffer (0 = no backlog) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 20)</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/lua_commands.xml b/doc/en/autogen/lua_commands.xml deleted file mode 100644 index 02f1be603..000000000 --- a/doc/en/autogen/lua_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/lua [list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]</command> -<programlisting> -list/load/unload scripts - -filename: script (file) to load -name: a script name - -Without argument, this command lists all loaded scripts. -</programlisting> - diff --git a/doc/en/autogen/perl_commands.xml b/doc/en/autogen/perl_commands.xml deleted file mode 100644 index cce2eefd0..000000000 --- a/doc/en/autogen/perl_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/perl [list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]</command> -<programlisting> -list/load/unload scripts - -filename: script (file) to load -name: a script name - -Without argument, this command lists all loaded scripts. -</programlisting> - diff --git a/doc/en/autogen/plugin_api/completions.txt b/doc/en/autogen/plugin_api/completions.txt new file mode 100644 index 000000000..2c234ea79 --- /dev/null +++ b/doc/en/autogen/plugin_api/completions.txt @@ -0,0 +1,84 @@ +[width="65%",cols="^1,^2,8",options="header"] +|======================================== +| Plugin | Name | Description +| alias | alias | list of alias + +| aspell | aspell_langs | list of supported langs for aspell + +| irc | irc_channel | current IRC channel + +| irc | irc_channel_nicks_hosts | nicks and hostnames of current IRC channel + +| irc | irc_channel_topic | topic of current IRC channel + +| irc | irc_channels | IRC channels (on all servers) + +| irc | irc_ignores_numbers | numbers for defined ignores + +| irc | irc_msg_part | default part message for IRC channel + +| irc | irc_privates | IRC privates (on all servers) + +| irc | irc_server | current IRC server + +| irc | irc_server_nick | nick on current IRC server + +| irc | irc_server_nicks | nicks on all channels of current IRC server + +| irc | irc_servers | IRC servers (internal names) + +| irc | nick | nicks of current IRC channel + +| lua | lua_script | list of scripts + +| perl | perl_script | list of scripts + +| python | python_script | list of scripts + +| ruby | ruby_script | list of scripts + +| tcl | tcl_script | list of scripts + +| weechat | bars_names | names of bars + +| weechat | bars_options | options for bars + +| weechat | buffers_names | names of buffers + +| weechat | buffers_numbers | numbers of buffers + +| weechat | buffers_plugins_names | names of buffers (including plugins names) + +| weechat | commands | commands (weechat and plugins) + +| weechat | config_files | configuration files + +| weechat | config_option_values | values for a configuration option + +| weechat | config_options | configuration options + +| weechat | filename | filename + +| weechat | filters_names | names of filters + +| weechat | infolists | names of infolists hooked + +| weechat | infos | names of infos hooked + +| weechat | keys_codes | key codes + +| weechat | nicks | nicks in nicklist of current buffer + +| weechat | plugins_commands | commands defined by plugins + +| weechat | plugins_names | names of plugins + +| weechat | proxies_names | names of proxies + +| weechat | proxies_options | options for proxies + +| weechat | weechat_commands | weechat commands + +| xfer | nick | nicks of DCC chat + +|======================================== diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt new file mode 100644 index 000000000..1d2c157e5 --- /dev/null +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -0,0 +1,56 @@ +[width="65%",cols="^1,^2,8",options="header"] +|======================================== +| Plugin | Name | Description +| alias | alias | list of alias + +| irc | irc_channel | list of channels for an IRC server + +| irc | irc_ignore | list of IRC ignore + +| irc | irc_nick | list of nicks for an IRC channel + +| irc | irc_server | list of IRC servers + +| logger | logger_buffer | list of logger buffers + +| lua | lua_script | list of lua scripts + +| perl | perl_script | list of perl scripts + +| python | python_script | list of python scripts + +| relay | relay | list of relay clients + +| ruby | ruby_script | list of ruby scripts + +| tcl | tcl_script | list of tcl scripts + +| weechat | bar | list of bars + +| weechat | bar_item | list of bar items + +| weechat | bar_window | list of bar windows + +| weechat | buffer | list of buffers + +| weechat | buffer_lines | lines of a buffer + +| weechat | filter | list of filters + +| weechat | hook | list of hooks + +| weechat | hotlist | list of buffers in hotlist + +| weechat | key | list of key bindings + +| weechat | nicklist | nicks in nicklist for a buffer + +| weechat | option | list of options + +| weechat | plugin | list of plugins + +| weechat | window | list of windows + +| xfer | xfer | list of xfer + +|======================================== diff --git a/doc/en/autogen/plugin_api/infos.txt b/doc/en/autogen/plugin_api/infos.txt new file mode 100644 index 000000000..1e113b0be --- /dev/null +++ b/doc/en/autogen/plugin_api/infos.txt @@ -0,0 +1,38 @@ +[width="65%",cols="^1,^2,8",options="header"] +|======================================== +| Plugin | Name | Description +| fifo | fifo_filename | name of FIFO pipe + +| irc | irc_buffer | get buffer pointer for an IRC server/channel + +| irc | irc_current_server | currently selected server (only if one buffer is used for all servers) + +| irc | irc_is_channel | 1 if string is an IRC channel + +| irc | irc_nick | get current nick on a server + +| irc | irc_nick_from_host | get nick from IRC host + +| weechat | charset_internal | WeeChat internal charset + +| weechat | charset_terminal | terminal charset + +| weechat | date | WeeChat compilation date + +| weechat | dir_separator | directory separator + +| weechat | filters_enabled | 1 if filters are enabled + +| weechat | inactivity | keyboard inactivity (seconds) + +| weechat | version | WeeChat version + +| weechat | weechat_dir | WeeChat directory + +| weechat | weechat_libdir | WeeChat "lib" directory + +| weechat | weechat_localedir | WeeChat "locale" directory + +| weechat | weechat_sharedir | WeeChat "share" directory + +|======================================== diff --git a/doc/en/autogen/python_commands.xml b/doc/en/autogen/python_commands.xml deleted file mode 100644 index 0608099f9..000000000 --- a/doc/en/autogen/python_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/python [list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]</command> -<programlisting> -list/load/unload scripts - -filename: script (file) to load -name: a script name - -Without argument, this command lists all loaded scripts. -</programlisting> - diff --git a/doc/en/autogen/relay_commands.xml b/doc/en/autogen/relay_commands.xml deleted file mode 100644 index ab425fc29..000000000 --- a/doc/en/autogen/relay_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/relay [list | listfull]</command> -<programlisting> -relay control - - list: list relay clients -listfull: list relay clients (verbose) - -Without argument, this command opens buffer with list of relay clients. -</programlisting> - diff --git a/doc/en/autogen/relay_options.xml b/doc/en/autogen/relay_options.xml deleted file mode 100644 index 1e9d990cb..000000000 --- a/doc/en/autogen/relay_options.xml +++ /dev/null @@ -1,118 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>relay.color.status_active</command>: text color for "connected" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightblue)</para> - </listitem> -</itemizedlist> - -<command>relay.color.status_auth_failed</command>: text color for "authentication failed" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - -<command>relay.color.status_connecting</command>: text color for "connecting" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>relay.color.status_disconnected</command>: text color for "disconnected" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - -<command>relay.color.status_waiting_auth</command>: text color for "waiting authentication" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: brown)</para> - </listitem> -</itemizedlist> - -<command>relay.color.text</command>: text color -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>relay.color.text_bg</command>: background color -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>relay.color.text_selected</command>: text color of selected client line -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>relay.look.auto_open_buffer</command>: auto open relay buffer when a new client is connecting -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>relay.network.enabled</command>: enable relay -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>relay.network.listen_port_range</command>: port number (or range of ports) that relay plugin listens on (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '22373-22400')</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/ruby_commands.xml b/doc/en/autogen/ruby_commands.xml deleted file mode 100644 index 16d04edb7..000000000 --- a/doc/en/autogen/ruby_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/ruby [list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]</command> -<programlisting> -list/load/unload scripts - -filename: script (file) to load -name: a script name - -Without argument, this command lists all loaded scripts. -</programlisting> - diff --git a/doc/en/autogen/tcl_commands.xml b/doc/en/autogen/tcl_commands.xml deleted file mode 100644 index 48a43e4e6..000000000 --- a/doc/en/autogen/tcl_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/tcl [list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]</command> -<programlisting> -list/load/unload scripts - -filename: script (file) to load -name: a script name - -Without argument, this command lists all loaded scripts. -</programlisting> - diff --git a/doc/en/autogen/user/alias_commands.txt b/doc/en/autogen/user/alias_commands.txt new file mode 100644 index 000000000..06ef1cd7d --- /dev/null +++ b/doc/en/autogen/user/alias_commands.txt @@ -0,0 +1,15 @@ +• *`/alias`* `[alias_name [command [arguments]]]`:: + +........................................ + create an alias for a command + + alias_name: name of alias + command: command name (many commands can be separated by semicolons) + arguments: arguments for command + + Without argument, this command lists all defined alias. + + Note: in command, special variables $1, $2,..,$9 are replaced by arguments given by user, and $* is replaced by all arguments. + Variables $nick, $channel and $server are replaced by current nick/channel/server. +........................................ + diff --git a/doc/en/autogen/user/aspell_commands.txt b/doc/en/autogen/user/aspell_commands.txt new file mode 100644 index 000000000..eaf33fe1a --- /dev/null +++ b/doc/en/autogen/user/aspell_commands.txt @@ -0,0 +1,13 @@ +• *`/aspell`* `dictlist | enable lang | disable | addword [lang] word`:: + +........................................ + aspell plugin configuration + + dictlist: show installed dictionaries + enable: enable aspell on current buffer + disable: disable aspell on current buffer + addword: add a word in your personal aspell dictionary + + Input line beginning with a '/' is not checked, except for some commands. +........................................ + diff --git a/doc/en/autogen/user/aspell_options.txt b/doc/en/autogen/user/aspell_options.txt new file mode 100644 index 000000000..0204403c6 --- /dev/null +++ b/doc/en/autogen/user/aspell_options.txt @@ -0,0 +1,30 @@ +* *aspell.check.commands* +** description: comma separated list of commands for which spell checking is enabled (spell checking is disabled for all other commands) +** type: string +** values: any string (default value: "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query,quit,topic") + +* *aspell.check.default_dict* +** description: default dictionary (or comma separated list of dictionaries) to use when buffer has no dictionary defined (leave blank to disable aspell on buffers for which you didn't explicitely enabled it) +** type: string +** values: any string (default value: "") + +* *aspell.check.during_search* +** description: check words during text search in buffer +** type: boolean +** values: on, off (default value: off) + +* *aspell.check.real_time* +** description: real-time spell checking of words (slower, disabled by default: words are checked only if there's delimiter after) +** type: boolean +** values: on, off (default value: off) + +* *aspell.check.word_min_length* +** description: minimum length for a word to be spell checked (use 0 to check all words) +** type: integer +** values: 0 .. 2147483647 (default value: 2) + +* *aspell.look.color* +** description: color used for mispelled words +** type: color +** values: a color name (default value: lightred) + diff --git a/doc/en/autogen/user/charset_commands.txt b/doc/en/autogen/user/charset_commands.txt new file mode 100644 index 000000000..c12a88efd --- /dev/null +++ b/doc/en/autogen/user/charset_commands.txt @@ -0,0 +1,11 @@ +• *`/charset`* `[[decode | encode] charset] | [reset]`:: + +........................................ + change charset for current buffer + + decode: change decoding charset + encode: change encoding charset + charset: new charset for current buffer + reset: reset charsets for current buffer +........................................ + diff --git a/doc/en/autogen/user/charset_options.txt b/doc/en/autogen/user/charset_options.txt new file mode 100644 index 000000000..36fad4b80 --- /dev/null +++ b/doc/en/autogen/user/charset_options.txt @@ -0,0 +1,10 @@ +* *charset.default.decode* +** description: global decoding charset +** type: string +** values: any string (default value: "iso-8859-1") + +* *charset.default.encode* +** description: global encoding charset +** type: string +** values: any string (default value: "") + diff --git a/doc/en/autogen/user/demo_commands.txt b/doc/en/autogen/user/demo_commands.txt new file mode 100644 index 000000000..fca1b30e8 --- /dev/null +++ b/doc/en/autogen/user/demo_commands.txt @@ -0,0 +1,42 @@ +• *`/demo_buffer`* `name`:: + +........................................ + open a new buffer +........................................ + +• *`/demo_buffer_set`* `property value`:: + +........................................ + set a buffer property +........................................ + +• *`/demo_info`* `[info [arguments]]`:: + +........................................ + get and display an info + + info: info to display + arguments: optional arguments for info + + Without argument, this command displays list of available infos +........................................ + +• *`/demo_infolist`* `[infolist [arguments]]`:: + +........................................ + get and display an infolist + + infolist: infolist to display + arguments: optional arguments for infolist + + Without argument, this command displays list of available infolists +........................................ + +• *`/demo_printf`* `[text]`:: + +........................................ + print some messages on current ubffer + + text: write this text +........................................ + diff --git a/doc/en/autogen/user/irc_commands.txt b/doc/en/autogen/user/irc_commands.txt new file mode 100644 index 000000000..7234fd5ff --- /dev/null +++ b/doc/en/autogen/user/irc_commands.txt @@ -0,0 +1,589 @@ +• *`/admin`* `[target]`:: + +........................................ + find information about the administrator of the server + + target: server +........................................ + +• *`/ame`* `message`:: + +........................................ + send a CTCP action to all channels of all connected servers + + message: message to send +........................................ + +• *`/amsg`* `text`:: + +........................................ + send message to all channels of all connected servers + + text: text to send +........................................ + +• *`/away`* `[-all] [message]`:: + +........................................ + toggle away status + + -all: toggle away status on all connected servers + message: message for away (if no message is given, away status is removed) +........................................ + +• *`/ban`* `[channel] [nickname [nickname ...]]`:: + +........................................ + ban nicks or hosts + + channel: channel for ban + nickname: user or host to ban +........................................ + +• *`/connect`* `[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname [-port port] [-ipv6] [-ssl]]`:: + +........................................ + connect to IRC server(s) + + -all: connect to all servers + servername: internal server name to connect + -nojoin: do not join any channel (even if autojoin is enabled on server) + hostname: hostname to connect + port: port for server (integer, default is 6667) + ipv6: use IPv6 protocol + ssl: use SSL protocol +........................................ + +• *`/ctcp`* `receiver type [arguments]`:: + +........................................ + send a CTCP message (Client-To-Client Protocol) + + receiver: nick or channel to send CTCP to + type: CTCP type (examples: "version", "ping", ..) + arguments: arguments for CTCP +........................................ + +• *`/cycle`* `[channel[,channel]] [part_message]`:: + +........................................ + leave and rejoin a channel + + channel: channel name for cycle + part_message: part message (displayed to other users) +........................................ + +• *`/dcc`* `action [nickname [file]]`:: + +........................................ + start DCC (file or chat) + + action: 'send' (file) or 'chat' + nickname: nickname to send file or chat + file: filename (on local host) +........................................ + +• *`/dehalfop`* `[nickname [nickname]]`:: + +........................................ + remove half channel operator status from nickname(s) +........................................ + +• *`/deop`* `[nickname [nickname]]`:: + +........................................ + remove channel operator status from nickname(s) +........................................ + +• *`/devoice`* `[nickname [nickname]]`:: + +........................................ + remove voice from nickname(s) +........................................ + +• *`/die`*:: + +........................................ + shutdown the server +........................................ + +• *`/disconnect`* `[-all | servername [servername ...]]`:: + +........................................ + disconnect from IRC server(s) + + -all: disconnect from all servers + servername: server name to disconnect +........................................ + +• *`/halfop`* `[nickname [nickname]]`:: + +........................................ + give half channel operator status to nickname(s) +........................................ + +• *`/ignore`* `[list] | [add [re:]nick/host [server [channel]]] | [del number|-all]`:: + +........................................ + ignore nicks/hosts from servers or channels + + list: list all ignore + add: add a ignore + del: del a ignore + number: number of ignore to delete (look at list to find it) + -all: delete all ignore + nick/host: nick or host to ignore: syntax is "re:regex" or "mask" (a mask is a string with some "*" to replace one or more chars) + server: internal server name where ignore is working + channel: channel name where ignore is working + + Examples: + ignore nick "toto" everywhere: + /ignore add toto + ignore host "toto@domain.com" on freenode server: + /ignore add toto@domain.com freenode + ignore host "toto*@*.domain.com" on freenode/#weechat: + /ignore add toto*@*.domain.com freenode #weechat +........................................ + +• *`/info`* `[target]`:: + +........................................ + get information describing the server + + target: server name +........................................ + +• *`/invite`* `nickname channel`:: + +........................................ + invite a nick on a channel + + nickname: nick to invite + channel: channel to invite +........................................ + +• *`/ison`* `nickname [nickname ...]`:: + +........................................ + check if a nickname is currently on IRC + + nickname: nickname +........................................ + +• *`/join`* `channel[,channel] [key[,key]]`:: + +........................................ + join a channel + + channel: channel name to join + key: key to join the channel +........................................ + +• *`/kick`* `[channel] nickname [comment]`:: + +........................................ + forcibly remove a user from a channel + + channel: channel where user is + nickname: nickname to kick + comment: comment for kick +........................................ + +• *`/kickban`* `[channel] nickname [comment]`:: + +........................................ + kicks and bans a nick from a channel + + channel: channel where user is + nickname: nickname to kick and ban + comment: comment for kick +........................................ + +• *`/kill`* `nickname comment`:: + +........................................ + close client-server connection + + nickname: nickname + comment: comment for kill +........................................ + +• *`/links`* `[[server] server_mask]`:: + +........................................ + list all servernames which are known by the server answering the query + + server: this server should answer the query + server_mask: list of servers must match this mask +........................................ + +• *`/list`* `[channel[,channel] [server]]`:: + +........................................ + list channels and their topic + + channel: channel to list (a regexp is allowed) + server: server name +........................................ + +• *`/lusers`* `[mask [target]]`:: + +........................................ + get statistics about the size of the IRC network + + mask: servers matching the mask only + target: server for forwarding request +........................................ + +• *`/me`* `message`:: + +........................................ + send a CTCP action to the current channel + + message: message to send +........................................ + +• *`/mode`* `{ [channel] {[+|-]|o|p|s|i|t|n|b|v} [limit] [user] [ban mask] } | { nickname {[+|-]|i|w|s|o} }`:: + +........................................ + change channel or user mode + + channel modes: + channel: channel name to modify (default is current one) + o: give/take channel operator privileges + p: private channel flag + s: secret channel flag + i: invite-only channel flag + t: topic settable by channel operator only flag + n: no messages to channel from clients on the outside + m: moderated channel + l: set the user limit to channel + b: set a ban mask to keep users out + e: set exception mask + v: give/take the ability to speak on a moderated channel + k: set a channel key (password) + user modes: + nickname: nickname to modify + i: mark a user as invisible + s: mark a user for receive server notices + w: user receives wallops + o: operator flag +........................................ + +• *`/motd`* `[target]`:: + +........................................ + get the "Message Of The Day" + + target: server name +........................................ + +• *`/msg`* `[-server server] receiver[,receiver] text`:: + +........................................ + send message to a nick or channel + + server: send to this server (internal name) + receiver: nick or channel (may be mask, '*' = current channel) + text: text to send +........................................ + +• *`/names`* `[channel[,channel]]`:: + +........................................ + list nicknames on channels + + channel: channel name +........................................ + +• *`/nick`* `[-all] nickname`:: + +........................................ + change current nickname + + -all: set new nickname for all connected servers + nickname: new nickname +........................................ + +• *`/notice`* `[-server server] nickname text`:: + +........................................ + send notice message to user + + server: send to this server (internal name) + nickname: user to send notice to + text: text to send +........................................ + +• *`/op`* `nickname [nickname]`:: + +........................................ + give channel operator status to nickname(s) +........................................ + +• *`/oper`* `user password`:: + +........................................ + get operator privileges + + user/password: used to get privileges on current IRC server +........................................ + +• *`/part`* `[channel[,channel]] [part_message]`:: + +........................................ + leave a channel + + channel: channel name to leave + part_message: part message (displayed to other users) +........................................ + +• *`/ping`* `server1 [server2]`:: + +........................................ + ping server + + server1: server to ping + server2: forward ping to this server +........................................ + +• *`/pong`* `daemon [daemon2]`:: + +........................................ + answer to a ping message + + daemon: daemon who has responded to Ping message + daemon2: forward message to this daemon +........................................ + +• *`/query`* `[-server server] nickname [text]`:: + +........................................ + send a private message to a nick + + server: send to this server (internal name) + nickname: nickname for private conversation + text: text to send +........................................ + +• *`/quote`* `[-server server] data`:: + +........................................ + send raw data to server without parsing + + server: send to this server (internal name) + data: raw data to send +........................................ + +• *`/reconnect`* `[-all [-nojoin] | servername [servername ...] [-nojoin]]`:: + +........................................ + reconnect to server(s) + + -all: reconnect to all servers + servername: server name to reconnect + -nojoin: do not join any channel (even if autojoin is enabled on server) +........................................ + +• *`/rehash`*:: + +........................................ + tell the server to reload its config file +........................................ + +• *`/restart`*:: + +........................................ + tell the server to restart itself +........................................ + +• *`/server`* `[list [servername]] | [listfull [servername]] | [add servername hostname[/port] [-auto | -noauto] [-ipv6] [-ssl]] | [copy servername newservername] | [rename servername newservername] | [keep servername] | [del servername] | [deloutq] | [raw] | [switch]`:: + +........................................ + list, add or remove IRC servers + + list: list servers (no parameter implies this list) + listfull: list servers with detailed info for each server + add: create a new server + servername: server name, for internal and display use + hostname: name or IP address of server, with optional port (default: 6667) + auto: automatically connect to server when WeeChat starts + noauto: do not connect to server when WeeChat starts (default) + ipv6: use IPv6 protocol + ssl: use SSL protocol + copy: duplicate a server + rename: rename a server + keep: keep server in config file (for temporary servers only) + del: delete a server + deloutq: delete messages out queue for all servers (all messages WeeChat is currently sending) + raw: open buffer with raw IRC data + switch: switch active server (when one buffer is used for all servers, default key: alt-s on server buffer) + + Examples: + /server listfull + /server add oftc irc.oftc.net/6697 -ssl + /server add oftc6 irc6.oftc.net/6697 -ipv6 -ssl + /server add freenode2 chat.eu.freenode.net/6667,chat.us.freenode.net/6667 + /server copy oftc oftcbis + /server rename oftc newoftc + /server del freenode + /server deloutq + /server switch +........................................ + +• *`/service`* `nickname reserved distribution type reserved info`:: + +........................................ + register a new service + + distribution: visibility of service + type: reserved for future usage +........................................ + +• *`/servlist`* `[mask [type]]`:: + +........................................ + list services currently connected to the network + + mask: list only services matching this mask + type: list only services of this type +........................................ + +• *`/squery`* `service text`:: + +........................................ + deliver a message to a service + + service: name of service + text: text to send +........................................ + +• *`/squit`* `server comment`:: + +........................................ + disconnect server links + + server: server name + comment: comment for quit +........................................ + +• *`/stats`* `[query [server]]`:: + +........................................ + query statistics about server + + query: c/h/i/k/l/m/o/y/u (see RFC1459) + server: server name +........................................ + +• *`/summon`* `user [target [channel]]`:: + +........................................ + give users who are on a host running an IRC server a message asking them to please join IRC + + user: username + target: server name + channel: channel name +........................................ + +• *`/time`* `[target]`:: + +........................................ + query local time from server + + target: query time from specified server +........................................ + +• *`/topic`* `[channel] [topic]`:: + +........................................ + get/set channel topic + + channel: channel name + topic: new topic for channel (if topic is "-delete" then topic is deleted) +........................................ + +• *`/trace`* `[target]`:: + +........................................ + find the route to specific server + + target: server +........................................ + +• *`/unban`* `[channel] nickname [nickname ...]`:: + +........................................ + unban nicks or hosts + + channel: channel for unban + nickname: user or host to unban +........................................ + +• *`/userhost`* `nickname [nickname ...]`:: + +........................................ + return a list of information about nicknames + + nickname: nickname +........................................ + +• *`/users`* `[target]`:: + +........................................ + list of users logged into the server + + target: server +........................................ + +• *`/version`* `[server | nickname]`:: + +........................................ + give the version info of nick or server (current or specified) + + server: server name + nickname: nickname +........................................ + +• *`/voice`* `[nickname [nickname]]`:: + +........................................ + give voice to nickname(s) +........................................ + +• *`/wallops`* `text`:: + +........................................ + send a message to all currently connected users who have set the 'w' user mode for themselves + + text to send +........................................ + +• *`/who`* `[mask ["o"]]`:: + +........................................ + generate a query which returns a list of information + + mask: only information which match this mask + o: only operators are returned according to the mask supplied +........................................ + +• *`/whois`* `[server] nickname[,nickname]`:: + +........................................ + query information about user(s) + + server: server name + nickname: nickname (may be a mask) +........................................ + +• *`/whowas`* `nickname [,nickname [,nickname ...]] [count [target]]`:: + +........................................ + ask for information about a nickname which no longer exists + + nickname: nickname to search + count: number of replies to return (full search if negative number) + target: reply should match this mask +........................................ + diff --git a/doc/en/autogen/user/irc_options.txt b/doc/en/autogen/user/irc_options.txt new file mode 100644 index 000000000..7a4f07993 --- /dev/null +++ b/doc/en/autogen/user/irc_options.txt @@ -0,0 +1,240 @@ +* *irc.color.input_nick* +** description: color for nick in input bar +** type: color +** values: a color name (default value: lightcyan) + +* *irc.color.message_join* +** description: color for text in join messages +** type: color +** values: a color name (default value: green) + +* *irc.color.message_quit* +** description: color for text in part/quit messages +** type: color +** values: a color name (default value: red) + +* *irc.look.color_nicks_in_server_messages* +** description: use nick color in messages from server +** type: boolean +** values: on, off (default value: on) + +* *irc.look.display_away* +** description: display message when (un)marking as away +** type: integer +** values: off, local, channel (default value: local) + +* *irc.look.display_channel_modes* +** description: display channel modes in "buffer_name" bar item +** type: boolean +** values: on, off (default value: on) + +* *irc.look.display_nick_modes* +** description: display nick modes in "input_prompt" bar item +** type: boolean +** values: on, off (default value: on) + +* *irc.look.display_old_topic* +** description: display old topic when channel topic is changed +** type: boolean +** values: on, off (default value: on) + +* *irc.look.hide_nickserv_pwd* +** description: hide password displayed by nickserv +** type: boolean +** values: on, off (default value: on) + +* *irc.look.highlight_tags* +** description: comma separated list of tags for messages that may produce highlight (usually any message from another user, not server messages,..) +** type: string +** values: any string (default value: "irc_privmsg,irc_notice") + +* *irc.look.nick_completion_smart* +** description: smart completion for nicks (completes first with last speakers) +** type: integer +** values: off, speakers, speakers_highlights (default value: speakers) + +* *irc.look.nick_prefix* +** description: text to display before nick in chat window +** type: string +** values: any string (default value: "") + +* *irc.look.nick_suffix* +** description: text to display after nick in chat window +** type: string +** values: any string (default value: "") + +* *irc.look.notice_as_pv* +** description: display notices as private messages +** type: boolean +** values: on, off (default value: off) + +* *irc.look.one_server_buffer* +** description: use same buffer for all servers +** type: boolean +** values: on, off (default value: off) + +* *irc.look.open_near_server* +** description: open new channels/privates near server +** type: boolean +** values: on, off (default value: off) + +* *irc.look.raw_messages* +** description: number of IRC raw messages to save in memory when raw data buffer is closed (messages will be displayed when opening raw data buffer) +** type: integer +** values: 0 .. 65535 (default value: 256) + +* *irc.look.show_away_once* +** description: show remote away message only once in private +** type: boolean +** values: on, off (default value: on) + +* *irc.look.smart_filter* +** description: filter join/part/quit messages for a nick if not speaking for some minutes on channel (you must create a filter on tag "irc_smart_filter") +** type: boolean +** values: on, off (default value: off) + +* *irc.look.smart_filter_delay* +** description: delay for filtering join/part/quit messages (in minutes) +** type: integer +** values: 1 .. 10080 (default value: 5) + +* *irc.look.topic_strip_colors* +** description: strip colors in topic (used only when displaying buffer title) +** type: boolean +** values: on, off (default value: off) + +* *irc.network.anti_flood* +** description: anti-flood: # seconds between two user messages (0 = no anti-flood) +** type: integer +** values: 0 .. 5 (default value: 2) + +* *irc.network.away_check* +** description: interval between two checks for away (in minutes, 0 = never check) +** type: integer +** values: 0 .. 2147483647 (default value: 0) + +* *irc.network.away_check_max_nicks* +** description: do not check away nicks on channels with high number of nicks (0 = unlimited) +** type: integer +** values: 0 .. 2147483647 (default value: 0) + +* *irc.network.colors_receive* +** description: when off, colors codes are ignored in incoming messages +** type: boolean +** values: on, off (default value: on) + +* *irc.network.colors_send* +** description: allow user to send colors with special codes (ctrl-c + a code and optional color: b=bold, cxx=color, cxx,yy=color+background, u=underline, r=reverse) +** type: boolean +** values: on, off (default value: on) + +* *irc.network.default_msg_part* +** description: default part message (leaving channel) ("%v" will be replaced by WeeChat version in string) +** type: string +** values: any string (default value: "WeeChat %v") + +* *irc.network.default_msg_quit* +** description: default quit message (disconnecting from server) ("%v" will be replaced by WeeChat version in string) +** type: string +** values: any string (default value: "WeeChat %v") + +* *irc.network.lag_check* +** description: interval between two checks for lag (in seconds, 0 = never check) +** type: integer +** values: 0 .. 2147483647 (default value: 60) + +* *irc.network.lag_disconnect* +** description: disconnect after important lag (in minutes, 0 = never disconnect) +** type: integer +** values: 0 .. 2147483647 (default value: 0) + +* *irc.network.lag_min_show* +** description: minimum lag to show (in seconds) +** type: integer +** values: 0 .. 2147483647 (default value: 1) + +* *irc.network.send_unknown_commands* +** description: send unknown commands to server +** type: boolean +** values: on, off (default value: off) + +* *irc.server_default.addresses* +** description: list of hostname/port or IP/port for server (separated by comma) +** type: string +** values: any string (default value: "") + +* *irc.server_default.autoconnect* +** description: automatically connect to server when WeeChat is starting +** type: boolean +** values: on, off (default value: off) + +* *irc.server_default.autojoin* +** description: comma separated list of channels to join when connected to server (example: "#chan1,#chan2,#chan3 key1,key2") +** type: string +** values: any string (default value: "") + +* *irc.server_default.autoreconnect* +** description: automatically reconnect to server when disconnected +** type: boolean +** values: on, off (default value: on) + +* *irc.server_default.autoreconnect_delay* +** description: delay (in seconds) before trying again to reconnect to server +** type: integer +** values: 0 .. 65535 (default value: 30) + +* *irc.server_default.autorejoin* +** description: automatically rejoin channels when kicked +** type: boolean +** values: on, off (default value: off) + +* *irc.server_default.command* +** description: command(s) to run when connected to server (many commands should be separated by ";", use "\;" for a semicolon, special variables $nick, $channel and $server are replaced by their value) +** type: string +** values: any string (default value: "") + +* *irc.server_default.command_delay* +** description: delay (in seconds) after command was executed (example: give some time for authentication) +** type: integer +** values: 0 .. 3600 (default value: 0) + +* *irc.server_default.ipv6* +** description: use IPv6 protocol for server communication +** type: boolean +** values: on, off (default value: off) + +* *irc.server_default.local_hostname* +** description: custom local hostname/IP for server (optional, if empty local hostname is used) +** type: string +** values: any string (default value: "") + +* *irc.server_default.nicks* +** description: nicknames to use on server (separated by comma) +** type: string +** values: any string (default value: "") + +* *irc.server_default.password* +** description: password for server +** type: string +** values: any string (default value: "") + +* *irc.server_default.proxy* +** description: proxy used for this server (optional) +** type: string +** values: any string (default value: "") + +* *irc.server_default.realname* +** description: real name to use on server +** type: string +** values: any string (default value: "") + +* *irc.server_default.ssl* +** description: use SSL for server communication +** type: boolean +** values: on, off (default value: off) + +* *irc.server_default.username* +** description: user name to use on server +** type: string +** values: any string (default value: "") + diff --git a/doc/en/autogen/user/jabber_commands.txt b/doc/en/autogen/user/jabber_commands.txt new file mode 100644 index 000000000..518f8d3f2 --- /dev/null +++ b/doc/en/autogen/user/jabber_commands.txt @@ -0,0 +1,65 @@ +• *`/jabber`* `[list [servername]] | [listfull [servername]] | [add servername username hostname[/port] password [-auto | -noauto] [-ipv6] [-tls] [-sasl]] | [copy servername newservername] | [rename servername newservername] | [keep servername] | [del servername] | [switch]`:: + +........................................ + list, add or remove Jabber servers + + list: list servers (no parameter implies this list) + listfull: list servers with detailed info for each server + add: create a new server + servername: server name, for internal and display use + username: username to use on server + hostname: name or IP address of server, with optional port (default: 5222) + password: password for username on server + auto: automatically connect to server when WeeChat starts + noauto: do not connect to server when WeeChat starts (default) + ipv6: use IPv6 protocol + tls: use TLS cryptographic protocol + sasl: use SASL for authentication + copy: duplicate a server + rename: rename a server + keep: keep server in config file (for temporary servers only) + del: delete a server + switch: switch active server (when one buffer is used for all servers, default key: alt-s on server buffer) + + Examples: + /jabber listfull + /jabber add jabberfr user jabber.fr/5222 password -tls + /jabber copy jabberfr jabberfr2 + /jabber rename jabberfr jabbfr + /jabber del jabberfr + /jabber switch +........................................ + +• *`/jchat`* `buddy [text]`:: + +........................................ + chat with a buddy + + buddy: buddy name for chat + text: text to send +........................................ + +• *`/jconnect`* `[-all [-nojoin] | servername [servername ...] [-nojoin] | hostname [-port port] [-ipv6] [-tls] [-sasl]]`:: + +........................................ + connect to Jabber server(s) + + -all: connect to all servers + servername: internal server name to connect + -nojoin: do not join any MUC (even if autojoin is enabled on server) + hostname: hostname to connect + port: port for server (integer, default is 6667) + ipv6: use IPv6 protocol + tls: use TLS cryptographic protocol + saal: use SASL for authentication +........................................ + +• *`/jdisconnect`* `[-all | servername [servername ...]]`:: + +........................................ + disconnect from Jabber server(s) + + -all: disconnect from all servers + servername: server name to disconnect +........................................ + diff --git a/doc/en/autogen/user/jabber_options.txt b/doc/en/autogen/user/jabber_options.txt new file mode 100644 index 000000000..6524b94e3 --- /dev/null +++ b/doc/en/autogen/user/jabber_options.txt @@ -0,0 +1,205 @@ +* *jabber.color.input_nick* +** description: color for nick in input bar +** type: color +** values: a color name (default value: lightcyan) + +* *jabber.color.message_join* +** description: color for text in join messages +** type: color +** values: a color name (default value: green) + +* *jabber.color.message_quit* +** description: color for text in part/quit messages +** type: color +** values: a color name (default value: red) + +* *jabber.look.color_nicks_in_server_messages* +** description: use nick color in messages from server +** type: boolean +** values: on, off (default value: on) + +* *jabber.look.display_away* +** description: display message when (un)marking as away +** type: integer +** values: off, local, muc (default value: local) + +* *jabber.look.display_muc_modes* +** description: display MUC modes in "buffer_name" bar item +** type: boolean +** values: on, off (default value: on) + +* *jabber.look.display_nick_modes* +** description: display nick modes in "input_prompt" bar item +** type: boolean +** values: on, off (default value: on) + +* *jabber.look.highlight_tags* +** description: comma separated list of tags for messages that may produce highlight (usually any message from another user, not server messages,..) +** type: string +** values: any string (default value: "jabber_chat_msg,jabber_notice") + +* *jabber.look.nick_completion_smart* +** description: smart completion for nicks (completes with last speakers first) +** type: boolean +** values: on, off (default value: on) + +* *jabber.look.nick_prefix* +** description: text to display before nick in chat window +** type: string +** values: any string (default value: "") + +* *jabber.look.nick_suffix* +** description: text to display after nick in chat window +** type: string +** values: any string (default value: "") + +* *jabber.look.one_server_buffer* +** description: use same buffer for all servers +** type: boolean +** values: on, off (default value: off) + +* *jabber.look.open_near_server* +** description: open new MUCs/privates near server +** type: boolean +** values: on, off (default value: off) + +* *jabber.look.show_away_once* +** description: show remote away message only once in private +** type: boolean +** values: on, off (default value: on) + +* *jabber.look.smart_filter* +** description: filter join/part/quit messages for a nick if not speaking for some minutes on MUC (you must create a filter on tag "jabber_smart_filter") +** type: boolean +** values: on, off (default value: off) + +* *jabber.look.smart_filter_delay* +** description: delay for filtering join/part/quit messages (in minutes) +** type: integer +** values: 1 .. 10080 (default value: 5) + +* *jabber.network.anti_flood* +** description: anti-flood: # seconds between two user messages (0 = no anti-flood) +** type: integer +** values: 0 .. 5 (default value: 2) + +* *jabber.network.colors_receive* +** description: when off, colors codes are ignored in incoming messages +** type: boolean +** values: on, off (default value: on) + +* *jabber.network.colors_send* +** description: allow user to send colors with special codes (^Cb=bold, ^Ccxx=color, ^Ccxx,yy=color+background, ^Cu=underline, ^Cr=reverse) +** type: boolean +** values: on, off (default value: on) + +* *jabber.network.default_msg_part* +** description: default part message (leaving MUC) ('%v' will be replaced by WeeChat version in string) +** type: string +** values: any string (default value: "WeeChat %v") + +* *jabber.network.default_msg_quit* +** description: default quit message (disconnecting from server) ('%v' will be replaced by WeeChat version in string) +** type: string +** values: any string (default value: "WeeChat %v") + +* *jabber.network.lag_check* +** description: interval between two checks for lag (in seconds, 0 = never check) +** type: integer +** values: 0 .. 2147483647 (default value: 60) + +* *jabber.network.lag_disconnect* +** description: disconnect after important lag (in minutes, 0 = never disconnect) +** type: integer +** values: 0 .. 2147483647 (default value: 5) + +* *jabber.network.lag_min_show* +** description: minimum lag to show (in seconds) +** type: integer +** values: 0 .. 2147483647 (default value: 1) + +* *jabber.server_default.autoconnect* +** description: automatically connect to server when WeeChat is starting +** type: boolean +** values: on, off (default value: off) + +* *jabber.server_default.autojoin* +** description: comma separated list of MUCs to join when connected to server (example: "#chan1,#chan2,#chan3 key1,key2") +** type: string +** values: any string (default value: "") + +* *jabber.server_default.autoreconnect* +** description: automatically reconnect to server when disconnected +** type: boolean +** values: on, off (default value: on) + +* *jabber.server_default.autoreconnect_delay* +** description: delay (in seconds) before trying again to reconnect to server +** type: integer +** values: 0 .. 65535 (default value: 10) + +* *jabber.server_default.autorejoin* +** description: automatically rejoin MUCs when kicked +** type: boolean +** values: on, off (default value: off) + +* *jabber.server_default.command* +** description: command(s) to run when connected to server (many commands should be separated by ';', use '\;' for a semicolon, special variables $nick, $muc and $server are replaced by their value) +** type: string +** values: any string (default value: "") + +* *jabber.server_default.command_delay* +** description: delay (in seconds) after command was executed (example: give some time for authentication) +** type: integer +** values: 0 .. 3600 (default value: 0) + +* *jabber.server_default.ipv6* +** description: use IPv6 protocol for server communication +** type: boolean +** values: on, off (default value: off) + +* *jabber.server_default.local_alias* +** description: local alias +** type: string +** values: any string (default value: "") + +* *jabber.server_default.local_hostname* +** description: custom local hostname/IP for server (optional, if empty local hostname is used) +** type: string +** values: any string (default value: "") + +* *jabber.server_default.password* +** description: password +** type: string +** values: any string (default value: "") + +* *jabber.server_default.proxy* +** description: proxy used for this server (optional) +** type: string +** values: any string (default value: "") + +* *jabber.server_default.resource* +** description: resource (for example: Home or Work) +** type: string +** values: any string (default value: "") + +* *jabber.server_default.sasl* +** description: use SASL for authentication +** type: boolean +** values: on, off (default value: on) + +* *jabber.server_default.server* +** description: hostname/port or IP/port for server +** type: string +** values: any string (default value: "") + +* *jabber.server_default.tls* +** description: use TLS cryptographic protocol for server communication +** type: boolean +** values: on, off (default value: off) + +* *jabber.server_default.username* +** description: user name to use on server +** type: string +** values: any string (default value: "") + diff --git a/doc/en/autogen/user/logger_commands.txt b/doc/en/autogen/user/logger_commands.txt new file mode 100644 index 000000000..18240291e --- /dev/null +++ b/doc/en/autogen/user/logger_commands.txt @@ -0,0 +1,33 @@ +• *`/logger`* `[list | set level | disable]`:: + +........................................ + logger plugin configuration + + list: show logging status for opened buffers + set: set logging level on current buffer + level: level for messages to be logged (0 = logging disabled, 1 = a few messages (most important) .. 9 = all messages) + disable: disable logging on current buffer (set level to 0) + + Options "logger.level.*" and "logger.mask.*" can be used to set level or mask for a buffer, or buffers beginning with name. + + Examples: + set level to 5 for current buffer: + /logger set 5 + disable logging for current buffer: + /logger disable + + set level to 3 for all IRC buffers: + /set logger.level.irc 3 + disable logging for main WeeChat buffer: + /set logger.level.core.weechat 0 + use a directory per IRC server and a file per channel inside: + /set logger.mask.irc "$server/$channel.weechatlog" + + Log levels used by IRC plugin: + 1: user message, notice, private + 2: nick change + 3: server message + 4: join/part/quit + 9: all other messages +........................................ + diff --git a/doc/en/autogen/user/logger_options.txt b/doc/en/autogen/user/logger_options.txt new file mode 100644 index 000000000..a7a98bfb8 --- /dev/null +++ b/doc/en/autogen/user/logger_options.txt @@ -0,0 +1,35 @@ +* *logger.file.auto_log* +** description: automatically save content of buffers to files (unless a buffer disables log) +** type: boolean +** values: on, off (default value: on) + +* *logger.file.info_lines* +** description: write information line in log file when log starts or ends for a buffer +** type: boolean +** values: on, off (default value: off) + +* *logger.file.mask* +** description: default file name mask for log files (format is "directory/to/file" or "file", without first "/" because "path" option is used to build complete path to file); local buffer variables are permitted +** type: string +** values: any string (default value: "$plugin.$name.weechatlog") + +* *logger.file.name_lower_case* +** description: use only lower case for log filenames +** type: boolean +** values: on, off (default value: on) + +* *logger.file.path* +** description: path for WeeChat log files ("%h" will be replaced by WeeChat home, "~/.weechat" by default) +** type: string +** values: any string (default value: "%h/logs/") + +* *logger.file.time_format* +** description: timestamp used in log files (see man strftime for date/time specifiers) +** type: string +** values: any string (default value: "%Y-%m-%d %H:%M:%S") + +* *logger.look.backlog* +** description: maximum number of lines to display from log file when creating new buffer (0 = no backlog) +** type: integer +** values: 0 .. 2147483647 (default value: 20) + diff --git a/doc/en/autogen/user/lua_commands.txt b/doc/en/autogen/user/lua_commands.txt new file mode 100644 index 000000000..54a70e129 --- /dev/null +++ b/doc/en/autogen/user/lua_commands.txt @@ -0,0 +1,11 @@ +• *`/lua`* `[list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]`:: + +........................................ + list/load/unload scripts + + filename: script (file) to load + name: a script name + + Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/autogen/user/perl_commands.txt b/doc/en/autogen/user/perl_commands.txt new file mode 100644 index 000000000..bd09104c2 --- /dev/null +++ b/doc/en/autogen/user/perl_commands.txt @@ -0,0 +1,11 @@ +• *`/perl`* `[list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]`:: + +........................................ + list/load/unload scripts + + filename: script (file) to load + name: a script name + + Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/autogen/user/python_commands.txt b/doc/en/autogen/user/python_commands.txt new file mode 100644 index 000000000..7cc90c3ef --- /dev/null +++ b/doc/en/autogen/user/python_commands.txt @@ -0,0 +1,11 @@ +• *`/python`* `[list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]`:: + +........................................ + list/load/unload scripts + + filename: script (file) to load + name: a script name + + Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/autogen/user/relay_commands.txt b/doc/en/autogen/user/relay_commands.txt new file mode 100644 index 000000000..957a0198d --- /dev/null +++ b/doc/en/autogen/user/relay_commands.txt @@ -0,0 +1,11 @@ +• *`/relay`* `[list | listfull]`:: + +........................................ + relay control + + list: list relay clients + listfull: list relay clients (verbose) + + Without argument, this command opens buffer with list of relay clients. +........................................ + diff --git a/doc/en/autogen/user/relay_options.txt b/doc/en/autogen/user/relay_options.txt new file mode 100644 index 000000000..ffb6a2dc7 --- /dev/null +++ b/doc/en/autogen/user/relay_options.txt @@ -0,0 +1,55 @@ +* *relay.color.status_active* +** description: text color for "connected" status +** type: color +** values: a color name (default value: lightblue) + +* *relay.color.status_auth_failed* +** description: text color for "authentication failed" status +** type: color +** values: a color name (default value: lightred) + +* *relay.color.status_connecting* +** description: text color for "connecting" status +** type: color +** values: a color name (default value: yellow) + +* *relay.color.status_disconnected* +** description: text color for "disconnected" status +** type: color +** values: a color name (default value: lightred) + +* *relay.color.status_waiting_auth* +** description: text color for "waiting authentication" status +** type: color +** values: a color name (default value: brown) + +* *relay.color.text* +** description: text color +** type: color +** values: a color name (default value: default) + +* *relay.color.text_bg* +** description: background color +** type: color +** values: a color name (default value: default) + +* *relay.color.text_selected* +** description: text color of selected client line +** type: color +** values: a color name (default value: white) + +* *relay.look.auto_open_buffer* +** description: auto open relay buffer when a new client is connecting +** type: boolean +** values: on, off (default value: on) + +* *relay.network.enabled* +** description: enable relay +** type: boolean +** values: on, off (default value: off) + +* *relay.network.listen_port_range* +** description: port number (or range of ports) that relay plugin listens on (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015) +** type: string +** values: any string (default value: "22373-22400") + diff --git a/doc/en/autogen/user/ruby_commands.txt b/doc/en/autogen/user/ruby_commands.txt new file mode 100644 index 000000000..83729f933 --- /dev/null +++ b/doc/en/autogen/user/ruby_commands.txt @@ -0,0 +1,11 @@ +• *`/ruby`* `[list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]`:: + +........................................ + list/load/unload scripts + + filename: script (file) to load + name: a script name + + Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/autogen/user/tcl_commands.txt b/doc/en/autogen/user/tcl_commands.txt new file mode 100644 index 000000000..1dd3de293 --- /dev/null +++ b/doc/en/autogen/user/tcl_commands.txt @@ -0,0 +1,11 @@ +• *`/tcl`* `[list [name]] | [listfull [name]] [load filename] | [autoload] | [reload] | [unload [name]]`:: + +........................................ + list/load/unload scripts + + filename: script (file) to load + name: a script name + + Without argument, this command lists all loaded scripts. +........................................ + diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt new file mode 100644 index 000000000..0a09a1526 --- /dev/null +++ b/doc/en/autogen/user/weechat_commands.txt @@ -0,0 +1,368 @@ +• *`/bar`* `[add barname type[,cond1,cond2,...] position size separator item1,item2,...] | [default] | [del barname|-all] | [set barname option value] | [hide|show|toggle barname] | [scroll barname buffer scroll_value] | [list] | [listfull] | [listitems]`:: + +........................................ + manage bars + + add: add a new bar + barname: name of bar (must be unique) + type: root: outside windows), + window: inside windows, with optional conditions (see below) + cond1,...: condition(s) for displaying bar (only for type "window"): + active: on active window + inactive: on inactive windows + nicklist: on windows with nicklist + without condition, bar is always displayed + position: bottom, top, left or right + filling: horizontal, vertical, columns_horizontal or columns_vertical + size: size of bar (in chars) + separator: 1 for using separator (line), 0 or nothing means no separator + item1,...: items for this bar (items can be separated by comma (space between items) or "+" (glued items)) + default: create default bars + del: delete a bar (or all bars with -all) + set: set a value for a bar property + option: option to change (for options list, look at /set weechat.bar.<barname>.*) + value: new value for option + hide: hide a bar + show: show an hidden bar + toggle: hide/show a bar + scroll: scroll bar up/down + buffer: name of buffer to scroll ('*' means current buffer, you should use '*' for root bars) + scroll_value: value for scroll: 'x' or 'y', followed by '+', '-', 'b' (beginning) or 'e' (end), value (for +/-), and optional %% (to scroll by %% of width/height, otherwise value is number of chars) + list: list all bars + listfull: list all bars (verbose) + listitems: list all bar items + + Examples: + create a bar with time, buffer number + name, and completion: + /bar add mybar root bottom 1 0 [time],buffer_number+:+buffer_name,completion + hide a bar: + /bar hide mybar + scroll nicklist 10 lines down on current buffer: + /bar scroll nicklist * y+10 + scroll nicklist one page up on #weechat buffer: + /bar scroll nicklist #weechat y-100% + scroll to end of nicklist on current buffer: + /bar scroll nicklist * ye +........................................ + +• *`/buffer`* `[clear [number | -all] | move number | close [n1[-n2]]| list | notify level | localvar | set property value | number | name]`:: + +........................................ + manage buffers + + clear: clear buffer content (-all for all buffers, number for a buffer, or nothing for current buffer) + move: move buffer in the list (may be relative, for example -1) + close: close buffer (number/range is optional) + list: list buffers (no parameter implies this list) + notify: set notify level for current buffer: this level determines whether buffer will be added to hotlist or not: + none: never + highlight: for highlights only + message: for messages from users + highlights + all: all messages + reset: reset to default value (all) + localvar: display local variables for current buffer + set: set a property for current buffer + number: jump to buffer by number, possible prefix: + '+': relative jump, add number to current + '-': relative jump, sub number to current + '*': jump to number, using option "weechat.look.jump_current_to_previous_buffer" + name: jump to buffer by (partial) name + + Examples: + clear current buffer: /buffer clear + clear all buffers: /buffer clear -all + move buffer: /buffer move 5 + close current buffer: /buffer close + close buffers 5 to 7: /buffer close 5-7 + jump to #weechat: /buffer #weechat + jump to next buffer: /buffer +1 +........................................ + +• *`/command`* `plugin command`:: + +........................................ + launch explicit WeeChat or plugin command + + plugin: plugin name ('weechat' for WeeChat internal command) + command: command to execute (a '/' is automatically added if not found at beginning of command) +........................................ + +• *`/debug`* `[list | plugin level | dump | buffer | windows]`:: + +........................................ + control debug for core/plugins + + plugin: name of plugin ("core" for WeeChat core) + level: debug level for plugin (0 = disable debug) + dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) + buffer: dump buffer content with hexadecimal values in log file + windows: display windows tree + text: send "debug" signal with "text" as argument +........................................ + +• *`/filter`* `[list] | [enable|disable|toggle [name]] | [add name plugin.buffer tags regex] | [del name|-all]`:: + +........................................ + filter messages in buffers, to hide/show them according to tags or regex + + list: list all filters + enable: enable filters (filters are enabled by default) + disable: disable filters + toggle: toggle filters + name: filter name + add: add a filter + del: delete a filter + -all: delete all filters + plugin.buffer: plugin and buffer where filter is active ("*" for all buffers) + tags: comma separated list of tags, for example: "irc_join,irc_part,irc_quit" + regex: regular expression to search in line (use \t to separate prefix from message) + + The default key alt+'=' toggles filtering on/off. + + Examples: + use IRC smart filter for join/part/quit messages: + /filter add irc_smart * irc_smart_filter * + filter all IRC join/part/quit messages: + /filter add joinquit * irc_join,irc_part,irc_quit * + filter nick "toto" on IRC channel #weechat: + /filter add toto irc.freenode.#weechat * toto\t + filter lines containing word "spam": + /filter add filterspam * * spam + filter lines containing "weechat sucks" on IRC channel #weechat: + /filter add sucks irc.freenode.#weechat * weechat sucks +........................................ + +• *`/help`* `[command | option]`:: + +........................................ + display help about commands and options + + command: a command name + option: an option name (use /set to see list) +........................................ + +• *`/history`* `[clear | value]`:: + +........................................ + show buffer command history + + clear: clear history + value: number of history entries to show +........................................ + +• *`/input`* `return | complete_next | complete_previous | search_next | delete_previous_char | delete_next_char | delete_previous_word | delete_next_word | delete_beginning_of_line | delete_end_of_line | delete_line | clipboard_paste | transpose_chars | move_beginning_of_line | move_end_of_line | move_previous_char | move_next_char | move_previous_word | move_next_word | history_previous | history_next | history_global_previous | history_global_next | jump_smart | jump_last_buffer | jump_previously_visited_buffer | jump_next_visited_buffer | hotlist_clear | grab_key | scroll_unread | set_unread | set_unread_current_buffer | insert [args]`:: + +........................................ + functions for command line + + Cette commande est utilisée par les associations de touches ou les extensions. +........................................ + +• *`/key`* `[bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]`:: + +........................................ + bind/unbind keys + + bind: bind a command to a key or display command bound to key + unbind: remove a key binding + reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) + missing: add missing keys (using default bindings) +........................................ + +• *`/layout`* `[[save | apply | reset] [buffers | windows]]`:: + +........................................ + save/apply/reset layout for buffers and windows + + save: save current layout + apply: apply saved layout + reset: remove saved layout + buffers: save/apply only buffers (order of buffers) + windows: save/apply only windows (buffer displayed by each window) + + Without argument, this command displays saved layout. +........................................ + +• *`/plugin`* `[list [name]] | [listfull [name]] | [load filename] | [autoload] | [reload [name]] | [unload [name]]`:: + +........................................ + list/load/unload plugins + + list: list loaded plugins + listfull: list loaded plugins (verbose) + load: load a plugin + autoload: autoload plugins in system or user directory + reload: reload one plugin (if no name given, unload all plugins, then autoload plugins) + unload: unload one or all plugins + + Without argument, this command lists loaded plugins. +........................................ + +• *`/proxy`* `[add proxyname type address port [username [password]]] | [del proxyname|-all] | [set proxyname option value] | [list]`:: + +........................................ + manage proxies + + add: add a new proxy + proxyname: name of proxy (must be unique) + type: http, socks4 or socks5 + address: IP or hostname + port: port + username: username (optional) + password: password (optional) + del: delete a proxy (or all proxies with -all) + set: set a value for a proxy property + option: option to change (for options list, look at /set weechat.proxy.<proxyname>.*) + value: new value for option + list: list all proxies + + Examples: + create a http proxy, running on local host, port 8888: + /proxy add local http 127.0.0.1 8888 + create a http proxy using IPv6 protocol: + /proxy add local http 127.0.0.1 8888 + /proxy set local ipv6 on + create a socks5 proxy with username/password: + /proxy add myproxy socks5 sample.host.org 3128 myuser mypass + delete a proxy: + /proxy del myproxy +........................................ + +• *`/quit`*:: + +........................................ + quit WeeChat +........................................ + +• *`/reload`* `[file [file...]]`:: + +........................................ + reload configuration files from disk + + file: configuration file to reload + + Without argument, all files (WeeChat and plugins) are reloaded. +........................................ + +• *`/save`* `[file [file...]]`:: + +........................................ + save configuration files to disk + + file: configuration file to save + + Without argument, all files (WeeChat and plugins) are saved. +........................................ + +• *`/set`* `[option [value]]`:: + +........................................ + set config options + + option: name of an option + value: new value for option + + New value can be, according to variable type: + boolean: on, off or toggle + integer: number, ++number or --number + string : any string ("" for empty string) + color : color name, ++number or --number + + For all types, you can use null to remove option value (undefined value). This works only for some special plugin variables. +........................................ + +• *`/unset`* `[option]`:: + +........................................ + unset/reset config options + + option: name of an option (may begin or end with "*" to mass-reset options, use carefully!) + + According to option, it's reset (for standard options) or removed (for optional settings, like server values). +........................................ + +• *`/upgrade`* `[path_to_binary]`:: + +........................................ + upgrade WeeChat without disconnecting from servers + + path_to_binary: path to WeeChat binary (default is current binary) + + This command run again a WeeChat binary, so it should have been compiled or installed with a package manager before running this command. +........................................ + +• *`/uptime`* `[-o]`:: + +........................................ + show WeeChat uptime + + -o: send uptime to current buffer as input +........................................ + +• *`/version`* `[-o]`:: + +........................................ + show WeeChat version and compilation date + + -o: send version to current buffer as input +........................................ + +• *`/wait`* `number[unit] command`:: + +........................................ + schedule a command execution in future + + number: amount of time to wait (integer number) + unit: optional, values are: + ms: milliseconds + s: seconds (default) + m: minutes + h: hours + command: command to execute (or text to send to buffer if command does not start with '/') + + Note: command is executed on buffer where /wait was executed (if buffer is not found (for example if it has been closed before execution of command), then command is executed on WeeChat core buffer). + + Examples: + join channel in 10 sec: /wait 10 join #test + set away in 15 min: /wait 15m away -all I'm away + say 'hello' in 2 min: /wait 2m hello +........................................ + +• *`/window`* `[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight | zoom]`:: + +........................................ + manage windows + + list: list opened windows (no parameter implies this list) + -1: jump to previous window + +1: jump to next window + b#: jump to next window displaying buffer number # + up: switch to window above current one + down: switch to window below current one + left: switch to window on the left + right: switch to window on the right + splith: split current window horizontally + splitv: split current window vertically + resize: resize window size, new size is <pct> percentage of parent window + merge: merge window with another (all = keep only one window) + + page_up: scroll one page up + page_down: scroll one page down + refresh: refresh screen + scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years + scroll_up: scroll a few lines up + scroll_down: scroll a few lines down + scroll_top: scroll to top of buffer + scroll_bottom: scroll to bottom of buffer + scroll_previous_highlight: scroll to previous highlight + scroll_next_highlight: scroll to next highlight + zoom: zoom on window + + For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4 + + Examples: + jump to window displaying buffer #1: /window b1 scroll 2 lines up: /window scroll -2 + scroll 2 days up: /window scroll -2d + scroll to beginning of current day: /window scroll -d +........................................ + diff --git a/doc/en/autogen/user/weechat_options.txt b/doc/en/autogen/user/weechat_options.txt new file mode 100644 index 000000000..021e54d44 --- /dev/null +++ b/doc/en/autogen/user/weechat_options.txt @@ -0,0 +1,575 @@ +* *weechat.color.bar_more* +** description: text color for '+' when scrolling bars +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.chat* +** description: text color for chat +** type: color +** values: a color name (default value: default) + +* *weechat.color.chat_bg* +** description: background color for chat +** type: color +** values: a color name (default value: default) + +* *weechat.color.chat_buffer* +** description: text color for buffer names +** type: color +** values: a color name (default value: white) + +* *weechat.color.chat_channel* +** description: text color for channel names +** type: color +** values: a color name (default value: white) + +* *weechat.color.chat_delimiters* +** description: text color for delimiters +** type: color +** values: a color name (default value: green) + +* *weechat.color.chat_highlight* +** description: text color for highlighted prefix +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.chat_highlight_bg* +** description: background color for highlighted prefix +** type: color +** values: a color name (default value: magenta) + +* *weechat.color.chat_host* +** description: text color for hostnames +** type: color +** values: a color name (default value: cyan) + +* *weechat.color.chat_nick* +** description: text color for nicks in chat window +** type: color +** values: a color name (default value: lightcyan) + +* *weechat.color.chat_nick_color01* +** description: text color #1 for nick +** type: color +** values: a color name (default value: cyan) + +* *weechat.color.chat_nick_color02* +** description: text color #2 for nick +** type: color +** values: a color name (default value: magenta) + +* *weechat.color.chat_nick_color03* +** description: text color #3 for nick +** type: color +** values: a color name (default value: green) + +* *weechat.color.chat_nick_color04* +** description: text color #4 for nick +** type: color +** values: a color name (default value: brown) + +* *weechat.color.chat_nick_color05* +** description: text color #5 for nick +** type: color +** values: a color name (default value: lightblue) + +* *weechat.color.chat_nick_color06* +** description: text color #6 for nick +** type: color +** values: a color name (default value: default) + +* *weechat.color.chat_nick_color07* +** description: text color #7 for nick +** type: color +** values: a color name (default value: lightcyan) + +* *weechat.color.chat_nick_color08* +** description: text color #8 for nick +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.chat_nick_color09* +** description: text color #9 for nick +** type: color +** values: a color name (default value: lightgreen) + +* *weechat.color.chat_nick_color10* +** description: text color #10 for nick +** type: color +** values: a color name (default value: blue) + +* *weechat.color.chat_nick_other* +** description: text color for other nick in private buffer +** type: color +** values: a color name (default value: cyan) + +* *weechat.color.chat_nick_self* +** description: text color for local nick in chat window +** type: color +** values: a color name (default value: white) + +* *weechat.color.chat_prefix_action* +** description: text color for action prefix +** type: color +** values: a color name (default value: white) + +* *weechat.color.chat_prefix_error* +** description: text color for error prefix +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.chat_prefix_join* +** description: text color for join prefix +** type: color +** values: a color name (default value: lightgreen) + +* *weechat.color.chat_prefix_more* +** description: text color for '+' when prefix is too long +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.chat_prefix_network* +** description: text color for network prefix +** type: color +** values: a color name (default value: magenta) + +* *weechat.color.chat_prefix_quit* +** description: text color for quit prefix +** type: color +** values: a color name (default value: lightred) + +* *weechat.color.chat_prefix_suffix* +** description: text color for suffix (after prefix) +** type: color +** values: a color name (default value: green) + +* *weechat.color.chat_read_marker* +** description: text color for unread data marker +** type: color +** values: a color name (default value: magenta) + +* *weechat.color.chat_read_marker_bg* +** description: background color for unread data marker +** type: color +** values: a color name (default value: default) + +* *weechat.color.chat_server* +** description: text color for server names +** type: color +** values: a color name (default value: brown) + +* *weechat.color.chat_text_found* +** description: text color for marker on lines where text sought is found +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.chat_text_found_bg* +** description: background color for marker on lines where text sought is found +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.chat_time* +** description: text color for time in chat window +** type: color +** values: a color name (default value: default) + +* *weechat.color.chat_time_delimiters* +** description: text color for time delimiters +** type: color +** values: a color name (default value: brown) + +* *weechat.color.chat_value* +** description: text color for values +** type: color +** values: a color name (default value: cyan) + +* *weechat.color.input_actions* +** description: text color for actions in input line +** type: color +** values: a color name (default value: lightgreen) + +* *weechat.color.input_nick* +** description: text color for nick name in input line +** type: color +** values: a color name (default value: lightcyan) + +* *weechat.color.input_text_not_found* +** description: text color for unsucessful text search in input line +** type: color +** values: a color name (default value: red) + +* *weechat.color.nicklist_away* +** description: text color for away nicknames +** type: color +** values: a color name (default value: cyan) + +* *weechat.color.nicklist_group* +** description: text color for groups in nicklist +** type: color +** values: a color name (default value: green) + +* *weechat.color.nicklist_more* +** description: text color for '+' when scrolling nicks in nicklist +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.nicklist_prefix1* +** description: text color for prefix #1 in nicklist +** type: color +** values: a color name (default value: lightgreen) + +* *weechat.color.nicklist_prefix2* +** description: text color for prefix #2 in nicklist +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.nicklist_prefix3* +** description: text color for prefix #3 in nicklist +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.nicklist_prefix4* +** description: text color for prefix #4 in nicklist +** type: color +** values: a color name (default value: blue) + +* *weechat.color.nicklist_prefix5* +** description: text color for prefix #5 in nicklist +** type: color +** values: a color name (default value: brown) + +* *weechat.color.nicklist_separator* +** description: text color for nicklist separator +** type: color +** values: a color name (default value: blue) + +* *weechat.color.separator* +** description: background color for window separators (when split) +** type: color +** values: a color name (default value: blue) + +* *weechat.color.status_data_highlight* +** description: text color for buffer with highlight (status bar) +** type: color +** values: a color name (default value: lightmagenta) + +* *weechat.color.status_data_msg* +** description: text color for buffer with new messages (status bar) +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.status_data_other* +** description: text color for buffer with new data (not messages) (status bar) +** type: color +** values: a color name (default value: default) + +* *weechat.color.status_data_private* +** description: text color for buffer with private message (status bar) +** type: color +** values: a color name (default value: lightgreen) + +* *weechat.color.status_filter* +** description: text color for filter indicator in status bar +** type: color +** values: a color name (default value: green) + +* *weechat.color.status_more* +** description: text color for buffer with new data (status bar) +** type: color +** values: a color name (default value: yellow) + +* *weechat.color.status_name* +** description: text color for current buffer name in status bar +** type: color +** values: a color name (default value: white) + +* *weechat.color.status_number* +** description: text color for current buffer number in status bar +** type: color +** values: a color name (default value: yellow) + +* *weechat.completion.default_template* +** description: default completion template (please see documentation for template codes and values) +** type: string +** values: any string (default value: "%(nicks)|%(irc_channels)") + +* *weechat.completion.nick_add_space* +** description: add space after nick completion (when nick is not first word on command line) +** type: boolean +** values: on, off (default value: on) + +* *weechat.completion.nick_completor* +** description: string inserted after nick completion +** type: string +** values: any string (default value: ":") + +* *weechat.completion.nick_first_only* +** description: complete only with first nick found +** type: boolean +** values: on, off (default value: off) + +* *weechat.completion.nick_ignore_chars* +** description: chars ignored for nick completion +** type: string +** values: any string (default value: "[]-^") + +* *weechat.completion.partial_completion_alert* +** description: alert user when a partial completion occurs +** type: boolean +** values: on, off (default value: on) + +* *weechat.completion.partial_completion_command* +** description: partially complete command names (stop when many commands found begin with same letters) +** type: boolean +** values: on, off (default value: off) + +* *weechat.completion.partial_completion_command_arg* +** description: partially complete command arguments (stop when many arguments found begin with same prefix) +** type: boolean +** values: on, off (default value: off) + +* *weechat.completion.partial_completion_count* +** description: display count for each partial completion in bar item +** type: boolean +** values: on, off (default value: on) + +* *weechat.completion.partial_completion_other* +** description: partially complete outside commands (stop when many words found begin with same letters) +** type: boolean +** values: on, off (default value: off) + +* *weechat.history.display_default* +** description: maximum number of commands to display by default in history listing (0 = unlimited) +** type: integer +** values: 0 .. 2147483647 (default value: 5) + +* *weechat.history.max_commands* +** description: maximum number of user commands in history (0 = unlimited) +** type: integer +** values: 0 .. 2147483647 (default value: 100) + +* *weechat.history.max_lines* +** description: maximum number of lines in history per buffer (0 = unlimited) +** type: integer +** values: 0 .. 2147483647 (default value: 4096) + +* *weechat.history.max_visited_buffers* +** description: maximum number of visited buffers to keep in memory +** type: integer +** values: 0 .. 1000 (default value: 50) + +* *weechat.look.buffer_notify_default* +** description: default notify level for buffers (used to tell WeeChat if buffer must be displayed in hotlist or not, according to importance of message) +** type: integer +** values: none, highlight, message, all (default value: all) + +* *weechat.look.buffer_time_format* +** description: time format for buffers +** type: string +** values: any string (default value: "%H:%M:%S") + +* *weechat.look.color_nicks_number* +** description: number of colors to use for nicks colors +** type: integer +** values: 1 .. 10 (default value: 10) + +* *weechat.look.color_real_white* +** description: if set, uses real white color, disabled by default for terms with white background (if you never use white background, you should turn on this option to see real white instead of default term foreground color) +** type: boolean +** values: on, off (default value: off) + +* *weechat.look.day_change* +** description: display special message when day changes +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.day_change_time_format* +** description: time format for date displayed when day changed +** type: string +** values: any string (default value: "%a, %d %b %Y") + +* *weechat.look.highlight* +** description: comma separated list of words to highlight (case insensitive comparison, words may begin or end with "*" for partial match) +** type: string +** values: any string (default value: "") + +* *weechat.look.hotlist_names_count* +** description: max number of names in hotlist (0 = no name displayed, only buffer numbers) +** type: integer +** values: 0 .. 32 (default value: 3) + +* *weechat.look.hotlist_names_length* +** description: max length of names in hotlist (0 = no limit) +** type: integer +** values: 0 .. 32 (default value: 0) + +* *weechat.look.hotlist_names_level* +** description: level for displaying names in hotlist (combination of: 1=join/part, 2=message, 4=private, 8=highlight, for example: 12=private+highlight) +** type: integer +** values: 1 .. 15 (default value: 12) + +* *weechat.look.hotlist_short_names* +** description: if set, uses short names to display buffer names in hotlist (start after first '.' in name) +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.hotlist_sort* +** description: hotlist sort type (group_time_asc (default), group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc) +** type: integer +** values: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (default value: group_time_asc) + +* *weechat.look.item_time_format* +** description: time format for "time" bar item +** type: string +** values: any string (default value: "%H:%M") + +* *weechat.look.jump_current_to_previous_buffer* +** description: jump to previous buffer displayed when jumping to current buffer number with /buffer *N (where N is a buffer number), to easily switch to another buffer, then come back to current buffer +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.jump_previous_buffer_when_closing* +** description: jump to previously visited buffer when closing a buffer (if disabled, then jump to buffer number - 1) +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.nickmode* +** description: display nick mode ((half)op/voice) before each nick +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.nickmode_empty* +** description: display space if nick mode is not (half)op/voice +** type: boolean +** values: on, off (default value: off) + +* *weechat.look.paste_max_lines* +** description: max number of lines for paste without asking user (0 = disable this feature) +** type: integer +** values: 0 .. 2147483647 (default value: 3) + +* *weechat.look.prefix_action* +** description: prefix for action messages +** type: string +** values: any string (default value: " *") + +* *weechat.look.prefix_align* +** description: prefix alignment (none, left, right (default)) +** type: integer +** values: none, left, right (default value: right) + +* *weechat.look.prefix_align_max* +** description: max size for prefix (0 = no max size) +** type: integer +** values: 0 .. 64 (default value: 0) + +* *weechat.look.prefix_error* +** description: prefix for error messages +** type: string +** values: any string (default value: "=!=") + +* *weechat.look.prefix_join* +** description: prefix for join messages +** type: string +** values: any string (default value: "-->") + +* *weechat.look.prefix_network* +** description: prefix for network messages +** type: string +** values: any string (default value: "--") + +* *weechat.look.prefix_quit* +** description: prefix for quit messages +** type: string +** values: any string (default value: "<--") + +* *weechat.look.prefix_suffix* +** description: string displayed after prefix +** type: string +** values: any string (default value: "|") + +* *weechat.look.read_marker* +** description: use a marker (line or char) on buffers to show first unread line +** type: integer +** values: none, line, dotted-line, char (default value: dotted-line) + +* *weechat.look.save_config_on_exit* +** description: save configuration file on exit +** type: boolean +** values: on, off (default value: on) + +* *weechat.look.save_layout_on_exit* +** description: save layout on exit (buffers, windows, or both) +** type: integer +** values: none, buffers, windows, all (default value: all) + +* *weechat.look.scroll_amount* +** description: how many lines to scroll by with scroll_up and scroll_down +** type: integer +** values: 1 .. 2147483647 (default value: 3) + +* *weechat.look.scroll_page_percent* +** description: percent of screen to scroll when scrolling one page up or down (for example 100 means one page, 50 half-page) +** type: integer +** values: 1 .. 100 (default value: 100) + +* *weechat.look.set_title* +** description: set title for window (terminal for Curses GUI) with name and version +** type: boolean +** values: on, off (default value: on) + +* *weechat.network.gnutls_dh_prime_bitsmax_lines* +** description: minimum size in bits for handshake using Diffie Hellman key exchange +** type: integer +** values: 0 .. 2147483647 (default value: 512) + +* *weechat.plugin.autoload* +** description: comma separated list of plugins to load automatically at startup, "*" means all plugins found (names may be partial, for example "perl" is ok for "perl.so") +** type: string +** values: any string (default value: "*") + +* *weechat.plugin.debug* +** description: enable debug messages by default in all plugins (option disabled by default, which is highly recommended) +** type: boolean +** values: on, off (default value: off) + +* *weechat.plugin.extension* +** description: standard plugins extension in filename (for example ".so" under Linux or ".dll" under Microsoft Windows) +** type: string +** values: any string (default value: ".so") + +* *weechat.plugin.path* +** description: path for searching plugins ("%h" will be replaced by WeeChat home, "~/.weechat" by default) +** type: string +** values: any string (default value: "%h/plugins") + +* *weechat.plugin.save_config_on_unload* +** description: save configuration files when unloading plugins +** type: boolean +** values: on, off (default value: on) + +* *weechat.startup.command_after_plugins* +** description: command executed when WeeChat starts, after loading plugins +** type: string +** values: any string (default value: "") + +* *weechat.startup.command_before_plugins* +** description: command executed when WeeChat starts, before loading plugins +** type: string +** values: any string (default value: "") + +* *weechat.startup.display_logo* +** description: display WeeChat logo at startup +** type: boolean +** values: on, off (default value: on) + +* *weechat.startup.display_version* +** description: display WeeChat version at startup +** type: boolean +** values: on, off (default value: on) + +* *weechat.startup.weechat_slogan* +** description: WeeChat slogan (if empty, slogan is not used) +** type: string +** values: any string (default value: "le client de discussion le plus geek !") + diff --git a/doc/en/autogen/user/xfer_commands.txt b/doc/en/autogen/user/xfer_commands.txt new file mode 100644 index 000000000..2648b584c --- /dev/null +++ b/doc/en/autogen/user/xfer_commands.txt @@ -0,0 +1,11 @@ +• *`/xfer`* `[list | listfull]`:: + +........................................ + xfer control + + list: list xfer + listfull: list xfer (verbose) + + Without argument, this command opens buffer with xfer list. +........................................ + diff --git a/doc/en/autogen/user/xfer_options.txt b/doc/en/autogen/user/xfer_options.txt new file mode 100644 index 000000000..78d593cb2 --- /dev/null +++ b/doc/en/autogen/user/xfer_options.txt @@ -0,0 +1,125 @@ +* *xfer.color.status_aborted* +** description: text color for "aborted" status +** type: color +** values: a color name (default value: lightred) + +* *xfer.color.status_active* +** description: text color for "active" status +** type: color +** values: a color name (default value: lightblue) + +* *xfer.color.status_connecting* +** description: text color for "connecting" status +** type: color +** values: a color name (default value: yellow) + +* *xfer.color.status_done* +** description: text color for "done" status +** type: color +** values: a color name (default value: lightgreen) + +* *xfer.color.status_failed* +** description: text color for "failed" status +** type: color +** values: a color name (default value: lightred) + +* *xfer.color.status_waiting* +** description: text color for "waiting" status +** type: color +** values: a color name (default value: lightcyan) + +* *xfer.color.text* +** description: text color +** type: color +** values: a color name (default value: default) + +* *xfer.color.text_bg* +** description: background color +** type: color +** values: a color name (default value: default) + +* *xfer.color.text_selected* +** description: text color of selected xfer line +** type: color +** values: a color name (default value: white) + +* *xfer.file.auto_accept_chats* +** description: automatically accept chat requests (use carefully!) +** type: boolean +** values: on, off (default value: off) + +* *xfer.file.auto_accept_files* +** description: automatically accept incoming files (use carefully!) +** type: boolean +** values: on, off (default value: off) + +* *xfer.file.auto_rename* +** description: rename incoming files if already exists (add ".1", ".2", ...) +** type: boolean +** values: on, off (default value: on) + +* *xfer.file.auto_resume* +** description: automatically resume file transfer if connection with remote host is lost +** type: boolean +** values: on, off (default value: on) + +* *xfer.file.convert_spaces* +** description: convert spaces to underscores when sending files +** type: boolean +** values: on, off (default value: on) + +* *xfer.file.download_path* +** description: path for writing incoming files +** type: string +** values: any string (default value: "%h/xfer") + +* *xfer.file.upload_path* +** description: path for reading files when sending (when no path is specified by user) +** type: string +** values: any string (default value: "~") + +* *xfer.file.use_nick_in_filename* +** description: use remote nick as prefix in local filename when receiving a file +** type: boolean +** values: on, off (default value: on) + +* *xfer.look.auto_open_buffer* +** description: auto open xfer buffer when a new xfer is added to list +** type: boolean +** values: on, off (default value: on) + +* *xfer.look.progress_bar_size* +** description: size of progress bar, in chars (if 0, progress bar is disabled) +** type: integer +** values: 0 .. 256 (default value: 20) + +* *xfer.network.blocksize* +** description: block size for sending packets, in bytes +** type: integer +** values: 1024 .. 102400 (default value: 65536) + +* *xfer.network.fast_send* +** description: does not wait for ACK when sending file +** type: boolean +** values: on, off (default value: on) + +* *xfer.network.own_ip* +** description: IP or DNS address used for sending files/chats (if empty, local interface IP is used) +** type: string +** values: any string (default value: "") + +* *xfer.network.port_range* +** description: restricts outgoing files/chats to use only ports in the given range (useful for NAT) (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015, empty value means any port) +** type: string +** values: any string (default value: "") + +* *xfer.network.speed_limit* +** description: speed limit for sending files, in kilo-bytes by second (0 means no limit) +** type: integer +** values: 0 .. 2147483647 (default value: 0) + +* *xfer.network.timeout* +** description: timeout for xfer request (in seconds) +** type: integer +** values: 5 .. 2147483647 (default value: 300) + diff --git a/doc/en/autogen/weechat_commands.xml b/doc/en/autogen/weechat_commands.xml deleted file mode 100644 index 230964d33..000000000 --- a/doc/en/autogen/weechat_commands.xml +++ /dev/null @@ -1,354 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/bar [add barname type[,cond1,cond2,...] position size separator item1,item2,...] | [default] | [del barname|-all] | [set barname option value] | [hide|show|toggle barname] | [scroll barname buffer scroll_value] | [list] | [listfull] | [listitems]</command> -<programlisting> -manage bars - - add: add a new bar - barname: name of bar (must be unique) - type: root: outside windows), - window: inside windows, with optional conditions (see below) - cond1,...: condition(s) for displaying bar (only for type "window"): - active: on active window - inactive: on inactive windows - nicklist: on windows with nicklist - without condition, bar is always displayed - position: bottom, top, left or right - filling: horizontal, vertical, columns_horizontal or columns_vertical - size: size of bar (in chars) - separator: 1 for using separator (line), 0 or nothing means no separator - item1,...: items for this bar (items can be separated by comma (space between items) or "+" (glued items)) - default: create default bars - del: delete a bar (or all bars with -all) - set: set a value for a bar property - option: option to change (for options list, look at /set weechat.bar.<barname>.*) - value: new value for option - hide: hide a bar - show: show an hidden bar - toggle: hide/show a bar - scroll: scroll bar up/down - buffer: name of buffer to scroll ('*' means current buffer, you should use '*' for root bars) - scroll_value: value for scroll: 'x' or 'y', followed by '+', '-', 'b' (beginning) or 'e' (end), value (for +/-), and optional %% (to scroll by %% of width/height, otherwise value is number of chars) - list: list all bars - listfull: list all bars (verbose) - listitems: list all bar items - -Examples: - create a bar with time, buffer number + name, and completion: - /bar add mybar root bottom 1 0 [time],buffer_number+:+buffer_name,completion - hide a bar: - /bar hide mybar - scroll nicklist 10 lines down on current buffer: - /bar scroll nicklist * y+10 - scroll nicklist one page up on #weechat buffer: - /bar scroll nicklist #weechat y-100% - scroll to end of nicklist on current buffer: - /bar scroll nicklist * ye -</programlisting> - -<command>/buffer [clear [number | -all] | move number | close [n1[-n2]]| list | notify level | localvar | set property value | number | name]</command> -<programlisting> -manage buffers - - clear: clear buffer content (-all for all buffers, number for a buffer, or nothing for current buffer) - move: move buffer in the list (may be relative, for example -1) - close: close buffer (number/range is optional) - list: list buffers (no parameter implies this list) - notify: set notify level for current buffer: this level determines whether buffer will be added to hotlist or not: - none: never - highlight: for highlights only - message: for messages from users + highlights - all: all messages - reset: reset to default value (all) -localvar: display local variables for current buffer - set: set a property for current buffer - number: jump to buffer by number, possible prefix: - '+': relative jump, add number to current - '-': relative jump, sub number to current - '*': jump to number, using option "weechat.look.jump_current_to_previous_buffer" - name: jump to buffer by (partial) name - -Examples: -clear current buffer: /buffer clear - clear all buffers: /buffer clear -all - move buffer: /buffer move 5 -close current buffer: /buffer close -close buffers 5 to 7: /buffer close 5-7 - jump to #weechat: /buffer #weechat - jump to next buffer: /buffer +1 -</programlisting> - -<command>/command plugin command</command> -<programlisting> -launch explicit WeeChat or plugin command - - plugin: plugin name ('weechat' for WeeChat internal command) -command: command to execute (a '/' is automatically added if not found at beginning of command) -</programlisting> - -<command>/debug [list | plugin level | dump | buffer | windows]</command> -<programlisting> -control debug for core/plugins - - plugin: name of plugin ("core" for WeeChat core) - level: debug level for plugin (0 = disable debug) - dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes) - buffer: dump buffer content with hexadecimal values in log file -windows: display windows tree - text: send "debug" signal with "text" as argument -</programlisting> - -<command>/filter [list] | [enable|disable|toggle [name]] | [add name plugin.buffer tags regex] | [del name|-all]</command> -<programlisting> -filter messages in buffers, to hide/show them according to tags or regex - - list: list all filters - enable: enable filters (filters are enabled by default) - disable: disable filters - toggle: toggle filters - name: filter name - add: add a filter - del: delete a filter - -all: delete all filters -plugin.buffer: plugin and buffer where filter is active ("*" for all buffers) - tags: comma separated list of tags, for example: "irc_join,irc_part,irc_quit" - regex: regular expression to search in line (use \t to separate prefix from message) - -The default key alt+'=' toggles filtering on/off. - -Examples: - use IRC smart filter for join/part/quit messages: - /filter add irc_smart * irc_smart_filter * - filter all IRC join/part/quit messages: - /filter add joinquit * irc_join,irc_part,irc_quit * - filter nick "toto" on IRC channel #weechat: - /filter add toto irc.freenode.#weechat * toto\t - filter lines containing word "spam": - /filter add filterspam * * spam - filter lines containing "weechat sucks" on IRC channel #weechat: - /filter add sucks irc.freenode.#weechat * weechat sucks -</programlisting> - -<command>/help [command | option]</command> -<programlisting> -display help about commands and options - -command: a command name - option: an option name (use /set to see list) -</programlisting> - -<command>/history [clear | value]</command> -<programlisting> -show buffer command history - -clear: clear history -value: number of history entries to show -</programlisting> - -<command>/input return | complete_next | complete_previous | search_next | delete_previous_char | delete_next_char | delete_previous_word | delete_next_word | delete_beginning_of_line | delete_end_of_line | delete_line | clipboard_paste | transpose_chars | move_beginning_of_line | move_end_of_line | move_previous_char | move_next_char | move_previous_word | move_next_word | history_previous | history_next | history_global_previous | history_global_next | jump_smart | jump_last_buffer | jump_previously_visited_buffer | jump_next_visited_buffer | hotlist_clear | grab_key | scroll_unread | set_unread | set_unread_current_buffer | insert [args]</command> -<programlisting> -functions for command line - -Cette commande est utilisée par les associations de touches ou les extensions. -</programlisting> - -<command>/key [bind key [command [args]]] | [unbind key] | [reset -yes] | [missing]</command> -<programlisting> -bind/unbind keys - - bind: bind a command to a key or display command bound to key - unbind: remove a key binding - reset: restore bindings to the default values and delete ALL personal bindings (use carefully!) -missing: add missing keys (using default bindings) -</programlisting> - -<command>/layout [[save | apply | reset] [buffers | windows]]</command> -<programlisting> -save/apply/reset layout for buffers and windows - - save: save current layout - apply: apply saved layout - reset: remove saved layout -buffers: save/apply only buffers (order of buffers) -windows: save/apply only windows (buffer displayed by each window) - -Without argument, this command displays saved layout. -</programlisting> - -<command>/plugin [list [name]] | [listfull [name]] | [load filename] | [autoload] | [reload [name]] | [unload [name]]</command> -<programlisting> -list/load/unload plugins - - list: list loaded plugins -listfull: list loaded plugins (verbose) - load: load a plugin -autoload: autoload plugins in system or user directory - reload: reload one plugin (if no name given, unload all plugins, then autoload plugins) - unload: unload one or all plugins - -Without argument, this command lists loaded plugins. -</programlisting> - -<command>/proxy [add proxyname type address port [username [password]]] | [del proxyname|-all] | [set proxyname option value] | [list]</command> -<programlisting> -manage proxies - - add: add a new proxy - proxyname: name of proxy (must be unique) - type: http, socks4 or socks5 - address: IP or hostname - port: port - username: username (optional) - password: password (optional) - del: delete a proxy (or all proxies with -all) - set: set a value for a proxy property - option: option to change (for options list, look at /set weechat.proxy.<proxyname>.*) - value: new value for option - list: list all proxies - -Examples: - create a http proxy, running on local host, port 8888: - /proxy add local http 127.0.0.1 8888 - create a http proxy using IPv6 protocol: - /proxy add local http 127.0.0.1 8888 - /proxy set local ipv6 on - create a socks5 proxy with username/password: - /proxy add myproxy socks5 sample.host.org 3128 myuser mypass - delete a proxy: - /proxy del myproxy -</programlisting> - -<command>/quit</command> -<programlisting> -quit WeeChat -</programlisting> - -<command>/reload [file [file...]]</command> -<programlisting> -reload configuration files from disk - -file: configuration file to reload - -Without argument, all files (WeeChat and plugins) are reloaded. -</programlisting> - -<command>/save [file [file...]]</command> -<programlisting> -save configuration files to disk - -file: configuration file to save - -Without argument, all files (WeeChat and plugins) are saved. -</programlisting> - -<command>/set [option [value]]</command> -<programlisting> -set config options - -option: name of an option - value: new value for option - -New value can be, according to variable type: - boolean: on, off or toggle - integer: number, ++number or --number - string : any string ("" for empty string) - color : color name, ++number or --number - -For all types, you can use null to remove option value (undefined value). This works only for some special plugin variables. -</programlisting> - -<command>/unset [option]</command> -<programlisting> -unset/reset config options - -option: name of an option (may begin or end with "*" to mass-reset options, use carefully!) - -According to option, it's reset (for standard options) or removed (for optional settings, like server values). -</programlisting> - -<command>/upgrade [path_to_binary]</command> -<programlisting> -upgrade WeeChat without disconnecting from servers - -path_to_binary: path to WeeChat binary (default is current binary) - -This command run again a WeeChat binary, so it should have been compiled or installed with a package manager before running this command. -</programlisting> - -<command>/uptime [-o]</command> -<programlisting> -show WeeChat uptime - --o: send uptime to current buffer as input -</programlisting> - -<command>/version [-o]</command> -<programlisting> -show WeeChat version and compilation date - --o: send version to current buffer as input -</programlisting> - -<command>/wait number[unit] command</command> -<programlisting> -schedule a command execution in future - - number: amount of time to wait (integer number) - unit: optional, values are: - ms: milliseconds - s: seconds (default) - m: minutes - h: hours -command: command to execute (or text to send to buffer if command does not start with '/') - -Note: command is executed on buffer where /wait was executed (if buffer is not found (for example if it has been closed before execution of command), then command is executed on WeeChat core buffer). - -Examples: - join channel in 10 sec: /wait 10 join #test - set away in 15 min: /wait 15m away -all I'm away - say 'hello' in 2 min: /wait 2m hello -</programlisting> - -<command>/window [list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv [pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | scroll_up | scroll_down | scroll_top | scroll_bottom | scroll_previous_highlight | scroll_next_highlight | zoom]</command> -<programlisting> -manage windows - - list: list opened windows (no parameter implies this list) - -1: jump to previous window - +1: jump to next window - b#: jump to next window displaying buffer number # - up: switch to window above current one - down: switch to window below current one - left: switch to window on the left - right: switch to window on the right - splith: split current window horizontally - splitv: split current window vertically - resize: resize window size, new size is <pct> percentage of parent window - merge: merge window with another (all = keep only one window) - - page_up: scroll one page up - page_down: scroll one page down - refresh: refresh screen - scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years - scroll_up: scroll a few lines up - scroll_down: scroll a few lines down - scroll_top: scroll to top of buffer -scroll_bottom: scroll to bottom of buffer -scroll_previous_highlight: scroll to previous highlight -scroll_next_highlight: scroll to next highlight - zoom: zoom on window - -For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4 - -Examples: - jump to window displaying buffer #1: /window b1 scroll 2 lines up: /window scroll -2 - scroll 2 days up: /window scroll -2d - scroll to beginning of current day: /window scroll -d -</programlisting> - diff --git a/doc/en/autogen/weechat_options.xml b/doc/en/autogen/weechat_options.xml deleted file mode 100644 index 932ad7bc3..000000000 --- a/doc/en/autogen/weechat_options.xml +++ /dev/null @@ -1,1158 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>weechat.color.bar_more</command>: text color for '+' when scrolling bars -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat</command>: text color for chat -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_bg</command>: background color for chat -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_buffer</command>: text color for buffer names -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_channel</command>: text color for channel names -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_delimiters</command>: text color for delimiters -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_highlight</command>: text color for highlighted prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_highlight_bg</command>: background color for highlighted prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: magenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_host</command>: text color for hostnames -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: cyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick</command>: text color for nicks in chat window -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color01</command>: text color #1 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: cyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color02</command>: text color #2 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: magenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color03</command>: text color #3 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color04</command>: text color #4 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: brown)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color05</command>: text color #5 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightblue)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color06</command>: text color #6 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color07</command>: text color #7 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color08</command>: text color #8 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color09</command>: text color #9 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_color10</command>: text color #10 for nick -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: blue)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_other</command>: text color for other nick in private buffer -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: cyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_nick_self</command>: text color for local nick in chat window -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_action</command>: text color for action prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_error</command>: text color for error prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_join</command>: text color for join prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_more</command>: text color for '+' when prefix is too long -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_network</command>: text color for network prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: magenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_quit</command>: text color for quit prefix -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_prefix_suffix</command>: text color for suffix (after prefix) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_read_marker</command>: text color for unread data marker -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: magenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_read_marker_bg</command>: background color for unread data marker -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_server</command>: text color for server names -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: brown)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_text_found</command>: text color for marker on lines where text sought is found -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_text_found_bg</command>: background color for marker on lines where text sought is found -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_time</command>: text color for time in chat window -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_time_delimiters</command>: text color for time delimiters -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: brown)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.chat_value</command>: text color for values -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: cyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.input_actions</command>: text color for actions in input line -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.input_nick</command>: text color for nick name in input line -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.input_text_not_found</command>: text color for unsucessful text search in input line -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: red)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_away</command>: text color for away nicknames -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: cyan)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_group</command>: text color for groups in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_more</command>: text color for '+' when scrolling nicks in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_prefix1</command>: text color for prefix #1 in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_prefix2</command>: text color for prefix #2 in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_prefix3</command>: text color for prefix #3 in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_prefix4</command>: text color for prefix #4 in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: blue)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_prefix5</command>: text color for prefix #5 in nicklist -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: brown)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.nicklist_separator</command>: text color for nicklist separator -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: blue)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.separator</command>: background color for window separators (when split) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: blue)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_data_highlight</command>: text color for buffer with highlight (status bar) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightmagenta)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_data_msg</command>: text color for buffer with new messages (status bar) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_data_other</command>: text color for buffer with new data (not messages) (status bar) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_data_private</command>: text color for buffer with private message (status bar) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_filter</command>: text color for filter indicator in status bar -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: green)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_more</command>: text color for buffer with new data (status bar) -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_name</command>: text color for current buffer name in status bar -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>weechat.color.status_number</command>: text color for current buffer number in status bar -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.default_template</command>: default completion template (please see documentation for template codes and values) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%(nicks)|%(irc_channels)')</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.nick_add_space</command>: add space after nick completion (when nick is not first word on command line) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.nick_completor</command>: string inserted after nick completion -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: ':')</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.nick_first_only</command>: complete only with first nick found -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.nick_ignore_chars</command>: chars ignored for nick completion -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '[]-^')</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.partial_completion_alert</command>: alert user when a partial completion occurs -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.partial_completion_command</command>: partially complete command names (stop when many commands found begin with same letters) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.partial_completion_command_arg</command>: partially complete command arguments (stop when many arguments found begin with same prefix) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.partial_completion_count</command>: display count for each partial completion in bar item -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.completion.partial_completion_other</command>: partially complete outside commands (stop when many words found begin with same letters) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.history.display_default</command>: maximum number of commands to display by default in history listing (0 = unlimited) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 5)</para> - </listitem> -</itemizedlist> - -<command>weechat.history.max_commands</command>: maximum number of user commands in history (0 = unlimited) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 100)</para> - </listitem> -</itemizedlist> - -<command>weechat.history.max_lines</command>: maximum number of lines in history per buffer (0 = unlimited) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 4096)</para> - </listitem> -</itemizedlist> - -<command>weechat.history.max_visited_buffers</command>: maximum number of visited buffers to keep in memory -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 1000 (default value: 50)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.buffer_notify_default</command>: default notify level for buffers (used to tell WeeChat if buffer must be displayed in hotlist or not, according to importance of message) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: none, highlight, message, all (default value: all)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.buffer_time_format</command>: time format for buffers -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%H:%M:%S')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.color_nicks_number</command>: number of colors to use for nicks colors -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 10 (default value: 10)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.color_real_white</command>: if set, uses real white color, disabled by default for terms with white background (if you never use white background, you should turn on this option to see real white instead of default term foreground color) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.day_change</command>: display special message when day changes -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.day_change_time_format</command>: time format for date displayed when day changed -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%a, %d %b %Y')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.highlight</command>: comma separated list of words to highlight (case insensitive comparison, words may begin or end with "*" for partial match) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.hotlist_names_count</command>: max number of names in hotlist (0 = no name displayed, only buffer numbers) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 32 (default value: 3)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.hotlist_names_length</command>: max length of names in hotlist (0 = no limit) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 32 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.hotlist_names_level</command>: level for displaying names in hotlist (combination of: 1=join/part, 2=message, 4=private, 8=highlight, for example: 12=private+highlight) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 15 (default value: 12)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.hotlist_short_names</command>: if set, uses short names to display buffer names in hotlist (start after first '.' in name) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.hotlist_sort</command>: hotlist sort type (group_time_asc (default), group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: group_time_asc, group_time_desc, group_number_asc, group_number_desc, number_asc, number_desc (default value: group_time_asc)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.item_time_format</command>: time format for "time" bar item -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%H:%M')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.jump_current_to_previous_buffer</command>: jump to previous buffer displayed when jumping to current buffer number with /buffer *N (where N is a buffer number), to easily switch to another buffer, then come back to current buffer -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.jump_previous_buffer_when_closing</command>: jump to previously visited buffer when closing a buffer (if disabled, then jump to buffer number - 1) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.nickmode</command>: display nick mode ((half)op/voice) before each nick -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.nickmode_empty</command>: display space if nick mode is not (half)op/voice -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.paste_max_lines</command>: max number of lines for paste without asking user (0 = disable this feature) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 3)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_action</command>: prefix for action messages -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: ' *')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_align</command>: prefix alignment (none, left, right (default)) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: none, left, right (default value: right)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_align_max</command>: max size for prefix (0 = no max size) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 64 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_error</command>: prefix for error messages -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '=!=')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_join</command>: prefix for join messages -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '-->')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_network</command>: prefix for network messages -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '--')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_quit</command>: prefix for quit messages -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '<--')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.prefix_suffix</command>: string displayed after prefix -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '|')</para> - </listitem> -</itemizedlist> - -<command>weechat.look.read_marker</command>: use a marker (line or char) on buffers to show first unread line -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: none, line, dotted-line, char (default value: dotted-line)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.save_config_on_exit</command>: save configuration file on exit -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.save_layout_on_exit</command>: save layout on exit (buffers, windows, or both) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: none, buffers, windows, all (default value: all)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.scroll_amount</command>: how many lines to scroll by with scroll_up and scroll_down -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 2147483647 (default value: 3)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.scroll_page_percent</command>: percent of screen to scroll when scrolling one page up or down (for example 100 means one page, 50 half-page) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1 .. 100 (default value: 100)</para> - </listitem> -</itemizedlist> - -<command>weechat.look.set_title</command>: set title for window (terminal for Curses GUI) with name and version -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.network.gnutls_dh_prime_bitsmax_lines</command>: minimum size in bits for handshake using Diffie Hellman key exchange -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 512)</para> - </listitem> -</itemizedlist> - -<command>weechat.plugin.autoload</command>: comma separated list of plugins to load automatically at startup, "*" means all plugins found (names may be partial, for example "perl" is ok for "perl.so") -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '*')</para> - </listitem> -</itemizedlist> - -<command>weechat.plugin.debug</command>: enable debug messages by default in all plugins (option disabled by default, which is highly recommended) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>weechat.plugin.extension</command>: standard plugins extension in filename (for example ".so" under Linux or ".dll" under Microsoft Windows) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '.so')</para> - </listitem> -</itemizedlist> - -<command>weechat.plugin.path</command>: path for searching plugins ('%h' will be replaced by WeeChat home, ~/.weechat by default) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%h/plugins')</para> - </listitem> -</itemizedlist> - -<command>weechat.plugin.save_config_on_unload</command>: save configuration files when unloading plugins -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.startup.command_after_plugins</command>: command executed when WeeChat starts, after loading plugins -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>weechat.startup.command_before_plugins</command>: command executed when WeeChat starts, before loading plugins -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>weechat.startup.display_logo</command>: display WeeChat logo at startup -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.startup.display_version</command>: display WeeChat version at startup -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>weechat.startup.weechat_slogan</command>: WeeChat slogan (if empty, slogan is not used) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: 'le client de discussion le plus geek !')</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/autogen/xfer_commands.xml b/doc/en/autogen/xfer_commands.xml deleted file mode 100644 index c74385cfc..000000000 --- a/doc/en/autogen/xfer_commands.xml +++ /dev/null @@ -1,18 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>/xfer [list | listfull]</command> -<programlisting> -xfer control - - list: list xfer -listfull: list xfer (verbose) - -Without argument, this command opens buffer with xfer list. -</programlisting> - diff --git a/doc/en/autogen/xfer_options.xml b/doc/en/autogen/xfer_options.xml deleted file mode 100644 index 4d09d7bb0..000000000 --- a/doc/en/autogen/xfer_options.xml +++ /dev/null @@ -1,258 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - ********* WARNING! ********* - - This file is autogenerated with docgen.pl script. *** DO NOT EDIT! *** - docgen.pl builds XML doc files to include in many languages ---> - -<command>xfer.color.status_aborted</command>: text color for "aborted" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.status_active</command>: text color for "active" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightblue)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.status_connecting</command>: text color for "connecting" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: yellow)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.status_done</command>: text color for "done" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightgreen)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.status_failed</command>: text color for "failed" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightred)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.status_waiting</command>: text color for "waiting" status -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: lightcyan)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.text</command>: text color -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.text_bg</command>: background color -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: default)</para> - </listitem> -</itemizedlist> - -<command>xfer.color.text_selected</command>: text color of selected xfer line -<itemizedlist> - <listitem> - <para>type: color</para> - </listitem> - <listitem> - <para>values: a color name (default value: white)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.auto_accept_chats</command>: automatically accept chat requests (use carefully!) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.auto_accept_files</command>: automatically accept incoming files (use carefully!) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: off)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.auto_rename</command>: rename incoming files if already exists (add '.1', '.2', ...) -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.auto_resume</command>: automatically resume file transfer if connection with remote host is lost -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.convert_spaces</command>: convert spaces to underscores when sending files -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.file.download_path</command>: path for writing incoming files -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '%h/xfer')</para> - </listitem> -</itemizedlist> - -<command>xfer.file.upload_path</command>: path for reading files when sending (when no path is specified by user) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '~')</para> - </listitem> -</itemizedlist> - -<command>xfer.file.use_nick_in_filename</command>: use remote nick as prefix in local filename when receiving a file -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.look.auto_open_buffer</command>: auto open xfer buffer when a new xfer is added to list -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.look.progress_bar_size</command>: size of progress bar, in chars (if 0, progress bar is disabled) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 256 (default value: 20)</para> - </listitem> -</itemizedlist> - -<command>xfer.network.blocksize</command>: block size for sending packets, in bytes -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 1024 .. 102400 (default value: 65536)</para> - </listitem> -</itemizedlist> - -<command>xfer.network.fast_send</command>: does not wait for ACK when sending file -<itemizedlist> - <listitem> - <para>type: boolean</para> - </listitem> - <listitem> - <para>values: on, off (default value: on)</para> - </listitem> -</itemizedlist> - -<command>xfer.network.own_ip</command>: IP or DNS address used for sending files/chats (if empty, local interface IP is used) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>xfer.network.port_range</command>: restricts outgoing files/chats to use only ports in the given range (useful for NAT) (syntax: a single port, ie. 5000 or a port range, ie. 5000-5015, empty value means any port) -<itemizedlist> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string (default value: '')</para> - </listitem> -</itemizedlist> - -<command>xfer.network.speed_limit</command>: speed limit for sending files, in kilo-bytes by second (0 means no limit) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 0 .. 2147483647 (default value: 0)</para> - </listitem> -</itemizedlist> - -<command>xfer.network.timeout</command>: timeout for xfer request (in seconds) -<itemizedlist> - <listitem> - <para>type: integer</para> - </listitem> - <listitem> - <para>values: 5 .. 2147483647 (default value: 300)</para> - </listitem> -</itemizedlist> - diff --git a/doc/en/dev/plugin_api.en.xml b/doc/en/dev/plugin_api.en.xml deleted file mode 100644 index 35abc832f..000000000 --- a/doc/en/dev/plugin_api.en.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapPluginAPI"> - <title>Plugin API</title> - - &plugin_c_api.en.xml; - - &plugin_script_api.en.xml; - -</chapter> diff --git a/doc/en/dev/plugin_c_api.en.xml b/doc/en/dev/plugin_c_api.en.xml deleted file mode 100644 index f066c3d42..000000000 --- a/doc/en/dev/plugin_c_api.en.xml +++ /dev/null @@ -1,10496 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginCApi"> - <title>C plugin API</title> - - <!-- =============================[ plugins ]============================ --> - - <section id="secPluginCApi_plugins"> - <title>Plugins</title> - - <para> - Functions to get infos about plugins. - </para> - - <section id="secPluginCApi_weechat_plugin_get_name"> - <title>weechat_plugin_get_name</title> - - <para> - Prototype: -<programlisting> -void weechat_plugin_get_name (struct t_weechat_plugin *plugin); -</programlisting> - </para> - <para> - Get plugin name (return "core" for WeeChat - NULL pointer). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>plugin</option>: plugin pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>const char *name = weechat_plugin_get_name (plugin);</screen> - </para> - </section> - - </section> - - <!-- =============================[ strings ]============================ --> - - <section id="secPluginCApi_strings"> - <title>Strings</title> - - <para> - Many string functions below are already available thru standard C - functions, but it's recommended to use functions in this API because - they are ok with UTF-8 and locale. - </para> - - <section id="secPluginCApi_weechat_charset_set"> - <title>weechat_charset_set</title> - - <para> - Prototype: -<programlisting> -void weechat_charset_set (const char *charset); -</programlisting> - </para> - <para> - Set new plugin charset. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>charset</option>: new charset to use - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_charset_set (plugin, "iso-8859-1");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_iconv_to_internal"> - <title>weechat_iconv_to_internal</title> - - <para> - Prototype: -<programlisting> -char *weechat_iconv_to_internal (const char *charset, const char *string); -</programlisting> - </para> - <para> - Convert string to WeeChat internal charset (UTF-8). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>charset</option>: charset to convert - </para> - </listitem> - <listitem> - <para> - <option>string</option>: string to convert - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: converted string. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: - <screen>char *str = weechat_iconv_to_internal (plugin, "iso-8859-1", "iso string: é à");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_iconv_from_internal"> - <title>weechat_iconv_from_internal</title> - - <para> - Prototype: -<programlisting> -char *weechat_iconv_from_internal (const char *charset, const char *string); -</programlisting> - </para> - <para> - Convert string from internal WeeChat charset (UTF-8) to another. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>charset</option>: target charset - </para> - </listitem> - <listitem> - <para> - <option>string</option>: string to convert - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: converted string. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: - <screen>char *str = weechat_iconv_from_internal ("iso-8859-1", "utf-8 string: é à");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_gettext"> - <title>weechat_gettext</title> - - <para> - Prototype: -<programlisting> -const char *weechat_gettext (const char *string); -</programlisting> - </para> - <para> - Return translated string (depends on local language). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string to translate - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: translated string. - </para> - <para> - Example: - <screen>char *str = weechat_gettext ("hello !");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_ngettext"> - <title>weechat_ngettext</title> - - <para> - Prototype: -<programlisting> -const char *weechat_ngettext (const char *string, const char *plural, int count); -</programlisting> - </para> - <para> - Return translated string, using single or plural form, according to - count. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>single</option>: string to translate (single form) - </para> - </listitem> - <listitem> - <para> - <option>plural</option>: string to translate (plural form) - </para> - </listitem> - <listitem> - <para> - <option>count</option>: used to choose between single and plural - form - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: translated string. - </para> - <para> - Example: - <screen>char *str = weechat_ngettext ("file", "files", num_files);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_strndup"> - <title>weechat_strndup</title> - - <para> - Prototype: -<programlisting> -char *weechat_strndup (const char *string, int length); -</programlisting> - </para> - <para> - Return duplicated string, with max "length" chars. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string to duplicate - </para> - </listitem> - <listitem> - <para> - <option>length</option>: max chars to duplicate - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: duplicated string. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: - <screen>char *str = weechat_strndup ("abcdef", 3); /* result: "abc" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_tolower"> - <title>weechat_string_tolower</title> - - <para> - Prototype: -<programlisting> -void weechat_string_tolower (const char *string); -</programlisting> - </para> - <para> - Convert UTF-8 string to lower case. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string to convert - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: - <screen>weechat_string_tolower ("AbCdEé"); /* result: "abcdeé" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_toupper"> - <title>weechat_string_toupper</title> - - <para> - Prototype: -<programlisting> -void weechat_string_toupper (const char *string); -</programlisting> - </para> - <para> - Convert UTF-8 string to upper case. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string to convert - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: - <screen>weechat_string_toupper ("AbCdEé"); /* result: "ABCDEé" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_strcasecmp"> - <title>weechat_strcasecmp</title> - - <para> - Prototype: -<programlisting> -int weechat_strcasecmp (const char *string1, const char *string2); -</programlisting> - </para> - <para> - Locale and case independent string comparison. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string1</option>: first string for comparison - </para> - </listitem> - <listitem> - <para> - <option>string2</option>: second string for comparison - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: difference between two strings: negative if - string1 < string2, zero if string1 == string2, positive if - string1 > string2 - </para> - <para> - Example: - <screen>int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */ </screen> - </para> - </section> - - <section id="secPluginCApi_weechat_strncasecmp"> - <title>weechat_strncasecmp</title> - - <para> - Prototype: -<programlisting> -int weechat_strncasecmp (const char *string1, const char *string2, int max); -</programlisting> - </para> - <para> - Locale and case independent string comparison, for "max" chars. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string1</option>: first string for comparison - </para> - </listitem> - <listitem> - <para> - <option>string2</option>: second string for comparison - </para> - </listitem> - <listitem> - <para> - <option>max</option>: max number of chars for comparison - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: difference between two strings: negative if - string1 < string2, zero if string1 == string2, positive if - string1 > string2 - </para> - <para> - Example: - <screen>int diff = weechat_strncasecmp ("aaa", "CCC", 2); /* == -2 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_strcmp_ignore_chars"> - <title>weechat_strcmp_ignore_chars</title> - - <para> - Prototype: -<programlisting> -int weechat_strcmp_ignore_chars ( - const char *string1, - const char *string2, - const char *chars_ignored, - int case_sensitive); -</programlisting> - </para> - <para> - Locale (and optionally case independent) string comparison, ignoring - some chars. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string1</option>: first string for comparison - </para> - </listitem> - <listitem> - <para> - <option>string2</option>: second string for comparison - </para> - </listitem> - <listitem> - <para> - <option>chars_ignored</option>: string with chars to ignore - </para> - </listitem> - <listitem> - <para> - <option>case_sensitive</option>: 1 for case sensitive comparison, - 0 otherwise - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: difference between two strings: negative if - string1 < string2, zero if string1 == string2, positive if - string1 > string2 - </para> - <para> - Example: - <screen>int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_strcasestr"> - <title>weechat_strcasestr</title> - - <para> - Prototype: -<programlisting> -char *weechat_strcasestr (const char *string, const char *search); -</programlisting> - </para> - <para> - Locale and case independent string search. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>search</option>: string to search in "string" - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to string found, or NULL if not found - </para> - <para> - Example: - <screen>char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_match"> - <title>weechat_string_match</title> - - <para> - Prototype: -<programlisting> -int weechat_string_match ( - const char *string, - const char *mask, - int case_sensitive); -</programlisting> - </para> - <para> - Check if a string matches a mask. Mask can begin or end with "*" (no - other "*" are allowed inside mask). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>mask</option>: mask - </para> - </listitem> - <listitem> - <para> - <option>case_sensitive</option>: 1 for case sensitive search, - otherwise 0 - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if string matches mask, otherwise 0. - </para> - <para> - Examples: -<screen> -int match1 = weechat_string_match ("abcdef", "abc*", 0); /* == 1 */ -int match2 = weechat_string_match ("abcdef", "*dd*", 0); /* == 0 */ -int match3 = weechat_string_match ("abcdef", "*def", 0); /* == 1 */ -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_replace"> - <title>weechat_string_replace</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_replace (const char *string, const char *search, - const char *replace); -</programlisting> - </para> - <para> - Replace "search" string by new one in a string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>search</option>: string to replace - </para> - </listitem> - <listitem> - <para> - <option>replace</option>: replacement for "search" string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string with "search" replaced by "replace". - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: - <screen>char *str = weechat_string_replace ("test", "s", "x"); /* result: "text" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_remove_quotes"> - <title>weechat_string_remove_quotes</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_remove_quotes (const char *string, const char *quotes); -</programlisting> - </para> - <para> - Remove quotes at beginning/end of string (ignore spaces if there are - before first quote or after last quote). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>quotes</option>: string with list of quotes - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string without quotes at beginning/end. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: - <screen>char *str = weechat_string_remove_quotes (string, " 'abc' ", "'"); /* result: "abc" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_strip"> - <title>weechat_string_strip</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_strip ( - const char *string, - int left, - int right, - const char *chars); -</programlisting> - </para> - <para> - Strip chars at beginning and/or end of string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>left</option>: strip left chars if different from 0 - </para> - </listitem> - <listitem> - <para> - <option>right</option>: strip right chars if different from 0 - </para> - </listitem> - <listitem> - <para> - <option>chars</option>: string with chars to strip - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: stripped string. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: -<screen> -char *str = weechat_string_strip (string, " ", 0, 1); /* remove spaces at end of string */ -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_has_highlight"> - <title>weechat_string_has_highlight</title> - - <para> - Prototype: -<programlisting> -int weechat_string_has_highlight ( - const char *string, - const char highlight_words); -</programlisting> - </para> - <para> - Check if a string has highlights, using list of highlight words. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>highlight_words</option>: list of highlight words, - separated by comma - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if string has one or more highlights, 0 otherwise. - </para> - <para> - Example: - <screen>if (weechat_string_has_highlight (string, "word1,word2")) ...</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_mask_to_regex"> - <title>weechat_string_mask_to_regex</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_mask_to_regex (const char *mask); -</programlisting> - </para> - <para> - Return a regex, built with a mask, where only special char is "*". - All special chars for regex are escaped. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>mask</option>: mask - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: regex. - </para> - <para> - Example: - <screen>char *regex = weechat_string_mask_to_regex ("test*mask");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_explode"> - <title>weechat_string_explode</title> - - <para> - Prototype: -<programlisting> -char **weechat_string_explode ( - const char *string, - const char *separators, int keep_eol, - int num_items_max, int *num_items); -</programlisting> - </para> - <para> - Explode a string according to one or more delimiter(s). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string to explode - </para> - </listitem> - <listitem> - <para> - <option>separators</option>: delimiters used for explosion - </para> - </listitem> - <listitem> - <para> - <option>keep_eol</option>: if different from 0, then each - argument will contain all string until end of line (see example - below) - </para> - </listitem> - <listitem> - <para> - <option>num_items_max</option>: maximum number of items - created (0 = no limit) - </para> - </listitem> - <listitem> - <para> - <option>num_items</option>: pointer to int which will - contain number of items created - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: array of strings, NULL if problem. - </para> - <note> - <para> - Result has to be free by a call to "weechat_string_free_exploded" - after use. - </para> - </note> - <para> - Examples: -<screen> -char **argv; -int argc; -argv = weechat_string_explode ("abc de fghi", " ", 0, 0, &argc); -/* result: argv[0] == "abc" - argv[1] == "de" - argv[2] == "fghi" - argv[3] == NULL - argc == 3 -*/ -weechat_string_free_exploded (argv); - -argv = weechat_string_explode ("abc de fghi", " ", 1, 0, &argc); -/* result: argv[0] == "abc de fghi" - argv[1] == "de fghi" - argv[2] == "fghi" - argv[3] == NULL - argc == 3 -*/ -weechat_string_free_exploded (argv); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_free_exploded"> - <title>weechat_string_free_exploded</title> - - <para> - Prototype: -<programlisting> -void weechat_string_free_exploded (char **exploded_string); -</programlisting> - </para> - <para> - Free memory used by a string explosion. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>exploded_string</option>: string exploded by - "weechat_string_explode" function - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: -<screen> -char *argv; -int argc; -argv = weechat_string_explode (string, " ", 0, 0, &argc); -... -weechat_string_free_exploded (, argv); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_build_with_exploded"> - <title>weechat_string_build_with_exploded</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_build_with_exploded ( - char **exploded_string, - const char *separator); -</programlisting> - </para> - <para> - Build a string with exploded string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>exploded_string</option>: string exploded by - "weechat_string_explode" function - </para> - </listitem> - <listitem> - <para> - <option>separator</option>: string used to separate strings - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string built with exploded string. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: -<screen> -char **argv; -int argc; -argv = weechat_string_explode ("abc def ghi", " ", 0, 0, &argc); -char *string = weechat_string_build_with_exploded (argv, ";"); -/* string == "abc;def;ghi" */ -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_split_command"> - <title>weechat_string_split_command</title> - - <para> - Prototype: -<programlisting> -char **weechat_string_split_command (const char *command, char separator); -</programlisting> - </para> - <para> - Split a list of commands separated by 'separator' (which can be escaped - by '\' in string). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>command</option>: command to split - </para> - </listitem> - <listitem> - <para> - <option>separator</option>: separator - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: array of strings, NULL if problem. - </para> - <note> - <para> - Result has to be free by a call to - "weechat_string_free_split_command" after use. - </para> - </note> - <para> - Example: - <screen>char **argv = weechat_string_split_command ("/command1;/command2", ';');</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_split_command"> - <title>weechat_string_free_split_command</title> - - <para> - Prototype: -<programlisting> -void weechat_string_free_split_command (char **split_command); -</programlisting> - </para> - <para> - Free memory used by a split command. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>split_command</option>: command split by - "weechat_string_split_commaand" function - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: -<screen> -char **argv = weechat_string_split_command ("/command1;/command2", ';'); -... -weechat_string_free_split_command (argv); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_format_size"> - <title>weechat_string_format_size</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_format_size (unsigned long size); -</programlisting> - </para> - <para> - Build a string with formatted size and translated unit. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>size</option>: size - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string with formatted size and translated unit. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: -<screen> -char *str = weechat_string_format_size (0); /* str == "0 byte" (english locale) */ -if (str) - free (str); -char *str = weechat_string_format_size (200); /* str == "200 bytes" (english locale) */ -if (str) - free (str); -char *str = weechat_string_format_size (1536); /* str == "1.5 KB" (english locale) */ -if (str) - free (str); -char *str = weechat_string_format_size (2097152); /* str == "2 MB" (english locale) */ -if (str) - free (str); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_string_remove_color"> - <title>weechat_string_remove_color</title> - - <para> - Prototype: -<programlisting> -char *weechat_string_remove_color (const char *string, const char *replacement); -</programlisting> - </para> - <para> - Remove WeeChat colors from a string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>replacement</option>: if not NULL and not empty, WeeChat - color codes are replaced by first char of this string, otherwise - WeeChat color codes and following chars (if related to color) are - removed from string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string without color. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: -<screen> -char *str1 = weechat_string_remove_color (my_string1, NULL); /* remove colors and related chars */ -char *str2 = weechat_string_remove_color (my_string2, "?"); /* replace color codes by "?" */ -</screen> - </para> - </section> - - </section> - - <!-- ==============================[ UTF-8 ]============================= --> - - <section id="secPluginCApi_utf8"> - <title>UTF-8</title> - - <para> - Some UTF-8 string functions. - </para> - - <section id="secPluginCApi_weechat_utf8_has_8bits"> - <title>weechat_utf8_has_8bits</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_has_8bits (const char *string); -</programlisting> - </para> - <para> - Check if a string has 8-bits chars. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if string has 8-buts chars, 0 if only 7-bits chars. - </para> - <para> - Example: - <screen>if (weechat_utf8_has_8bits (string)) ...</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_is_valid"> - <title>weechat_utf8_is_valid</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_is_valid (const char *string, char **error); -</programlisting> - </para> - <para> - Check if a string is UTF-8 valid. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>error</option>: if not NULL, it is set with first non - valid UTF-8 char in string, if any - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if UTF-8 string is valid, 0 otherwise. - </para> - <para> - Example: -<screen> -char *error; -if (weechat_utf8_is_valid (string, &error)) ... -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_normalize"> - <title>weechat_utf8_normalize</title> - - <para> - Prototype: -<programlisting> -void weechat_utf8_normalize (const char *string, char replacement); -</programlisting> - </para> - <para> - Normalize UTF-8 string: remove non UTF-8 chars and replace them by a - char - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>replacement</option>: replacement char for non UTF-8 chars - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: - <screen>weechat_utf8_normalize (string, '?');</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_prev_char"> - <title>weechat_utf8_prev_char</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_prev_char (const char *string_start, const char *string); -</programlisting> - </para> - <para> - Return previous UTF-8 char in a string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string_start</option>: start of string (function will not - return a char before this pointer) - </para> - </listitem> - <listitem> - <para> - <option>string</option>: pointer to string (must be >= - string_start) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to previous UTF-8 char, NULL if not found - (start of string reached) - </para> - <para> - Example: - <screen>char *prev_char = weechat_utf8_prev_char (string, ptr_in_string);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_next_char"> - <title>weechat_utf8_next_char</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_next_char (const char *string); -</programlisting> - </para> - <para> - Return next UTF-8 char in a string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to next UTF-8 char, NULL if not found - (end of string reached) - </para> - <para> - Example: - <screen>char *next_char = weechat_utf8_next_char (string);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_char_size"> - <title>weechat_utf8_char_size</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_char_size (const char *string); -</programlisting> - </para> - <para> - Return UTF-8 char size (in bytes). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: UTF-8 char size (in bytes). - </para> - <para> - Example: - <screen>int char_size = weechat_utf8_char_size ("être"); /* == 2 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_strlen"> - <title>weechat_utf8_strlen</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_strlen (const char *string); -</programlisting> - </para> - <para> - Return UTF-8 string length (multi-byte char is considered as 1 char). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: UTF-8 string length (number of real chars). - </para> - <para> - Example: - <screen>int length = weechat_utf8_strlen ("chêne"); /* == 5 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_strnlen"> - <title>weechat_utf8_strnlen</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_strnlen (const char *string, int bytes); -</programlisting> - </para> - <para> - Return UTF-8 string length (multi-byte char is considered as 1 char), - for max bytes in string - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>bytes</option>: max bytes in string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: UTF-8 string length (number of real chars). - </para> - <para> - Example: - <screen>int length = weechat_utf8_strnlen ("chêne", 4); /* == 3 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_strlen_screen"> - <title>weechat_utf8_strlen_screen</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_strlen_screen (const char *string); -</programlisting> - </para> - <para> - Return number of chars needed on screen to display UTF-8 string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: number of chars needed on screen to display UTF-8 string. - </para> - <para> - Example: - <screen>int length_on_screen = weechat_utf8_strlen_screen ("东"); /* == 2 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_charcasecmp"> - <title>weechat_utf8_charcasecmp</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_charcasecmp (const char *string1, const char *string2); -</programlisting> - </para> - <para> - Compare two UTF-8 chars (case is ignored). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string1</option>: first string for comparison - </para> - </listitem> - <listitem> - <para> - <option>string2</option>: second string for comparison - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: difference between first char of each string: negative if - char1 < char2, zero if char1 == char2, positive if char1 > char2 - </para> - <para> - Example: - <screen>if (weechat_utf8_charcasecmp (string1, string2) != 0) ...</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_char_size_screen"> - <title>weechat_utf8_char_size_screen</title> - - <para> - Prototype: -<programlisting> -int weechat_utf8_char_size_screen (const char *string); -</programlisting> - </para> - <para> - Return number of chars needed on screen to display UTF-8 char. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: number of chars needed on screen to display UTF-8 char. - </para> - <para> - Example: - <screen>int length_on_screen = weechat_utf8_char_size_screen (string)</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_add_offset"> - <title>weechat_utf8_add_offset</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_add_offset (const char *string, int offset); -</programlisting> - </para> - <para> - Move forward N chars in an UTF-8 string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>offset</option>: number of chars - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to string, N chars after (NULL if it's not - reachable). - </para> - <para> - Example: - <screen>char *ptr = weechat_utf8_add_offset ("chêne", 3); /* points to "ne" */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_real_pos"> - <title>weechat_utf8_real_pos</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_real_pos (const char *string, int pos); -</programlisting> - </para> - <para> - Get real position in UTF-8 string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>pos</option>: position in chars - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: real position (in bytes) for "pos" chars in string. - </para> - <para> - Example: - <screen>int pos = weechat_utf8_real_pos ("chêne", 3); /* == 4 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_pos"> - <title>weechat_utf8_pos</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_pos (const char *string, int real_pos); -</programlisting> - </para> - <para> - Get position in UTF-8 string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>real_pos</option>: position in bytes - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: position (in chars) for "real_pos" bytes in string. - </para> - <para> - Example: - <screen>int pos = weechat_utf8_real_pos ("chêne", 4); /* == 3 */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_utf8_strndup"> - <title>weechat_utf8_strndup</title> - - <para> - Prototype: -<programlisting> -char *weechat_utf8_strndup (const char *string, int max_chars); -</programlisting> - </para> - <para> - Return duplicate string, with max N chars. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>string</option>: string - </para> - </listitem> - <listitem> - <para> - <option>max_chars</option>: max chars - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: duplicated string, NULL if error. - </para> - <para> - Example: - <screen>char *string = weechat_utf8_strndup ("chêne", 3); /* returns "chê" */</screen> - </para> - </section> - - </section> - - <!-- ===========================[ directories ]========================== --> - - <section id="secPluginCApi_directories"> - <title>Directories</title> - - <para> - Some functions related to directories. - </para> - - <section id="secPluginCApi_weechat_mkdir_home"> - <title>weechat_mkdir_home</title> - - <para> - Prototype: -<programlisting> -int weechat_mkdir_home (char *directory, int mode); -</programlisting> - </para> - <para> - Create a directory in WeeChat home. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>directory</option>: directory to create - </para> - </listitem> - <listitem> - <para> - <option>mode</option>: mode for new directory - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if directory was successfully created, 0 if an - error occurred. - </para> - <para> - Example: - <screen>if (!weechat_mkdir_home ("temp")) ... </screen> - </para> - </section> - - <section id="secPluginCApi_weechat_mkdir"> - <title>weechat_mkdir</title> - - <para> - Prototype: -<programlisting> -int weechat_mkdir (char *directory, int mode); -</programlisting> - </para> - <para> - Create a directory. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>directory</option>: directory to create - </para> - </listitem> - <listitem> - <para> - <option>mode</option>: mode for new directory - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if directory was successfully created, 0 if an - error occurred. - </para> - <para> - Example: - <screen>if (!weechat_mkdir ("/tmp/mydir")) ... </screen> - </para> - </section> - - <section id="secPluginCApi_weechat_mkdir_parents"> - <title>weechat_mkdir_parents</title> - - <para> - Prototype: -<programlisting> -int weechat_mkdir_parents (char *directory, int mode); -</programlisting> - </para> - <para> - Create a directory and make parent directories as needed. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>directory</option>: directory to create - </para> - </listitem> - <listitem> - <para> - <option>mode</option>: mode for new directory (and parents) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if directory was successfully created, 0 if an - error occurred. - </para> - <para> - Example: - <screen>if (!weechat_mkdir_parents ("/tmp/my/dir")) ... </screen> - </para> - </section> - - <section id="secPluginCApi_weechat_exec_on_files"> - <title>weechat_exec_on_files</title> - - <para> - Prototype: -<programlisting> -void weechat_exec_on_files ( - const char *directory, - void *data, - int (*callback)(void *data, const char *filename)); -</programlisting> - </para> - <para> - Find files in a directory and execute a callback on each file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>directory</option>: directory for searching files - </para> - </listitem> - <listitem> - <para> - <option>data</option>: pointer given to callback when it is - called by WeeChat - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called for each file - found, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>filename</entry> - <entry>filename found</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: -<screen> -int callback (void *data, const char *filename) -{ - /* ... */ - return 1; -} -... -plugin->exec_on_files (plugin, "/tmp", &callback); -</screen> - </para> - </section> - - </section> - - <!-- ==============================[ util ]============================== --> - - <section id="secPluginCApi_util"> - <title>Util</title> - - <para> - Some useful functions. - </para> - - <section id="secPluginCApi_weechat_timeval_cmp"> - <title>weechat_timeval_cmp</title> - - <para> - Prototype: -<programlisting> -int weechat_timeval_cmp (struct timeval *tv1, struct timeval *tv2); -</programlisting> - </para> - <para> - Compare 2 timeval structures. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>tv1</option>: first timeval structure - </para> - </listitem> - <listitem> - <para> - <option>tv2</option>: second timeval structure - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: -1 if tv1 < char2, zero if tv1 == tv2, +1 if tv1 > - tv2 - </para> - <para> - Example: - <screen>if (weechat_timeval_cmp (&tv1, &tv2) > 0) ...</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_timeval_diff"> - <title>weechat_timeval_diff</title> - - <para> - Prototype: -<programlisting> -long weechat_timeval_diff (struct timeval *tv1, struct timeval *tv2); -</programlisting> - </para> - <para> - Return difference (in milliseconds) between 2 timeval structures. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>tv1</option>: first timeval structure - </para> - </listitem> - <listitem> - <para> - <option>tv2</option>: second timeval structure - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: difference in milliseconds. - </para> - <para> - Example: - <screen>long diff = weechat_timeval_diff (&tv1, &tv2);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_timeval_add"> - <title>weechat_timeval_add</title> - - <para> - Prototype: -<programlisting> -void weechat_timeval_add (struct timeval *tv, long interval); -</programlisting> - </para> - <para> - Add interval (in milliseconds) to a timeval structure. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>tv</option>: timeval structure - </para> - </listitem> - <listitem> - <para> - <option>interval</option>: interval (in milliseconds) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: none. - </para> - <para> - Example: - <screen>weechat_timeval_add (&tv, 2000); /* add 2 seconds */</screen> - </para> - </section> - - </section> - - <!-- ==========================[ sorted list ]=========================== --> - - <section id="secPluginCApi_sorted_list"> - <title>Sorted lists</title> - - <para> - Sorted list functions. - </para> - - <section id="secPluginCApi_weechat_list_new"> - <title>weechat_list_new</title> - - <para> - Prototype: -<programlisting> -struct t_weelist *weechat_list_new (); -</programlisting> - </para> - <para> - Create a new list. - </para> - <para> - Return value: pointer to new list. - </para> - <para> - Example: - <screen>struct t_weelist *list = weechat_list_new ();</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_add"> - <title>weechat_list_add</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_add ( - struct t_weelist *weelist, - const char *data, - const char *where, - void *user_data); -</programlisting> - </para> - <para> - Add an item in a list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>weelist</option>: list pointer - </para> - </listitem> - <listitem> - <para> - <option>data</option>: data to insert in list - </para> - </listitem> - <listitem> - <para> - <option>where</option>: position in list (constants are: - WEECHAT_LIST_POS_SORT, WEECHAT_LIST_POS_BEGINNING or - WEECHAT_LIST_POS_END) - </para> - </listitem> - <listitem> - <para> - <option>user_data</option>: any pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new item. - </para> - <para> - Example: - <screen>weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT, NULL);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_search"> - <title>weechat_list_search</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_search ( - struct t_weelist *weelist, - const char *data); -</programlisting> - </para> - <para> - Search an item in a list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>weelist</option>: list pointer - </para> - </listitem> - <listitem> - <para> - <option>data</option>: data to search in list - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to item found, NULL if item was not found. - </para> - <para> - Example: - <screen>struct t_weelist_item *item = weechat_list_search (list, "my data");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_casesearch"> - <title>weechat_list_casesearch</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_casesearch ( - struct t_weelist *weelist, - const char *data); -</programlisting> - </para> - <para> - Search an item in a list (case sensitive search). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>weelist</option>: list pointer - </para> - </listitem> - <listitem> - <para> - <option>data</option>: data to search in list - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to item found, NULL if item was not found. - </para> - <para> - Example: - <screen>struct t_weelist_item *item = weechat_list_casesearch (list, "my data");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_get"> - <title>weechat_list_get</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_get ( - struct t_weelist *weelist, - int position); -</programlisting> - </para> - <para> - Get an item in a list by position. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>weelist</option>: list pointer - </para> - </listitem> - <listitem> - <para> - <option>position</option>: position in list (0 is first item) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to item found, NULL if item position was not - found. - </para> - <para> - Example: - <screen>struct t_weelist_item *item = weechat_list_get (list, 0); /* first item */</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_set"> - <title>weechat_list_set</title> - - <para> - Prototype: -<programlisting> -void weechat_list_set (struct t_weelist_item *item, const char *value); -</programlisting> - </para> - <para> - Set new value for an item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: item pointer - </para> - </listitem> - <listitem> - <para> - <option>value</option>: new value for item - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_list_set (item, "new data");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_next"> - <title>weechat_list_next</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_next (struct t_weelist_item *item); -</programlisting> - </para> - <para> - Get next item in list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: item pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to next item, NULL if pointer was last item in - list. - </para> - <para> - Example: - <screen>struct t_weelist_item *next_item = weechat_list_next_item (item);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_prev"> - <title>weechat_list_prev</title> - - <para> - Prototype: -<programlisting> -struct t_weelist_item *weechat_list_prev (struct t_weelist_item *item); -</programlisting> - </para> - <para> - Get previous item in list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: item pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to previous item, NULL if pointer was first item - in list. - </para> - <para> - Example: - <screen>struct t_weelist_item *prev_item = weechat_list_prev_item (item);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_string"> - <title>weechat_list_string</title> - - <para> - Prototype: -<programlisting> -const char *weechat_list_string (struct t_weelist_item *item); -</programlisting> - </para> - <para> - Get string value of an item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: item pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string value of item. - </para> - <para> - Example: - <screen>char *value = weechat_list_string (item);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_size"> - <title>weechat_list_size</title> - - <para> - Prototype: -<programlisting> -char *weechat_list_size (struct t_weelist *weelist); -</programlisting> - </para> - <para> - Get size of list (number of items). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>weelist</option>: list pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: size of list (number of items), 0 if list is empty. - </para> - <para> - Example: - <screen>int size = weechat_list_size (list);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_remove"> - <title>weechat_list_remove</title> - - <para> - Prototype: -<programlisting> -void weechat_list_remove ( - struct t_weelist *weelist, - struct t_weelist_item *item); -</programlisting> - </para> - <para> - Remove an item in a list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>list</option>: list pointer - </para> - </listitem> - <listitem> - <para> - <option>item</option>: item pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_list_remove (list, item);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_remove_all"> - <title>weechat_list_remove_all</title> - - <para> - Prototype: -<programlisting> -void weechat_list_remove_all (struct t_weelist *weelist); -</programlisting> - </para> - <para> - Remove all items in a list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>list</option>: list pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_list_remove_all (list);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_list_free"> - <title>weechat_list_free</title> - - <para> - Prototype: -<programlisting> -void weechat_list_free (struct t_weelist *weelist); -</programlisting> - </para> - <para> - Free a list. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>list</option>: list pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_list_free (list);</screen> - </para> - </section> - - </section> - - <!-- ==========================[ config files ]========================== --> - - <section id="secPluginCApi_configuration_files"> - <title>Configuration files</title> - - <para> - Functions for configuration files. - </para> - - <section id="secPluginCApi_weechat_config_new"> - <title>weechat_config_new</title> - - <para> - Prototype: -<programlisting> -struct t_config_file *weechat_config_new ( - const char *name, - int (*callback_reload)(void *data, - struct t_config_file *config_file), - void *callback_reload_data); -</programlisting> - </para> - <para> - Create a new configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: name of configuration file (without path - or extension) - </para> - </listitem> - <listitem> - <para> - <option>callback_reload</option>: callback called when - configuration file is reloaded with /reload (optional, can be - NULL), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_reload_data</option>: pointer given to reload - callback when it is called by WeeChat - NULL) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new configuration file, NULL if an error - occured. - </para> - <note> - <para> - File is NOT created by this function. It will be created by call to - function <xref linkend="secPluginCApi_weechat_config_write" /> (you - should do that only after adding some sections (with - <xref linkend="secPluginCApi_weechat_config_new_section" />) and - options (with - <xref linkend="secPluginCApi_weechat_config_new_option" />). - </para> - </note> - <para> - Example: -<screen> -int -my_config_reload_cb (void *data, struct t_config_file *config_file) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -struct t_config_file *config_file = weechat_config_new ("test", - &my_config_reload_cb, - NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_new_section"> - <title>weechat_config_new_section</title> - - <para> - Prototype: -<programlisting> -struct t_config_section *weechat_config_new_section ( - struct t_config_file *config_file, - const char *name, - int user_can_add_options, - int user_can_delete_options, - int (*callback_read)(void *data, - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name, - const char *value), - void *callback_read_data, - int (*callback_write)(void *data, - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name), - void *callback_write_data, - int (*callback_write_default)(void *data, - struct t_config_file *config_file, - const char *section_name); - void *callback_write_default_data, - int (*callback_create_option)(void *data, - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name, - const char *value), - void *callback_create_option_data, - int (*callback_delete_option)(void *data, - struct t_config_file *config_file, - struct t_config_section *section, - struct t_config_option *option), - void *callback_delete_option_data); -</programlisting> - </para> - <para> - Create a new section in configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: name of section - </para> - </listitem> - <listitem> - <para> - <option>user_can_add_options</option>: 1 if user can add options - in section, or 0 if it is forbidden - </para> - </listitem> - <listitem> - <para> - <option>user_can_delete_options</option>: 1 if user can delete - options in section, or 0 if it is forbidden - </para> - </listitem> - <listitem> - <para> - <option>callback_read</option>: callback called when an option - in section is read from disk (should be NULL for most cases, - except if options in your section need custom function), - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>struct t_config_section *</entry> - <entry>section</entry> - <entry>section pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>option_name</entry> - <entry>name of option</entry> - </row> - <row> - <entry>const char *</entry> - <entry>value</entry> - <entry>value</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_read_data</option>: pointer given to read - callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_write</option>: callback called when section - is written in file (should be NULL for most cases, except if your - section needs to be written by a custom function), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>struct t_config_section *</entry> - <entry>section</entry> - <entry>section pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>option_name</entry> - <entry>name of option</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_write_data</option>: pointer given to write - callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_write_default</option>: callback called when - default values for section must be written in file, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>section_name</entry> - <entry>name of section</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_write_default_data</option>: pointer given to - write_default callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_create_option</option>: callback called when a - new option is created in section (NULL if section does not allow - new options to be created), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>struct t_config_section *</entry> - <entry>section</entry> - <entry>section pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>option_name</entry> - <entry>name of option</entry> - </row> - <row> - <entry>const char *</entry> - <entry>value</entry> - <entry>value</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_create_option_data</option>: pointer given to - create_option callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_delete_option</option>: callback called when an - option is deleted (NULL if section does not allow options to be - deleted), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_file *</entry> - <entry>config_file</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>struct t_config_section *</entry> - <entry>section</entry> - <entry>section pointer</entry> - </row> - <row> - <entry>struct t_config_option *option</entry> - <entry>option</entry> - <entry>option pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_delete_option_data</option>: pointer given to - delete_option callback when it is called by WeeChat - NULL) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new section in configuration file, NULL if an - error occured. - </para> - <para> - Example: -<screen> -int -my_section_read_cb (void *data, struct t_config_file *config_file, - struct t_config_section *section, const char *option_name, - const char *value) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -int -my_section_write_cb (void *data, struct t_config_file *config_file, - const char *section_name) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -int -my_section_write_default_cb (void *data, struct t_config_file *config_file, - const char *section_name) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -int -my_section_create_option_cb (void *data, struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name, const char *value) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -int -my_section_delete_option_cb (void *data, struct t_config_file *config_file, - struct t_config_section *section, - struct t_config_option *option) -{ - /* ... */ - - return WEECHAT_RC_OK; -} - -/* standard section, user can not add/delete options */ -struct t_config_section *new_section1 = - weechat_config_new ("section1", 0, 0, - NULL, NULL, /* read callback */ - NULL, NULL, /* write callback */ - NULL, NULL, /* write default callback */ - NULL, NULL, /* create option callback */ - NULL, NULL); /* delete option callback */ - -/* special section, user can add/delete options, and options need - callback to be read/written */ -struct t_config_section *new_section2 = - weechat_config_new ("section2", 1, 1, - &my_section_read_cb, NULL, - &my_section_write_cb, NULL, - &my_section_write_default_cb, NULL, - &my_section_create_option_cb, NULL, - &my_section_delete_option_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_search_section"> - <title>weechat_config_search_section</title> - - <para> - Prototype: -<programlisting> -struct t_config_section *weechat_config_search_section ( - struct t_config_file *config_file, - const char *section_name); -</programlisting> - </para> - <para> - Search a section in a configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>section_name</option>: name of section to search - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to section found, NULL if section was not found. - </para> - <para> - Example: -<screen> -struct t_config_section *section = weechat_config_search_section (config_file, "section"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_new_option"> - <title>weechat_config_new_option</title> - - <para> - Prototype: -<programlisting> -struct t_config_option *weechat_config_new_option ( - struct t_config_file *config_file, - struct t_config_section *section, - const char *name, - const char *type, - const char *description, - const char *string_values, - int min, - int max, - const char *default_value, - const char *value, - int null_value_allowed, - int (*callback_check_value)(void *data, - struct t_config_option *option, - const char *value), - void *callback_check_value_data, - int (*callback_change)(void *data, - struct t_config_option *option), - void *callback_change_data, - int (*callback_delete)(void *data, - struct t_config_option *option), - void *callback_delete_data); -</programlisting> - </para> - <para> - Create a new option in a section of a configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>section</option>: section pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: name of option - </para> - </listitem> - <listitem> - <para> - <option>type</option>: type of option, one of: - <itemizedlist> - <listitem> - <para>boolean</para> - </listitem> - <listitem> - <para>integer</para> - </listitem> - <listitem> - <para>string</para> - </listitem> - <listitem> - <para>color</para> - </listitem> - </itemizedlist> - </para> - </listitem> - <listitem> - <para> - <option>description</option>: description of option - </para> - </listitem> - <listitem> - <para> - <option>string_values</option>: values as string (separated by - "|"), used for type integer (optional) - </para> - </listitem> - <listitem> - <para> - <option>min</option>: minimum value (for integer) - NULL) - </para> - </listitem> - <listitem> - <para> - <option>max</option>: maximum value (for integer) - </para> - </listitem> - <listitem> - <para> - <option>default_value</option>: default value for option (used - when option is reset) - </para> - </listitem> - <listitem> - <para> - <option>value</option>: value for option - </para> - </listitem> - <listitem> - <para> - <option>null_value_allowed</option>: 1 if null (undefined value) - is allowed for option, otherwise 0 - </para> - </listitem> - <listitem> - <para> - <option>callback_check_value</option>: callback called to check - new value for an option (optional), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_option *</entry> - <entry>option</entry> - <entry>option pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>value</entry> - <entry>new value for option</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_check_value_data</option>: pointer given to - check_value callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_change</option>: callback called when value of - option has changed (optional), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_option *</entry> - <entry>option</entry> - <entry>option pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_change_data</option>: pointer given to change - callback when it is called by WeeChat - NULL) - </para> - </listitem> - <listitem> - <para> - <option>callback_delete</option>: callback called when option - will be deleted (optional), arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_config_option *</entry> - <entry>option</entry> - <entry>option pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_delete_data</option>: pointer given to delete - callback when it is called by WeeChat - NULL) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new option in section, NULL if an error - occured. - </para> - <para> - Example: -<screen> -/* boolean */ -struct t_config_option *option1 = - weechat_config_new_option (config_file, section, - "option1", "My option, type boolean" - NULL, /* string values */ - 0, 0, /* min, max */ - "on", /* default */ - "on", /* value */ - 0, /* null value allowed */ - NULL, NULL, /* check callback */ - NULL, NULL, /* change callback */ - NULL, NULL); /* delete callback */ - -/* integer */ -struct t_config_option *option2 = - weechat_config_new_option (config_file, section, - "option2", "My option, type integer" - NULL, /* string values */ - 0, 100, /* min, max */ - "15", /* default */ - "15", /* value */ - 0, /* null value allowed */ - NULL, NULL, /* check callback */ - NULL, NULL, /* change callback */ - NULL, NULL); /* delete callback */ - -/* integer (with string values) */ -struct t_config_option *option3 = - weechat_config_new_option (config_file, section, - "option3", "My option, type integer (with string values)" - "top|bottom|left|right", /* string values */ - 0, 0, /* min, max */ - "bottom", /* default */ - "bottom", /* value */ - 0, /* null value allowed */ - NULL, NULL, /* check callback */ - NULL, NULL, /* change callback */ - NULL, NULL); /* delete callback */ - -/* string */ -struct t_config_option *option4 = - weechat_config_new_option (config_file, section, - "option4", "My option, type string" - NULL, /* string values */ - 0, 0, /* min, max */ - "test", /* default */ - "test", /* value */ - 1, /* null value allowed */ - NULL, NULL, /* check callback */ - NULL, NULL, /* change callback */ - NULL, NULL); /* delete callback */ - -/* color */ -struct t_config_option *option5 = - weechat_config_new_option (config_file, section, - "option5", "My option, type color" - NULL, /* string values */ - 0, 0, /* min, max */ - "lightblue", /* default */ - "lightblue", /* value */ - 0, /* null value allowed */ - NULL, NULL, /* check callback */ - NULL, NULL, /* change callback */ - NULL, NULL); /* delete callback */ -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_search_option"> - <title>weechat_config_search_option</title> - - <para> - Prototype: -<programlisting> -struct t_config_option *weechat_config_search_option ( - struct t_config_file *config_file, - struct t_config_section *section, - const char *option_name); -</programlisting> - </para> - <para> - Search an option in a section of a configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>section</option>: section pointer - </para> - </listitem> - <listitem> - <para> - <option>option_name</option>: name of option to search - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to option found, NULL if option was not found. - </para> - <para> - Example: -<screen> -struct t_config_option *option = - weechat_config_search_option (config_file, section, "option"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_search_with_string"> - <title>weechat_config_search_with_string</title> - - <para> - Prototype: -<programlisting> -void weechat_config_search_with_string ( - const char *option_name, - struct t_config_file **config_file, - struct t_config_section **section, - struct t_config_option **option); -</programlisting> - </para> - <para> - Search an option in a configuration file with string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: full option name (format: - "file.section.option") - </para> - </listitem> - <listitem> - <para> - <option>config_file</option>: pointer to a configuration file - pointer, will be set to configuration file of option, if found - </para> - </listitem> - <listitem> - <para> - <option>section</option>: pointer to a section pointer, will be - set to section of option, if found - </para> - </listitem> - <listitem> - <para> - <option>option</option>: pointer to an option pointer, will be - set to option pointer, if found - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -struct t_config_file *ptr_config_file; -struct t_config_section *ptr_section; -struct t_config_option *ptr_option; - -weechat_config_search_with_string ("file.section.option", - &ptr_config_file, - &ptr_section, - &ptr_option); -if (ptr_option) -{ - /* option found */ - /* ... */ -} -else -{ - /* option not found */ - /* ... */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_string_to_boolean"> - <title>weechat_config_string_to_boolean</title> - - <para> - Prototype: -<programlisting> -int weechat_config_string_to_boolean (const char *text); -</programlisting> - </para> - <para> - Check if a text is "true" or "false". - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>text</option>: text to analyze - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if text is "true" ("on", "yes", "y", "true", "t", "1"), - or 0 if text is "false" ("off", "no", "n", "false", "f", "0"). - </para> - <para> - Example: -<screen> -if (weechat_config_string_to_boolean ("on")) -{ - /* true */ - /* ... */ -} -else -{ - /* false */ - /* never executed! */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_reset"> - <title>weechat_config_option_reset</title> - - <para> - Prototype: -<programlisting> -int weechat_config_option_reset ( - struct t_config_option *option, - int run_callback); -</programlisting> - </para> - <para> - Reset an option to its default value. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - <listitem> - <para> - <option>run_callback</option>: 1 for calling change callback if - option is changed, 0 otherwise - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_OPTION_SET_OK_CHANGED if option value has - been reset, WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE if value was not - changed, WEECHAT_CONFIG_OPTION_SET_ERROR if an error occured. - </para> - <para> - Example: -<screen> -switch (weechat_config_option_reset (option, 1)) -{ - case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_ERROR: - /* .... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_set"> - <title>weechat_config_option_set</title> - - <para> - Prototype: -<programlisting> -int weechat_config_option_set ( - struct t_config_option *option, - const char *value, int run_callback); -</programlisting> - </para> - <para> - Set new value for an option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - <listitem> - <para> - <option>value</option>: new value for option - </para> - </listitem> - <listitem> - <para> - <option>run_callback</option>: 1 for calling change callback if - option is changed, 0 otherwise - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_OPTION_SET_OK_CHANGED if option value has - been reset, WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE if value was not - changed, WEECHAT_CONFIG_OPTION_SET_ERROR if an error occured. - </para> - <para> - Example: -<screen> -switch (weechat_config_option_set (option, "new_value", 1)) -{ - case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_ERROR: - /* .... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_set_null"> - <title>weechat_config_option_set_null</title> - - <para> - Prototype: -<programlisting> -int weechat_config_option_set_null ( - struct t_config_option *option, - int run_callback); -</programlisting> - </para> - <para> - Set null (undefined value) for an option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - <listitem> - <para> - <option>run_callback</option>: 1 for calling change callback if - option is changed (if it was not null), 0 otherwise - </para> - </listitem> - </itemizedlist> - </para> - <note> - <para> - You can set value to null only if option allows null value - (see <xref linkend="secPluginCApi_weechat_config_new_option" />). - </para> - </note> - <para> - Return value: WEECHAT_CONFIG_OPTION_SET_OK_CHANGED if option value has - been reset, WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE if value was not - changed, WEECHAT_CONFIG_OPTION_SET_ERROR if an error occured. - </para> - <para> - Example: -<screen> -switch (weechat_config_option_set_null (option, 1)) -{ - case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_SET_ERROR: - /* .... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_unset"> - <title>weechat_config_option_unset</title> - - <para> - Prototype: -<programlisting> -int weechat_config_option_unset (struct t_config_option *option); -</programlisting> - </para> - <para> - Unset/reset option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET if option value - has not been reset, WEECHAT_CONFIG_OPTION_UNSET_OK_RESET if option - value has been reset, WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED if option - has been removed, WEECHAT_CONFIG_OPTION_UNSET_ERROR if an error - occured. - </para> - <para> - Example: -<screen> -switch (weechat_config_option_unset (option)) -{ - case WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_UNSET_OK_RESET: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED: - /* .... */ - break; - case WEECHAT_CONFIG_OPTION_UNSET_ERROR: - /* .... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_rename"> - <title>weechat_config_option_rename</title> - - <para> - Prototype: -<programlisting> -void weechat_config_option_rename ( - struct t_config_option *option, - const char *new_name); -</programlisting> - </para> - <para> - Rename an option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - <listitem> - <para> - <option>new_name</option>: new name for option - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_config_option_rename (option, "new_name"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_get_pointer"> - <title>weechat_config_option_get_pointer</title> - - <para> - Prototype: -<programlisting> -void *weechat_config_option_get_pointer ( - struct t_config_option *option, - const char *property); -</programlisting> - </para> - <para> - Get a pointer on an option property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Property</entry> - <entry>Type</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>config_file</entry> - <entry>struct t_config_file *</entry> - <entry>configuration file pointer</entry> - </row> - <row> - <entry>section</entry> - <entry>struct t_config_section *</entry> - <entry>section pointer</entry> - </row> - <row> - <entry>name</entry> - <entry>char *</entry> - <entry>option name</entry> - </row> - <row> - <entry>type</entry> - <entry>int</entry> - <entry>option type</entry> - </row> - <row> - <entry>description</entry> - <entry>char *</entry> - <entry>option description</entry> - </row> - <row> - <entry>string_values</entry> - <entry>char **</entry> - <entry>string values</entry> - </row> - <row> - <entry>min</entry> - <entry>int</entry> - <entry>minimum value</entry> - </row> - <row> - <entry>max</entry> - <entry>int</entry> - <entry>maximum value</entry> - </row> - <row> - <entry>default_value</entry> - <entry>(depends on type)</entry> - <entry>default value</entry> - </row> - <row> - <entry>value</entry> - <entry>(depends on type)</entry> - <entry>current value</entry> - </row> - <row> - <entry>prev_option</entry> - <entry>struct t_config_option *</entry> - <entry>previous option pointer</entry> - </row> - <row> - <entry>next_option</entry> - <entry>struct t_config_option *</entry> - <entry>next option pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to property asked. - </para> - <para> - Example: -<screen> -char *description = weechat_config_option_get_pointer (option, "description"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_is_null"> - <title>weechat_config_option_is_null</title> - - <para> - Prototype: -<programlisting> -int weechat_config_option_is_null (struct t_config_option *option); -</programlisting> - </para> - <para> - Check if an option is null (undefined value). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -if (weechat_config_option_is_null (option)) -{ - /* value is null */ -} -else -{ - /* value is not null */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_boolean"> - <title>weechat_config_boolean</title> - - <para> - Prototype: -<programlisting> -int weechat_config_boolean (struct t_config_option *option); -</programlisting> - </para> - <para> - Get boolean value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: boolean value of option (0 or 1). - </para> - <para> - Example: -<screen> -if (weechat_config_boolean (option)) -{ - /* true */ -} -else -{ - /* false */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_boolean_default"> - <title>weechat_config_boolean_default</title> - - <para> - Prototype: -<programlisting> -int weechat_config_boolean_default (struct t_config_option *option); -</programlisting> - </para> - <para> - Get default boolean value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: default boolean value of option (0 or 1). - </para> - <para> - Example: -<screen> -if (weechat_config_boolean_default (option)) -{ - /* true */ -} -else -{ - /* false */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_integer"> - <title>weechat_config_integer</title> - - <para> - Prototype: -<programlisting> -int weechat_config_integer (struct t_config_option *option); -</programlisting> - </para> - <para> - Get integer value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: integer value of option. - </para> - <para> - Example: - <screen>int value = weechat_config_integer (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_integer_default"> - <title>weechat_config_integer_default</title> - - <para> - Prototype: -<programlisting> -int weechat_config_integer_default (struct t_config_option *option); -</programlisting> - </para> - <para> - Get default integer value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: default integer value of option. - </para> - <para> - Example: - <screen>int value = weechat_config_integer (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_string"> - <title>weechat_config_string</title> - - <para> - Prototype: -<programlisting> -const char *weechat_config_string (struct t_config_option *option); -</programlisting> - </para> - <para> - Get string value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string value of option. - </para> - <para> - Example: - <screen>char *value = weechat_config_string (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_string_default"> - <title>weechat_config_string_default</title> - - <para> - Prototype: -<programlisting> -const char *weechat_config_string_default (struct t_config_option *option); -</programlisting> - </para> - <para> - Get default string value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: default string value of option. - </para> - <para> - Example: - <screen>char *value = weechat_config_string_default (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_color"> - <title>weechat_config_color</title> - - <para> - Prototype: -<programlisting> -const char *weechat_config_color (struct t_config_option *option); -</programlisting> - </para> - <para> - Get color value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: color value of option (string with name of color). - </para> - <para> - Example: - <screen>char *color = weechat_config_color (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_color_default"> - <title>weechat_config_color_default</title> - - <para> - Prototype: -<programlisting> -const char *weechat_config_color_default (struct t_config_option *option); -</programlisting> - </para> - <para> - Get default color value of option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: default color value of option (string with name of color). - </para> - <para> - Example: - <screen>char *color = weechat_config_color_default (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_write_option"> - <title>weechat_config_write_option</title> - - <para> - Prototype: -<programlisting> -void weechat_config_write_option ( - struct t_config_file *config_file, - struct t_config_option *option); -</programlisting> - </para> - <para> - Write a line in a configuration file with option and its value (this - function should be called only in "write" or "write_default" callbacks - for a section). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -int -my_section_write_cb (void *data, struct t_config_file *config_file, - const char *section_name) -{ - weechat_config_write_line (config_file, "my_section", NULL); - - weechat_config_write_option (config_file, option); - - return WEECHAT_RC_OK; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_write_line"> - <title>weechat_config_write_line</title> - - <para> - Prototype: -<programlisting> -void weechat_config_write_line ( - struct t_config_file *config_file, - const char *option_name, - const char *value, ...); -</programlisting> - </para> - <para> - Write a line in a configuration file (this function should be called - only in "write" or "write_default" callbacks for a section). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - <listitem> - <para> - <option>option_name</option>: option name - </para> - </listitem> - <listitem> - <para> - <option>value</option>: value - </para> - </listitem> - </itemizedlist> - </para> - <note> - <para> - If value is NULL, then line with section name is written - (for example: "[section]"). - </para> - </note> - <para> - Example: -<screen> -int -my_section_write_cb (void *data, struct t_config_file *config_file, - const char *section_name) -{ - weechat_config_write_line (config_file, "my_section", NULL); - - weechat_config_write_line (config_file, "option", "%s;%d", - "value", 123); - - return WEECHAT_RC_OK; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_write"> - <title>weechat_config_write</title> - - <para> - Prototype: -<programlisting> -int weechat_config_write (struct t_config_file *config_file); -</programlisting> - </para> - <para> - Write configuration file to disk. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_WRITE_OK if configuration was written, - WEECHAT_CONFIG_WRITE_ERROR if an error occured, - WEECHAT_CONFIG_WRITE_MEMORY_ERROR if there was not enough memory. - </para> - <para> - Example: -<screen> -switch (weechat_config_write (config_file)) -{ - case WEECHAT_CONFIG_WRITE_OK: - /* ... */ - break; - case WEECHAT_CONFIG_WRITE_ERROR: - /* ... */ - break; - case WEECHAT_CONFIG_WRITE_MEMORY_ERROR: - /* ... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_read"> - <title>weechat_config_read</title> - - <para> - Prototype: -<programlisting> -int weechat_config_read (struct t_config_file *config_file); -</programlisting> - </para> - <para> - Read configuration file from disk. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_READ_OK if configuration was loaded, - WEECHAT_CONFIG_READ_MEMORY_ERROR if there was not enough memory, - WEECHAT_CONFIG_READ_FILE_NOT_FOUND if file was not found. - </para> - <para> - Example: -<screen> -switch (weechat_config_read (config_file)) -{ - case WEECHAT_CONFIG_READ_OK: - /* ... */ - break; - case WEECHAT_CONFIG_READ_MEMORY_ERROR: - /* ... */ - break; - case WEECHAT_CONFIG_READ_FILE_NOT_FOUND: - /* ... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_reload"> - <title>weechat_config_reload</title> - - <para> - Prototype: -<programlisting> -int weechat_config_reload (struct t_config_file *config_file); -</programlisting> - </para> - <para> - Reload configuration file from disk. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_READ_OK if configuration was reloaded, - WEECHAT_CONFIG_READ_MEMORY_ERROR if there was not enough memory, - WEECHAT_CONFIG_READ_FILE_NOT_FOUND if file was not found. - </para> - <para> - Example: -<screen> -switch (weechat_config_reload (config_file)) -{ - case WEECHAT_CONFIG_READ_OK: - /* ... */ - break; - case WEECHAT_CONFIG_READ_MEMORY_ERROR: - /* ... */ - break; - case WEECHAT_CONFIG_READ_FILE_NOT_FOUND: - /* ... */ - break; -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_option_free"> - <title>weechat_config_option_free</title> - - <para> - Prototype: -<programlisting> -void weechat_config_option_free (struct t_config_option *option); -</programlisting> - </para> - <para> - Free an option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_config_option_free (option);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_section_free_options"> - <title>weechat_config_section_free_options</title> - - <para> - Prototype: -<programlisting> -void weechat_config_section_free_options (struct t_config_section *section); -</programlisting> - </para> - <para> - Free all options in a section. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>section</option>: section pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_config_section_free_options (section);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_section_free"> - <title>weechat_config_section_free</title> - - <para> - Prototype: -<programlisting> -void weechat_config_section_free (struct t_config_section *section); -</programlisting> - </para> - <para> - Free a section. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>section</option>: section pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_config_section_free (section);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_free"> - <title>weechat_config_free</title> - - <para> - Prototype: -<programlisting> -void weechat_config_free (struct t_config_file *config_file); -</programlisting> - </para> - <para> - Free a configuration file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>config_file</option>: configuration file pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_config_free (config_file);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_get"> - <title>weechat_config_get</title> - - <para> - Prototype: -<programlisting> -struct t_config_option *weechat_config_get (const char *option_name); -</programlisting> - </para> - <para> - Search an option in a configuration file with string. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: full option name (format: - "file.section.option") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to option found, NULL if option was not found. - </para> - <para> - Example: -<screen> -struct t_config_option *option = weechat_config_get ("weechat.look.item_time_format"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_get_plugin"> - <title>weechat_config_get_plugin</title> - - <para> - Prototype: -<programlisting> -const char *weechat_config_get_plugin (const char *option_name); -</programlisting> - </para> - <para> - Search an option in plugins configuration file (plugins.conf), by - adding prefix with current plugin name. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: option name, WeeChat will add - prefix "plugins.var.xxxx." (where xxxx is current plugin name). - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to option found, NULL if option was not found. - </para> - <para> - Example: -<screen> -/* if current plugin is "test", then look for value of option - "plugins.var.test.option" in plugins.conf file */ -char *value = weechat_config_get_plugin ("option"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_is_set_plugin"> - <title>weechat_config_is_set_plugin</title> - - <para> - Prototype: -<programlisting> -int weechat_config_is_set_plugin (const char *option_name); -</programlisting> - </para> - <para> - Check if option is set in plugins configuration file (plugins.conf). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: option name, WeeChat will add - prefix "plugins.var.xxxx." (where xxxx is current plugin name). - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if option is set, 0 if option does not exist. - </para> - <para> - Example: -<screen> -if (weechat_config_is_set_plugin ("option")) -{ - /* ... */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_set_plugin"> - <title>weechat_config_set_plugin</title> - - <para> - Prototype: -<programlisting> -int weechat_config_set_plugin (const char *option_name, const char *value); -</programlisting> - </para> - <para> - Set value for option in plugins configuration file (plugins.conf). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: option name, WeeChat will add - prefix "plugins.var.xxxx." (where xxxx is current plugin name). - </para> - </listitem> - <listitem> - <para> - <option>value</option>: value for option - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_OPTION_SET_OK_CHANGED if option value has - been reset, WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE if value was not - changed, WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND if option was not - found, WEECHAT_CONFIG_OPTION_SET_ERROR if other error occured. - </para> - <para> - Example: -<screen> -weechat_config_set_plugin ("option", "test_value"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_config_unset_plugin"> - <title>weechat_config_unset_plugin</title> - - <para> - Prototype: -<programlisting> -int weechat_config_unset_plugin (const char *option_name); -</programlisting> - </para> - <para> - Unset option in plugins configuration file (plugins.conf). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option_name</option>: option name, WeeChat will add - prefix "plugins.var.xxxx." (where xxxx is current plugin name). - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET if option value - has not been reset, WEECHAT_CONFIG_OPTION_UNSET_OK_RESET if option - value has been reset, WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED if option - has been removed, WEECHAT_CONFIG_OPTION_UNSET_ERROR if an error - occured. - </para> - <para> - Example: -<screen> -weechat_config_unset_plugin ("option"); -</screen> - </para> - </section> - - </section> - - <!-- ============================[ display ]============================= --> - - <section id="secPluginCApi_display"> - <title>Display</title> - - <para> - Functions to display text in buffers. - </para> - - <section id="secPluginCApi_weechat_prefix"> - <title>weechat_prefix</title> - - <para> - Prototype: -<programlisting> -const char *weechat_prefix (const char *prefix); -</programlisting> - </para> - <para> - Get a prefix. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>prefix</option>: name of prefix: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Prefix</entry> - <entry>Default value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>error</entry> - <entry>=!=</entry> - <entry>error message</entry> - </row> - <row> - <entry>network</entry> - <entry>--</entry> - <entry>message from network</entry> - </row> - <row> - <entry>action</entry> - <entry>*</entry> - <entry>self action</entry> - </row> - <row> - <entry>join</entry> - <entry>--></entry> - <entry>someone joins current chat</entry> - </row> - <row> - <entry>quit</entry> - <entry><--</entry> - <entry>someone leaves current chat</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: prefix value, empty string if prefix is not found - (not NULL). - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "%sThis is an error...", - weechat_prefix ("error")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_color"> - <title>weechat_color</title> - - <para> - Prototype: -<programlisting> -const char *weechat_color (const char *color_name); -</programlisting> - </para> - <para> - Get a string color code for display. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>color_name</option>: name of color: can be a WeeChat - color name (from weechat.color.xxx), a color with optional - background (separated by comma), attribute ("bold", "-bold", - "reverse", "-reverse", "italic", "-italic", "underline", - "-underline", ) or a bar color ("bar_fg", "bar_delim", "bar_bg"). - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string with color code, or a "reset color" code if color - is not found. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "Color: %sblue %schat default %sred on green", - weechat_color ("blue"), - weechat_color ("chat"), - weechat_color ("red,green")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_printf"> - <title>weechat_printf</title> - - <para> - Prototype: -<programlisting> -void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); -</programlisting> - </para> - <para> - Display a message on a buffer. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, message is - displayed on WeeChat buffer. - </para> - </listitem> - <listitem> - <para> - <option>message</option>: message to display - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "Hello on WeeChat buffer"); -weechat_printf (buffer, "Hello on this buffer"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_printf_date"> - <title>weechat_printf_date</title> - - <para> - Prototype: -<programlisting> -void weechat_printf_date ( - struct t_gui_buffer *buffer, time_t date, - const char *message, ...); -</programlisting> - </para> - <para> - Display a message on a buffer, using a custom date. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, message is - displayed on WeeChat buffer. - </para> - </listitem> - <listitem> - <para> - <option>date</option>: date for message - </para> - </listitem> - <listitem> - <para> - <option>message</option>: message to display - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_printf (NULL, time (NULL) - 120, "Hello, 2 minutes ago"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_printf_tags"> - <title>weechat_printf_tags</title> - - <para> - Prototype: -<programlisting> -void weechat_printf_tags ( - struct t_gui_buffer *buffer, - const char *tags, - const char *message, ...); -</programlisting> - </para> - <para> - Display a message on a buffer, using a custom tags. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, message is - displayed on WeeChat buffer. - </para> - </listitem> - <listitem> - <para> - <option>tags</option>: tags for message, separated by a comma - </para> - </listitem> - <listitem> - <para> - <option>message</option>: message to display - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_printf_tags (NULL, "notify_message", "Hello with a message notify tag"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_printf_date_tags"> - <title>weechat_printf_date_tags</title> - - <para> - Prototype: -<programlisting> -void weechat_printf_date_tags ( - struct t_gui_buffer *buffer, - time_t date, - const char *tags, - const char *message, ...); -</programlisting> - </para> - <para> - Display a message on a buffer, using a custom date and tags. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, message is - displayed on WeeChat buffer. - </para> - </listitem> - <listitem> - <para> - <option>date</option>: date for message - </para> - </listitem> - <listitem> - <para> - <option>tags</option>: tags for message, separated by a comma - </para> - </listitem> - <listitem> - <para> - <option>message</option>: message to display - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_printf_date_tags (NULL, time (NULL) - 120, "notify_message", - "Hello, 2 minutes ago, with a message notify tag"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_printf_y"> - <title>weechat_printf_y</title> - - <para> - Prototype: -<programlisting> -void weechat_printf_y ( - struct t_gui_buffer *buffer, - int y, - const char *message, ...); -</programlisting> - </para> - <para> - Display a message on a line of a buffer with free content (see - <xref linkend="secPluginCApi_weechat_buffer_set" />). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, message is - displayed on WeeChat buffer. - </para> - </listitem> - <listitem> - <para> - <option>y</option>: line number (0 for first line) - </para> - </listitem> - <listitem> - <para> - <option>message</option>: message to display - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_printf_y (buffer, 2, "My message on third line"); -</screen> - </para> - </section> - - </section> - - <!-- =============================[ hooks ]============================== --> - - <section id="secPluginCApi_hooks"> - <title>Hooks</title> - - <para> - Functions to hook/unhook something. - </para> - - <section id="secPluginCApi_weechat_hook_command"> - <title>weechat_hook_command</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_command ( - const char *command, - const char *description, - const char *args, - const char *args_description, - const char *completion, - int (*callback)(void *data, - struct t_gui_buffer *buffer, - int argc, char **argv, - char **argv_eol), - void *callback_data); -</programlisting> - </para> - <para> - Hook a command. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>command</option>: new command name - </para> - </listitem> - <listitem> - <para> - <option>description</option>: description of command (displayed - with <command>/help command</command>) - </para> - </listitem> - <listitem> - <para> - <option>args</option>: arguments for command (displayed with - <command>/help command</command>) - </para> - </listitem> - <listitem> - <para> - <option>args_description</option>: description of arguments - (displayed with <command>/help command</command>) - </para> - </listitem> - <listitem> - <para> - <option>completion</option>: completion template for command: - list of completions for each arguments, separated by space. Many - completions are possible for one argument, separated by "|". - Many templates are possible for same command, separeted by "||". - Default completion codes are: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Plugin</entry> - <entry>Code</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - &completions.xml; - </tbody> - </tgroup> - </informaltable> - Special codes: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Code</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>%%command</entry> - <entry>Reuse completion template from /command</entry> - </row> - <row> - <entry>%-</entry> - <entry>Stop completion</entry> - </row> - <row> - <entry>%*</entry> - <entry>Repeat last completion</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when command is used, - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer where command is executed</entry> - </row> - <row> - <entry>int</entry> - <entry>argc</entry> - <entry>argument count</entry> - </row> - <row> - <entry>char **</entry> - <entry>argv</entry> - <entry>arguments</entry> - </row> - <row> - <entry>char **</entry> - <entry>argv_eol</entry> - <entry>arguments (until end of line)</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - <para> - For example, if command called is - <command>/command abc def ghi</command>, then argv and argv_eol - contain following values: - <itemizedlist> - <listitem><para>argv[0] == "abc"</para></listitem> - <listitem><para>argv[1] == "def"</para></listitem> - <listitem><para>argv[2] == "ghi"</para></listitem> - <listitem><para>argv_eol[0] == "abc def ghi"</para></listitem> - <listitem><para>argv_eol[1] == "def ghi"</para></listitem> - <listitem><para>argv_eol[2] == "ghi"</para></listitem> - </itemizedlist> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_command_cb (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -/* this is an example, inspired by weechat command /filter */ -struct t_hook *my_command_hook = - weechat_hook_command (/* command name */ - "myfilter", - /* description */ - "description of myfilter", - /* args */ - "[list] | [enable|disable|toggle [name]] | " - "[add name plugin.buffer tags regex] | " - "[del name|-all]", - /* args description */ - "description of arguments...", - /* completion */ - "list" - " || enable %(filters_names)" - " || disable %(filters_names)" - " || toggle %(filters_names)" - " || add %(filters_names) %(buffers_plugins_names)|*" - " || del %(filters_names)|-all", - /* callback */ - &my_command_cb, - /* callback_data */ - NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_command_run"> - <title>weechat_hook_command_run</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_command_run ( - const char *command, - int (*callback)(void *data, - struct t_gui_buffer *buffer, - const char *command), - void *callback_data); -</programlisting> - </para> - <para> - Hook a command when WeeChat runs it. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>command</option>: command to hook, may start or end with - "*" as joker - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when command is run, - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer where command is executed</entry> - </row> - <row> - <entry>const char *</entry> - <entry>command</entry> - <entry>the command executed, with its arguments</entry> - </row> - </tbody> - </tgroup> - The callback can return WEECHAT_RC_OK or WEECHAT_RC_OK_EAT (ok - and "eat" command, will not be executed by WeeChat after - callback). - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_command_run_cb (void *data, struct t_gui_buffer *buffer, - const char *command) -{ - weechat_printf (NULL, - "You wanted to complete? I'm eating the completion ahah!"); - return WEECHAT_RC_OK_EAT; -} - -struct t_hook *my_command_run_hook = - weechat_hook_command_run ("/input complete*", - &my_command_run_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_timer"> - <title>weechat_hook_timer</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_timer ( - long interval, - const char *align_second, - const char *max_calls, - int (*callback)(void *data, int remaining_calls), - void *callback_data); -</programlisting> - </para> - <para> - Hook a timer. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>interval</option>: interval between two calls - (milliseconds, so 1000 = 1 second) - </para> - </listitem> - <listitem> - <para> - <option>align_second</option>: alignment on a second: align timer - on a second. For example, if current time is 09:00, if - interval = 60000 (60 seconds), and align_second = 60, then timer - is called each minute when second is 00. - </para> - </listitem> - <listitem> - <para> - <option>max_calls</option>: number of calls to timer (if 0, then - timer has no end) - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when time is reached, - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>int</entry> - <entry>remaining_calls</entry> - <entry>remaining calls (-1 if timer has no end)</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_timer_cb (void *data, int remaining_calls) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -/* timer called each 20 seconds */ -struct t_hook *my_timer_hook = - weechat_hook_timer (20 * 1000, 0, 0, &my_timer_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_fd"> - <title>weechat_hook_fd</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_fd ( - int fd, - int flag_read, - int flag_write, - int flag_exception, - int (*callback)(void *data, int fd), - void *callback_data); -</programlisting> - </para> - <para> - Hook a file descriptor (file or socket). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>fd</option>: file descriptor - </para> - </listitem> - <listitem> - <para> - <option>flag_read</option>: 1 for catching read event, 0 for - ignoring it - </para> - </listitem> - <listitem> - <para> - <option>flag_write</option>: 1 for catching write event, 0 for - ignoring it - </para> - </listitem> - <listitem> - <para> - <option>flag_exception</option>: 1 for catching exception event, - 0 for ignoring it - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when a selected event - occurs, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>int</entry> - <entry>fd</entry> - <entry>file descriptor</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_fd_cb (void *data, int fd) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -int sock = socket (AF_INET, SOCK_STREAM, 0); -/* set socket options */ -/* ... */ -/* hook socket */ -struct t_hook *my_fd_hook = - weechat_hook_fd (sock, 1, 0, 0, &my_fd_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_process"> - <title>weechat_hook_process</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_process ( - const char *command, - int timeout, - int (*callback)(void *data, - const char *command, - int return_code, - const char *stdout, - const char *stderr), - void *callback_data); -</programlisting> - </para> - <para> - Hook a process (with fork), and catch output. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>command</option>: command to launch in child process - </para> - </listitem> - <listitem> - <para> - <option>timeout</option>: timeout for command (in milliseconds): - after this timeout, child process is killed (0 means no timeout) - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when data from child - is available, or when child has ended, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>command</entry> - <entry>command executed by child</entry> - </row> - <row> - <entry>int</entry> - <entry>return_code</entry> - <entry> - if >= 0, it's child (command) return code (it's last - call to this callback), if < 0, it can be - WEECHAT_HOOK_PROCESS_OK_RUNNING (data available, but - child still running) or WEECHAT_HOOK_PROCESS_ERROR - (error when launching command). - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) -{ - if (return_code == WEECHAT_HOOK_PROCESS_ERROR) - { - weechat_printf (NULL, "Error with command '%s'", command); - return; - } - - if (return_code >= 0) - { - weechat_printf (NULL, "return_code = %d", return_code); - } - - if (stdout) - { - weechat_printf (NULL, "stdout: %s", stdout); - } - - if (stderr) - { - weechat_printf (NULL, "stderr: %s", stderr); - } - - return WEECHAT_RC_OK; -} - -struct t_hook *my_process_hook = - weechat_hook_process ("ls", 5000, &my_process_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_connect"> - <title>weechat_hook_connect</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_connect ( - const char *address, - int port, - int sock, - int ipv6, - void *gnutls_sess, - const char *local_hostname, - int (*callback)(void *data, - int status, - const char *ip_address), - void *callback_data); -</programlisting> - </para> - <para> - Hook a connection (background connection to a remote host). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>address</option>: name or IP address to connect to - </para> - </listitem> - <listitem> - <para> - <option>port</option>: port number - </para> - </listitem> - <listitem> - <para> - <option>sock</option>: socket used to connect - </para> - </listitem> - <listitem> - <para> - <option>ipv6</option>: 1 to use IPv6, 0 to use IPv4 - </para> - </listitem> - <listitem> - <para> - <option>gnutls_sess</option>: GnuTLS session (optional) - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when connection is ok - or failed, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>int</entry> - <entry>status</entry> - <entry> - constant with connection status: - <itemizedlist> - <listitem> - <para>WEECHAT_HOOK_CONNECT_OK</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_PROXY_ERROR</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR</para> - </listitem> - <listitem> - <para>WEECHAT_HOOK_CONNECT_MEMORY_ERROR</para> - </listitem> - </itemizedlist> - </entry> - </row> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_connect_cb (void *data, int status, const char *ip_address) -{ - switch (status) - { - case WEECHAT_HOOK_CONNECT_OK: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_PROXY_ERROR: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR: - /* ... */ - break; - case WEECHAT_HOOK_CONNECT_MEMORY_ERROR: - /* ... */ - break; - } - return WEECHAT_RC_OK; -} - -struct t_hook *my_connect_hook = - weechat_hook_connect (sock, 1, 0, 0, &my_connect_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_print"> - <title>weechat_hook_print</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_print ( - struct t_gui_buffer *buffer, - const char *tags, - const char *message, - int strip_colors, - int (*callback)(void *data, - struct t_gui_buffer *buffer, - time_t date, - int tags_count, - const char **tags, - int displayed, - int highlight, - const char *prefix, - const char *message), - void *callback_data); -</programlisting> - </para> - <para> - Hook a message printed. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer, if NULL, messages from - any buffer are caught - </para> - </listitem> - <listitem> - <para> - <option>tags</option>: only messages with these tags (comma - separated list) will be caught (optional) - </para> - </listitem> - <listitem> - <para> - <option>message</option>: only messages with this string will be - caught (optional) - </para> - </listitem> - <listitem> - <para> - <option>strip_colors</option>: colors will be stripped from - message displayed, before calling callback - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when message is - printed, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer pointer</entry> - </row> - <row> - <entry>time_t</entry> - <entry>date</entry> - <entry>date</entry> - </row> - <row> - <entry>int</entry> - <entry>tags_count</entry> - <entry>number of tags for line</entry> - </row> - <row> - <entry>const char **</entry> - <entry>tags</entry> - <entry>tags for line</entry> - </row> - <row> - <entry>int</entry> - <entry>displayed</entry> - <entry> - 1 if line is displayed, 0 if it is filtered - </entry> - </row> - <row> - <entry>int</entry> - <entry>highlight</entry> - <entry>1 if line has highlight, otherwise 0</entry> - </row> - <row> - <entry>const char *</entry> - <entry>prefix</entry> - <entry>prefix</entry> - </row> - <row> - <entry>const char *</entry> - <entry>message</entry> - <entry>message</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_print_cb (void *data, struct t_gui_buffer *buffer, time_t date, - int tags_count, const char **tags, - int displayed, int highlight, - const char *prefix, const char *message) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -/* catch all messages, on all buffers, without color */ -struct t_hook *my_print_hook = - weechat_hook_print (NULL, NULL, NULL, 1, &my_print_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_signal"> - <title>weechat_hook_signal</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_signal ( - const char *signal, - int (*callback)(void *data, - const char *signal, - const char *type_data, - void *signal_data), - void *callback_data); -</programlisting> - </para> - <para> - Hook a signal. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>signal</option>: signal to catch. List of signals sent by - WeeChat or plugins: - <informaltable colsep="0" frame="none"> - <tgroup cols="4"> - <thead> - <row> - <entry>Plugin</entry> - <entry>Signal</entry> - <entry>Arguments</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>irc</entry> - <entry>xxx,irc_in_yyy (xxx is server name, yyy is command name)</entry> - <entry>string: message</entry> - <entry>irc message from server (before irc plugin uses it)</entry> - </row> - <row> - <entry>irc</entry> - <entry>xxx,irc_in2_yyy (xxx is server name, yyy is command name)</entry> - <entry>string: message</entry> - <entry>irc message from server (after irc plugin uses it)</entry> - </row> - <row> - <entry>irc</entry> - <entry>xxx,irc_out_yyy (xxx is server name, yyy is command name)</entry> - <entry>string: message</entry> - <entry>irc message sent to server</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_ctcp</entry> - <entry>string: message</entry> - <entry>CTCP received</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_dcc</entry> - <entry>string: message</entry> - <entry>new DCC</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_pv</entry> - <entry>string: message</entry> - <entry>private message received</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_channel_opened</entry> - <entry>pointer: buffer</entry> - <entry>channel opened</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_pvl_opened</entry> - <entry>pointer: buffer</entry> - <entry>private opened</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_server_connecting</entry> - <entry>string: server name</entry> - <entry>connecting to server</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_server_connected</entry> - <entry>string: server name</entry> - <entry>connected to server</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_server_disconnected</entry> - <entry>string: server name</entry> - <entry>disconnected from server</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_ignore_removing</entry> - <entry>pointer: ignore</entry> - <entry>removing ignore</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_ignore_removed</entry> - <entry>pointer: ignore</entry> - <entry>ignore removed</entry> - </row> - <row> - <entry>logger</entry> - <entry>logger_start</entry> - <entry>pointer: buffer</entry> - <entry>start logging for buffer</entry> - </row> - <row> - <entry>logger</entry> - <entry>logger_stop</entry> - <entry>pointer: buffer</entry> - <entry>stop logging for buffer</entry> - </row> - <row> - <entry>logger</entry> - <entry>logger_backlog</entry> - <entry>pointer: buffer</entry> - <entry>display backlog for buffer</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_closing</entry> - <entry>pointer: buffer</entry> - <entry>closing buffer</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_closed</entry> - <entry>pointer: buffer</entry> - <entry>buffer closed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_lines_hidden</entry> - <entry>pointer: buffer</entry> - <entry>lines hidden in buffer</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_localvar_added</entry> - <entry>pointer: buffer</entry> - <entry>local variable has been added</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_localvar_changed</entry> - <entry>pointer: buffer</entry> - <entry>local variable has changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_localvar_removed</entry> - <entry>pointer: buffer</entry> - <entry>local variable has been removed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_moved</entry> - <entry>pointer: buffer</entry> - <entry>buffer moved</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_opened</entry> - <entry>pointer: buffer</entry> - <entry>buffer opened</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_renamed</entry> - <entry>pointer: buffer</entry> - <entry>buffer renamed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_switch</entry> - <entry>pointer: buffer</entry> - <entry>switching buffer</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_title_changed</entry> - <entry>pointer: buffer</entry> - <entry>title of buffer changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>buffer_type_changed</entry> - <entry>pointer: buffer</entry> - <entry>type of buffer changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>debug_dump</entry> - <entry>-</entry> - <entry>dump request</entry> - </row> - <row> - <entry>weechat</entry> - <entry>filter_added</entry> - <entry>pointer: new filter</entry> - <entry>filter added</entry> - </row> - <row> - <entry>weechat</entry> - <entry>filter_removing</entry> - <entry>pointer: filter</entry> - <entry>removing filter</entry> - </row> - <row> - <entry>weechat</entry> - <entry>filter_removed</entry> - <entry>pointer: filter</entry> - <entry>filter removed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>filters_enabled</entry> - <entry>-</entry> - <entry>filters enabled</entry> - </row> - <row> - <entry>weechat</entry> - <entry>filters_disabled</entry> - <entry>-</entry> - <entry>filters disabled</entry> - </row> - <row> - <entry>weechat</entry> - <entry>hotlist_changed</entry> - <entry>-</entry> - <entry>hotlist changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_paste_pending</entry> - <entry>-</entry> - <entry>paste pending</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_search</entry> - <entry>-</entry> - <entry>input search</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_text_changed</entry> - <entry>-</entry> - <entry>input text changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_text_cursor_moved</entry> - <entry>-</entry> - <entry>input text cursor moved</entry> - </row> - <row> - <entry>weechat</entry> - <entry>key_pressed</entry> - <entry>string: key pressed</entry> - <entry>key pressed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>nicklist_changed</entry> - <entry>-</entry> - <entry>nicklist has changed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>partial_completion</entry> - <entry>-</entry> - <entry>partial completion happened</entry> - </row> - <row> - <entry>weechat</entry> - <entry>quit</entry> - <entry>arguments for command /quit</entry> - <entry>command /quit issued by user</entry> - </row> - <row> - <entry>weechat</entry> - <entry>upgrade</entry> - <entry>-</entry> - <entry>command /upgrade issued by user</entry> - </row> - <row> - <entry>weechat</entry> - <entry>weechat_highlight</entry> - <entry>string: message with prefix</entry> - <entry>highlight displayed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>weechat_pv</entry> - <entry>string: message with prefix</entry> - <entry>private message displayed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>window_scrolled</entry> - <entry>pointer: window</entry> - <entry>scroll in window</entry> - </row> - <row> - <entry>weechat</entry> - <entry>window_unzooming</entry> - <entry>pointer: current window</entry> - <entry>unzooming window</entry> - </row> - <row> - <entry>weechat</entry> - <entry>window_unzoomed</entry> - <entry>pointer: current window</entry> - <entry>window unzoomed</entry> - </row> - <row> - <entry>weechat</entry> - <entry>window_zooming</entry> - <entry>pointer: current window</entry> - <entry>unzooming window</entry> - </row> - <row> - <entry>weechat</entry> - <entry>window_zoomed</entry> - <entry>pointer: current window</entry> - <entry>window unzoomed</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_add</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>new xfer</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_send_ready</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>xfer ready (file or chat, send)</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_accept_resume</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>xfer accepts resume (send)</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_send_accept_resume</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>xfer accepts resume (send)</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_start_resume</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>start resume</entry> - </row> - <row> - <entry>xfer</entry> - <entry>xfer_resume_ready</entry> - <entry>pointer: infolist with xfer info</entry> - <entry>xfer resume ready</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when signal is - received, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>signal</entry> - <entry>signal received</entry> - </row> - <row> - <entry>const char *</entry> - <entry>type_data</entry> - <entry> - type of data sent with signal: - WEECHAT_HOOK_SIGNAL_STRING, WEECHAT_HOOK_SIGNAL_INT - or WEECHAT_HOOK_SIGNAL_POINTER - </entry> - </row> - <row> - <entry>void *</entry> - <entry>signal_data</entry> - <entry>data sent with signal</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_signal_cb (void *data, const char *signal, const char *type_data, - void *signal_data) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -/* catch signal "quit", sent by WeeChat when /quit command is executed */ -struct t_hook *my_signal_hook = - weechat_hook_signal ("quit", &my_signal_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_signal_send"> - <title>weechat_hook_signal_send</title> - - <para> - Prototype: -<programlisting> -void weechat_hook_signal_send ( - const char *signal, - const char *type_data, - void *signal_data); -</programlisting> - </para> - <para> - Send a signal. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>signal</option>: signal to send - </para> - </listitem> - <listitem> - <para> - <option>type_data</option>: type of data sent with signal - (see <xref linkend="secPluginCApi_weechat_hook_signal" />) - </para> - </listitem> - <listitem> - <para> - <option>signal_data</option>: data sent with signal - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_hook_signal_send ("my_signal", WEECHAT_HOOK_SIGNAL_STRING, my_string); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_config"> - <title>weechat_hook_config</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_config ( - const char *option, - int (*callback)(void *data, - const char *option, - const char *value), - void *callback_data); -</programlisting> - </para> - <para> - Hook a configuration option. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>option</option>: option, format is full name, as used - with /set command (for example: - <literal>weechat.look.item_time_format</literal>) - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when configuration - option is changed, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>option</entry> - <entry>name of option</entry> - </row> - <row> - <entry>const char *</entry> - <entry>value</entry> - <entry>new value for option</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_config_cb (void *data, const char *option, const char *value) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -/* catch changes to option "weechat.look.item_time_format" */ -struct t_hook *my_config_hook = - weechat_hook_config ("weechat.look.item_time_format", - &my_config_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_completion"> - <title>weechat_hook_completion</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_completion ( - const char *completion_item, - int (*callback)(void *data, - const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion), - void *callback_data); -</programlisting> - </para> - <para> - Hook a completion. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>completion_item</option>: name of completion item, - after you can use <literal>%(name)</literal> in a command hooked - (argument "<literal>completion</literal>", see - <xref linkend="secPluginCApi_weechat_hook_command" />) - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when completion item - is used (user is completing something using this item), - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>completion_item</entry> - <entry>name of completion item</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer where completion was done</entry> - </row> - <row> - <entry>struct t_gui_completion *</entry> - <entry>completion</entry> - <entry> - structure used to add words for completion - (see - <xref linkend="secPluginCApi_weechat_hook_completion_list_add" />) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_completion_cb (void *data, const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -struct t_hook *my_completion_hook = - weechat_hook_completion ("myitem", - &my_completion_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_completion_list_add"> - <title>weechat_hook_completion_list_add</title> - - <para> - Prototype: -<programlisting> -void weechat_hook_completion_list_add ( - struct t_gui_completion *completion, - const char *word, - int nick_completion, - const char *where); -</programlisting> - </para> - <para> - Add a word for a completion. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>completion</option>: completion pointer - </para> - </listitem> - <listitem> - <para> - <option>word</option>: word to add - </para> - </listitem> - <listitem> - <para> - <option>nick_completion</option>: 1 if word is a nick, 0 if word - is not a nick - </para> - </listitem> - <listitem> - <para> - <option>where</option>: position where word will be inserted in - list: WEECHAT_LIST_POS_SORT, WEECHAT_LIST_POS_BEGINNING or - WEECHAT_LIST_POS_END - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -int -my_completion_cb (void *data, const char *completion_item, - struct t_gui_buffer *buffer, - struct t_gui_completion *completion) -{ - weechat_hook_completion_list_add (completion, "word1", - 0, WEECHAT_LIST_POS_SORT); - weechat_hook_completion_list_add (completion, "test_word2", - 0, WEECHAT_LIST_POS_SORT); - return WEECHAT_RC_OK; -} - -struct t_hook *my_completion_hook = - weechat_hook_completion ("myitem", - &my_completion_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_modifier"> - <title>weechat_hook_modifier</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_modifier ( - const char *modifier, - char *(*callback)(void *data, - const char *modifier, - const char *modifier_data, - const char *string), - void *callback_data); -</programlisting> - </para> - <para> - Hook a modifier. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>modifier</option>: modifier name, list of modifiers used - by Weechat or plugins: - <informaltable colsep="0" frame="none"> - <tgroup cols="5"> - <thead> - <row> - <entry>Plugin</entry> - <entry>Modifier</entry> - <entry>Modifier data</entry> - <entry>String</entry> - <entry>Output</entry> - </row> - </thead> - <tbody> - <row> - <entry>charset</entry> - <entry>charset_decode</entry> - <entry>plugin.buffer_name</entry> - <entry>any string</entry> - <entry>string decoded from charset found for plugin/buffer to UTF-8</entry> - </row> - <row> - <entry>charset</entry> - <entry>charset_encode</entry> - <entry>plugin.buffer_name</entry> - <entry>any string</entry> - <entry>string encoded from UTF-8 to charset found for plugin/buffer</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_color_decode</entry> - <entry>"1" to keep colors, "0" to remove colors</entry> - <entry>any string</entry> - <entry>string with WeeChat color codes, or without color</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_color_encode</entry> - <entry>"1" to keep colors, "0" to remove colors</entry> - <entry>any string, with user colors</entry> - <entry>string with IRC color codes, or without color</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_in_xxx (xxx is IRC command name)</entry> - <entry>server name</entry> - <entry>content of message received from IRC server</entry> - <entry>new content of message</entry> - </row> - <row> - <entry>irc</entry> - <entry>irc_out_xxx (xxx is IRC command name)</entry> - <entry>server name</entry> - <entry>content of message about to be sent to IRC server</entry> - <entry>new content of message</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_text_content</entry> - <entry>string with buffer pointer ("0x123..")</entry> - <entry>input buffer (from user)</entry> - <entry>new content of input buffer</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_text_display</entry> - <entry>string with buffer pointer ("0x123..")</entry> - <entry>input buffer (from user), without cursor tag</entry> - <entry>new content of input buffer, for display only (input buffer is not changed)</entry> - </row> - <row> - <entry>weechat</entry> - <entry>input_text_display_with_cursor</entry> - <entry>string with buffer pointer ("0x123..")</entry> - <entry>input buffer (from user), with cursor tag</entry> - <entry>new content of input buffer, for display only (input buffer is not changed)</entry> - </row> - <row> - <entry>weechat</entry> - <entry>weechat_print</entry> - <entry>plugin;buffer_name;tags</entry> - <entry>message printed</entry> - <entry>new message printed</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when modifier is - received, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>modifier</entry> - <entry>name of modifier</entry> - </row> - <row> - <entry>const char *</entry> - <entry>modifier_data</entry> - <entry>modifier data</entry> - </row> - <row> - <entry>const char *</entry> - <entry>string</entry> - <entry> - string to modify (function must return copy of this - string, no changes are allowed in this string) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -char * -my_modifier_cb (void *data, const char *modifier, - const char *modifier_data, - const char *string) -{ - char *result; - int length; - - if (!string) - return NULL; - - length = strlen (string) + 4; - result = malloc (length); - if (result) - { - /* add "xxx" to any message printed */ - snprintf (result, length, "%s xxx", string); - } - - return result; -} - -struct t_hook *my_modifier_hook = - weechat_hook_modifier ("weechat_print", - &my_modifier_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_modifier_exec"> - <title>weechat_hook_modifier_exec</title> - - <para> - Prototype: -<programlisting> -char *weechat_hook_modifier_exec ( - const char *modifier, - const char *modifier_data, - const char *string); -</programlisting> - </para> - <para> - Execute modifier(s). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>modifier</option>: modifier name - </para> - </listitem> - <listitem> - <para> - <option>modifier_data</option>: modifier data - </para> - </listitem> - <listitem> - <para> - <option>string</option>: string to modify - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string modified, NULL if no changes in string were - made by modifier(s). - </para> - <para> - Example: -<screen> - char *new_string = - weechat_hook_modifier_exec ("my_modifier", my_data, my_string); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_info"> - <title>weechat_hook_info</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_info ( - const char *info_name, - const char *description, - const char *(*callback)(void *data, - const char *info_name, - const char *arguments), - void *callback_data); -</programlisting> - </para> - <para> - Hook an information: callback will return pointer to info asked. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>info_name</option>: name of info - </para> - </listitem> - <listitem> - <para> - <option>description</option>: description - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when info is asked, - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>info_name</entry> - <entry>name of info to return</entry> - </row> - <row> - <entry>const char *</entry> - <entry>arguments</entry> - <entry>additional arguments, depending on info</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -const char * -my_info_cb (void *data, const char *info_name, const char *arguments) -{ - /* ... */ - return pointer_to_string; -} - -/* add info "my_info" */ -struct t_hook *my_info = - weechat_hook_info ("my_info", "Some info about something", - &my_info_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_hook_infolist"> - <title>weechat_hook_infolist</title> - - <para> - Prototype: -<programlisting> -struct t_hook *weechat_hook_infolist ( - const char *infolist_name, - const char *description, - const char *(*callback)(void *data, - const char *infolist_name, - void *pointer, - const char *arguments), - void *callback_data); -</programlisting> - </para> - <para> - Hook an infolist: callback will return pointer to infolist asked. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist_name</option>: name of infolist - </para> - </listitem> - <listitem> - <para> - <option>description</option>: description - </para> - </listitem> - <listitem> - <para> - <option>callback</option>: function called when infolist is asked, - arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>infolist_name</entry> - <entry>name of infolist to return</entry> - </row> - <row> - <entry>void *</entry> - <entry>pointer</entry> - <entry> - pointer to an item infolist must return (to get only - one item in infolist) - </entry> - </row> - <row> - <entry>const char *</entry> - <entry>arguments</entry> - <entry>additional arguments, depending on infolist</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>callback_data</option>: pointer given to callback when it - is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new hook, NULL if error occured. - </para> - <para> - Example: -<screen> -struct t_infolist * -my_infolist_cb (void *data, const char *infolist_name, void *pointer, - const char *arguments) -{ - /* ... build infolist ... */ - return my_infolist; -} - -/* add info "my_infolist" */ -struct t_hook *my_infolist = - weechat_hook_infolist ("my_infolist", "Infolist with some data", - &my_infolist_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_unhook"> - <title>weechat_unhook</title> - - <para> - Prototype: -<programlisting> -void weechat_unhook (struct t_hook *hook); -</programlisting> - </para> - <para> - Unhook something hooked. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>hook</option>: something hooked with weechat_hook_xxxx() - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -struct t_hook *my_hook = weechat_hook_command (...); -/* ... */ -weechat_unhook (my_hook); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_unhook_all"> - <title>weechat_unhook_all</title> - - <para> - Prototype: -<programlisting> -void weechat_unhook_all (); -</programlisting> - </para> - <para> - Unhook everything that has been hooked by current plugin. - </para> - <para> - Example: -<screen> -weechat_unhook_all (); -</screen> - </para> - </section> - - </section> - - <!-- ============================[ buffers ]============================= --> - - <section id="secPluginCApi_buffers"> - <title>Buffers</title> - - <para> - Functions to create/query/close buffers. - </para> - - <section id="secPluginCApi_weechat_buffer_new"> - <title>weechat_buffer_new</title> - - <para> - Prototype: -<programlisting> -struct t_gui_buffer *weechat_buffer_new ( - const char *name, - int (*input_callback)(void *data, - struct t_gui_buffer *buffer, - const char *input_data), - void *input_callback_data, - int (*close_callback)(void *data, - struct t_gui_buffer *buffer), - void *close_callback_data); -</programlisting> - </para> - <para> - Open a new buffer. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: name of buffer (must be unique) - </para> - </listitem> - <listitem> - <para> - <option>input_callback</option>: function called when input text - is entered on buffer, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer pointer</entry> - </row> - <row> - <entry>const char *</entry> - <entry>input_data</entry> - <entry>input data</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>input_callback_data</option>: pointer given to input - callback when it is called by WeeChat - </para> - </listitem> - <listitem> - <para> - <option>close_callback</option>: function called when buffer is - closed, arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Type</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>void *</entry> - <entry>data</entry> - <entry>pointer</entry> - </row> - <row> - <entry>struct t_gui_buffer *</entry> - <entry>buffer</entry> - <entry>buffer pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>close_callback_data</option>: pointer given to close - callback when it is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new buffer, NULL if error occured. - </para> - <para> - Example: -<screen> -int -my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data) -{ - weechat_printf (buffer, "Text: %s", input_data); - return WEECHAT_RC_OK; -} - -int -my_close_cb (void *data, struct t_gui_buffer *buffer) -{ - weechat_printf (NULL, "Buffer '%s' will be closed!", - weechat_buffer_get_string (buffer, "name")); - return WEECHAT_RC_OK; -} - -struct t_gui_buffer *my_buffer = - weechat_buffer_new ("my_buffer", - &my_input_cb, NULL, &my_close_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_current_buffer"> - <title>weechat_current_buffer</title> - - <para> - Prototype: -<programlisting> -struct t_gui_buffer *weechat_current_buffer (); -</programlisting> - </para> - <para> - Return pointer to current buffer (buffer displayed by current window). - </para> - <para> - Return value: pointer to current buffer. - </para> - <para> - Example: -<screen> -struct t_gui_buffer *current_buffer = weechat_current_buffer (); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_search"> - <title>weechat_buffer_search</title> - - <para> - Prototype: -<programlisting> -struct t_gui_buffer *weechat_buffer_search (const char *plugin, const char *name); -</programlisting> - </para> - <para> - Search a buffer by plugin and/or buffer name. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>plugin</option>: name of plugin - </para> - </listitem> - <listitem> - <para> - <option>name</option>: name of buffer. If it is NULL or empty - string, then current buffer is returned (buffer displayed by - current window). - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to buffer found, NULL if not found. - </para> - <para> - Example: -<screen> -struct t_gui_buffer *weechat_buffer = weechat_buffer_search ("core", "weechat"); -struct t_gui_buffer *my_buffer = weechat_buffer_search ("myplugin", "my_buffer"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_clear"> - <title>weechat_buffer_clear</title> - - <para> - Prototype: -<programlisting> -void weechat_buffer_clear (struct t_gui_buffer *buffer); -</programlisting> - </para> - <para> - Clear content of a buffer. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -struct t_gui_buffer *my_buffer = weechat_buffer_search ("myplugin", "my_buffer"); -if (my_buffer) -{ - weechat_buffer_clear (my_buffer); -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_close"> - <title>weechat_buffer_close</title> - - <para> - Prototype: -<programlisting> -void weechat_buffer_close (struct t_gui_buffer *buffer) -</programlisting> - </para> - <para> - Close a buffer. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -struct t_gui_buffer *my_buffer = - weechat_buffer_new ("my_buffer", - &my_input_cb, NULL, &my_close_cb, NULL); -/* ... */ -weechat_buffer_close (my_buffer); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_get_integer"> - <title>weechat_buffer_get_integer</title> - - <para> - Prototype: -<programlisting> -int weechat_buffer_get_integer (struct t_gui_buffer *buffer, const char *property); -</programlisting> - </para> - <para> - Get integer value of a buffer property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>number</entry> - <entry>number of buffer (1 to # open buffers)</entry> - </row> - <row> - <entry>num_displayed</entry> - <entry>number of windows displaying buffer</entry> - </row> - <row> - <entry>notify</entry> - <entry>notify level for buffer</entry> - </row> - <row> - <entry>lines_hidden</entry> - <entry> - 1 if at least one line is hidden on buffer - (filtered), or 0 if all lines are displayed - </entry> - </row> - <row> - <entry>prefix_max_length</entry> - <entry>max length for prefix in this buffer</entry> - </row> - <row> - <entry>time_for_each_line</entry> - <entry> - 1 if time is displayed for each line in buffer - (default), 0 otherwise - </entry> - </row> - <row> - <entry>text_search</entry> - <entry> - text search type: 0 = disabled, 1 = backward, 2 = forward - </entry> - </row> - <row> - <entry>text_search_exact</entry> - <entry>1 if text search is exact (case sensitive)</entry> - </row> - <row> - <entry>text_search_found</entry> - <entry>1 if text found, 0 otherwise</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: integer value of property. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "my buffer number is: %d", - weechat_buffer_get_integer (my_buffer, "number")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_get_string"> - <title>weechat_buffer_get_string</title> - - <para> - Prototype: -<programlisting> -const char *weechat_buffer_get_string (struct t_gui_buffer *buffer, const char *property); -</programlisting> - </para> - <para> - Get string value of a buffer property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>plugin</entry> - <entry> - name of plugin which created this buffer ("core" for - WeeChat main buffer) - </entry> - </row> - <row> - <entry>name</entry> - <entry>name of buffer</entry> - </row> - <row> - <entry>short_name</entry> - <entry>short name of buffer</entry> - </row> - <row> - <entry>tilte</entry> - <entry>title of buffer</entry> - </row> - <row> - <entry>input</entry> - <entry>input text</entry> - </row> - <row> - <entry>localvar_xxx</entry> - <entry> - get content of local varialbe "xxx" (replace - "xxx" by the name of variable you want to read) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string value of property. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "name / short name of buffer are: %s / %s", - weechat_buffer_get_string (my_buffer, "name"), - weechat_buffer_get_string (my_buffer, "short_name")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_get_pointer"> - <title>weechat_buffer_get_pointer</title> - - <para> - Prototype: -<programlisting> -const char *weechat_buffer_pointer (struct t_gui_buffer *buffer, const char *property); -</programlisting> - </para> - <para> - Get pointer value of a buffer property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>plugin</entry> - <entry>plugin pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer value of property. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "plugin pointer of my buffer: %lx", - weechat_buffer_get_pointer (my_buffer, "plugin")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_set"> - <title>weechat_buffer_set</title> - - <para> - Prototype: -<programlisting> -void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, - const char *value); -</programlisting> - </para> - <para> - Set string value of a buffer property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Name</entry> - <entry>Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>hotlist</entry> - <entry> - "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, - WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT - </entry> - <entry> - <para> - "+": enable hotlist (global setting, buffer pointer - is not used) - </para> - <para> - "-": disable hotlist (global setting, buffer pointer - is not used); when hotlist is disabled, messages - printed in buffers does not change hotlist (but - content of current hotlist is not cleared) - </para> - <para> - priority: add buffer to hotlist with this priority - </para> - </entry> - </row> - <row> - <entry>unread</entry> - <entry>N/A</entry> - <entry> - set unread marker on current line for buffer - </entry> - </row> - <row> - <entry>display</entry> - <entry>"1", "auto"</entry> - <entry> - switch to this buffer in current window (if value is - "auto", then it's considered as auto-switch and read - marker is not reset for current buffer) - </entry> - </row> - <row> - <entry>name</entry> - <entry>any string</entry> - <entry>set new name for buffer</entry> - </row> - <row> - <entry>short_name</entry> - <entry>any string</entry> - <entry>set new short name for buffer</entry> - </row> - <row> - <entry>type</entry> - <entry>"formatted" or "free"</entry> - <entry> - set type for buffer: "formatted" (for printing - chat messages), or "free" for free content - </entry> - </row> - <row> - <entry>notify</entry> - <entry>"0", "1", "2", "3"</entry> - <entry> - set notify level for buffer: "0" = never add to hotlist, - "1" = add for highlights only, "2" = add for highlights - and messages, "3" = add for ell messages - </entry> - </row> - <row> - <entry>title</entry> - <entry>any string</entry> - <entry>set new title for buffer</entry> - </row> - <row> - <entry>time_for_each_line</entry> - <entry>"0" or "1"</entry> - <entry> - "0" to hide time for all lines in buffer, "1" to - see time for all lines (default for a new buffer) - </entry> - </row> - <row> - <entry>nicklist</entry> - <entry>"0" or "1"</entry> - <entry> - "0" to remove nicklist for buffer, "1" to add - nicklist for buffer - </entry> - </row> - <row> - <entry>nicklist_case_sensitive</entry> - <entry>"0" or "1"</entry> - <entry> - "0" to have case insensitive nicklist, "1" to have - case sensitive nicklist - </entry> - </row> - <row> - <entry>nicklist_display_groups</entry> - <entry>"0" or "1"</entry> - <entry> - "0" to hide nicklist groups, "1" to display nicklist - groups - </entry> - </row> - <row> - <entry>highlight_words</entry> - <entry>"-" or comma separated list of words</entry> - <entry> - "-" is a special value to disable any highlight on this - buffer, or comma separated list of words to highlight - in this buffer, for example: "abc,def,ghi" - </entry> - </row> - <row> - <entry>highlight_tags</entry> - <entry>comma separated list of tags</entry> - <entry> - comma separated list of tags to highlight in this - buffer - </entry> - </row> - <row> - <entry>key_bind_xxx</entry> - <entry>any string</entry> - <entry> - bind a new key, specific to this buffer (replace "xxx" - by the key, for example "meta-I" to bind alt+i) ; the - value is text or command to execute - </entry> - </row> - <row> - <entry>key_bind_xxx</entry> - <entry>N/A</entry> - <entry> - unbind a key (which was bound with above property) - </entry> - </row> - <row> - <entry>input</entry> - <entry>any string</entry> - <entry>set new value for buffer input</entry> - </row> - <row> - <entry>input_get_unknown_commands</entry> - <entry>"0" or "1"</entry> - <entry> - "0" to disable unknown commands on this buffer - (default behaviour), "1" to get unknown commands, - for example if user type "/unknowncmd", buffer will - receive it (no error about unknown command) - </entry> - </row> - <row> - <entry>localvar_set_xxx</entry> - <entry>any string</entry> - <entry> - set new value for a local variable (replace "xxx" by - variable name) ; variable is created if it does not - exist - </entry> - </row> - <row> - <entry>localvar_del_xxx</entry> - <entry>any string</entry> - <entry> - remove a local variable (replace "xxx" by variable name) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -/* disable hotlist (for all buffers) */ -weechat_buffer_set (NULL, "hotlist", "-"); - -/* enable again hotlist */ -weechat_buffer_set (NULL, "hotlist", "+"); - -/* change buffer name */ -weechat_buffer_set (my_buffer, "name", "my_new_name"); - -/* add new local variable "toto" with value "my_value" */ -weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); - -/* remove local variable "toto" */ -weechat_buffer_set (my_buffer, "localvar_del_toto", NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_set_pointer"> - <title>weechat_buffer_set_pointer</title> - - <para> - Prototype: -<programlisting> -void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, - void *pointer); -</programlisting> - </para> - <para> - Set pointer value of a buffer property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Name</entry> - <entry>Value</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>close_callback</entry> - <entry>close callback function</entry> - <entry>close callback function</entry> - </row> - <row> - <entry>close_callback_data</entry> - <entry>close callback data pointer</entry> - <entry>close callback data pointer</entry> - </row> - <row> - <entry>input_callback</entry> - <entry>input callback function</entry> - <entry>input callback function</entry> - </row> - <row> - <entry>input_callback_data</entry> - <entry>input callback data pointer</entry> - <entry>input callback data pointer</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -int -my_close_cb (void *data, struct t_gui_buffer *buffer) -{ - /* ... */ - return WEECHAT_RC_OK; -} - -weechat_buffer_set_pointer (NULL, "close_callback", &my_close_cb); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_buffer_string_replace_local_var"> - <title>weechat_buffer_string_replace_local_var</title> - - <para> - Prototype: -<programlisting> -char *weechat_buffer_string_replace_local_var (struct t_gui_buffer *buffer, - const char *string); -</programlisting> - </para> - <para> - Replace local variables in a string by their value, using buffer local - variables. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>string</option>: string with text and local variables - using format "$var" - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string with value for local variables. - </para> - <note> - <para> - Result has to be free by a call to "free" after use. - </para> - </note> - <para> - Example: -<screen> -weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); - -char *str = weechat_buffer_string_replace_local_var (my_buffer, - "test with $toto"); -/* str contains "test with my_value" */ -/* ... */ -free (str); -</screen> - </para> - </section> - - </section> - - <!-- ============================[ windows ]============================= --> - - <section id="secPluginCApi_windows"> - <title>Windows</title> - - <para> - Functions to query windows. - </para> - - <section id="secPluginCApi_weechat_current_window"> - <title>weechat_current_window</title> - - <para> - Prototype: -<programlisting> -struct t_gui_window *weechat_current_window (); -</programlisting> - </para> - <para> - Return pointer to current window. - </para> - <para> - Return value: pointer to current window. - </para> - <para> - Example: -<screen> -struct t_gui_window *current_window = weechat_current_window (); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_window_get_integer"> - <title>weechat_window_get_integer</title> - - <para> - Prototype: -<programlisting> -int weechat_window_get_integer (struct t_gui_window *window, const char *property); -</programlisting> - </para> - <para> - Get integer value of a window property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>window</option>: window pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>win_x</entry> - <entry> - X position of window in terminal (0 is first column) - </entry> - </row> - <row> - <entry>win_y</entry> - <entry> - Y position of window in terminal (0 is first column) - </entry> - </row> - <row> - <entry>win_width</entry> - <entry>width of window, in chars</entry> - </row> - <row> - <entry>win_height</entry> - <entry>height of window, in chars</entry> - </row> - <row> - <entry>win_width_pct</entry> - <entry> - percentage size, compared to parent window (if 50, - width is half) - </entry> - </row> - <row> - <entry>win_height_pct</entry> - <entry> - percentage size, compared to parent window (if 50, - height is half) - </entry> - </row> - <row> - <entry>win_chat_x</entry> - <entry> - X position of chat window in terminal (0 is first - column) - </entry> - </row> - <row> - <entry>win_chat_y</entry> - <entry> - Y position of chat window in terminal (0 is first - column) - </entry> - </row> - <row> - <entry>win_chat_width</entry> - <entry>width of chat window, in chars</entry> - </row> - <row> - <entry>win_chat_height</entry> - <entry>height of chat window, in chars</entry> - </row> - <row> - <entry>first_line_displayed</entry> - <entry> - 1 if first line of buffer is displayed on screen, - otherwise 0 - </entry> - </row> - <row> - <entry>scroll</entry> - <entry> - 1 if scroll is active on window (last line not - displayed) - </entry> - </row> - <row> - <entry>scroll_lines_after</entry> - <entry> - number of lines not displayed after last one displayed - (when scrolling) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: integer value of property. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "current window is at position (x,y): (%d,%d)", - weechat_window_get_integer (weechat_current_window, "win_x"), - weechat_window_get_integer (weechat_current_window, "win_y")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_window_get_string"> - <title>weechat_window_get_string</title> - - <para> - Prototype: -<programlisting> -const char *weechat_window_get_string (struct t_gui_window *window, const char *property); -</programlisting> - </para> - <para> - Get string value of a window property. NOT USED TODAY, reserved for - future version. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>window</option>: window pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string value of property. - </para> - </section> - - <section id="secPluginCApi_weechat_window_get_pointer"> - <title>weechat_window_get_pointer</title> - - <para> - Prototype: -<programlisting> -void *weechat_window_get_pointer (struct t_gui_window *window, const char *property); -</programlisting> - </para> - <para> - Get pointer value of a window property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>window</option>: window pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>current</entry> - <entry>current window pointer</entry> - </row> - <row> - <entry>buffer</entry> - <entry>pointer to buffer displayed by window</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer value of property. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "current window pointer is: %lx, buffer displayed is: %lx", - weechat_window_get_pointer (NULL, "current"), - weechat_window_get_integer (weechat_current_window, "buffer")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_window_set_title"> - <title>weechat_window_set_title</title> - - <para> - Prototype: -<programlisting> -void weechat_window_set_title (const char *title); -</programlisting> - </para> - <para> - Set title for window (terminal for Curses interface). - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>title</option>: new title (if empty, then title is reset) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_window_set_title ("new title"); -</screen> - </para> - </section> - - </section> - - <!-- ============================[ nicklist ]============================ --> - - <section id="secPluginCApi_nicklist"> - <title>Nicklist</title> - - <para> - Functions for buffer nicklist. - </para> - - <section id="secPluginCApi_weechat_nicklist_add_group"> - <title>weechat_nicklist_add_group</title> - - <para> - Prototype: -<programlisting> -struct t_gui_nick_group *weechat_nicklist_add_group ( - struct t_gui_buffer *buffer, - struct t_gui_nick_group *parent_group, - const char *name, - const char *color, - int visible); -</programlisting> - </para> - <para> - Add a group in a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>parent_group</option>: pointer to parent of group, NULL - if group has no parent (nicklist root) - </para> - </listitem> - <listitem> - <para> - <option>name</option>: group name - </para> - </listitem> - <listitem> - <para> - <option>visible</option>: 1 if group and sub-groups/nicks are - visible, 0 if they are hidden - </para> - </listitem> - <listitem> - <para> - <option>color</option>: color option name - ("weechat.color.xxx" or "file.section.option") or color name - ("blue", "red",..) or "bar_fg"/"bar_bg"/"bar_delim" (bar - foreground/background/delimiter) - </para> - </listitem> - </itemizedlist> - </para> - <note> - <para> - The group name can begin with one or more digits, followed by pipe, - and then group name. When such string is found at beginning, it's - used to sort groups in nicklist. For examples groups "1|test" and - "2|abc" will be sorted: "test" first, "abc" second, whereas "test" - and "abc" will be sorted: "abc" first, "test" second. - </para> - </note> - <para> - Return value: pointer to new group, NULL if an error occured. - </para> - <para> - Example: -<screen> -struct t_gui_nick_group *my_group = - weechat_nicklist_add_group (my_buffer, my_parent_group, - "test_group", "weechat.color.nicklist_group", 1); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_search_group"> - <title>weechat_nicklist_search_group</title> - - <para> - Prototype: -<programlisting> -struct t_gui_nick_group *weechat_nicklist_search_group ( - struct t_gui_buffer *buffer, - struct t_gui_nick_group *from_group, - const char *name); -</programlisting> - </para> - <para> - Search a group in a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>from_group</option>: search from this group only, if NULL, - then search in whole nicklist - </para> - </listitem> - <listitem> - <para> - <option>name</option>: group name to search - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to group found, NULL if not found. - </para> - <para> - Example: -<screen> -struct t_gui_nick_group *ptr_group = - weechat_nicklist_search_group (my_buffer, NULL, "test_group"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_add_nick"> - <title>weechat_nicklist_add_nick</title> - - <para> - Prototype: -<programlisting> -struct t_gui_nick_group *weechat_nicklist_add_nick ( - struct t_gui_buffer *buffer, - struct t_gui_nick_group *group, - const char *name, - const char *color, - const char *prefix, - const char *prefix_color, - int visible); -</programlisting> - </para> - <para> - Add a nick in a group. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>group</option>: group pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: nick name - </para> - </listitem> - <listitem> - <para> - <option>color</option>: color option name - ("weechat.color.xxx" or "file.section.option") or color name - ("blue", "red",..) or "bar_fg"/"bar_bg"/"bar_delim" (bar - foreground/background/delimiter) - </para> - </listitem> - <listitem> - <para> - <option>prefix</option>: prefix displayed before nick - </para> - </listitem> - <listitem> - <para> - <option>prefix_color</option>: color option name - ("weechat.color.xxx" or "file.section.option") or color name - ("blue", "red",..) or "bar_fg"/"bar_bg"/"bar_delim" (bar - foreground/background/delimiter) - </para> - </listitem> - <listitem> - <para> - <option>visible</option>: 1 if nick is visible, 0 if it is hidden - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new nick, NULL if an error occured. - </para> - <para> - Example: -<screen> -struct t_gui_nick *my_nick = - weechat_nicklist_add_nick (my_buffer, my_group, - "test_nick", - (nick_away) ? "weechat.color.nicklist_away" : "bar_fg", - "@", "lightgreen", - 1); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_search_nick"> - <title>weechat_nicklist_search_nick</title> - - <para> - Prototype: -<programlisting> -struct t_gui_nick *weechat_nicklist_search_nick ( - struct t_gui_buffer *buffer, - struct t_gui_nick_group *from_group, - const char *name); -</programlisting> - </para> - <para> - Search a nick in a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>from_group</option>: search from this group only, if NULL, - then search in whole nicklist - </para> - </listitem> - <listitem> - <para> - <option>name</option>: nick name to search - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to nick found, NULL if not found. - </para> - <para> - Example: -<screen> -struct t_gui_nick *ptr_nick = - weechat_nicklist_search_nick (my_buffer, NULL, "test_nick"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_remove_group"> - <title>weechat_nicklist_remove_group</title> - - <para> - Prototype: -<programlisting> -void weechat_nicklist_remove_group ( - struct t_gui_buffer *buffer, - struct t_gui_nick_group *group); -</programlisting> - </para> - <para> - Remove a group from a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>group</option>: group pointer to remove (all - sub-groups/nicks will be removed too) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_nicklist_remove_group (my_buffer, my_group); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_remove_nick"> - <title>weechat_nicklist_remove_nick</title> - - <para> - Prototype: -<programlisting> -void weechat_nicklist_remove_nick ( - struct t_gui_buffer *buffer, - struct t_gui_nick *nick); -</programlisting> - </para> - <para> - Remove a nick from a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - <listitem> - <para> - <option>nick</option>: nick pointer to remove - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_nicklist_remove_nick (my_buffer, my_nick); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_nicklist_remove_all"> - <title>weechat_nicklist_remove_all</title> - - <para> - Prototype: -<programlisting> -void weechat_nicklist_remove_all (struct t_gui_buffer *buffer); -</programlisting> - </para> - <para> - Remove all groups/nicks from a nicklist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_nicklist_remove_all (my_buffer); -</screen> - </para> - </section> - - </section> - - <!-- ==============================[ bars ]============================== --> - - <section id="secPluginCApi_bars"> - <title>Bars</title> - - <para> - Functions for bars. - </para> - - <section id="secPluginCApi_weechat_bar_item_search"> - <title>weechat_bar_item_search</title> - - <para> - Prototype: -<programlisting> -struct t_gui_bar_item *weechat_bar_item_search (const char *name); -</programlisting> - </para> - <para> - Search a bar item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar item name - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to bar item found, NULL if bar item was not found. - </para> - <para> - Example: -<screen> -struct t_gui_bar_item *bar_item = weechat_bar_item_search ("myitem"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_item_new"> - <title>weechat_bar_item_new</title> - - <para> - Prototype: -<programlisting> -struct t_gui_bar_item *weechat_bar_item_new ( - const char *name, - char *(build_callback)(void *data, - struct t_gui_bar_item *item, - struct t_gui_window *window), - void *build_callback_data); -</programlisting> - </para> - <para> - Create a new bar item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar item name - </para> - </listitem> - <listitem> - <para> - <option>build_callback</option>: function called when bar item - is built: it must return content of bar item - </para> - </listitem> - <listitem> - <para> - <option>build_callback_data</option>: pointer given to build - callback, when it is called by Weechat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new bar item, NULL if an error occured. - </para> - <para> - Example: -<screen> -char * -my_build_callback (void *data, - struct t_gui_bar_item *item, - struct t_gui_window *window) -{ - return strdup ("my content"); -} - -struct t_gui_bar_item *my_item = weechat_bar_item_new ("myitem", - &my_build_callback, - NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_item_update"> - <title>weechat_bar_item_update</title> - - <para> - Prototype: -<programlisting> -void weechat_bar_item_update (const char *name); -</programlisting> - </para> - <para> - Update content of a bar item, by calling its build callback. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar item name - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_bar_item_update ("myitem"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_item_remove"> - <title>weechat_bar_item_remove</title> - - <para> - Prototype: -<programlisting> -void weechat_bar_item_remove (struct t_gui_bar_item *item); -</programlisting> - </para> - <para> - Remove a bar item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: bar item pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_bar_item_remove (&my_item); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_search"> - <title>weechat_bar_search</title> - - <para> - Prototype: -<programlisting> -struct t_gui_bar_item *weechat_bar_search (const char *name); -</programlisting> - </para> - <para> - Search a bar. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar name - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to bar found, NULL if bar was not found. - </para> - <para> - Example: -<screen> -struct t_gui_bar *bar = weechat_bar_search ("mybar"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_new"> - <title>weechat_bar_new</title> - - <para> - Prototype: -<programlisting> -struct t_gui_bar *weechat_bar_new ( - const char *name, - const char *hidden, - const char *priority, - const char *type, - const char *condition, - const char *position, - const char *filling_top_bottom, - const char *filling_left_right, - const char *size, - const char *size_max, - const char *color_fg, - const char *color_delim, - const char *color_bg, - const char *separator, - const char *items); -</programlisting> - </para> - <para> - Create a new item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar item name - </para> - </listitem> - <listitem> - <para> - <option>hidden</option>: "on" if bar is hidden, "off" is bar is - visible - </para> - </listitem> - <listitem> - <para> - <option>priority</option>: bar priority (integer) - </para> - </listitem> - <listitem> - <para> - <option>type</option>: "root" (bar displayed once, outside - windows), or "window" (bar displayed in each window) - </para> - </listitem> - <listitem> - <para> - <option>condition</option>: condition for displaying bar, one of - following: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Condition</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>active</entry> - <entry> - bar is displayed in active window only - </entry> - </row> - <row> - <entry>inactive</entry> - <entry> - bar is displayed in inactive window(s) only - </entry> - </row> - <row> - <entry>nicklist</entry> - <entry>bar is displayed in window(s) with nicklist</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>position</option>: "top", "bottom", "left" or "right" - </para> - </listitem> - <listitem> - <para> - <option>filling_top_bottom</option>: filling when bar is in - position "top" or "bottom", one of following: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Filling</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>horizontal</entry> - <entry> - items are filled horitontally (space after each item) - </entry> - </row> - <row> - <entry>vertical</entry> - <entry> - items are filled verticaly (new line after each item) - </entry> - </row> - <row> - <entry>columns_horizontal</entry> - <entry> - items are filled horizontally, displayed with columns - </entry> - </row> - <row> - <entry>columns_vertical</entry> - <entry> - items are filled vertically, displayed with columns - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>filling_left_right</option>: filling when bar is in - position "left" or "right", one of following: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Filling</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>horizontal</entry> - <entry> - items are filled horitontally (space after each item) - </entry> - </row> - <row> - <entry>vertical</entry> - <entry> - items are filled verticaly (new line after each item) - </entry> - </row> - <row> - <entry>columns_horizontal</entry> - <entry> - items are filled horizontally, displayed with columns - </entry> - </row> - <row> - <entry>columns_vertical</entry> - <entry> - items are filled vertically, displayed with columns - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>size</option>: bar size in chars (0 means automatic - size) - </para> - </listitem> - <listitem> - <para> - <option>size_max</option>: max size for bar (0 means no max size) - </para> - </listitem> - <listitem> - <para> - <option>color_fg</option>: color for text in bar - </para> - </listitem> - <listitem> - <para> - <option>color_delim</option>: color for delimiters in bar - </para> - </listitem> - <listitem> - <para> - <option>color_bg</option>: background color for bar - </para> - </listitem> - <listitem> - <para> - <option>separator</option>: "on" if bar has separator line with - other windows/bars, "off" otherwise - </para> - </listitem> - <listitem> - <para> - <option>items</option>: list of items in bar, separated by comma - (space between items), or "+" (glued items) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new bar, NULL if an error occured. - </para> - <para> - Example: -<screen> -struct t_gui_bar *my_bar = - weechat_bar_new ("mybar", - "off", - 100, - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "off", - "time,buffer_number+buffer_name"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_set"> - <title>weechat_bar_set</title> - - <para> - Prototype: -<programlisting> -int weechat_bar_set (struct t_gui_bar *bar, - const char *property, - const char *value); -</programlisting> - </para> - <para> - Set a new value for a bar property. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>bar</option>: bar pointer - </para> - </listitem> - <listitem> - <para> - <option>property</option>: property name: name, hidden, priority, - conditions, position, filling_top_bottom, filling_left_right, - size, size_max, color_fg, color_delim, color_bg, separator, items - (see <xref linkend="secPluginCApi_weechat_bar_new" />) - </para> - </listitem> - <listitem> - <para> - <option>value</option>: new value for property - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if new value was set, 0 if an error occured. - </para> - <para> - Example: <screen>weechat_bar_set (mybar, "position", "bottom");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_update"> - <title>weechat_bar_update</title> - - <para> - Prototype: -<programlisting> -void weechat_bar_update (const char *name); -</programlisting> - </para> - <para> - Refresh content of a bar on screen. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: bar name - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: <screen>weechat_bar_update ("mybar");</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_bar_remove"> - <title>weechat_bar_remove</title> - - <para> - Prototype: -<programlisting> -void weechat_bar_remove (struct t_gui_bar *bar); -</programlisting> - </para> - <para> - Remove a bar. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>bar</option>: bar pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: <screen>weechat_bar_remove (mybar);</screen> - </para> - </section> - - </section> - - <!-- ============================[ commands ]============================ --> - - <section id="secPluginCApi_commands"> - <title>Commands</title> - - <para> - Functions for executing WeeChat commands. - </para> - - <section id="secPluginCApi_weechat_command"> - <title>weechat_command</title> - - <para> - Prototype: -<programlisting> -void weechat_command (struct t_gui_buffer *buffer, - const char *command); -</programlisting> - </para> - <para> - Execute a command. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>buffer</option>: buffer pointer (command is executed - on this buffer, use NULL for WeeChat core buffer) - </para> - </listitem> - <listitem> - <para> - <option>command</option>: command to execute (if beginning with a - "/"), or text is sent to buffer (without leading "/") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: -<screen> -weechat_command (weechat_buffer_search ("irc", "freenode.#weechat"), - "/whois FlashCode"); -</screen> - </para> - </section> - - </section> - - <!-- ============================[ network ]============================= --> - - <section id="secPluginCApi_network"> - <title>Network</title> - - <para> - Network functions. - </para> - - <section id="secPluginCApi_weechat_network_pass_proxy"> - <title>weechat_network_pass_proxy</title> - - <para> - Prototype: -<programlisting> -int weechat_network_pass_proxy (const char *proxy, - int sock, - const char *address, - int port); -</programlisting> - </para> - <para> - Establish a connection/authentification to a proxy. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>proxy</option>: proxy name to use - </para> - </listitem> - <listitem> - <para> - <option>sock</option>: socket to use - </para> - </listitem> - <listitem> - <para> - <option>address</option>: address (hostname or IP) - </para> - </listitem> - <listitem> - <para> - <option>port</option>: port - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if connection is ok, 0 if an error occured. - </para> - <para> - Example: -<screen> -if (weechat_network_pass_proxy ("myproxy", sock, "irc.freenode.net", 6667)) -{ - /* OK */ -} -else -{ - /* error */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_network_connect_to"> - <title>weechat_network_network_connect_to</title> - - <para> - Prototype: -<programlisting> -int weechat_network_connect_to (const char *proxy, - int sock, - unsigned long address, - int port); -</programlisting> - </para> - <para> - Establish a connection to a remote host. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>proxy</option>: proxy name to use - </para> - </listitem> - <listitem> - <para> - <option>sock</option>: socket to use - </para> - </listitem> - <listitem> - <para> - <option>address</option>: address - </para> - </listitem> - <listitem> - <para> - <option>port</option>: port - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if connection is ok, 0 if an error occured. - </para> - <para> - Example: -<screen> -struct sockaddr_in addr; -socklen_t length; -unsigned long address; - -memset (&addr, 0, sizeof (struct sockaddr_in)); -length = sizeof (addr); -getsockname (sock, (struct sockaddr *) &addr, &length); -addr.sin_family = AF_INET; -address = ntohl (addr.sin_addr.s_addr); - -if (weechat_network_connect_to (NULL, sock, address, 6667)) -{ - /* OK */ -} -else -{ - /* error */ -} -</screen> - </para> - </section> - - </section> - - <!-- =============================[ infos ]============================== --> - - <section id="secPluginCApi_infos"> - <title>Infos</title> - - <para> - Functions to get infos. - </para> - - <section id="secPluginCApi_weechat_info_get"> - <title>weechat_info_get</title> - - <para> - Prototype: -<programlisting> -const char *weechat_info_get (const char *info_name, - const char *arguments); -</programlisting> - </para> - <para> - Get info from WeeChat or a plugin. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>info_name</option>: name of info to read: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Plugin</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - &infos.xml; - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>arguments</option>: arguments for info asked (optional, - NULL if no argument is needed) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: const string with info asked, NULL if an error occured. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "Current WeeChat version is: %s (compiled on %s)", - weechat_info_get ("version", NULL), - weechat_info_get ("date", NULL)); -weechat_printf (NULL, "WeeChat home is: %s", - weechat_info_get ("weechat_dir")); -</screen> - </para> - </section> - - </section> - - <!-- ===========================[ infolists ]============================ --> - - <section id="secPluginCApi_infolists"> - <title>Infolists</title> - - <para> - Infolists functions. - </para> - - <para> - An infolist is a list of "items". Each item contains variables. - For example, infolist "irc_server" has N items (N is number of IRC - servers defined). For each item, there is variables like "name", - "buffer", "is_connected", ... - Each variable has a type and a value. Possible types are: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Type</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>integer</entry> - <entry>any integer value</entry> - </row> - <row> - <entry>string</entry> - <entry>any string value</entry> - </row> - <row> - <entry>pointer</entry> - <entry>any pointer</entry> - </row> - <row> - <entry>buffer</entry> - <entry>buffer with fixed length, containing any data</entry> - </row> - <row> - <entry>time</entry> - <entry>time value</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - <section id="secPluginCApi_weechat_infolist_new"> - <title>weechat_infolist_new</title> - - <para> - Prototype: -<programlisting> -struct t_infolist *weechat_infolist_new (); -</programlisting> - </para> - <para> - Create a new infolist. - </para> - <para> - Return value: pointer to new infolist. - </para> - <para> - Example: - <screen>struct t_infolist *infolist = weechat_infolist_new ();</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_item"> - <title>weechat_infolist_new_item</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_item *weechat_infolist_new_item (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Add an item in an infolist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new item. - </para> - <para> - Example: -<screen> -struct t_infolist_item *item = weechat_infolist_new_item (infolist); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_var_integer"> - <title>weechat_infolist_new_var_integer</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_var *weechat_infolist_new_var_integer ( - struct t_infolist_item *item, - const char *name, - int value); -</programlisting> - </para> - <para> - Add an integer variable to an infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: infolist item pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: variable name - </para> - </listitem> - <listitem> - <para> - <option>value</option>: integer value - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new variable. - </para> - <para> - Example: -<screen> -struct t_infolist_var *var = - weechat_infolist_new_variable_integer (item, "my_integer", 123); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_var_string"> - <title>weechat_infolist_new_var_string</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_var *weechat_infolist_new_var_string ( - struct t_infolist_item *item, - const char *name, - const char *value); -</programlisting> - </para> - <para> - Add a string variable to an infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: infolist item pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: variable name - </para> - </listitem> - <listitem> - <para> - <option>value</option>: string value - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new variable. - </para> - <para> - Example: -<screen> -struct t_infolist_var *var = - weechat_infolist_new_variable_string (item, "my_string", "value here"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_var_pointer"> - <title>weechat_infolist_new_var_pointer</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_var *weechat_infolist_new_var_pointer ( - struct t_infolist_item *item, - const char *name, - void *pointer); -</programlisting> - </para> - <para> - Add a pointer variable to an infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: infolist item pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: variable name - </para> - </listitem> - <listitem> - <para> - <option>pointer</option>: pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new variable. - </para> - <para> - Example: -<screen> -struct t_infolist_var *var = - weechat_infolist_new_variable_pointer (item, "my_pointer", &something); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_var_buffer"> - <title>weechat_infolist_new_var_buffer</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_var *weechat_infolist_new_var_buffer ( - struct t_infolist_item *item, - const char *name, - void *pointer, - int size); -</programlisting> - </para> - <para> - Add a buffer variable to an infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: infolist item pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: variable name - </para> - </listitem> - <listitem> - <para> - <option>pointer</option>: pointer to buffer - </para> - </listitem> - <listitem> - <para> - <option>size</option>: size of buffer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new variable. - </para> - <para> - Example: -<screen> -char buffer[256]; -/* ... */ -struct t_infolist_var *var = - weechat_infolist_new_variable_buffer (item, "my_buffer", - &buffer, sizeof (buffer)); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_new_var_time"> - <title>weechat_infolist_new_var_time</title> - - <para> - Prototype: -<programlisting> -struct t_infolist_var *weechat_infolist_new_var_time ( - struct t_infolist_item *item, - const char *name, - time_t time); -</programlisting> - </para> - <para> - Add a time variable to an infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>item</option>: infolist item pointer - </para> - </listitem> - <listitem> - <para> - <option>name</option>: variable name - </para> - </listitem> - <listitem> - <para> - <option>time</option>: time value - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new variable. - </para> - <para> - Example: -<screen> -struct t_infolist_var *var = - weechat_infolist_new_variable_time (item, "my_time", time (NULL)); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_get"> - <title>weechat_infolist_get</title> - - <para> - Prototype: -<programlisting> -struct t_infolist *weechat_infolist_get (const char *infolist_name, - void *pointer, - const char *arguments); -</programlisting> - </para> - <para> - Get infolist from WeeChat or a plugin. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist_name</option>: name of infolist to read: - <informaltable colsep="0" frame="none"> - <tgroup cols="3"> - <thead> - <row> - <entry>Plugin</entry> - <entry>Name</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - &infolists.xml; - </tbody> - </tgroup> - </informaltable> - </para> - </listitem> - <listitem> - <para> - <option>pointer</option>: pointer to an item, to get only this - item in infolist (optional, can be NULL) - </para> - </listitem> - <listitem> - <para> - <option>arguments</option>: name/type of item to retrieve - (optional, can be NULL) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to infolist, NULL if an error occured. - </para> - <para> - Example: -<screen> -struct t_infolist *infolist = weechat_infolist_get ("irc_server", NULL, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_next"> - <title>weechat_infolist_next</title> - - <para> - Prototype: -<programlisting> -int weechat_infolist_next (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Move "cursor" to next item in an infolist. The first call to this - function for an infolist moves cursor to first item in infolist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if pointer is now on next item, 0 if end of list was - reached. - </para> - <para> - Example: -<screen> -if (weechat_infolist_next (infolist)) -{ - /* read variables in item... */ -} -else -{ - /* no more item available */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_prev"> - <title>weechat_infolist_prev</title> - - <para> - Prototype: -<programlisting> -int weechat_infolist_prev (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Move "cursor" to previous item in an infolist. The first call to this - function for an infolist moves cursor to last item in infolist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if pointer is now on previous item, 0 if beginning of - list was reached. - </para> - <para> - Example: -<screen> -if (weechat_infolist_prev (infolist)) -{ - /* read variables in item... */ -} -else -{ - /* no more item available */ -} -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_reset_item_cursor"> - <title>weechat_infolist_reset_item_cursor</title> - - <para> - Prototype: -<programlisting> -void weechat_infolist_reset_item_cursor (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Reset "cursor" for infolist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: <screen>weechat_infolist_reset_item_cursor (infolist);</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_fields"> - <title>weechat_infolist_fields</title> - - <para> - Prototype: -<programlisting> -const char *weechat_infolist_fields (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Get list of fields for current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string with list of fields for current infolist item. - List is comma separated, and contains letter for type, followed by - variable name. Types are: "i" (integer), "s" (string), "p" (pointer), - "b" (buffer), "t" (time). - </para> - <para> - Example: -<screen> -const char *fields = weechat_infolist_fields (infolist); -/* fields contains something like: - "i:my_integer,s:my_string,p:my_pointer,b:my_buffer,t:my_time" */ -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_integer"> - <title>weechat_infolist_integer</title> - - <para> - Prototype: -<programlisting> -int weechat_infolist_integer (struct t_infolist *infolist, - const char *var); -</programlisting> - </para> - <para> - Get value of integer variable in current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - <listitem> - <para> - <option>var</option>: variable name (must be type "integer") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: integer value of variable. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "integer value = %d", - weechat_infolist_integer (infolist, "my_integer")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_string"> - <title>weechat_infolist_string</title> - - <para> - Prototype: -<programlisting> -const char *weechat_infolist_string (struct t_infolist *infolist, - const char *var); -</programlisting> - </para> - <para> - Get value of string variable in current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - <listitem> - <para> - <option>var</option>: variable name (must be type "string") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: string value of variable. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "string value = %s", - weechat_infolist_string (infolist, "my_string")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_pointer"> - <title>weechat_infolist_pointer</title> - - <para> - Prototype: -<programlisting> -void *weechat_infolist_pointer (struct t_infolist *infolist, - const char *var); -</programlisting> - </para> - <para> - Get value of pointer variable in current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - <listitem> - <para> - <option>var</option>: variable name (must be type "pointer") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer value of variable. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "pointer value = 0x%lx", - weechat_infolist_pointer (infolist, "my_pointer")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_buffer"> - <title>weechat_infolist_buffer</title> - - <para> - Prototype: -<programlisting> -void *weechat_infolist_buffer (struct t_infolist *infolist, - const char *var, - int *size); -</programlisting> - </para> - <para> - Get value of buffer variable in current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - <listitem> - <para> - <option>var</option>: variable name (must be type "buffer") - </para> - </listitem> - <listitem> - <para> - <option>size</option>: pointer to integer variable, will be set - with buffer size - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: buffer pointer. - </para> - <para> - Example: -<screen> -int size; -void *pointer = weechat_infolist_buffer (infolist, "my_buffer", &size); -weechat_printf (NULL, "buffer pointer = 0x%lx, size = %d", - pointer, size); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_time"> - <title>weechat_infolist_time</title> - - <para> - Prototype: -<programlisting> -time_t weechat_infolist_time (struct t_infolist *infolist, - const char *var); -</programlisting> - </para> - <para> - Get value of time variable in current infolist item. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - <listitem> - <para> - <option>var</option>: variable name (must be type "time") - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: time value of variable. - </para> - <para> - Example: -<screen> -weechat_printf (NULL, "time value = 0x%ld", - weechat_infolist_time (infolist, "my_time")); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_infolist_free"> - <title>weechat_infolist_free</title> - - <para> - Prototype: -<programlisting> -void weechat_infolist_free (struct t_infolist *infolist); -</programlisting> - </para> - <para> - Free an infolist. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>infolist</option>: infolist pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: - <screen>weechat_infolist_free (infolist);</screen> - </para> - </section> - - </section> - - <!-- ============================[ upgrade ]============================= --> - - <section id="secPluginCApi_upgrade"> - <title>Upgrade</title> - - <para> - Functions for WeeChat upgrading. - </para> - - <section id="secPluginCApi_weechat_upgrade_new"> - <title>weechat_upgrade_new</title> - - <para> - Prototype: -<programlisting> -struct t_upgrade_file *weechat_upgrade_new (const char *filename, - int write); -</programlisting> - </para> - <para> - Create or read a file for upgrade. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>filename</option>: name of file (extension ".upgrade" - will be added to this name by WeeChat) - </para> - <para> - <option>write</option>: 1 to create file (write mode, before - upgrade), 0 to read file (after upgrade) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: pointer to new upgrade file. - </para> - <para> - Example: -<screen> -struct t_upgrade_file *upgrade_file = weechat_upgrade_new ("my_file"); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_upgrade_write_object"> - <title>weechat_upgrade_write_object</title> - - <para> - Prototype: -<programlisting> -struct t_upgrade_file *weechat_upgrade_write_object ( - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist); -</programlisting> - </para> - <para> - Write an object in upgrade file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>upgrade_file</option>: upgrade file pointer - </para> - <para> - <option>object_id</option>: id for object - </para> - <para> - <option>infolist</option>: infolist to write in file - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if ok, 0 if error. - </para> - <para> - Example: -<screen> -weechat_upgrade_write_object (upgrade_file, 1, &infolist); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_upgrade_read"> - <title>weechat_upgrade_read</title> - - <para> - Prototype: -<programlisting> -struct t_upgrade_file *weechat_upgrade_read ( - struct t_upgrade_file *upgrade_file, - int (*callback_read)(void *data, - struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist), - void *callback_read_data); -</programlisting> - </para> - <para> - Read an upgrade file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>upgrade_file</option>: upgrade file pointer - </para> - <para> - <option>callback_read</option>: callback called for each object - read in upgrade file - </para> - <para> - <option>callback_read_data</option>: pointer given to read - callback when it is called by WeeChat - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if ok, 0 if error. - </para> - <para> - Example: -<screen> -int -my_upgrade_read_cb (struct t_upgrade_file *upgrade_file, - int object_id, - struct t_infolist *infolist) -{ - /* read variables... */ - return WEECHAT_RC_OK; -} - -weechat_upgrade_read (upgrade_file, &my_upgrade_read_cb, NULL); -</screen> - </para> - </section> - - <section id="secPluginCApi_weechat_upgrade_close"> - <title>weechat_upgrade_close</title> - - <para> - Prototype: -<programlisting> -void weechat_upgrade_close (struct t_upgrade_file *upgrade_file); -</programlisting> - </para> - <para> - Close an upgrade file. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>upgrade_file</option>: upgrade file pointer - </para> - </listitem> - </itemizedlist> - </para> - <para> - Example: <screen>weechat_upgrade_close (upgrade_file);</screen> - </para> - </section> - - </section> - -</section> diff --git a/doc/en/dev/plugin_script_api.en.xml b/doc/en/dev/plugin_script_api.en.xml deleted file mode 100644 index 0067b6f3a..000000000 --- a/doc/en/dev/plugin_script_api.en.xml +++ /dev/null @@ -1,467 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secScriptPluginAPI"> - <title>Script plugin API</title> - - <para> - Five plugins are provided with WeeChat to use script languages: - Perl, Python, Ruby, Lua and Tcl. - </para> - - <section id="secLoadUnloadScripts"> - <title>Load / unload scripts</title> - - <para> - Scripts are loaded and unloaded with <command>/perl</command>, - <command>/python</command>, <command>/ruby</command>, - <command>/lua</command> and <command>/tcl</command> commands - (type <command>/help</command> in WeeChat for help about commands). - </para> - - <para> - Examples: - <itemizedlist> - <listitem> - <para> - Load a Perl script: - <command><userinput>/perl load /tmp/test.pl</userinput></command> - </para> - </listitem> - <listitem> - <para> - List all loaded Perl scripts: - <command><userinput>/perl</userinput></command> - </para> - </listitem> - <listitem> - <para> - Load a Python script: - <command><userinput>/python load /tmp/test.py</userinput></command> - </para> - </listitem> - <listitem> - <para> - List all loaded Python scripts: - <command><userinput>/python</userinput></command> - </para> - </listitem> - <listitem> - <para> - Load a Ruby script: - <command><userinput>/ruby load /tmp/test.rb</userinput></command> - </para> - </listitem> - <listitem> - <para> - List all loaded Ruby scripts: - <command><userinput>/ruby</userinput></command> - </para> - </listitem> - <listitem> - <para> - Load a Lua script: - <command><userinput>/lua load /tmp/test.lua</userinput></command> - </para> - </listitem> - <listitem> - <para> - List all loaded Lua scripts: - <command><userinput>/lua</userinput></command> - </para> - </listitem> - <listitem> - <para> - Load a Tcl script: - <command><userinput>/tcl load /tmp/test.tcl</userinput></command> - </para> - </listitem> - <listitem> - <para> - List all loaded Tcl scripts: - <command><userinput>/tcl</userinput></command> - </para> - </listitem> - </itemizedlist> - </para> - - </section> - - <section id="secSyntaxByLanguage"> - <title>Syntax by language</title> - - <section id="secScriptPerl"> - <title>Perl</title> - - <para> - In a WeeChat Perl script, all API functions and variables are - prefixed by "<literal>weechat::</literal>". - Example: -<screen> -weechat::register("test", "Author <author\@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", ""); -</screen> - </para> - - </section> - - <section id="secScriptPython"> - <title>Python</title> - - <para> - A WeeChat Python script has to start by importing weechat: - <screen>import weechat</screen> - </para> - - <para> - All API functions and variables are prefixed by - "<literal>weechat.</literal>". - Example: -<screen> -weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") -</screen> - </para> - - </section> - - <section id="secScriptRuby"> - <title>Ruby</title> - - <para> - In a WeeChat Ruby script, all code has to be in functions. - So for main code, you have to define a - "<literal>weechat_init</literal>" function, which is automatically - called when script is loaded by WeeChat. Example: -<screen> -def weechat_init - Weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") - return Weechat::WEECHAT_RC_OK -end -</screen> - </para> - - <para> - All API functions are prefixed by - "<literal>Weechat.</literal>" and variables by - "<literal>Weechat::</literal>". - </para> - - </section> - - <section id="secScriptLua"> - <title>Lua</title> - - <para> - In a WeeChat Lua script, all API functions are prefixed by - "<literal>weechat.</literal>". - Variables are prefixed by "<literal>weechat.</literal>" and - suffixed by "<literal>()</literal>". - Example: -<screen> -weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") -</screen> - </para> - - </section> - - <section id="secScriptTcl"> - <title>Tcl</title> - - <para> - In a WeeChat Tcl script, all API functions are prefixed by - "<literal>weechat::</literal>". - Variables are prefixed by "<literal>$weechat::</literal>". - Example: -<screen> -weechat::register "test" "Author <author@domain.com>" "1.0" "GPL3" "Script description" "bye_bye" "" -</screen> - </para> - - </section> - - </section> - - <section id="secWeeChatScriptsAPI"> - <title>WeeChat / scripts API</title> - - <section id="secScript_register"> - <title>register</title> - - <para> - Perl prototype: - <command> - weechat::register(name, author, version, license, description, - end_function, charset); - </command> - </para> - <para> - Python prototype: - <command> - weechat.register(name, author, version, license, description, - end_function, charset) - </command> - </para> - <para> - Ruby prototype: - <command> - Weechat.register(name, author, version, license, description, - end_function, charset) - </command> - </para> - <para> - Lua prototype: - <command> - weechat.register(name, author, version, license, description, - end_function, charset) - </command> - </para> - <para> - Tcl prototype: - <command> - weechat::register name author version license description - end_function charset - </command> - </para> - <para> - This is first function to call in script. - All WeeChat scripts have to call this function. - </para> - <para> - Arguments: - <itemizedlist> - <listitem> - <para> - <option>name</option>: unique name to identify script - (each script must have unique name) - </para> - </listitem> - <listitem> - <para> - <option>author</option>: string with author (may include name, - nick, e-mail, ..) - </para> - </listitem> - <listitem> - <para> - <option>version</option>: script version - </para> - </listitem> - <listitem> - <para> - <option>description</option>: short description of script - </para> - </listitem> - <listitem> - <para> - <option>end_function</option>: function called when script is - unloaded (optional parameter, empty string means nothing is - called at the end) - </para> - </listitem> - <listitem> - <para> - <option>charset</option>: charset used by script, you should - set this if script is NOT written with UTF-8 (you can use blank - value for UTF-8 script, which is default charset) - </para> - </listitem> - </itemizedlist> - </para> - <para> - Return value: 1 if script was registered, 0 if an error occured. - </para> - <para> - Examples: -<screen> -# perl -weechat::register("test", "Author <author\@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", ""); - -# python -weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") - -# ruby -Weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") - --- lua -weechat.register("test", "Author <author@domain.com>", "1.0", - "GPL3", "Script description", "bye_bye", "") - -# tcl -weechat::register "test" "Author <author@domain.com>" "1.0" "GPL3" "Script description" "bye_bye" "" -</screen> - </para> - </section> - - <section id="secOther_functions"> - <title>Other functions</title> - - <para> - Following functions are in script API (for description, see - <xref linkend="secPluginCApi" />). - <itemizedlist> - <listitem><para>plugin_get_name</para></listitem> - <listitem><para>set_charset</para></listitem> - <listitem><para>plugin_get_name</para></listitem> - <listitem><para>charset_set</para></listitem> - <listitem><para>iconv_to_internal</para></listitem> - <listitem><para>iconv_from_internal</para></listitem> - <listitem><para>gettext</para></listitem> - <listitem><para>ngettext</para></listitem> - <listitem><para>string_remove_color</para></listitem> - <listitem><para>mkdir_home</para></listitem> - <listitem><para>mkdir</para></listitem> - <listitem><para>mkdir_parents</para></listitem> - <listitem><para>list_new</para></listitem> - <listitem><para>list_add</para></listitem> - <listitem><para>list_search</para></listitem> - <listitem><para>list_casesearch</para></listitem> - <listitem><para>list_get</para></listitem> - <listitem><para>list_set</para></listitem> - <listitem><para>list_next</para></listitem> - <listitem><para>list_prev</para></listitem> - <listitem><para>list_string</para></listitem> - <listitem><para>list_size</para></listitem> - <listitem><para>list_remove</para></listitem> - <listitem><para>list_remove_all</para></listitem> - <listitem><para>list_free</para></listitem> - <listitem><para>config_new</para></listitem> - <listitem><para>config_new_section</para></listitem> - <listitem><para>config_search_section</para></listitem> - <listitem><para>config_new_option</para></listitem> - <listitem><para>config_search_option</para></listitem> - <listitem><para>config_string_to_boolean</para></listitem> - <listitem><para>config_option_reset</para></listitem> - <listitem><para>config_option_set</para></listitem> - <listitem><para>config_option_set_null</para></listitem> - <listitem><para>config_option_unset</para></listitem> - <listitem><para>config_option_rename</para></listitem> - <listitem><para>config_option_is_null</para></listitem> - <listitem><para>config_option_default_is_null</para></listitem> - <listitem><para>config_boolean</para></listitem> - <listitem><para>config_boolean_default</para></listitem> - <listitem><para>config_integer</para></listitem> - <listitem><para>config_integer_default</para></listitem> - <listitem><para>config_string</para></listitem> - <listitem><para>config_string_default</para></listitem> - <listitem><para>config_color</para></listitem> - <listitem><para>config_color_default</para></listitem> - <listitem><para>config_write_option</para></listitem> - <listitem><para>config_write_line</para></listitem> - <listitem><para>config_write</para></listitem> - <listitem><para>config_read</para></listitem> - <listitem><para>config_reload</para></listitem> - <listitem><para>config_option_free</para></listitem> - <listitem><para>config_section_free_options</para></listitem> - <listitem><para>config_section_free</para></listitem> - <listitem><para>config_free</para></listitem> - <listitem><para>config_get</para></listitem> - <listitem><para>config_get_plugin</para></listitem> - <listitem><para>config_set_plugin</para></listitem> - <listitem><para>config_unset_plugin</para></listitem> - <listitem><para>prefix</para></listitem> - <listitem><para>color</para></listitem> - <listitem><para>print</para></listitem> - <listitem><para>print_date_tags</para></listitem> - <listitem><para>print_y</para></listitem> - <listitem><para>log_print</para></listitem> - <listitem><para>hook_command</para></listitem> - <listitem><para>hook_command_run</para></listitem> - <listitem><para>hook_timer</para></listitem> - <listitem><para>hook_fd</para></listitem> - <listitem><para>hook_process</para></listitem> - <listitem><para>hook_connect</para></listitem> - <listitem><para>hook_print</para></listitem> - <listitem><para>hook_signal</para></listitem> - <listitem><para>hook_signal_send</para></listitem> - <listitem><para>hook_config</para></listitem> - <listitem><para>hook_completion</para></listitem> - <listitem><para>hook_completion_list_add</para></listitem> - <listitem><para>hook_modifier</para></listitem> - <listitem><para>hook_modifier_exec</para></listitem> - <listitem><para>hook_info</para></listitem> - <listitem><para>hook_infolist</para></listitem> - <listitem><para>unhook</para></listitem> - <listitem><para>unhook_all</para></listitem> - <listitem><para>buffer_new</para></listitem> - <listitem><para>buffer_search</para></listitem> - <listitem><para>current_buffer</para></listitem> - <listitem><para>buffer_clear</para></listitem> - <listitem><para>buffer_close</para></listitem> - <listitem><para>buffer_get_integer</para></listitem> - <listitem><para>buffer_get_string</para></listitem> - <listitem><para>buffer_get_pointer</para></listitem> - <listitem><para>buffer_set</para></listitem> - <listitem><para>current_window</para></listitem> - <listitem><para>window_get_integer</para></listitem> - <listitem><para>window_get_string</para></listitem> - <listitem><para>window_get_pointer</para></listitem> - <listitem><para>nicklist_add_group</para></listitem> - <listitem><para>nicklist_search_group</para></listitem> - <listitem><para>nicklist_add_nick</para></listitem> - <listitem><para>nicklist_search_nick</para></listitem> - <listitem><para>nicklist_remove_group</para></listitem> - <listitem><para>nicklist_remove_nick</para></listitem> - <listitem><para>nicklist_remove_all</para></listitem> - <listitem><para>bar_item_search</para></listitem> - <listitem><para>bar_item_new</para></listitem> - <listitem><para>bar_item_update</para></listitem> - <listitem><para>bar_item_remove</para></listitem> - <listitem><para>bar_search</para></listitem> - <listitem><para>bar_new</para></listitem> - <listitem><para>bar_set</para></listitem> - <listitem><para>bar_update</para></listitem> - <listitem><para>bar_remove</para></listitem> - <listitem><para>command</para></listitem> - <listitem><para>info_get</para></listitem> - <listitem><para>infolist_new</para></listitem> - <listitem><para>infolist_new_var_integer</para></listitem> - <listitem><para>infolist_new_var_string</para></listitem> - <listitem><para>infolist_new_var_pointer</para></listitem> - <listitem><para>infolist_new_var_time</para></listitem> - <listitem><para>infolist_get</para></listitem> - <listitem><para>infolist_next</para></listitem> - <listitem><para>infolist_prev</para></listitem> - <listitem><para>infolist_fields</para></listitem> - <listitem><para>infolist_integer</para></listitem> - <listitem><para>infolist_string</para></listitem> - <listitem><para>infolist_pointer</para></listitem> - <listitem><para>infolist_time</para></listitem> - <listitem><para>infolist_free</para></listitem> - <listitem><para>upgrade_new</para></listitem> - <listitem><para>upgrade_write_object</para></listitem> - <listitem><para>upgrade_read</para></listitem> - <listitem><para>upgrade_close</para></listitem> - </itemizedlist> - </para> - - </section> - - </section> - -</section> diff --git a/doc/en/dev/plugins.en.xml b/doc/en/dev/plugins.en.xml deleted file mode 100644 index cde8d314c..000000000 --- a/doc/en/dev/plugins.en.xml +++ /dev/null @@ -1,238 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapPlugins"> - <title>Plugins</title> - - <para> - This chapter describes WeeChat plugin API and default plugins provided with - WeeChat. - </para> - - <section id="secPluginsInWeeChat"> - <title>Plugins in WeeChat</title> - - <para> - A plugin is a C program which can call WeeChat functions defined in - an interface. - </para> - - <para> - This C program does not need WeeChat sources to compile and can be - dynamically loaded into WeeChat with command - <command>/plugin</command>. - </para> - - <para> - The plugin has to be a dynamic library, for dynamic loading by - operating system. - Under GNU/Linux, the file has ".so" extension, ".dll" under - Windows. - </para> - - </section> - - <section id="secWriteAPlugin"> - <title>Write a plugin</title> - - <para> - The plugin has to include "weechat-plugin.h" file (available in - WeeChat source code). - This file defines structures and types used to communicate with - WeeChat. - </para> - - <para> - The plugin must use some mandatory macros (to define some variables) - and some functions (without them the plugin can't load): - - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Macro</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>WEECHAT_PLUGIN_NAME</literal></entry> - <entry>plugin name</entry> - </row> - <row> - <entry><literal>WEECHAT_PLUGIN_DESCRIPTION</literal></entry> - <entry>short description of plugin</entry> - </row> - <row> - <entry><literal>WEECHAT_PLUGIN_VERSION</literal></entry> - <entry>plugin version</entry> - </row> - <row> - <entry><literal>WEECHAT_PLUGIN_WEECHAT_VERSION</literal></entry> - <entry> - target WeeChat version where plugin will run (warning: plugin - will not run on any other WeeChat version!) - </entry> - </row> - <row> - <entry><literal>WEECHAT_PLUGIN_LICENSE</literal></entry> - <entry>plugin license</entry> - </row> - </tbody> - </tgroup> - </informaltable> - - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Function</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>int weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])</literal></entry> - <entry> - function called when plugin is loaded, must return - WEECHAT_RC_OK if successful, WEECHAT_RC_ERROR if error - (if error, plugin will NOT be loaded), argc/argv are arguments - for plugin (given on command line by user) - </entry> - </row> - <row> - <entry><literal>int weechat_plugin_end (struct t_weechat_plugin *plugin)</literal></entry> - <entry>function called when plugin is unloaded</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - <section id="secCompilePlugin"> - <title>Compile plugin</title> - - <para> - Compile does not need WeeChat sources, only file - "<literal>weechat-plugin.h</literal>". - </para> - - <para> - To compile a plugin which has one file "toto.c" (under GNU/Linux): -<screen> -<prompt>$ </prompt><userinput>gcc -fPIC -Wall -c toto.c</userinput> -<prompt>$ </prompt><userinput>gcc -shared -fPIC -o libtoto.so toto.o</userinput> -</screen> - </para> - - </section> - - <section id="secLoadPlugin"> - <title>Load plugin into WeeChat</title> - - <para> - Copy "libtoto.so" file into system plugins directory (for example - "<literal>/usr/local/lib/weechat/plugins</literal>") or into - user's plugins directory (for example - "<literal>/home/xxxxx/.weechat/plugins</literal>"). - </para> - - <para> - Under WeeChat: - <screen><userinput>/plugin load toto</userinput></screen> - </para> - - </section> - - <section id="secPluginExample"> - <title>Plugin example</title> - - <para> - Full example of plugin, which adds a /double command, which displays - two times arguments on current buffer, or execute two times a command - (ok that's not very useful, but that's just an example!): -<screen> -#include <stdlib.h> - -#include "weechat-plugin.h" - -WEECHAT_PLUGIN_NAME("double"); -WEECHAT_PLUGIN_DESCRIPTION("Test plugin for WeeChat"); -WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); -WEECHAT_PLUGIN_VERSION("0.1"); -WEECHAT_PLUGIN_WEECHAT_VERSION("0.3.0"); -WEECHAT_PLUGIN_LICENSE("GPL3"); - -struct t_weechat_plugin *weechat_plugin = NULL; - - -/* "/double" command manager */ - -int -double_cmd (void *data, struct t_gui_buffer *buffer, int argc, - char **argv, char **argv_eol) -{ - /* make C compiler happy */ - (void) argv; - - if (argc > 1) - { - weechat_command (NULL, argv_eol[1]); - weechat_command (NULL, argv_eol[1]); - } - - return WEECHAT_RC_OK; -} - -int -weechat_plugin_init (struct t_weechat_plugin *plugin, - int argc, char *argv[]) -{ - weechat_plugin = plugin; - - weechat_hook_command ("double", - "Display two times a message", - "msg", - "msg: message to display two times", - NULL, - &double_cmd, NULL); - - return WEECHAT_RC_OK; -} - -int -weechat_plugin_end (struct t_weechat_plugin *plugin) -{ - /* nothing done here */ - (void) plugin; - - return WEECHAT_RC_OK; -} -</screen> - </para> - - </section> - - </section> - -</chapter> diff --git a/doc/en/dev/weechat_dev.en.xml b/doc/en/dev/weechat_dev.en.xml deleted file mode 100644 index 6e4232545..000000000 --- a/doc/en/dev/weechat_dev.en.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" -"file:///usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd" -[ - <!-- ***** auto-built: ***** --> - <!ENTITY date.xml SYSTEM "date.xml"> - <!ENTITY % include_autogen.xml SYSTEM "include_autogen.xml"> - %include_autogen.xml; - - <!-- ***** written by hand: ***** --> - <!ENTITY intro.en.xml SYSTEM "intro.en.xml"> - <!ENTITY plugins.en.xml SYSTEM "plugins.en.xml"> - <!ENTITY plugin_api.en.xml SYSTEM "plugin_api.en.xml"> - <!ENTITY plugin_c_api.en.xml SYSTEM "plugin_c_api.en.xml"> - <!ENTITY plugin_script_api.en.xml SYSTEM "plugin_script_api.en.xml"> - <!ENTITY authors.en.xml SYSTEM "authors.en.xml"> -]> - -<book lang="en"> - - <bookinfo> - - <title>WeeChat 0.3.0-dev - Developer guide</title> - <subtitle>Fast, light and extensible chat client</subtitle> - - <author> - <firstname>Sébastien</firstname> - <surname>Helleu</surname> - <email>flashcode AT flashtux.org</email> - </author> - - &date.xml; - - <copyright> - <year>2009</year> - <holder>Sébastien Helleu</holder> - </copyright> - - <legalnotice> - <para> - This manual is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - </para> - <para> - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - </para> - <para> - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. - </para> - </legalnotice> - - <abstract> - <para> - This manual documents development of WeeChat and its extensions. - It is part of WeeChat. - </para> - <para> - Latest version of this document can be found on this page: - <ulink url="http://weechat.flashtux.org/doc.php"> - http://weechat.flashtux.org/doc.php - </ulink> - </para> - </abstract> - - </bookinfo> - - &intro.en.xml; - - &plugins.en.xml; - - &plugin_api.en.xml; - - &authors.en.xml; - -</book> diff --git a/doc/en/intro.en.xml b/doc/en/intro.en.xml deleted file mode 100644 index 5f0a51fc4..000000000 --- a/doc/en/intro.en.xml +++ /dev/null @@ -1,147 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapIntroduction"> - <title>Introduction</title> - - <para> - This chapter describes WeeChat and pre-requisites for its installation. - </para> - - <section id="secDescription"> - <title>Description</title> - - <para> - WeeChat (Wee Enhanced Environment for Chat) is a free chat client, - fast and light, designed for many operating systems. - </para> - - <para> - Main features are: - <itemizedlist> - <listitem> - <para> - multi-protocols (IRC and other soon) - </para> - </listitem> - <listitem> - <para> - multi-servers connection (with SSL, IPv6, proxy) - </para> - </listitem> - <listitem> - <para> - many GUI: Curses (wxWidgets, Gtk and Qt under development) - </para> - </listitem> - <listitem> - <para> - small, fast and light - </para> - </listitem> - <listitem> - <para> - customizable and extensible with plugins and scripts - </para> - </listitem> - <listitem> - <para> - compliant with IRC <acronym>RFC</acronym>s - <ulink url="http://www.ietf.org/rfc/rfc1459.txt">1459</ulink>, - <ulink url="http://www.ietf.org/rfc/rfc2810.txt">2810</ulink>, - <ulink url="http://www.ietf.org/rfc/rfc2811.txt">2811</ulink>, - <ulink url="http://www.ietf.org/rfc/rfc2812.txt">2812</ulink> and - <ulink url="http://www.ietf.org/rfc/rfc2813.txt">2813</ulink> - </para> - </listitem> - <listitem> - <para> - multi-platform (GNU/Linux, *BSD, MacOS X, Windows and other) - </para> - </listitem> - <listitem> - <para> - 100% GPL, free software - </para> - </listitem> - </itemizedlist> - </para> - - <para> - WeeChat homepage is here: - <ulink url="http://weechat.flashtux.org/"> - http://weechat.flashtux.org/ - </ulink> - </para> - - </section> - - <section id="secPreRequisites"> - <title>Pre-requisites</title> - - <para> - In order to install WeeChat, you <emphasis>need</emphasis>: - <itemizedlist> - <listitem> - <para> - a running GNU/Linux system (with compiler tools for source - package), or compatible OS (see above) - </para> - </listitem> - <listitem> - <para> - "root" privileges (to install WeeChat in a system directory) - </para> - </listitem> - <listitem> - <para> - according to GUI, one of the following libraries: - <itemizedlist> - <listitem> - <para> - Curses: ncurses library - </para> - </listitem> - <listitem> - <para> - Gtk: <emphasis>*** GUI not developed ***</emphasis> - </para> - </listitem> - <listitem> - <para> - WxWidgets: <emphasis>*** GUI not developed ***</emphasis> - </para> - </listitem> - <listitem> - <para> - Qt: <emphasis>*** GUI not developed ***</emphasis> - </para> - </listitem> - </itemizedlist> - </para> - </listitem> - </itemizedlist> - </para> - - </section> -</chapter> diff --git a/doc/en/user/install.en.xml b/doc/en/user/install.en.xml deleted file mode 100644 index 48e305ba0..000000000 --- a/doc/en/user/install.en.xml +++ /dev/null @@ -1,135 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapInstallation"> - <title>Installation</title> - - <para> - This chapter explains how to install WeeChat. - </para> - - <section id="secBinaryPackages"> - <title>Binary packages</title> - - <para> - Binary packages are available for many distributions, including: - <itemizedlist> - <listitem> - <para> - Debian (or any Debian compatible distribution): - <screen><userinput>apt-get install weechat</userinput></screen> - </para> - </listitem> - <listitem> - <para> - Mandriva/RedHat (or any RPM compatible distribution): - <screen><userinput>rpm -i /path/to/weechat-x.y.z-1.i386.rpm</userinput></screen> - </para> - </listitem> - <listitem> - <para> - Gentoo : - <screen><userinput>emerge weechat</userinput></screen> - </para> - </listitem> - </itemizedlist> - - Some additional packages may be useful, like weechat-plugins. - - For other distributions, please look at your manual for - installation instructions. - </para> - - </section> - - <section id="secSourcePackage"> - <title>Source package</title> - - <para> - WeeChat can be compiled with autotools or cmake. - </para> - - <section id="secCompileWithAutotools"> - <title>Compile with Autotools</title> - - <para> - In a console or a terminal: -<screen><prompt>$ </prompt><userinput>./configure</userinput> -<prompt>$ </prompt><userinput>make</userinput></screen> - </para> - <para> - Then get root privileges and install WeeChat: -<screen><prompt>$ </prompt><userinput>su</userinput> -(enter root password) -<prompt># </prompt><userinput>make install</userinput></screen> - </para> - - </section> - - <section id="secCompileWithCmake"> - <title>Compile with Cmake</title> - - <para> - In a console or a terminal: -<screen><prompt>$ </prompt><userinput>mkdir build</userinput> -<prompt>$ </prompt><userinput>cd build</userinput> -<prompt>$ </prompt><userinput>cmake ..</userinput> -<prompt>$ </prompt><userinput>make</userinput></screen> - </para> - <para> - Then get root privileges and install WeeChat: -<screen><prompt>$ </prompt><userinput>su</userinput> -(enter root password) -<prompt># </prompt><userinput>make install</userinput></screen> - </para> - - </section> - - </section> - - <section id="secGITSources"> - <title>GIT sources</title> - - <para> - Warning: GIT sources are for advanced users: it may not compile - or not be stable. You're warned! - </para> - - <para> - To get GIT sources, issue this command: -<screen><prompt>$ </prompt><userinput>git clone git://git.sv.gnu.org/weechat.git</userinput></screen> - </para> - - <para> - If you're using Autotools (and not cmake), execute this script: - <userinput>./autogen.sh</userinput> - </para> - - <para> - Then follow instructions for source package - (see <xref linkend="secSourcePackage" />) - </para> - - </section> - -</chapter> diff --git a/doc/en/user/plugin_alias.en.xml b/doc/en/user/plugin_alias.en.xml deleted file mode 100644 index 5f2c2de6d..000000000 --- a/doc/en/user/plugin_alias.en.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginAlias"> - <title>Alias plugin</title> - - <para> - Alias plugin lets you create alias for commands (from WeeChat or other - plugins). - </para> - - <section id="secAliasCommands"> - <title>Commands</title> - - <para> - &alias_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_aspell.en.xml b/doc/en/user/plugin_aspell.en.xml deleted file mode 100644 index b28bb66d4..000000000 --- a/doc/en/user/plugin_aspell.en.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginAspell"> - <title>Aspell plugin</title> - - <para> - Aspell plugin lets you check spelling in command line. - It is possible to use many languages by buffer. - </para> - - <section id="secAspellOptions"> - <title>Options (file aspell.conf)</title> - - <para> - &aspell_options.xml; - </para> - - </section> - - <section id="secAspellCommands"> - <title>Commands</title> - - <para> - &aspell_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_charset.en.xml b/doc/en/user/plugin_charset.en.xml deleted file mode 100644 index e9eb577c8..000000000 --- a/doc/en/user/plugin_charset.en.xml +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginCharset"> - <title>Charset plugin</title> - - <para> - Charset plugin lets you decode or encode data using charsets. - There is default charset for decode/encode, and specific charsets - for buffers (or group of buffers). - This plugin is optional, but recommended: if it's not loaded, WeeChat - can only read/write UTF-8 data. - </para> - - <para> - Charset plugin should be autoloaded by WeeChat at startup. - To be sure plugin is loaded, try: <command>/charset</command>. - If command is not found, then load plugin with command: - <screen>/plugin load charset</screen> - If plugin is not found, then you should compile again WeeChat with - plugins and Charset support. - </para> - - <para> - When Charset plugin starts, it displays terminal and internal charsets. - Terminal charset depends on your locale, and internal is UTF-8. - For example : - <screen>charset: terminal: ISO-8859-15, internal: UTF-8</screen> - </para> - - <section id="secCharsetOptions"> - <title>Options (file charset.conf)</title> - - <para> - &charset_options.xml; - </para> - - <para> - <itemizedlist> - <listitem> - <para> - To set global decode and encode charsets, use command - <command>/set</command>. - For example: -<screen> -/set charset.default.decode ISO-8859-15 -/set charset.default.encode ISO-8859-15 -</screen> - If global decode charset is not set (for example during first - load of Charset plugin), it will be automatically set to terminal - charset (if it's different from UTF-8), or by default to - "<literal>ISO-8859-1</literal>". - Default encode value is empty, so it sends by default with - internal charset (UTF-8). - </para> - </listitem> - <listitem> - <para> - To set IRC server charset, use command <command>/charset</command> on - server buffer. - If you give only charset, then it will set "decode" and "encode" - values. - For example: - <screen>/charset ISO-8859-15</screen> - It's equivalent to: -<screen> -/charset decode ISO-8859-15 -/charset encode ISO-8859-15 -</screen> - </para> - </listitem> - <listitem> - <para> - To set IRC channel (or private) charset, use same commands as server, - but on channel (or private) buffer. - </para> - </listitem> - <listitem> - <para> - To set charset for all IRC channels (and privates) of an IRC server, - use following command: - <screen>/set charset.decode.irc.freenode ISO-8859-15</screen> - </para> - </listitem> - <listitem> - <para> - To see all charsets used, use following command: - <screen>/set charset.*</screen> - </para> - </listitem> - </itemizedlist> - </para> - - </section> - - <section id="secCharsetCommands"> - <title>Commands</title> - - <para> - &charset_commands.xml; - </para> - - </section> - - <section id="secCharsetFAQ"> - <title>FAQ</title> - - <para> - If you have problems with chars or accents using Charset plugin: - <itemizedlist> - <listitem> - <para> - check that weechat-curses is linked to libncursesw (warning: - needed on most distributions but not all) : - <screen>ldd /path/to/weechat-curses</screen> - </para> - </listitem> - <listitem> - <para> - check charset line (on WeeChat buffer), you should see - ISO-XXXXXX or UTF-8 for terminal charset. If you see - ANSI_X3.4-1968 or other values, probably your locale is wrong. - </para> - </listitem> - <listitem> - <para> - setup global decode value, for example: - <screen>/set charset.default.decode ISO-8859-15</screen> - </para> - </listitem> - </itemizedlist> - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_fifo.en.xml b/doc/en/user/plugin_fifo.en.xml deleted file mode 100644 index 7f95eb449..000000000 --- a/doc/en/user/plugin_fifo.en.xml +++ /dev/null @@ -1,95 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginFifo"> - <title>FIFO plugin</title> - - <para> - You can remote control WeeChat, by sending commands or text to a - FIFO pipe (if option "plugins.var.fifo.fifo" is enabled, it is by default). - </para> - - <para> - The FIFO pipe is located in "<literal>~/.weechat/</literal>" and is - called "weechat_fifo_xxxxx" (where xxxxx is the process ID (PID) of - running WeeChat). - </para> - - <para> - Syntax for the FIFO pipe commands/text is one of following: - <screen> - plugin.buffer *text or command here - *text or command here - </screen> - </para> - - <para> - Some examples: - <itemizedlist> - <listitem> - <para> - nick change on IRC server freenode to "newnick" : - <screen><prompt>$ </prompt><userinput>echo 'irc.server.freenode */nick newnick' >~/.weechat/weechat_fifo_12345</userinput></screen> - </para> - </listitem> - <listitem> - <para> - display text on IRC #weechat channel: - <screen><prompt>$ </prompt><userinput>echo 'irc.freenode.#weechat *hello everybody!' >~/.weechat/weechat_fifo_12345</userinput></screen> - </para> - </listitem> - <listitem> - <para> - display text on current buffer: - <screen><prompt>$ </prompt><userinput>echo '*hello!' >~/.weechat/weechat_fifo_12345</userinput></screen> - <emphasis>Warning:</emphasis> this is dangerous and you should - not do that except if you know what you do! - </para> - </listitem> - <listitem> - <para> - send two commands to unload/reload Perl scripts (you have to separate - them with "\n"): - <screen><prompt>$ </prompt><userinput>echo -e '*/perl unload\n*/perl autoload' >~/.weechat/weechat_fifo_12345</userinput></screen> - </para> - </listitem> - </itemizedlist> - </para> - - <para> - You can write a script to send command to all running WeeChat at same - time, for example: -<screen> -#!/bin/sh -if [ $# -eq 1 ]; then - for fifo in ~/.weechat/weechat_fifo_* - do - echo -e "$1" >$fifo - done -fi -</screen> - If the script is called "auto_weechat_command", you can run it with: -<screen><prompt>$ </prompt><userinput>./auto_weechat_command 'irc.freenode.#weechat *hello'</userinput></screen> - </para> - -</section> diff --git a/doc/en/user/plugin_irc.en.xml b/doc/en/user/plugin_irc.en.xml deleted file mode 100644 index faeec482a..000000000 --- a/doc/en/user/plugin_irc.en.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginIrc"> - <title>IRC plugin</title> - - <para> - The IRC plugin is designed to chat thru IRC protocol with other people. - It is multi-servers, and offers all supported IRC commands including DCC - chat and file transfer (via xfer plugin, see - <xref linkend="secPluginXfer" />). - </para> - - <section id="secIrcCommandLineOptions"> - <title>Command line options</title> - - <para> - It is possible to give URL for one or many IRC servers, as - follow: - <screen>irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/channel][,channel[...]</screen> - Example to join #weechat and #toto on - "<literal>irc.freenode.net</literal>" server, default port (6667), - with "nono" nick: - <screen><prompt>$ </prompt><userinput>weechat-curses irc://nono@irc.freenode.net/#weechat,#toto</userinput></screen> - </para> - - </section> - - <section id="secIrcOptions"> - <title>Options (file irc.conf)</title> - - <para> - &irc_options.xml; - </para> - - </section> - - <section id="secIrcCommands"> - <title>Commands</title> - - <para> - Almost all commands must be executed on a server or channel buffer. - Exceptions are: <command>/server</command>, <command>/connect</command> - and <command>/ignore</command>. - </para> - - <para> - &irc_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_jabber.en.xml b/doc/en/user/plugin_jabber.en.xml deleted file mode 100644 index 0d99189bc..000000000 --- a/doc/en/user/plugin_jabber.en.xml +++ /dev/null @@ -1,50 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginJabber"> - <title>Jabber plugin</title> - - <para> - The Jabber plugin is designed to chat thru XMPP protocol with other people. - It is multi-servers. - </para> - - <section id="secJabberOptions"> - <title>Options (file jabber.conf)</title> - - <para> - &jabber_options.xml; - </para> - - </section> - - <section id="secJabberCommands"> - <title>Commands</title> - - <para> - &jabber_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_logger.en.xml b/doc/en/user/plugin_logger.en.xml deleted file mode 100644 index 9b9cae82a..000000000 --- a/doc/en/user/plugin_logger.en.xml +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginLogger"> - <title>Logger plugin</title> - - <para> - The Logger plugin lets you save content of buffers to files, with options - about what and how it is saved. - </para> - - <section id="secLoggerOptions"> - <title>Options (file logger.conf)</title> - - <para> - &logger_options.xml; - </para> - - </section> - - <section id="secLoggerCommands"> - <title>Commands</title> - - <para> - &logger_commands.xml; - </para> - - </section> - - <section id="secLoggerLevels"> - <title>Levels</title> - - <para> - Logging is made with a level for each buffer. Default level is 9 (log - all messages displayed on buffer). - You can change level for one buffer, or a group of buffers. - </para> - - <para> - Possible levels are 0 to 9. Zero means "<literal>do not log - anything</literal>" and 9 means "<literal>log all messages</literal>". - </para> - - <para> - Plugins are using different levels for messages displayed. - IRC plugin uses following levels: - <itemizedlist> - <listitem> - <para> - Level 1: message from user (on channel or private) - </para> - </listitem> - <listitem> - <para> - Level 2: nick change (you or someone else) - </para> - </listitem> - <listitem> - <para> - Level 3: any server message (except join/part/quit) - </para> - </listitem> - <listitem> - <para> - Level 4: server message join/part/quit - </para> - </listitem> - </itemizedlist> - So if you set level 3 for an IRC channel, WeeChat will log all messages, - but not join/part/quit. - </para> - - <para> - Some examples: - <itemizedlist> - <listitem> - <para> - set level 3 for IRC channel #weechat: - <screen>/set logger.level.irc.freenode.#weechat 3</screen> - </para> - </listitem> - <listitem> - <para> - set level 3 for freenode server buffer: - <screen>/set logger.level.irc.server.freenode 3</screen> - </para> - </listitem> - <listitem> - <para> - set level 3 for all channels on server freenode: - <screen>/set logger.level.irc.freenode 3</screen> - </para> - </listitem> - <listitem> - <para> - set level 2 for all IRC buffers: - <screen>/set logger.level.irc 2</screen> - </para> - </listitem> - </itemizedlist> - </para> - - </section> - - <section id="secLoggerMasks"> - <title>Filename masks</title> - - <para> - It is possible to define a filename mask for each buffer, and use local - buffer variables to build filename (to see local variables for current - buffer: <command>/buffer localvar</command>). - </para> - - <para> - For example if you want one directory by IRC server and one file by - channel inside: - <screen>/set logger.mask.irc "irc/$server/$channel.weechatlog"</screen> - You'll have following files: -<screen> -~/.weechat/ - |--- logs/ - |--- irc/ - |--- freenode/ - | freenode.weechatlog - | #weechat.weechatlog - | #mychan.weechatlog - |--- oftc/ - | oftc.weechatlog - | #chan1.weechatlog - | #chan2.weechatlog -</screen> - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_scripts.en.xml b/doc/en/user/plugin_scripts.en.xml deleted file mode 100644 index 9d094fcd3..000000000 --- a/doc/en/user/plugin_scripts.en.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginScripts"> - <title>Scripts plugins</title> - - <para> - WeeChat provides 5 scripting plugins: Perl, Python, Ruby, Lua and Tcl. - These plugins can load, execute and unload scripts for these languages. - </para> - - <para> - For more information about how to write scripts, or WeeChat API for - scripts, please read "<literal>WeeChat developer guide</literal>". - </para> - - <para> - You can find some scripts for WeeChat here: - <ulink url="http://weechat.flashtux.org/plugins.php"> - http://weechat.flashtux.org/plugins.php - </ulink> - </para> - - <section id="secScriptsCommands"> - <title>Commands</title> - - <para> - &perl_commands.xml; - &python_commands.xml; - &ruby_commands.xml; - &lua_commands.xml; - &tcl_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugin_xfer.en.xml b/doc/en/user/plugin_xfer.en.xml deleted file mode 100644 index 9f9de4bd0..000000000 --- a/doc/en/user/plugin_xfer.en.xml +++ /dev/null @@ -1,45 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<section id="secPluginXfer"> - <title>Xfer plugin</title> - - <section id="secXferOptions"> - <title>Options (file xfer.conf)</title> - - <para> - &xfer_options.xml; - </para> - - </section> - - <section id="secXferCommands"> - <title>Commands</title> - - <para> - &xfer_commands.xml; - </para> - - </section> - -</section> diff --git a/doc/en/user/plugins.en.xml b/doc/en/user/plugins.en.xml deleted file mode 100644 index b2e57a84a..000000000 --- a/doc/en/user/plugins.en.xml +++ /dev/null @@ -1,146 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapPlugins"> - <title>Plugins</title> - - <para> - This chapter describes WeeChat plugin mechanism and default plugins - provided with WeeChat. - </para> - - <para> - To learn more about plugin or script development (thru API), please read - "<literal>WeeChat developer guide</literal>". - </para> - - <section id="secPluginsInWeeChat"> - <title>Plugins in WeeChat</title> - - <para> - A plugin is dynamic library, written in C and compiled, which is loaded - by WeeChat. - Under GNU/Linux, the file has ".so" extension, ".dll" under Windows. - </para> - - <para> - Plugins found are automatically loaded when WeeChat is starting, and it - is possible to load or unload plugins while WeeChat is running. - </para> - - <para> - It's important to make difference between a <literal>plugin</literal> and - a <literal>script</literal>: a plugin is a binary file compiled and - loaded with command<command>/plugin</command>, whereas a script is a text - file loaded with a plugin like <literal>Perl</literal> with command - <command>/perl</command>. - </para> - - <para> - You can use command <command>/plugin</command> to load/unload a plugin, - or list all loaded plugins. - When a plugin is unloaded, all buffers created by this plugin are - automatically closed. - </para> - - <para> - Examples to load, unload or list plugins: -<screen> -/plugin load irc -/plugin unload irc -/plugin list -</screen> - </para> - - <para> - Default plugins are: - <itemizedlist> - <listitem> - <para>alias: define alias for commands</para> - </listitem> - <listitem> - <para>aspell: spell checking for command line</para> - </listitem> - <listitem> - <para>charset: charset decoding/encoding for buffers</para> - </listitem> - <listitem> - <para>demo: demo plugin (not compiled by default, not documented)</para> - </listitem> - <listitem> - <para>fifo: FIFO pipe used to remotely send commands to WeeChat</para> - </listitem> - <listitem> - <para>irc: IRC chat protocol</para> - </listitem> - <listitem> - <para>jabber: Jabber chat protocol</para> - </listitem> - <listitem> - <para>logger: log buffers to files</para> - </listitem> - <listitem> - <para>notify: notify level for buffers</para> - </listitem> - <listitem> - <para>perl: Perl scripting API</para> - </listitem> - <listitem> - <para>python: Python scripting API</para> - </listitem> - <listitem> - <para>ruby: Ruby scripting API</para> - </listitem> - <listitem> - <para>lua: Lua scripting API</para> - </listitem> - <listitem> - <para>tcl: Tcl scripting API</para> - </listitem> - <listitem> - <para>xfer: file transfer and direct chat</para> - </listitem> - </itemizedlist> - </para> - - </section> - - &plugin_alias.en.xml; - - &plugin_aspell.en.xml; - - &plugin_charset.en.xml; - - &plugin_fifo.en.xml; - - &plugin_irc.en.xml; - - &plugin_jabber.en.xml; - - &plugin_logger.en.xml; - - &plugin_scripts.en.xml; - - &plugin_xfer.en.xml; - -</chapter> diff --git a/doc/en/user/usage.en.xml b/doc/en/user/usage.en.xml deleted file mode 100644 index 0fb30bb1f..000000000 --- a/doc/en/user/usage.en.xml +++ /dev/null @@ -1,793 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<chapter id="chapUsage"> - <title>Usage</title> - - <para> - This chapter explains how to run WeeChat, the default key bindings - used, internal and IRC commands, setup file, and FIFO pipe use. - </para> - - <section id="secRunWeeChat"> - <title>Running WeeChat</title> - - <para> - Command line arguments: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Parameter</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>-a, --no-connect</literal></entry> - <entry> - Disable auto-connect to servers at startup - </entry> - </row> - <row> - <entry><literal>-d, --dir <path></literal></entry> - <entry> - Set path as home for WeeChat (used for configuration files, - logs, user plugins and scripts). Default value is - "<literal>~/.weechat</literal>". Please note that directory - is created if not found by WeeChat. - </entry> - </row> - <row> - <entry><literal>-h, --help</literal></entry> - <entry> - Display help - </entry> - </row> - <row> - <entry><literal>-k, --keys</literal></entry> - <entry> - Display WeeChat default keys - </entry> - </row> - <row> - <entry><literal>-l, --license</literal></entry> - <entry> - Display WeeChat license - </entry> - </row> - <row> - <entry><literal>-p, --no-plugin</literal></entry> - <entry> - Disable plugins auto-load - </entry> - </row> - <row> - <entry><literal>-v, --version</literal></entry> - <entry> - Display WeeChat version - </entry> - </row> - <row> - <entry><literal>plugin:option</literal></entry> - <entry> - Option for plugin (see doc for each plugin) - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - <para> - To start WeeChat, issue this command: - <itemizedlist> - <listitem> - <para> - for Curses GUI: <userinput>weechat-curses</userinput> - </para> - </listitem> - <listitem> - <para> - for Gtk GUI: <userinput>weechat-gtk</userinput> - </para> - </listitem> - <listitem> - <para> - for wxWidgets GUI: <userinput>weechat-wxwidgets</userinput> - </para> - </listitem> - <listitem> - <para> - for Qt GUI: <userinput>weechat-qt</userinput> - </para> - </listitem> - </itemizedlist> - </para> - - <para> - When you run WeeChat for the first time, a default configuration - file is created, with default options. - The default configuration file is: - "<literal>~/.weechat/weechat.conf</literal>" - </para> - - <para> - You can edit this file at your convenience to configure WeeChat - or you can set parameters with "<literal>/set</literal>" command in - WeeChat (see <xref linkend="secWeechatCommands" />) - </para> - - </section> - - <section id="secKeyboardShortcuts"> - <title>Key bindings</title> - - <para> - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Key</entry> - <entry>Action</entry> - </row> - </thead> - <tbody> - <row> - <entry>Left arrow / Ctrl + B</entry> - <entry> - Go to previous char in command line - </entry> - </row> - <row> - <entry>Right arrow / Ctrl + F</entry> - <entry> - Go to next char in command line - </entry> - </row> - <row> - <entry>Ctrl + left arrow</entry> - <entry> - Go to previous word in command line - </entry> - </row> - <row> - <entry>Ctrl + right arrow</entry> - <entry> - Go to next word in command line - </entry> - </row> - <row> - <entry>Home / Ctrl + A</entry> - <entry> - Go to the beginning of command line - </entry> - </row> - <row> - <entry>Ctrl + C then B</entry> - <entry> - Insert code for bold text. - </entry> - </row> - <row> - <entry>Ctrl + C then C</entry> - <entry> - Insert code for colored text. - </entry> - </row> - <row> - <entry>Ctrl + C then I</entry> - <entry> - Insert code for italic text. - </entry> - </row> - <row> - <entry>Ctrl + C then O</entry> - <entry> - Insert code for color reset. - </entry> - </row> - <row> - <entry>Ctrl + C then R</entry> - <entry> - Insert code for reverse color. - </entry> - </row> - <row> - <entry>Ctrl + C then U</entry> - <entry> - Insert code for underlined text. - </entry> - </row> - <row> - <entry>End / Ctrl + E</entry> - <entry> - Go to the end of command line - </entry> - </row> - <row> - <entry>Ctrl + K</entry> - <entry> - Delete from cursor until end of command line - (deleted string is copied to clipboard) - </entry> - </row> - <row> - <entry>Ctrl + L</entry> - <entry> - Redraw whole window - </entry> - </row> - <row> - <entry>Ctrl + R</entry> - <entry> - Search for text in buffer history - (two times: search exact text) - </entry> - </row> - <row> - <entry>Ctrl + S then Ctrl + U</entry> - <entry> - Set unread marker on all buffers - </entry> - </row> - <row> - <entry>Ctrl + T</entry> - <entry> - Transpose chars - </entry> - </row> - <row> - <entry>Ctrl + U</entry> - <entry> - Delete from cursor until beginning of command line - (deleted string is copied to clipboard) - </entry> - </row> - <row> - <entry>Ctrl + W</entry> - <entry> - Delete previous word of command line - (deleted string is copied to clipboard) - </entry> - </row> - <row> - <entry>Ctrl + Y</entry> - <entry> - Paste clipboard content - </entry> - </row> - <row> - <entry>Backspace / Ctrl + H</entry> - <entry> - Delete previous char in command line - </entry> - </row> - <row> - <entry>Delete / Ctrl + D</entry> - <entry> - Delete next char in command line - </entry> - </row> - <row> - <entry>Tab</entry> - <entry> - Complete command or nick - (Tab again: find next completion) - </entry> - </row> - <row> - <entry>Shift + Tab</entry> - <entry> - Without completion, do a partial completion. - With pending completion, complete with previous completion. - </entry> - </row> - <row> - <entry>Any char</entry> - <entry> - Insert char at cursor position in command line - </entry> - </row> - <row> - <entry>Enter / Ctrl + J / Ctrl + M</entry> - <entry> - Execute command or send message - (in search mode: stop search) - </entry> - </row> - <row> - <entry>Up arrow / Down arrow</entry> - <entry> - Call again last commands/messages (in search mode: search - up/down) - </entry> - </row> - <row> - <entry>Ctrl + up arrow / Ctrl + down arrow</entry> - <entry> - Call again last commands/messages in global history - (common for all buffers) - </entry> - </row> - <row> - <entry>PageUp / PageDown</entry> - <entry> - Scroll up / down one page in buffer history - </entry> - </row> - <row> - <entry>Alt + PageUp / Alt + PageDown</entry> - <entry> - Scroll up / down a few lines in buffer history - </entry> - </row> - <row> - <entry>Alt + Home / Alt + End</entry> - <entry> - Scroll to top / bottom of buffer - </entry> - </row> - <row> - <entry>Alt + left arrow / Alt + up arrow / Ctrl + P / F5</entry> - <entry> - Switch to previous buffer - </entry> - </row> - <row> - <entry>Alt + right arrow / Alt + down arrow / Ctrl + N / F6</entry> - <entry> - Switch to next buffer - </entry> - </row> - <row> - <entry>F7</entry> - <entry> - Switch to previous window - </entry> - </row> - <row> - <entry>F8</entry> - <entry> - Switch to next window - </entry> - </row> - <row> - <entry>F9 / F10</entry> - <entry> - Scroll topic - </entry> - </row> - <row> - <entry>F11 / F12</entry> - <entry> - Scroll nicklist - </entry> - </row> - <row> - <entry>Alt + F11 / Alt + F12</entry> - <entry> - Go to the beginning / the end of nicklist - </entry> - </row> - <row> - <entry>Alt + A</entry> - <entry> - Switch to next buffer with activity - (with priority: highlight, message, other) - </entry> - </row> - <row> - <entry>Alt + B</entry> - <entry> - Go to previous word in command line - </entry> - </row> - <row> - <entry>Alt + D</entry> - <entry> - Delete next word in command line - (deleted string is copied to clipboard) - </entry> - </row> - <row> - <entry>Alt + F</entry> - <entry> - Go to next word in command line - </entry> - </row> - <row> - <entry>Alt + H</entry> - <entry> - Clear hotlist - (activity notification on other buffers) - </entry> - </row> - <row> - <entry>Alt + J then Alt + L</entry> - <entry> - Switch to last buffer - </entry> - </row> - <row> - <entry>Alt + J then Alt + R</entry> - <entry> - Switch to IRC raw buffer - </entry> - </row> - <row> - <entry>Alt + digit (0-9)</entry> - <entry> - Switch to buffer by number (0 = 10) - </entry> - </row> - <row> - <entry>Alt + J then number (01-99)</entry> - <entry> - Switch to buffer by number - </entry> - </row> - <row> - <entry>Alt + K</entry> - <entry> - Grab a key and insert its code in command line - </entry> - </row> - <row> - <entry>Alt + N</entry> - <entry> - Scroll to next highlight - </entry> - </row> - <row> - <entry>Alt + P</entry> - <entry> - Scroll to previous highlight - </entry> - </row> - <row> - <entry>Alt + R</entry> - <entry> - Delete entire command line - </entry> - </row> - <row> - <entry>Alt + S</entry> - <entry> - Switch servers on servers buffer - (if option "look_one_server_buffer" is enabled) - </entry> - </row> - <row> - <entry>Alt + U</entry> - <entry> - Scroll to first unread line in buffer - </entry> - </row> - <row> - <entry>Alt + W then Alt + arrow</entry> - <entry> - Switch to window with direction - </entry> - </row> - <row> - <entry>Alt + Z</entry> - <entry> - Zoom on current window - </entry> - </row> - <row> - <entry>Alt + <</entry> - <entry> - Switch to previous buffer in list of visited buffers - </entry> - </row> - <row> - <entry>Alt + ></entry> - <entry> - Switch to next buffer in list of visited buffers - </entry> - </row> - <row> - <entry>Alt + =</entry> - <entry> - Toggle filters on/off - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - </section> - - <section id="secCommandLine"> - <title>Command line</title> - - <para> - WeeChat command line (at the bottom of window) lets you execute commands - or send text to buffer. - </para> - - <para> - Commands begin with "/" char, followed by name of command. - For example, to see list of all options: - <screen><userinput>/set</userinput></screen> - </para> - - <para> - Text sent to a buffer is any text that does not begin with "/" char. - For example, to send text "<literal>hello</literal>" on current - buffer: - <screen><userinput>hello</userinput></screen> - </para> - - <para> - However, it is possible to start with "/" char, by adding another. - For example, to send text "<literal>/set</literal>" on current - buffer: - <screen><userinput>//set</userinput></screen> - </para> - - <para> - For some plugins like IRC, you can use color codes and attributes, as - follow (press Ctrl-C then following letter, with optional value): - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Code</entry> - <entry>Description</entry> - </row> - </thead> - <tbody> - <row> - <entry>^Cb</entry> - <entry> - bold text - </entry> - </row> - <row> - <entry>^Ccxx</entry> - <entry> - text color "<literal>xx</literal>" - (see colors table below) - </entry> - </row> - <row> - <entry>^Ccxx,yy</entry> - <entry> - text color "<literal>xx</literal>" - and background "<literal>yy</literal>" - (see colors table below) - </entry> - </row> - <row> - <entry>^Co</entry> - <entry> - disable color and attributes - </entry> - </row> - <row> - <entry>^Cr</entry> - <entry> - reverse video (revert text color with background) - </entry> - </row> - <row> - <entry>^Cu</entry> - <entry> - underlined text - </entry> - </row> - </tbody> - </tgroup> - </informaltable> - Note: the same code (without number for ^Cc) may be used to stop the - attribute. - </para> - - <para> - Color codes for ^Cc are: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Code</entry> - <entry>Color</entry> - </row> - </thead> - <tbody> - <row> - <entry>00</entry> - <entry>white</entry> - </row> - <row> - <entry>01</entry> - <entry>black</entry> - </row> - <row> - <entry>02</entry> - <entry>dark blue</entry> - </row> - <row> - <entry>03</entry> - <entry>dark green</entry> - </row> - <row> - <entry>04</entry> - <entry>light red</entry> - </row> - <row> - <entry>05</entry> - <entry>dark red</entry> - </row> - <row> - <entry>06</entry> - <entry>magenta</entry> - </row> - <row> - <entry>07</entry> - <entry>orange</entry> - </row> - <row> - <entry>08</entry> - <entry>yellow</entry> - </row> - <row> - <entry>09</entry> - <entry>light green</entry> - </row> - <row> - <entry>10</entry> - <entry>cyan</entry> - </row> - <row> - <entry>11</entry> - <entry>light cyan</entry> - </row> - <row> - <entry>12</entry> - <entry>light blue</entry> - </row> - <row> - <entry>13</entry> - <entry>light magenta</entry> - </row> - <row> - <entry>14</entry> - <entry>gray</entry> - </row> - <row> - <entry>15</entry> - <entry>light gray (white)</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - <para> - Example: display of "<literal>hello everybody!</literal>" with - "<literal>hello</literal>" in light blue bold, and - "<literal>everybody</literal>" in light red underlined: -<screen><userinput>^Cc12^Cbhello^Cb^Cc04^Cu everybody^Cu^Cc!</userinput></screen> - </para> - - </section> - - <section id="secWeechatOptions"> - <title>WeeChat options (file weechat.conf)</title> - - <para> - &weechat_options.xml; - </para> - - <para> - Colors for Curses GUI are: - <informaltable colsep="0" frame="none"> - <tgroup cols="2"> - <thead> - <row> - <entry>Keyword</entry> - <entry>Color</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>default</literal></entry> - <entry>default color (transparent for background)</entry> - </row> - <row> - <entry><literal>black</literal></entry> - <entry>black</entry> - </row> - <row> - <entry><literal>red</literal></entry> - <entry>dark red</entry> - </row> - <row> - <entry><literal>lightred</literal></entry> - <entry>light red</entry> - </row> - <row> - <entry><literal>green</literal></entry> - <entry>dark green</entry> - </row> - <row> - <entry><literal>lightgreen</literal></entry> - <entry>light green</entry> - </row> - <row> - <entry><literal>brown</literal></entry> - <entry>brown</entry> - </row> - <row> - <entry><literal>yellow</literal></entry> - <entry>yellow</entry> - </row> - <row> - <entry><literal>blue</literal></entry> - <entry>dark blue</entry> - </row> - <row> - <entry><literal>lightblue</literal></entry> - <entry>light blue</entry> - </row> - <row> - <entry><literal>magenta</literal></entry> - <entry>dark magenta</entry> - </row> - <row> - <entry><literal>lightmagenta</literal></entry> - <entry>light magenta</entry> - </row> - <row> - <entry><literal>cyan</literal></entry> - <entry>dark cyan</entry> - </row> - <row> - <entry><literal>lightcyan</literal></entry> - <entry>light cyan</entry> - </row> - <row> - <entry><literal>white</literal></entry> - <entry>white</entry> - </row> - </tbody> - </tgroup> - </informaltable> - </para> - - </section> - - <section id="secWeechatCommands"> - <title>WeeChat commands</title> - - <para> - &weechat_commands.xml; - </para> - - </section> - -</chapter> diff --git a/doc/en/user/weechat_user.en.xml b/doc/en/user/weechat_user.en.xml deleted file mode 100644 index 359b854fc..000000000 --- a/doc/en/user/weechat_user.en.xml +++ /dev/null @@ -1,113 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<!-- - -WeeChat documentation (english version) - -Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org> - -This manual is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 3 of the License, or -(at your option) any later version. - -This manual is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. - ---> - -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" -"file:///usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd" -[ - <!-- ***** auto-built: ***** --> - <!ENTITY date.xml SYSTEM "date.xml"> - <!ENTITY % include_autogen.xml SYSTEM "include_autogen.xml"> - %include_autogen.xml; - - <!-- ***** written by hand: ***** --> - <!ENTITY intro.en.xml SYSTEM "intro.en.xml"> - <!ENTITY install.en.xml SYSTEM "install.en.xml"> - <!ENTITY usage.en.xml SYSTEM "usage.en.xml"> - <!ENTITY plugins.en.xml SYSTEM "plugins.en.xml"> - <!ENTITY plugin_alias.en.xml SYSTEM "plugin_alias.en.xml"> - <!ENTITY plugin_aspell.en.xml SYSTEM "plugin_aspell.en.xml"> - <!ENTITY plugin_charset.en.xml SYSTEM "plugin_charset.en.xml"> - <!ENTITY plugin_fifo.en.xml SYSTEM "plugin_fifo.en.xml"> - <!ENTITY plugin_irc.en.xml SYSTEM "plugin_irc.en.xml"> - <!ENTITY plugin_jabber.en.xml SYSTEM "plugin_jabber.en.xml"> - <!ENTITY plugin_logger.en.xml SYSTEM "plugin_logger.en.xml"> - <!ENTITY plugin_scripts.en.xml SYSTEM "plugin_scripts.en.xml"> - <!ENTITY plugin_xfer.en.xml SYSTEM "plugin_xfer.en.xml"> - <!ENTITY authors.en.xml SYSTEM "authors.en.xml"> -]> - -<book lang="en"> - - <bookinfo> - - <title>WeeChat 0.3.0-dev - User guide</title> - <subtitle>Fast, light and extensible chat client</subtitle> - - <author> - <firstname>Sébastien</firstname> - <surname>Helleu</surname> - <email>flashcode AT flashtux.org</email> - </author> - - &date.xml; - - <copyright> - <year>2009</year> - <holder>Sébastien Helleu</holder> - </copyright> - - <legalnotice> - <para> - This manual is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - </para> - <para> - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - </para> - <para> - You should have received a copy of the GNU General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. - </para> - </legalnotice> - - <abstract> - <para> - This manual documents WeeChat chat client, it is part of WeeChat. - </para> - <para> - Latest version of this document can be found on this page: - <ulink url="http://weechat.flashtux.org/doc.php"> - http://weechat.flashtux.org/doc.php - </ulink> - </para> - </abstract> - - </bookinfo> - - &intro.en.xml; - - &install.en.xml; - - &usage.en.xml; - - &plugins.en.xml; - - &authors.en.xml; - -</book> diff --git a/doc/en/weechat_faq.en.txt b/doc/en/weechat_faq.en.txt index 1b9c9b3b3..4d87b4c9a 100644 --- a/doc/en/weechat_faq.en.txt +++ b/doc/en/weechat_faq.en.txt @@ -1,7 +1,6 @@ -WeeChat Frequently Asked Questions (FAQ) +WeeChat FAQ (Frequently Asked Questions) ======================================== FlashCode <flashcode@flashtux.org> -v0.3.0-dev, 2009-05-15 General diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt new file mode 100644 index 000000000..b40e91b95 --- /dev/null +++ b/doc/en/weechat_plugin_api.en.txt @@ -0,0 +1,7005 @@ +WeeChat Plugin API Reference +============================ +FlashCode <flashcode@flashtux.org> + + +This manual documents WeeChat chat client, it is part of WeeChat. + +Latest version of this document can be found on this page: +http://weechat.flashtux.org/doc.php + + +[[introduction]] +Introduction +------------ + +WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and +light, designed for many operating systems. + +This manual documents WeeChat plugins API, used by C plugins to interact with +WeeChat core. + +[[plugins_in_weechat]] +Plugins in WeeChat +------------------ + +A plugin is a C program which can call WeeChat functions defined in an +interface. + +This C program does not need WeeChat sources to compile and can be dynamically +loaded into WeeChat with command `/plugin`. + +The plugin has to be a dynamic library, for dynamic loading by operating +system. +Under GNU/Linux, the file has ".so" extension, ".dll" under Windows. + +The plugin has to include "weechat-plugin.h" file (available in WeeChat source +code). +This file defines structures and types used to communicate with WeeChat. + +[[macros]] +Macros +~~~~~~ + +The plugin must use some mandatory macros (to define some variables): + +WEECHAT_PLUGIN_NAME("name"):: + plugin name + +WEECHAT_PLUGIN_DESCRIPTION("description"):: + short description of plugin + +WEECHAT_PLUGIN_VERSION("0.1.2"):: + plugin version + +WEECHAT_PLUGIN_WEECHAT_VERSION("0.3.0"):: + target WeeChat version where plugin will run (warning: plugin will not run + on any other WeeChat version!) + +WEECHAT_PLUGIN_LICENSE("GPL3"):: + plugin license + +[[main_functions]] +Main functions +~~~~~~~~~~~~~~ + +The plugin must use two mandatory functions. + +weechat_plugin_init +^^^^^^^^^^^^^^^^^^^ + +This function is called when plugin is loaded by WeeChat. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_plugin_init (struct t_weechat_plugin *plugin, + int argc, char *argv[]); +---------------------------------------- + +Arguments: + +* 'plugin': pointer to WeeChat plugin structure +* 'argc': number of arguments for plugin (given on command line by user) +* 'argv': arguments for plugin + +Return value: + +* 'WEECHAT_RC_OK' if successful (plugin will be loaded) +* 'WEECHAT_RC_ERROR' if error (plugin will NOT be loaded) + +weechat_plugin_end +^^^^^^^^^^^^^^^^^^ + +This function is called when plugin is unloaded by WeeChat. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_plugin_end (struct t_weechat_plugin *plugin); +---------------------------------------- + +Arguments: + +* 'plugin': pointer to WeeChat plugin structure + +Return value: + +* 'WEECHAT_RC_OK' if successful +* 'WEECHAT_RC_ERROR' if error + +[[compile_plugin]] +Compile plugin +~~~~~~~~~~~~~~ + +Compile does not need WeeChat sources, only file 'weechat-plugin.h' is +required. + +To compile a plugin which has one file "toto.c" (under GNU/Linux): + +---------------------------------------- +$ gcc -fPIC -Wall -c toto.c +$ gcc -shared -fPIC -o libtoto.so toto.o +---------------------------------------- + +[[load_plugin]] +Load plugin +~~~~~~~~~~~ + +Copy file 'libtoto.so' into system plugins directory (for example +'/usr/local/lib/weechat/plugins' or into user's plugins directory (for example +'/home/xxxxx/.weechat/plugins'). + +Under WeeChat: + +---------------------------------------- +/plugin load toto +---------------------------------------- + +[[plugin_example]] +Plugin example +~~~~~~~~~~~~~~ + +Full example of plugin, which adds a /double command, which displays two times +arguments on current buffer, or execute two times a command (ok that's not +very useful, but that's just an example!): + +[source,C] +---------------------------------------- +#include <stdlib.h> + +#include "weechat-plugin.h" + +WEECHAT_PLUGIN_NAME("double"); +WEECHAT_PLUGIN_DESCRIPTION("Test plugin for WeeChat"); +WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); +WEECHAT_PLUGIN_VERSION("0.1"); +WEECHAT_PLUGIN_WEECHAT_VERSION("0.3.0"); +WEECHAT_PLUGIN_LICENSE("GPL3"); + +struct t_weechat_plugin *weechat_plugin = NULL; + + +/* "/double" command manager */ + +int +double_cmd (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + (void) argv; + + if (argc > 1) + { + weechat_command (NULL, argv_eol[1]); + weechat_command (NULL, argv_eol[1]); + } + + return WEECHAT_RC_OK; +} + +int +weechat_plugin_init (struct t_weechat_plugin *plugin, + int argc, char *argv[]) +{ + weechat_plugin = plugin; + + weechat_hook_command ("double", + "Display two times a message", + "msg", + "msg: message to display two times", + NULL, + &double_cmd, NULL); + + return WEECHAT_RC_OK; +} + +int +weechat_plugin_end (struct t_weechat_plugin *plugin) +{ + /* make C compiler happy */ + (void) plugin; + + return WEECHAT_RC_OK; +} +---------------------------------------- + +[[c_plugin_api]] +C plugin API +------------ + +[[plugins]] +Plugins +~~~~~~~ + +Functions to get infos about plugins. + +weechat_plugin_get_name +^^^^^^^^^^^^^^^^^^^^^^^ + +Get plugin name (return "core" for WeeChat). + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_plugin_get_name (struct t_weechat_plugin *plugin); +---------------------------------------- + +Arguments: + +* 'plugin': pointer to WeeChat plugin structure (may be NULL for WeeChat core) + +Return value: + +* name of plugin, "core" for WeeChat core (if plugin pointer is NULL) + +Example: + +[source,C] +---------------------------------------- +const char *name = weechat_plugin_get_name (plugin); +---------------------------------------- + +[[strings]] +Strings +~~~~~~~ + +Many string functions below are already available thru standard C functions, +but it's recommended to use functions in this API because they are ok with +UTF-8 and locale. + +weechat_charset_set +^^^^^^^^^^^^^^^^^^^ + +Set new plugin charset (default charset is 'UTF-8', so if your plugin uses +'UTF-8', you don't need to call this function). + +Prototype: + +[source,C] +---------------------------------------- +void weechat_charset_set (const char *charset); +---------------------------------------- + +Arguments: + +* 'charset': new charset to use + +Example: + +[source,C] +---------------------------------------- +weechat_charset_set (plugin, "iso-8859-1"); +---------------------------------------- + +weechat_iconv_to_internal +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Convert string to WeeChat internal charset (UTF-8). + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_iconv_to_internal (const char *charset, const char *string); +---------------------------------------- + +Arguments: + +* 'charset': charset to convert +* 'string': string to convert + +Return value: + +* converted string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_iconv_to_internal (plugin, "iso-8859-1", "iso string: é à"); +/* ... */ +free (str); +---------------------------------------- + +weechat_iconv_from_internal +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Convert string from internal WeeChat charset (UTF-8) to another. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_iconv_from_internal (const char *charset, const char *string); +---------------------------------------- + +Arguments: + +* 'charset': target charset +* 'string': string to convert + +Return value: + +* converted string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_iconv_from_internal ("iso-8859-1", "utf-8 string: é à"); +/* ... */ +free (str); +---------------------------------------- + +weechat_gettext +^^^^^^^^^^^^^^^ + +Return translated string (depends on local language). + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_gettext (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string to translate + +Return value: + +* translated string + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_gettext ("hello !"); +---------------------------------------- + +weechat_ngettext +^^^^^^^^^^^^^^^^ + +Return translated string, using single or plural form, according to count. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_ngettext (const char *string, const char *plural, + int count); +---------------------------------------- + +Arguments: + +* 'string': string to translate (single form) +* 'plural': string to translate (plural form) +* 'count': used to choose between single and plural form + +Return value: + +* translated string + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_ngettext ("file", "files", num_files); +---------------------------------------- + +weechat_strndup +^^^^^^^^^^^^^^^ + +Return duplicated string, with max "length" chars. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_strndup (const char *string, int length); +---------------------------------------- + +Arguments: + +* 'string': string to duplicate +* 'length': max chars to duplicate + +Return value: + +* duplicated string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_strndup ("abcdef", 3); /* result: "abc" */ +/* ... */ +free (str); +---------------------------------------- + +weechat_string_tolower +^^^^^^^^^^^^^^^^^^^^^^ + +Convert UTF-8 string to lower case. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_string_tolower (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string to convert + +Example: + +[source,C] +---------------------------------------- +char *str = "AbCdé"; +weechat_string_tolower (str); /* str is now: "abcdé" */ +---------------------------------------- + +weechat_string_toupper +^^^^^^^^^^^^^^^^^^^^^^ + +Convert UTF-8 string to upper case. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_string_toupper (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string to convert + +Example: + +[source,C] +---------------------------------------- +char *str = "AbCdé"; +weechat_string_tolower (str); /* str is now: "ABCDé" */ +---------------------------------------- + +weechat_strcasecmp +^^^^^^^^^^^^^^^^^^ + +Locale and case independent string comparison. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_strcasecmp (const char *string1, const char *string2); +---------------------------------------- + +Arguments: + +* 'string1': first string for comparison +* 'string2': second string for comparison + +Return value: + +* difference between two strings: +** negative if string1 < string2 +** zero if string1 == string2 +** positive if string1 > string2 + +Example: + +[source,C] +---------------------------------------- +int diff = weechat_strcasecmp ("aaa", "CCC"); /* == -2 */ +---------------------------------------- + +weechat_strcmp_ignore_chars +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Locale (and optionally case independent) string comparison, ignoring some +chars. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_strcmp_ignore_chars (const char *string1, const char *string2, + const char *chars_ignored, + int case_sensitive); +---------------------------------------- + +Arguments: + +* 'string1': first string for comparison +* 'string2': second string for comparison +* 'chars_ignored': string with chars to ignored +* 'case_sensitive': 1 for case sensitive comparison, 0 otherwise + +Return value: + +* difference between two strings: +** negative if string1 < string2 +** zero if string1 == string2 +** positive if string1 > string2 + +Example: + +[source,C] +---------------------------------------- +int diff = weechat_strcmp_ignore_chars ("a-b", "--a-e", "-", 1); /* == -3 */ +---------------------------------------- + +weechat_strcasestr +^^^^^^^^^^^^^^^^^^ + +Locale and case independent string search. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_strcasestr (const char *string, const char *search); +---------------------------------------- + +Arguments: + +* 'string': string +* 'search': string to search in "string" + +Return value: + +* pointer to string found, or NULL if not found + +Example: + +[source,C] +---------------------------------------- +char *pos = weechat_strcasestr ("aBcDeF", "de"); /* result: pointer to "DeF" */ +---------------------------------------- + +weechat_string_match +^^^^^^^^^^^^^^^^^^^^ + +Check if a string matches a mask. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_string_match (const char *string, const char *mask, + int case_sensitive); +---------------------------------------- + +Arguments: + +* 'string': string +* 'mask': mask, can begin or end with "`*`" (no other "`*`" are allowed inside + mask) + +Return value: + +* 1 if string matches mask, otherwise 0 + +Example: + +[source,C] +---------------------------------------- +int match1 = weechat_string_match ("abcdef", "abc*", 0); /* == 1 */ +int match2 = weechat_string_match ("abcdef", "*dd*", 0); /* == 0 */ +int match3 = weechat_string_match ("abcdef", "*def", 0); /* == 1 */ +int match4 = weechat_string_match ("abcdef", "*de*", 0); /* == 1 */ +---------------------------------------- + +weechat_string_replace +^^^^^^^^^^^^^^^^^^^^^^ + +Replace "search" string by new one in a string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_replace (const char *string, const char *search, + const char *replace); +---------------------------------------- + +Arguments: + +* 'string': string +* 'search': string to replace +* 'replace': replacement for "search" string + +Return value: + +* string with "search" replaced by "replace" (must be freed by calling "free" + after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_string_replace ("test", "s", "x"); /* result: "text" */ +---------------------------------------- + +weechat_string_remove_quotes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove quotes at beginning/end of string (ignore spaces if there are before +first quote or after last quote). + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_remove_quotes (const char *string, const char *quotes); +---------------------------------------- + +Arguments: + +* 'string': string +* 'quotes': string with list of quotes + +Return value: + +* string without quotes at beginning/end (must be freed by calling "free" + after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_string_remove_quotes (string, " 'abc' ", "'"); /* result: "abc" */ +---------------------------------------- + +weechat_string_strip +^^^^^^^^^^^^^^^^^^^^ + +Strip chars at beginning and/or end of string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_strip (const char *string, int left, int right, + const char *chars); +---------------------------------------- + +Arguments: + +* 'string': string +* 'left': strip left chars if different from 0 +* 'right': strip right chars if different from 0 +* 'chars': string with chars to strip + +Return value: + +* stripped string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *str = weechat_string_strip (".abc -", 0, 1, "- ."); /* result: ".abc" */ +---------------------------------------- + +weechat_string_has_highlight +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Check if a string has highlights, using list of highlight words. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_string_has_highlight (const char *string, + const char highlight_words); +---------------------------------------- + +Arguments: + +* 'string': string +* 'highlight_words': list of highlight words, separated by comma + +Return value: + +* 1 if string has one or more highlights, 0 otherwise + +Example: + +[source,C] +---------------------------------------- +int hl = weechat_string_has_highlight ("my test string", "test,word2"); /* == 1 */ +---------------------------------------- + +weechat_string_mask_to_regex +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Return a regex, built with a mask, where only special char is "`*`". All +special chars for regex are escaped. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_mask_to_regex (const char *mask); +---------------------------------------- + +Arguments: + +* 'mask': mask + +Return value: + +* regular expression, as string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *str_regex = weechat_string_mask_to_regex ("test*mask"); +/* result is: "test.*mask" */ +free (str_regex); +---------------------------------------- + +weechat_string_explode +^^^^^^^^^^^^^^^^^^^^^^ + +Explode a string according to one or more delimiter(s). + +Prototype: + +[source,C] +---------------------------------------- +char **weechat_string_explode (const char *string, const char *separators, + int keep_eol, int num_items_max, + int *num_items); +---------------------------------------- + +Arguments: + +* 'string': string to explode +* 'separators': delimiters used for explosion +* 'keep_eol': if different from 0, then each argument will contain all string + until end of line (see example below) +* 'num_items_max': maximum number of items created (0 = no limit) +* 'num_items': pointer to int which will contain number of items created + +Return value: + +* array of strings, NULL if problem (must be freed by calling + "weechat_string_free_exploded" after use) + +Examples: + +[source,C] +---------------------------------------- +char **argv; +int argc; +argv = weechat_string_explode ("abc de fghi", " ", 0, 0, &argc); +/* result: argv[0] == "abc" + argv[1] == "de" + argv[2] == "fghi" + argv[3] == NULL + argc == 3 +*/ +weechat_string_free_exploded (argv); + +argv = weechat_string_explode ("abc de fghi", " ", 1, 0, &argc); +/* result: argv[0] == "abc de fghi" + argv[1] == "de fghi" + argv[2] == "fghi" + argv[3] == NULL + argc == 3 +*/ +weechat_string_free_exploded (argv); +---------------------------------------- + +weechat_string_free_exploded +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Free memory used by a string explosion. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_string_free_exploded (char **exploded_string); +---------------------------------------- + +Arguments: + +* 'exploded_string': string exploded by function "weechat_string_explode" + +Example: + +[source,C] +---------------------------------------- +char *argv; +int argc; +argv = weechat_string_explode (string, " ", 0, 0, &argc); +/* ... */ +weechat_string_free_exploded (argv); +---------------------------------------- + +weechat_string_build_with_exploded +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Build a string with exploded string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_build_with_exploded (char **exploded_string, + const char *separator); +---------------------------------------- + +Arguments: + +* 'exploded_string': string exploded by function "weechat_string_explode" +* 'separator': string used to separate strings + +Return value: + +* string built with exploded string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char **argv; +int argc; +argv = weechat_string_explode ("abc def ghi", " ", 0, 0, &argc); +char *str = weechat_string_build_with_exploded (argv, ";"); +/* str == "abc;def;ghi" */ +free (str); +---------------------------------------- + +weechat_string_split_command +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Split a list of commands separated by "separator" (which can be escaped by "\" +in string). + +Prototype: + +[source,C] +---------------------------------------- +char **weechat_string_split_command (const char *command, char separator); +---------------------------------------- + +Arguments: + +* 'command': command to split +* 'separator': separator + +Return value: + +* array of strings, NULL if problem (must be freed by calling + "weechat_free_split_command" after use) + +Example: + +[source,C] +---------------------------------------- +char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); +/* result: argv[0] == "/command1 arg" + argv[1] == "/command2" +*/ +weechat_free_split_command (argv); +---------------------------------------- + +weechat_string_free_split_command +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Free memory used by a split command. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_string_free_split_command (char **split_command); +---------------------------------------- + +Arguments: + +* 'split_command': command split by "weechat_string_split_command" + +Example: + +[source,C] +---------------------------------------- +char **argv = weechat_string_split_command ("/command1 arg;/command2", ';'); +/* ... */ +weechat_free_split_command (argv); +---------------------------------------- + +weechat_string_format_size +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Build a string with formatted size and translated unit. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_format_size (unsigned long size); +---------------------------------------- + +Arguments: + +* 'size': size + +Return value: + +* string with formatted size and translated unit (must be freed by calling + "free" after use) + +Examples: + +[source,C] +---------------------------------------- +/* examples with english locale */ + +char *str = weechat_string_format_size (0); /* str == "0 byte" */ +/* ... */ +free (str); + +char *str = weechat_string_format_size (200); /* str == "200 bytes" */ +/* ... */ +free (str); + +char *str = weechat_string_format_size (1536); /* str == "1.5 KB" */ +/* ... */ +free (str); + +char *str = weechat_string_format_size (2097152); /* str == "2 MB" */ +/* ... */ +free (str); +---------------------------------------- + +weechat_string_reove_color +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove WeeChat colors from a string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_string_remove_color (const char *string, + const char *replacement); +---------------------------------------- + +Arguments: + +* 'string': string +* 'replacement': if not NULL and not empty, WeeChat color codes are replaced by + first char of this string, otherwise WeeChat color codes and following chars + (if related to color) are removed from string + +Return value: + +* string without color (must be freed by calling "free" after use) + +Examples: + +[source,C] +---------------------------------------- +/* remove color codes */ +char *str = weechat_string_remove_color (my_string1, NULL); +/* ... */ +free (str); + +/* replace color codes by "?" */ +char *str = weechat_string_remove_color (my_string2, "?"); +/* ... */ +free (str); +---------------------------------------- + +[[utf-8]] +UTF-8 +~~~~~ + +Some UTF-8 string functions. + +weechat_utf8_has_8bits +^^^^^^^^^^^^^^^^^^^^^^ + +Check if a string has 8-bits chars. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_has_8bits (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* 1 if string has 8-bits chars, 0 if only 7-bits chars + +Example: + +[source,C] +---------------------------------------- +if (weechat_utf8_has_8bits (string)) +{ + /* ... */ +} +---------------------------------------- + +weechat_utf8_is_valid +^^^^^^^^^^^^^^^^^^^^^ + +Check if a string is UTF-8 valid. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_is_valid (const char *string, char **error); +---------------------------------------- + +Arguments: + +* 'string': string +* 'error': if not NULL, it is set with first non valid UTF-8 char in string, + if any + +Return value: + +* 1 if UTF-8 string is valid, 0 otherwise + +Example: + +[source,C] +---------------------------------------- +char *error; +if (weechat_utf8_is_valid (string, &error)) +{ + /* ... */ +} +else +{ + /* "error" points to first invalid char */ +} +---------------------------------------- + +weechat_utf8_normalize +^^^^^^^^^^^^^^^^^^^^^^ + +Normalize UTF-8 string: remove non UTF-8 chars and replace them by a char. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_utf8_normalize (const char *string, char replacement); +---------------------------------------- + +Arguments: + +* 'string': string +* 'replacement': replacement char for non UTF-8 chars + +Example: + +[source,C] +---------------------------------------- +weechat_utf8_normalize (string, '?'); +---------------------------------------- + +weechat_utf8_prev_char +^^^^^^^^^^^^^^^^^^^^^^ + +Return previous UTF-8 char in a string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_utf8_prev_char (const char *string_start, const char *string); +---------------------------------------- + +Arguments: + +* 'string_start': start of string (function will not return a char before this + pointer) +* 'string': pointer to string (must be > = string_start) + +Return value: + +* pointer to previous UTF-8 char, NULL if not found (start of string reached) + +Example: + +[source,C] +---------------------------------------- +char *prev_char = weechat_utf8_prev_char (string, ptr_in_string); +---------------------------------------- + +weechat_utf8_next_char +^^^^^^^^^^^^^^^^^^^^^^ + +Return next UTF-8 char in a string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_utf8_next_char (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* pointer to next UTF-8 char, NULL if not found (end of string reached) + +Example: + +[source,C] +---------------------------------------- +char *next_char = weechat_utf8_next_char (string); +---------------------------------------- + +weechat_utf8_char_size +^^^^^^^^^^^^^^^^^^^^^^ + +Return UTF-8 char size (in bytes). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_char_size (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* UTF-8 char size (in bytes) + +Example: + +[source,C] +---------------------------------------- +int char_size = weechat_utf8_char_size ("être"); /* == 2 */ +---------------------------------------- + +weechat_utf8_strlen +^^^^^^^^^^^^^^^^^^^ + +Return UTF-8 string length (multi-byte char is considered as 1 char). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_strlen (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* UTF-8 string length (number of real chars) + +Example: + +[source,C] +---------------------------------------- +int length = weechat_utf8_strlen ("chêne"); /* == 5 */ +---------------------------------------- + +weechat_utf8_strnlen +^^^^^^^^^^^^^^^^^^^^ + +Return UTF-8 string length (multi-byte char is considered as 1 char), for max +bytes in string. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_strnlen (const char *string, int bytes); +---------------------------------------- + +Arguments: + +* 'string': string +* 'bytes': max bytes in string + +Return value: + +* UTF-8 string length (number of real chars) + +Example: + +[source,C] +---------------------------------------- +int length = weechat_utf8_strnlen ("chêne", 4); /* == 3 */ +---------------------------------------- + +weechat_utf8_strlen_screen +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Return number of chars needed on screen to display UTF-8 string. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_strlen_screen (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* number of chars needed on screen to display UTF-8 string + +Example: + +[source,C] +---------------------------------------- +int length_on_screen = weechat_utf8_strlen_screen ("é"); /* == 1 */ +---------------------------------------- + +weechat_utf8_charcasecmp +^^^^^^^^^^^^^^^^^^^^^^^^ + +Compare two UTF-8 chars (case is ignored). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_charcasecmp (const char *string1, const char *string2); +---------------------------------------- + +Arguments: + +* 'string1': first string for comparison +* 'string2': second string for comparison + +Return value: + +* difference between first char of each string: +** negative if char1 < char2 +** zero if char1 == char2 +** positive if char1 > char2 + +Example: + +[source,C] +---------------------------------------- +int diff = weechat_utf8_charcasecmp ("aaa", "CCC"); /* == -2 */ +---------------------------------------- + +weechat_utf8_char_size_screen +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Return number of chars needed on screen to display UTF-8 char. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_char_size_screen (const char *string); +---------------------------------------- + +Arguments: + +* 'string': string + +Return value: + +* number of chars needed on screen to display UTF-8 char + +Example: + +[source,C] +---------------------------------------- +int length_on_screen = weechat_utf8_char_size_screen ("é"); /* == 1 */ +---------------------------------------- + +weechat_utf8_add_offset +^^^^^^^^^^^^^^^^^^^^^^^ + +Move forward N chars in an UTF-8 string. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_utf8_add_offset (const char *string, int offset); +---------------------------------------- + +Arguments: + +* 'string': string +* 'offset': number of chars + +Return value: + +* pointer to string, N chars after (NULL if it's not reachable) + +Example: + +[source,C] +---------------------------------------- +char *str = "chêne"; +char *str2 = weechat_utf8_add_offset (str, 3); /* points to "ne" */ +---------------------------------------- + +weechat_utf8_real_pos +^^^^^^^^^^^^^^^^^^^^^ + +Get real position in UTF-8 string. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_real_pos (const char *string, int pos); +---------------------------------------- + +Arguments: + +* 'string': string +* 'pos': position (number of chars) + +Return value: + +* real potision (in bytes) for "pos" chars in string + +Example: + +[source,C] +---------------------------------------- +int pos = weechat_utf8_real_pos ("chêne", 3); /* == 4 */ +---------------------------------------- + +weechat_utf8_pos +^^^^^^^^^^^^^^^^ + +Get position in UTF-8 string. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_utf8_pos (const char *string, int real_pos); +---------------------------------------- + +Arguments: + +* 'string': string +* 'real_pos': position (bytes) + +Return value: + +* position (in chars) for "real_pos" bytes in string + +Example: + +[source,C] +---------------------------------------- +int pos = weechat_utf8_pos ("chêne", 4); /* == 3 */ +---------------------------------------- + +weechat_utf8_strndup +^^^^^^^^^^^^^^^^^^^^ + +Return duplicate string, with max N chars. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_utf8_strndup (const char *string, int max_chars); +---------------------------------------- + +Arguments: + +* 'string': string +* 'max_chars': max chars + +Return value: + +* duplicated string (must be freed by calling "free" after use) + +Example: + +[source,C] +---------------------------------------- +char *string = weechat_utf8_strndup ("chêne", 3); /* returns "chê" */ +---------------------------------------- + +[[directories]] +Directories +~~~~~~~~~~~ + +Some functions related to directories. + +weechat_mkdir_home +^^^^^^^^^^^^^^^^^^ + +Create a directory in WeeChat home. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_mkdir_home (char *directory, int mode); +---------------------------------------- + +Arguments: + +* 'directory': directory to create +* 'mode': mode for new directory + +Return value: + +* 1 if directory was successfully created, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +if (!weechat_mkdir_home ("temp")) +{ + /* error */ +} +---------------------------------------- + +weechat_mkdir +^^^^^^^^^^^^^ + +Create a directory. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_mkdir (char *directory, int mode); +---------------------------------------- + +Arguments: + +* 'directory': directory to create +* 'mode': mode for new directory + +Return value: + +* 1 if directory was successfully created, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +if (!weechat_mkdir ("/tmp/mydir")) +{ + /* error */ +} +---------------------------------------- + +weechat_mkdir_parents +^^^^^^^^^^^^^^^^^^^^^ + +Create a directory and make parent directories as needed. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_mkdir_parents (char *directory, int mode); +---------------------------------------- + +Arguments: + +* 'directory': directory to create +* 'mode': mode for new directory + +Return value: + +* 1 if directory was successfully created, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +if (!weechat_mkdir_parents ("/tmp/my/dir")) +{ + /* error */ +} +---------------------------------------- + +weechat_exec_on_files +^^^^^^^^^^^^^^^^^^^^^ + +Find files in a directory and execute a callback on each file. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_exec_on_files (const char *directory, void *data, + int (*callback)(void *data, + const char *filename)); +---------------------------------------- + +Arguments: + +* 'directory': directory for searching files +* 'data': pointer given to callback when it is called by WeeChat +* 'callback': function called for each file found, arguments: +** 'void *data': pointer +** 'const char *filename': filename found + +Example: + +[source,C] +---------------------------------------- +int callback (void *data, const char *filename) +{ + /* ... */ + return 1; +} +... +weechat_exec_on_files (plugin, "/tmp", &callback); +---------------------------------------- + +[[util]] +Util +~~~~ + +Some useful functions. + +weechat_timeval_cmp +^^^^^^^^^^^^^^^^^^^ + +Compare 2 timeval structures. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_timeval_cmp (struct timeval *tv1, struct timeval *tv2); +---------------------------------------- + +Arguments: + +* 'tv1': first timeval structure +* 'tv2': second timeval structure + +Return value: + +* -1 if tv1 < tv2 +* zero if tv1 == tv2 +* +1 if tv1 > tv2 + +Example: + +[source,C] +---------------------------------------- +if (weechat_timeval_cmp (&tv1, &tv2) > 0) +{ + /* tv1 > tv2 */ +} +---------------------------------------- + +weechat_timeval_diff +^^^^^^^^^^^^^^^^^^^^ + +Return difference (in milliseconds) between 2 timeval structures. + +Prototype: + +[source,C] +---------------------------------------- +long weechat_timeval_diff (struct timeval *tv1, struct timeval *tv2); +---------------------------------------- + +Arguments: + +* 'tv1': first timeval structure +* 'tv2': second timeval structure + +Return value: + +* difference in milliseconds + +Example: + +[source,C] +---------------------------------------- +long diff = weechat_timeval_diff (&tv1, &tv2); +---------------------------------------- + +weechat_timeval_add +^^^^^^^^^^^^^^^^^^^ + +Add interval (in milliseconds) to a timeval structure. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_timeval_add (struct timeval *tv, long interval); +---------------------------------------- + +Arguments: + +* 'tv': timeval structure +* 'interval': interval (in milliseconds) + +Return value: + +* difference in milliseconds + +Example: + +[source,C] +---------------------------------------- +weechat_timeval_add (&tv, 2000); /* add 2 seconds */ +---------------------------------------- + +[[sorted_lists]] +Sorted lists +~~~~~~~~~~~~ + +Sorted list functions. + +weechat_list_new +^^^^^^^^^^^^^^^^ + +Create a new list. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist *weechat_list_new (); +---------------------------------------- + +Return value: + +* pointer to new list + +Example: + +[source,C] +---------------------------------------- +struct t_weelist *list = weechat_list_new (); +---------------------------------------- + +weechat_list_add +^^^^^^^^^^^^^^^^ + +Add an item in a list. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_add (struct t_weelist *weelist, + const char *data, + const char *where, + void *user_data); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer +* 'data': data to insert in list +* 'where': position in list: +** 'WEECHAT_LIST_POS_SORT': add in list, keeping list sorted +** 'WEECHAT_LIST_POS_BEGINNING': add to beginning of list +** 'WEECHAT_LIST_POS_END': add to end of list +* 'user_data': any pointer + +Return value: + +* pointer to new item + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *my_item = + weechat_list_add (list, "my data", WEECHAT_LIST_POS_SORT, NULL); +---------------------------------------- + +weechat_list_search +^^^^^^^^^^^^^^^^^^^ + +Search an item in a list. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_search (struct t_weelist *weelist, + const char *data); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer +* 'data': data to search in list + +Return value: + +* pointer to item found, NULL if item was not found + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *item = weechat_list_search (list, "my data"); +---------------------------------------- + +weechat_list_casesearch +^^^^^^^^^^^^^^^^^^^^^^^ + +Search an item in a list (case sensitive search). + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_casesearch (struct t_weelist *weelist, + const char *data); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer +* 'data': data to search in list + +Return value: + +* pointer to item found, NULL if item was not found + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *item = weechat_list_casesearch (list, "my data"); +---------------------------------------- + +weechat_list_get +^^^^^^^^^^^^^^^^ + +Get an item in a list by position. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_get (struct t_weelist *weelist, + int position); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer +* 'position': position in list (0 is first item) + +Return value: + +* pointer to item found, NULL if item was not found + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *item = weechat_list_get (list, 0); /* first item */ +---------------------------------------- + +weechat_list_set +^^^^^^^^^^^^^^^^ + +Set new value for an item. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_list_set (struct t_weelist_item *item, const char *value); +---------------------------------------- + +Arguments: + +* 'item': item pointer +* 'value': new value for item + +Example: + +[source,C] +---------------------------------------- +weechat_list_set (item, "new data"); +---------------------------------------- + +weechat_list_next +^^^^^^^^^^^^^^^^^ + +Get next item in list. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_next (struct t_weelist_item *item); +---------------------------------------- + +Arguments: + +* 'item': item pointer + +Return value: + +* pointer to next item, NULL if pointer was last item in list + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *next_item = weechat_list_next_item (item); +---------------------------------------- + +weechat_list_prev +^^^^^^^^^^^^^^^^^ + +Get previous item in list. + +Prototype: + +[source,C] +---------------------------------------- +struct t_weelist_item *weechat_list_prev (struct t_weelist_item *item); +---------------------------------------- + +Arguments: + +* 'item': item pointer + +Return value: + +* pointer to previous item, NULL if pointer was last item in list + +Example: + +[source,C] +---------------------------------------- +struct t_weelist_item *prev_item = weechat_list_prev_item (item); +---------------------------------------- + +weechat_list_string +^^^^^^^^^^^^^^^^^^^ + +Get string value of an item. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_list_string (struct t_weelist_item *item); +---------------------------------------- + +Arguments: + +* 'item': item pointer + +Return value: + +* string value of item + +Example: + +[source,C] +---------------------------------------- +char *value = weechat_list_string (item); +---------------------------------------- + +weechat_list_size +^^^^^^^^^^^^^^^^^ + +Get size of list (number of items). + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_list_size (struct t_weelist *weelist); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer + +Return value: + +* size of list (number of items), 0 if list is empty + +Example: + +[source,C] +---------------------------------------- +int size = weechat_list_size (list); +---------------------------------------- + +weechat_list_remove +^^^^^^^^^^^^^^^^^^^ + +Remove an item in a list. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_list_remove (struct t_weelist *weelist, + struct t_weelist_item *item); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer +* 'item': item pointer + +Example: + +[source,C] +---------------------------------------- +weechat_list_remove (list, item); +---------------------------------------- + +weechat_list_remove_all +^^^^^^^^^^^^^^^^^^^^^^^ + +Remove all items in a list. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_list_remove_all (struct t_weelist *weelist); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer + +Example: + +[source,C] +---------------------------------------- +weechat_list_remove_all (list); +---------------------------------------- + +weechat_list_free +^^^^^^^^^^^^^^^^^ + +Free a list. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_list_free (struct t_weelist *weelist); +---------------------------------------- + +Arguments: + +* 'weelist': list pointer + +Example: + +[source,C] +---------------------------------------- +weechat_list_free (list); +---------------------------------------- + +[[configuration_files]] +Configuration files +~~~~~~~~~~~~~~~~~~~ + +Functions for configuration files. + +weechat_config_new +^^^^^^^^^^^^^^^^^^ + +Create a new configuration file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_file *weechat_config_new (const char *name, + int (*callback_reload)(void *data, + struct t_config_file *config_file), + void *callback_reload_data); +---------------------------------------- + +Arguments: + +* 'name': name of configuration file (without path or extension) +* 'callback_reload': callback called when configuration file is reloaded with + `/reload` (optional, can be NULL), arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +* 'callback_reload_data': pointer given to reload callback when it is called + by WeeChat + +Return value: + +* pointer to new configuration file, NULL if an error occured + +[NOTE] +File is NOT created by this function. It will be created by call to function +"weechat_write_config" (you should do that only after adding some sections +(with "weechat_config_new_section") and options (with +"weechat_config_new_option"). + +Example: + +[source,C] +---------------------------------------- +int +my_config_reload_cb (void *data, struct t_config_file *config_file) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +struct t_config_file *config_file = weechat_config_new ("test", + &my_config_reload_cb, + NULL); +---------------------------------------- + +weechat_config_new_section +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Create a new section in configuration file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_section *weechat_config_new_section ( + struct t_config_file *config_file, + const char *name, + int user_can_add_options, + int user_can_delete_options, + int (*callback_read)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, + const char *value), + void *callback_read_data, + int (*callback_write)(void *data, + struct t_config_file *config_file, + const char *section_name), + void *callback_write_data, + int (*callback_write_default)(void *data, + struct t_config_file *config_file, + const char *section_name); + void *callback_write_default_data, + int (*callback_create_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, + const char *value), + void *callback_create_option_data, + int (*callback_delete_option)(void *data, + struct t_config_file *config_file, + struct t_config_section *section, + struct t_config_option *option), + void *callback_delete_option_data); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'name': name of section +* 'user_can_add_options': 1 if user can add options in section, or 0 if it is + forbidden +* 'user_can_delete_options': 1 if user can delete options in section, or 0 if + it is forbidden +* 'callback_read': callback called when an option in section is read from disk + (should be NULL in most cases, except if options in your section need custom + function), arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_section *section': section pointer +** 'const char *option_name': name of option +** 'const char *value': value +* 'callback_read_data': pointer given to read callback when it is called by + WeeChat +* 'callback_write': callback called when section is written in file (should be + NULL for most cases, except if your section needs to be written by a custom + function), arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_section *section': section pointer +** 'const char *option_name': name of option +* callback_write_data: pointer given to write callback when it is called by + WeeChat +* callback_write_default: callback called when default values for section must + be written in file, arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'const char *section_name': name of section +* 'callback_write_default_data': pointer given to write_default callback when + it is called by WeeChat +* 'callback_create_option': callback called when a new option is created in + section (NULL if section does not allow new options to be created), + arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_section *section': section pointer +** 'const char *option_name': name of option +** 'const char *value': value +* 'callback_create_option_data': pointer given to create_option callback when + it is called by WeeChat +* 'callback_delete_option': callback called when a new option is deleted in + section (NULL if section does not allow new options to be deleted), + arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_section *section': section pointer +** 'struct t_config_option *option': option pointer +* 'callback_delete_option_data': pointer given to delete_option callback when + it is called by WeeChat + +Return value: + +* pointer to new section in configuration file, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +int +my_section_read_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, + const char *value) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +int +my_section_write_cb (void *data, struct t_config_file *config_file, + const char *section_name) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +int +my_section_write_default_cb (void *data, struct t_config_file *config_file, + const char *section_name) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +int +my_section_create_option_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, const char *value) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +int +my_section_delete_option_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, + struct t_config_option *option) +{ + /* ... */ + + return WEECHAT_RC_OK; +} + +/* standard section, user can not add/delete options */ +struct t_config_section *new_section1 = + weechat_config_new_section (config_file, "section1", 0, 0, + NULL, NULL, /* read callback */ + NULL, NULL, /* write callback */ + NULL, NULL, /* write default callback */ + NULL, NULL, /* create option callback */ + NULL, NULL); /* delete option callback */ + +/* special section, user can add/delete options, and options need + callback to be read/written */ +struct t_config_section *new_section2 = + weechat_config_new_section (config_file, "section2", 1, 1, + &my_section_read_cb, NULL, + &my_section_write_cb, NULL, + &my_section_write_default_cb, NULL, + &my_section_create_option_cb, NULL, + &my_section_delete_option_cb, NULL); +---------------------------------------- + +weechat_config_search_section +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search a section in a configuration file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_section *weechat_config_search_section ( + struct t_config_file *config_file, + const char *section_name); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'section_name': name of section to search + +Return value: + +* pointer to section found, NULL if section was not found + +Example: + +[source,C] +---------------------------------------- +struct t_config_section *section = weechat_config_search_section (config_file, + "section"); +---------------------------------------- + +weechat_config_new_option +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Create a new option in a section of a configuration file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_option *weechat_config_new_option ( + struct t_config_file *config_file, + struct t_config_section *section, + const char *name, + const char *type, + const char *description, + const char *string_values, + int min, + int max, + const char *default_value, + const char *value, + int null_value_allowed, + int (*callback_check_value)(void *data, + struct t_config_option *option, + const char *value), + void *callback_check_value_data, + int (*callback_change)(void *data, + struct t_config_option *option), + void *callback_change_data, + int (*callback_delete)(void *data, + struct t_config_option *option), + void *callback_delete_data); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'section': section pointer +* 'name': name of option +* 'type': type of option: +** 'boolean' +** 'integer' +** 'string' +** 'color' +* 'description': description of option +* 'string_values': values as string (separated by "|"), used for type integer + (optional) +* 'min': minimum value (for integer) +* 'max': maximum value (for integer) +* 'default_value': default value for option (used when option is reset) +* 'value': value for option +* 'null_value_allowed': 1 if null (undefined value) is allowed for option, + otherwise 0 +* 'callback_check_value': callback called to check new value for option + (optional), arguments: +** 'void *data': pointer +** 'struct t_config_option *option': option pointer +** 'const char *value': new value for option +* 'callback_check_value_data': pointer given to check_value callback when it + is called by WeeChat +* 'callback_change': callback called when value of option has changed + (optional), arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_option *option': option pointer +* 'callback_change_data': pointer given to change callback when it is called + by WeeChat +* 'callback_delete': callback called when option will be deleted (optional), + arguments: +** 'void *data': pointer +** 'struct t_config_file *config_file': configuration file pointer +** 'struct t_config_option *option': option pointer +* 'callback_delete_data': pointer given to delete callback when it is called + by WeeChat + +Return value: + +* pointer to new option in section, NULL if an error + +Example: + +[source,C] +---------------------------------------- +/* boolean */ +struct t_config_option *option1 = + weechat_config_new_option (config_file, section, + "option1", "My option, type boolean" + NULL, /* string values */ + 0, 0, /* min, max */ + "on", /* default */ + "on", /* value */ + 0, /* null value allowed */ + NULL, NULL, /* check callback */ + NULL, NULL, /* change callback */ + NULL, NULL); /* delete callback */ + +/* integer */ +struct t_config_option *option2 = + weechat_config_new_option (config_file, section, + "option2", "My option, type integer" + NULL, /* string values */ + 0, 100, /* min, max */ + "15", /* default */ + "15", /* value */ + 0, /* null value allowed */ + NULL, NULL, /* check callback */ + NULL, NULL, /* change callback */ + NULL, NULL); /* delete callback */ + +/* integer (with string values) */ +struct t_config_option *option3 = + weechat_config_new_option (config_file, section, + "option3", "My option, type integer (with string values)" + "top|bottom|left|right", /* string values */ + 0, 0, /* min, max */ + "bottom", /* default */ + "bottom", /* value */ + 0, /* null value allowed */ + NULL, NULL, /* check callback */ + NULL, NULL, /* change callback */ + NULL, NULL); /* delete callback */ + +/* string */ +struct t_config_option *option4 = + weechat_config_new_option (config_file, section, + "option4", "My option, type string" + NULL, /* string values */ + 0, 0, /* min, max */ + "test", /* default */ + "test", /* value */ + 1, /* null value allowed */ + NULL, NULL, /* check callback */ + NULL, NULL, /* change callback */ + NULL, NULL); /* delete callback */ + +/* color */ +struct t_config_option *option5 = + weechat_config_new_option (config_file, section, + "option5", "My option, type color" + NULL, /* string values */ + 0, 0, /* min, max */ + "lightblue", /* default */ + "lightblue", /* value */ + 0, /* null value allowed */ + NULL, NULL, /* check callback */ + NULL, NULL, /* change callback */ + NULL, NULL); /* delete callback */ +---------------------------------------- + +weechat_config_search_option +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search an option in a section of a configuration file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_option *weechat_config_search_option ( + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'section': section pointer +* 'name': name of option to search + +Return value: + +* pointer to option found, NULL if option was not found + +Example: + +[source,C] +---------------------------------------- +struct t_config_option *option = + weechat_config_search_option (config_file, section, "option"); +---------------------------------------- + +weechat_config_search_with_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search an option in a configuration file with string. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_search_with_string (const char *option_name, + struct t_config_file **config_file, + struct t_config_section **section, + struct t_config_option **option); +---------------------------------------- + +Arguments: + +* 'option_name': full option name (format: "file.section.option") +* 'config_file': pointer to configuration file pointer, will be set to + configuration file of option, if found +* 'section': pointer to section pointer, will be set to section of option, if + found +* 'option': pointer to an option pointer, will be set to option pointer, if + found + +Example: + +[source,C] +---------------------------------------- +struct t_config_file *ptr_config_file; +struct t_config_section *ptr_section; +struct t_config_option *ptr_option; + +weechat_config_search_with_string ("file.section.option", + &ptr_config_file, + &ptr_section, + &ptr_option); +if (ptr_option) +{ + /* option found */ +} +else +{ + /* option not found */ +} +---------------------------------------- + +weechat_config_string_to_boolean +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Check if a text is "true" or "false". + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_string_to_boolean (const char *text); +---------------------------------------- + +Arguments: + +* 'text': text to analyze + +Return value: + +* 1 if text is "true" ("on", "yes", "y", "true", "t", "1") +* 0 if text is "false" ("off", "no", "n", "false", "f", "0") + +Example: + +[source,C] +---------------------------------------- +if (weechat_config_string_to_boolean (option_value)) +{ + /* option is true */ +} +else +{ + /* option is false */ +} +---------------------------------------- + +weechat_config_option_reset +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Reset an option to its default value. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_option_reset (struct t_config_option *option, + int run_callback); +---------------------------------------- + +Arguments: + +* 'option': option pointer +* 'run_callback': 1 for calling chang callback if option is changed, 0 + otherwise + +Return value: + +* 'WEECHAT_CONFIG_OPTION_SET_OK_CHANGED' if option value has been reset +* 'WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE' if value was not changed +* 'WEECHAT_CONFIG_OPTION_SET_ERROR' if an error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_option_reset (option, 1)) +{ + case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_ERROR: + /* .... */ + break; +} +---------------------------------------- + +weechat_config_option_set +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Set new value for an option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_option_set (struct t_config_option *option, + const char *value, int run_callback); +---------------------------------------- + +Arguments: + +* 'option': option pointer +* 'value': new value for option +* 'run_callback': 1 for calling chang callback if option is changed, 0 + otherwise + +Return value: + +* 'WEECHAT_CONFIG_OPTION_SET_OK_CHANGED' if option value has been changed +* 'WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE' if value was not changed +* 'WEECHAT_CONFIG_OPTION_SET_ERROR' if an error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_option_set (option, "new_value", 1)) +{ + case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_ERROR: + /* .... */ + break; +} +---------------------------------------- + +weechat_config_option_set_null +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Set null (undefined value) for an option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_option_set_null (struct t_config_option *option, + int run_callback); +---------------------------------------- + +Arguments: + +* 'option': option pointer +* 'run_callback': 1 for calling chang callback if option is changed (if it was + not null), 0 otherwise + +[NOTE] +You can set value to null only if it is allowed for option (see +<<_weechat_config_new_option>>). + +Return value: + +* 'WEECHAT_CONFIG_OPTION_SET_OK_CHANGED' if option value has been reset +* 'WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE' if value was not changed +* 'WEECHAT_CONFIG_OPTION_SET_ERROR' if an error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_option_set_null (option, 1)) +{ + case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_SET_ERROR: + /* .... */ + break; +} +---------------------------------------- + +weechat_config_option_unset +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Unset/reset option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_option_unset (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET' if option value has not been reset +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_RESET' if option value has been reset +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED' if option has been removed +* 'WEECHAT_CONFIG_OPTION_UNSET_ERROR' if an error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_option_unset (option)) +{ + case WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_OK_RESET: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED: + /* .... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_ERROR: + /* .... */ + break; +} +---------------------------------------- + +weechat_config_option_rename +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Rename an option. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_option_rename (struct t_config_option *option, + const char *new_name); +---------------------------------------- + +Arguments: + +* 'option': option pointer +* 'new_name': new name for option + +Example: + +[source,C] +---------------------------------------- +weechat_config_option_rename (option, "new_name"); +---------------------------------------- + +weechat_config_option_get_pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get a pointer on an option property. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_config_option_get_pointer (struct t_config_option *option, + const char *property); +---------------------------------------- + +Arguments: + +* 'option': option pointer +* 'property': property name: +** 'config_file': configuration file pointer ('struct t_config_file *') +** 'section': section pointer ('struct t_config_section *') +** 'name': option name ('char *') +** 'type': option type ('int *') +** 'description': option description ('char *') +** 'string_values': string values ('char *') +** 'min': minimum value ('int *') +** 'max': maximum value ('int *') +** 'default_value': default value (depends on type) +** 'value': current value (depends on type) +** 'prev_option': previous option pointer ('struct t_config_option *') +** 'next_option': next option pointer ('struct t_config_option *') + +Return value: + +* pointer to property asked + +Example: + +[source,C] +---------------------------------------- +char *description = weechat_config_option_get_pointer (option, "description"); +---------------------------------------- + +weechat_config_option_is_null +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Check if an option is null (undefined value). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_option_is_null (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* 1 if option is null +* 0 if option is not null + +Example: + +[source,C] +---------------------------------------- +if (weechat_config_option_is_null (option)) +{ + /* value is null */ +} +else +{ + /* value is not null */ +} +---------------------------------------- + +weechat_config_boolean +^^^^^^^^^^^^^^^^^^^^^^ + +Get boolean value of option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_boolean (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* boolean value of option (0 or 1) + +Example: + +[source,C] +---------------------------------------- +if (weechat_config_boolean (option)) +{ + /* true */ +} +else +{ + /* false */ +} +---------------------------------------- + +weechat_config_boolean_default +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get default boolean value of option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_boolean_default (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* default boolean value of option (0 or 1) + +Example: + +[source,C] +---------------------------------------- +if (weechat_config_boolean_default (option)) +{ + /* true */ +} +else +{ + /* false */ +} +---------------------------------------- + +weechat_config_integer +^^^^^^^^^^^^^^^^^^^^^^ + +Get integer value of option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_integer (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* integer value of option + +Example: + +[source,C] +---------------------------------------- +int value = weechat_config_integer (option); +---------------------------------------- + +weechat_config_integer_default +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get default integer value of option. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_integer_default (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* default integer value of option + +Example: + +[source,C] +---------------------------------------- +int value = weechat_config_integer_default (option); +---------------------------------------- + +weechat_config_string +^^^^^^^^^^^^^^^^^^^^^ + +Get string value of option. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_config_string (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* string value of option + +Example: + +[source,C] +---------------------------------------- +const char *value = weechat_config_string (option); +---------------------------------------- + +weechat_config_string_default +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get default string value of option. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_config_integer_default (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* default string value of option + +Example: + +[source,C] +---------------------------------------- +const char *value = weechat_config_string_default (option); +---------------------------------------- + +weechat_config_color +^^^^^^^^^^^^^^^^^^^^ + +Get color value of option. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_config_color (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* color value of option (string with name of color) + +Example: + +[source,C] +---------------------------------------- +const char *color = weechat_config_color (option); +---------------------------------------- + +weechat_config_color_default +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get default color value of option. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_config_color_default (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Return value: + +* default color value of option (string with name of color) + +Example: + +[source,C] +---------------------------------------- +const char *color = weechat_config_color_default (option); +---------------------------------------- + +weechat_config_write_option +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Write a line in a configuration file with option and its value (this function +should be called only in "write" or "write_default" callbacks for a section). + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_write_option (struct t_config_file *config_file, + struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'option': option pointer + +Example: + +[source,C] +---------------------------------------- +int +my_section_write_cb (void *data, struct t_config_file *config_file, + const char *section_name) +{ + weechat_config_write_line (config_file, "my_section", NULL); + + weechat_config_write_option (config_file, option); + + return WEECHAT_RC_OK; +} +---------------------------------------- + +weechat_config_write_line +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Write a line in a configuration file (this function should be called only in +"write" or "write_default" callbacks for a section). + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_write_line (struct t_config_file *config_file, + const char *option_name, + const char *value, ...); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer +* 'option_name': option name +* 'value': value (if NULL, then line with section name is written, for + example: "[section]") + +Example: + +[source,C] +---------------------------------------- +int +my_section_write_cb (void *data, struct t_config_file *config_file, + const char *section_name) +{ + weechat_config_write_line (config_file, "my_section", NULL); + + weechat_config_write_line (config_file, "option", "%s;%d", + "value", 123); + + return WEECHAT_RC_OK; +} +---------------------------------------- + +weechat_config_write +^^^^^^^^^^^^^^^^^^^^ + +Write configuration file to disk. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_write (struct t_config_file *config_file); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer + +Return value: + +* 'WEECHAT_CONFIG_WRITE_OK' if configuration was written +* 'WEECHAT_CONFIG_WRITE_MEMORY_ERROR' if there was not enough memory +* 'WEECHAT_CONFIG_WRITE_ERROR' if another error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_write (config_file)) +{ + case WEECHAT_CONFIG_WRITE_OK: + /* ... */ + break; + case WEECHAT_CONFIG_WRITE_MEMORY_ERROR: + /* ... */ + break; + case WEECHAT_CONFIG_WRITE_ERROR: + /* ... */ + break; +} +---------------------------------------- + +weechat_config_read +^^^^^^^^^^^^^^^^^^^ + +Read configuration file from disk. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_read (struct t_config_file *config_file); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer + +Return value: + +* 'WEECHAT_CONFIG_READ_OK' if configuration was loaded +* 'WEECHAT_CONFIG_READ_MEMORY_ERROR' if there was not enough memory +* 'WEECHAT_CONFIG_READ_FILE_NOT_FOUND' if file was not found + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_read (config_file)) +{ + case WEECHAT_CONFIG_READ_OK: + /* ... */ + break; + case WEECHAT_CONFIG_READ_MEMORY_ERROR: + /* ... */ + break; + case WEECHAT_CONFIG_READ_FILE_NOT_FOUND: + /* ... */ + break; +} +---------------------------------------- + +weechat_config_reload +^^^^^^^^^^^^^^^^^^^^^ + +Reload configuration file from disk. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_reload (struct t_config_file *config_file); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer + +Return value: + +* 'WEECHAT_CONFIG_READ_OK' if configuration was reloaded +* 'WEECHAT_CONFIG_READ_MEMORY_ERROR' if there was not enough memory +* 'WEECHAT_CONFIG_READ_FILE_NOT_FOUND' if file was not found + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_reload (config_file)) +{ + case WEECHAT_CONFIG_READ_OK: + /* ... */ + break; + case WEECHAT_CONFIG_READ_MEMORY_ERROR: + /* ... */ + break; + case WEECHAT_CONFIG_READ_FILE_NOT_FOUND: + /* ... */ + break; +} +---------------------------------------- + +weechat_config_option_free +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Free an option. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_option_free (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'option': option pointer + +Example: + +[source,C] +---------------------------------------- +weechat_config_option_free (option); +---------------------------------------- + +weechat_config_section_free_options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Free all options in a section. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_section_free_options (struct t_config_section *section); +---------------------------------------- + +Arguments: + +* 'section': section pointer + +Example: + +[source,C] +---------------------------------------- +weechat_config_section_free_options (section); +---------------------------------------- + +weechat_config_section_free +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Free an option. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_section_free (struct t_config_option *option); +---------------------------------------- + +Arguments: + +* 'section': section pointer + +Example: + +[source,C] +---------------------------------------- +weechat_config_section_free (section); +---------------------------------------- + +weechat_config_free +^^^^^^^^^^^^^^^^^^^ + +Free a configuration file. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_config_free (struct t_config_file *config_file); +---------------------------------------- + +Arguments: + +* 'config_file': configuration file pointer + +Example: + +[source,C] +---------------------------------------- +weechat_config_free (config_file); +---------------------------------------- + +weechat_config_get +^^^^^^^^^^^^^^^^^^ + +Search an option in a configuration file with string. + +Prototype: + +[source,C] +---------------------------------------- +struct t_config_option *weechat_config_get (const char *option_name); +---------------------------------------- + +Arguments: + +* 'option_name': full option name (format: "file.section.option") + +Return value: + +* pointer to option found, NULL if option was not found + +Example: + +[source,C] +---------------------------------------- +struct t_config_option *option = weechat_config_get ("weechat.look.item_time_format"); +---------------------------------------- + +weechat_config_get_plugin +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search an option in plugins configuration file (plugins.conf), by adding +prefix with current plugin name. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_config_get_plugin (const char *option_name); +---------------------------------------- + +Arguments: + +* 'option_name': option name, WeeChat will add prefix "plugins.var.xxxx." + (where xxxx is current plugin name) + +Return value: + +* value of option found, NULL if option was not found + +Example: + +[source,C] +---------------------------------------- +/* if current plugin is "test", then look for value of option + "plugins.var.test.option" in file plugins.conf */ +char *value = weechat_config_get_plugin ("option"); +---------------------------------------- + +weechat_config_is_set_plugin +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Check if option is set in plugins configuration file (plugins.conf). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_is_set_plugin (const char *option_name); +---------------------------------------- + +Arguments: + +* 'option_name': option name, WeeChat will add prefix "plugins.var.xxxx." + (where xxxx is current plugin name) + +Return value: + +* 1 if option is set, 0 if option does not exist + +Example: + +[source,C] +---------------------------------------- +if (weechat_config_is_set_plugin ("option")) +{ + /* option is set */ +} +else +{ + /* option does not exist in plugins.conf */ +} +---------------------------------------- + +weechat_config_set_plugin +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Set value for option in plugins configuration file (plugins.conf). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_set_plugin (const char *option_name, const char *value); +---------------------------------------- + +Arguments: + +* 'option_name': option name, WeeChat will add prefix "plugins.var.xxxx." + (where xxxx is current plugin name) +* 'value': new value for option + +Return value: + +* 'WEECHAT_CONFIG_OPTION_SET_OK_CHANGED' if option valus has been changed +* 'WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE' if value was not changed +* 'WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND' if option was not found +* 'WEECHAT_CONFIG_OPTION_SET_ERROR' if other error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_set_plugin ("option", "test_value")) +{ + case WEECHAT_CONFIG_OPTION_SET_OK_CHANGED: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_SET_ERROR: + /* ... */ + break; +} +---------------------------------------- + +weechat_config_unset_plugin +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Unset option in plugins configuration file (plugins.conf). + +Prototype: + +[source,C] +---------------------------------------- +int weechat_config_unset_plugin (const char *option_name); +---------------------------------------- + +Arguments: + +* 'option_name': option name, WeeChat will add prefix "plugins.var.xxxx." + (where xxxx is current plugin name) + +Return value: + +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET' if option value has not been reset +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_RESET' if option value has been reset +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED' if option has been removed +* 'WEECHAT_CONFIG_OPTION_UNSET_ERROR' if an error occured + +Example: + +[source,C] +---------------------------------------- +switch (weechat_config_unset_plugin ("option")) +{ + case WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_OK_RESET: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED: + /* ... */ + break; + case WEECHAT_CONFIG_OPTION_UNSET_ERROR: + /* ... */ + break; +} +---------------------------------------- + +[[display]] +Display +~~~~~~~ + +Functions to display text in buffers. + +weechat_prefix +^^^^^^^^^^^^^^ + +Get a prefix. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_prefix (const char *prefix); +---------------------------------------- + +Arguments: + +* 'prefix': name of prefix: + +[width="60%",cols="^2,^1,^2,5",options="header"] +|======================================== +| Prefix | Value | Color | Description +| 'error' | `=!=` | yellow | error message +| 'network' | `--` | magenta | message from network +| 'action' | `*` | white | self action +| 'join' | `-->` | lightgreen | someone joins current chat +| 'quit' | `<--` | lightred | someone leaves current chat +|======================================== + +[NOTE] +Values and colors can be customized with command `/set`. + +Return value: + +* prefix value (string with prefix and color codes), empty string if prefix is + not found + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "%sThis is an error...", weechat_prefix ("error")); +---------------------------------------- + +weechat_color +^^^^^^^^^^^^^ + +Get a string color code for display. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_color (const char *color_name); +---------------------------------------- + +Arguments: + +* 'color_name': name of color, one of: +** WeeChat option name (from weechat.color.xxx), for example 'chat_delimiters' +** color with optional background, for example 'yellow' or 'yellow,red' +** attribute: +*** 'bold': set bold +*** '-bold': remove bold +*** 'reverse': set reverse +*** '-reverse': remove reverse +*** 'italic': set italic +*** '-italic': remove italix +*** 'underline': set underline +*** '-underline': remove underline +** bar color name: +*** 'bar_fg': foreground color for bar +*** 'bar_delim': delimiters color for bar +*** 'bar_bg': background color for bar + +Return value: + +* string with color code, or a "reset color" code if color is not found + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "Color: %sblue %schat default %syellow on red", + weechat_color ("blue"), + weechat_color ("chat"), + weechat_color ("yellow,red")); +---------------------------------------- + +weechat_printf +^^^^^^^^^^^^^^ + +Display a message on a buffer. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_printf (struct t_gui_buffer *buffer, const char *message, ...); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer +* 'message': message to display + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "Hello on WeeChat buffer"); +weechat_printf (buffer, "Hello on this buffer"); +---------------------------------------- + +weechat_printf_date +^^^^^^^^^^^^^^^^^^^ + +Display a message on a buffer, using a custom date. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_printf_date (struct t_gui_buffer *buffer, time_t date, + const char *message, ...); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer +* 'date': date for message +* 'message': message to display + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, time (NULL) - 120, "Hello, 2 minutes ago"); +---------------------------------------- + +weechat_printf_tags +^^^^^^^^^^^^^^^^^^^ + +Display a message on a buffer, using a custom tags. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_printf_tags (struct t_gui_buffer *buffer, const char *tags, + const char *message, ...); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer +* 'tags': comma separated list of tags +* 'message': message to display + +Example: + +[source,C] +---------------------------------------- +weechat_printf_tags (NULL, "notify_message", "Hello with a message notify tag"); +---------------------------------------- + +weechat_printf_date_tags +^^^^^^^^^^^^^^^^^^^^^^^^ + +Display a message on a buffer, using a custom date and tags. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_printf_date_tags (struct t_gui_buffer *buffer, time_t date, + const char *tags, const char *message, ...); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer +* 'date': date for message +* 'tags': comma separated list of tags +* 'message': message to display + +Example: + +[source,C] +---------------------------------------- +weechat_printf_date_tags (NULL, time (NULL) - 120, "notify_message", + "Hello, 2 minutes ago, with a message notify tag"); +---------------------------------------- + +weechat_printf_y +^^^^^^^^^^^^^^^^ + +Display a message on a line of a buffer with free content. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_printf_y (struct t_gui_buffer *buffer, int y, + const char *message, ...); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, message is displayed on WeeChat buffer +* 'y': line number (0 for first line) +* 'message': message to display + +Example: + +[source,C] +---------------------------------------- +weechat_printf_y (buffer, 2, "My message on third line"); +---------------------------------------- + +weechat_log_printf +^^^^^^^^^^^^^^^^^^ + +Write a message in WeeChat log file. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_log_printf (const char *message, ...); +---------------------------------------- + +Arguments: + +* 'message': message to write + +Example: + +[source,C] +---------------------------------------- +weechat_log_printf ("My message in log"); +---------------------------------------- + +[[hooks]] +Hooks +~~~~~ + +weechat_hook_command +^^^^^^^^^^^^^^^^^^^^ + +Hook a command. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_command (const char *command, + const char *description, + const char *args, + const char *args_description, + const char *completion, + int (*callback)(void *data, + struct t_gui_buffer *buffer, + int argc, char **argv, + char **argv_eol), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'command': new command name +* 'description': description fo command (displayed with `/help command`) +* 'args': arguments for command (displayed with `/help command`) +* 'args_description': description of arguments (displayed with `/help command`) +* 'completion': completion template for command: list of completions for each + arguments, separated by space. Many completions are possible for one + argument, separated by "|". Many templates are possible for same command, + separated by "||". Default completion codes are: +include::autogen/plugin_api/completions.txt[] +** special codes: +*** '%%command': reuse completion template from /command +*** '%-': stop completion +*** '%*': repeat last completion +* 'callback': function called when command is used, arguments: +** 'void *data': pointer +** 'struct t_gui_buffer *buffer': buffer where command is executed +** 'int argc': argument count +** 'char **argv': arguments +** 'char **argv_eol': argumenst (until end of line) +* 'callback_data': pointer given to callback when it is called by WeeChat + +For example, if command called is `/command abc def ghi`, then argv and +argv_eol contain following values: + +* 'argv': +** 'argv[0]' == "abc" +** 'argv[1]' == "def" +** 'argv[2]' == "ghi" +* 'argv_eol': +** 'argv_eol[0]' == "abc def ghi" +** 'argv_eol[1]' == "def ghi" +** 'argv_eol[2]' == "ghi" + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_command_cb (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +/* this example is inspired by weechat command /filter */ +struct t_hook *my_command_hook = + weechat_hook_command (/* command name */ + "myfilter", + /* description */ + "description of myfilter", + /* args */ + "[list] | [enable|disable|toggle [name]] | " + "[add name plugin.buffer tags regex] | " + "[del name|-all]", + /* args description */ + "description of arguments...", + /* completion */ + "list" + " || enable %(filters_names)" + " || disable %(filters_names)" + " || toggle %(filters_names)" + " || add %(filters_names) %(buffers_plugins_names)|*" + " || del %(filters_names)|-all", + /* callback */ + &my_command_cb, + /* callback_data */ + NULL); +---------------------------------------- + +weechat_hook_command_run +^^^^^^^^^^^^^^^^^^^^^^^^ + +Hook a command when WeeChat runs it. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_command_run (const char *command, + int (*callback)(void *data, + struct t_gui_buffer *buffer, + const char *command), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'command': command to hook, may start or end with "*" as joker +* 'callback': function called when command is run, arguments: +** 'void *data': pointer +** 'struct t_gui_buffer *buffer': buffer where command is executed +** 'const char *command': the command executed, with its arguments +* 'callback_data': pointer given to callback when it is called by WeeChat + +[NOTE] +Callback can return 'WEECHAT_RC_OK' or 'WEECHAT_RC_OK_EAT' (ok and "eat" +command, will not be executed by WeeChat after callback). + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_command_run_cb (void *data, struct t_gui_buffer *buffer, + const char *command) +{ + weechat_printf (NULL, + "You want to complete? I'm eating the completion ahah!"); + return WEECHAT_RC_OK_EAT; +} + +struct t_hook *my_command_run_hook = + weechat_hook_command_run ("/input complete*", + &my_command_run_cb, NULL); +---------------------------------------- + +weechat_hook_timer +^^^^^^^^^^^^^^^^^^ + +Hook a timer. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_timer (long interval, + const char *align_second, + const char *max_calls, + int (*callback)(void *data, + int remaining_calls), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'interval': interval between two calls (milliseconds, so 1000 = 1 second) +* 'align_second': alignment on a second: align timer on a second. For example, + if current time is 09:00, if interval = 60000 (60 seconds), and + align_second = 60, then timer is called each minute when second is 00 +* 'max_calls': number of calls to timer (if 0, then timer has no end) +* 'callback': function called when time is reached, arguments: +** 'void *data': pointer +** 'int remaining_calls': remaining calls (-1 if timer has no end) +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_timer_cb (void *data, int remaining_calls) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +/* timer called each 20 seconds */ +struct t_hook *my_timer_hook = + weechat_hook_timer (20 * 1000, 0, 0, &my_timer_cb, NULL); +---------------------------------------- + +weechat_hook_fd +^^^^^^^^^^^^^^^ + +Hook a file descriptor (file or socket). + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_fd (int fd, + int flag_read, + int flag_write, + int flag_exception, + int (*callback)(void *data, int fd), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'fd': file descriptor +* 'flag_read': 1 = catch read event, 0 = ignore +* 'flag_write': 1 = catch write event, 0 = ignore +* 'flag_exception': 1 = catch exception event, 0 = ignore +* 'callback': function called when time is reached, arguments: +** 'void *data': pointer +** 'int fd': file descriptor +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_fd_cb (void *data, int fd) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +int sock = socket (AF_INET, SOCK_STREAM, 0); +/* set socket options */ +/* ... */ +/* hook socket */ +struct t_hook *my_fd_hook = weechat_hook_fd (sock, 1, 0, 0, &my_fd_cb, NULL); +---------------------------------------- + +weechat_hook_process +^^^^^^^^^^^^^^^^^^^^ + +Hook a process (with fork), and catch output. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_process (const char *command, + int timeout, + int (*callback)(void *data, + const char *command, + int return_code, + const char *stdout, + const char *stderr), + void *callback_data); +---------------------------------------- + + +Arguments: + +* 'command': command to launch in child process +* 'timeout': timeout for command (in milliseconds): after this timeout, child + process is killed (0 means no timeout) +* 'callback': function called when data from child is available, or when child + has ended, arguments: +** 'void *data': pointer +** 'const char *command': command executed by child +** 'int return_code': +*** '>= 0': child command return code +*** '< 0': 'WEECHAT_HOOK_PROCESS_OK_RUNNING' (data available, but child still + running) or 'WEECHAT_HOOK_PROCESS_ERROR' (error when launching command) +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_process_cb (void *data, const char *command, int return_code, + const char *stdout, const char *stderr) +{ + if (return_code == WEECHAT_HOOK_PROCESS_ERROR) + { + weechat_printf (NULL, "Error with command '%s'", command); + return; + } + + if (return_code >= 0) + { + weechat_printf (NULL, "return_code = %d", return_code); + } + + if (stdout) + { + weechat_printf (NULL, "stdout: %s", stdout); + } + + if (stderr) + { + weechat_printf (NULL, "stderr: %s", stderr); + } + + return WEECHAT_RC_OK; +} + +struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000, + &my_process_cb, NULL); +---------------------------------------- + +weechat_hook_connect +^^^^^^^^^^^^^^^^^^^^ + +Hook a connection (background connection to a remote host). + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_connect (const char *address, + int port, + int sock, + int ipv6, + void *gnutls_sess, + const char *local_hostname, + int (*callback)(void *data, + int status, + const char *ip_address), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'address': name or IP address to connect to +* 'port': port number +* 'sock': socket used to connect +* 'ipv6': 1 to use IPv6, 0 to use IPv4 +* 'gnutls_sess': GnuTLSsession (optional) +* 'callback': function called when connection is ok or failed, arguments: +** 'void *data': pointer +** 'int status': constant with connection status: +*** 'WEECHAT_HOOK_CONNECT_OK' +*** 'WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND' +*** 'WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND' +*** 'WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED' +*** 'WEECHAT_HOOK_CONNECT_PROXY_ERROR' +*** 'WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR' +*** 'WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR' +*** 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR' +*** 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR' +** 'const char *ip_address': IP address found +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_connect_cb (void *data, int status, const char *ip_address) +{ + switch (status) + { + case WEECHAT_HOOK_CONNECT_OK: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_PROXY_ERROR: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR: + /* ... */ + break; + case WEECHAT_HOOK_CONNECT_MEMORY_ERROR: + /* ... */ + break; + } + return WEECHAT_RC_OK; +} + +struct t_hook *my_connect_hook = weechat_hook_connect ("my.server.org", 1234, + sock, 0, NULL, NULL, + &my_connect_cb, NULL); +---------------------------------------- + +weechat_hook_print +^^^^^^^^^^^^^^^^^^ + +Hook a message printed. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_print (struct t_gui_buffer *buffer, + const char *tags, + const char *message, + int strip_colors, + int (*callback)(void *data, + struct t_gui_buffer *buffer, + time_t date, + int tags_count, + const char **tags, + int displayed, + int highlight, + const char *prefix, + const char *message), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer, if NULL, messages from any buffer are caught +* 'tags': only messages with these tags (comma separated list) will be caught + (optional) +* 'message': only messages with this string will be caught (optional) +* 'strip_colors': if == 1, colors will be stripped from message displayed, + before calling callback +* 'callback': function called when message is printed, arguments: +** 'void *data': pointer +** 'struct t_gui_buffer *buffer': buffer pointer +** 'time_t date': date +** 'int tags_count': number of tags for line +** 'const char **tags': tags for line +** 'int displayed': 1 if line is displayed, 0 if it is filtered +** 'int highlight': 1 if line has highlight, otherwise 0 +** 'const char *prefix': prefix +** 'const char *message': message +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_print_cb (void *data, struct t_gui_buffer *buffer, time_t date, + int tags_count, const char **tags, + int displayed, int highlight, + const char *prefix, const char *message) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +/* catch all messages, on all buffers, without color */ +struct t_hook *my_print_hook = + weechat_hook_print (NULL, NULL, NULL, 1, &my_print_cb, NULL); +---------------------------------------- + +weechat_hook_signal +^^^^^^^^^^^^^^^^^^^ + +Hook a signal. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_signal (const char *signal, + int (*callback)(void *data, + const char *signal, + const char *type_data, + void *signal_data), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'signal': signal to catch, can begin or end with "*": + +[width="80%",cols="^1,^3,^3,5",options="header"] +|======================================== +| Plugin | Signal | Arguments | Description + +| irc | xxx,irc_in_yyy ^1^ | string: message | + irc message from server (before irc plugin uses it) + +| irc | xxx,irc_in2_yyy ^1^ | string: message | + irc message from server (after irc plugin uses it) + +| irc | xxx,irc_out_yyy ^1^ | string: message | + irc message sent to server + +| irc | irc_ctcp | string: message | + CTCP received + +| irc | irc_dcc | string: message | + new DCC + +| irc | irc_pv | string: message | + private message received + +| irc | irc_channel_opened | pointer: buffer | + channel opened + +| irc | irc_pv_opened | pointer: buffer | + private opened + +| irc | irc_server_connecting | string: server name | + connecting to server + +| irc | irc_server_connected | string: server name | + connected to server + +| irc | irc_server_disconnected | string: server name | + disconnected from server + +| irc | irc_ignore_removing | pointer: ignore | + removing ignore + +| irc | irc_ignore_removed | - | + ignore removed + +| logger | logger_start | pointer: buffer | + start logging for buffer + +| logger | logger_stop | pointer: buffer | + stop logging for buffer + +| logger | logger_backlog | pointer: buffer | + display backlog for buffer + +| weechat | buffer_closing | pointer: buffer | + closing buffer + +| weechat | buffer_closed | pointer: buffer | + buffer closed + +| weechat | buffer_lines_hidden | pointer: buffer | + lines hidden in buffer + +| weechat | buffer_localvar_added | pointer: buffer | + local variable has been added + +| weechat | buffer_localvar_changed | pointer: buffer | + local variable has changed + +| weechat | buffer_localvar_removed | pointer: buffer | + local variable has been removed + +| weechat | buffer_moved | pointer: buffer | + buffer moved + +| weechat | buffer_opened | pointer: buffer | + buffer opened + +| weechat | buffer_renamed | pointer: buffer | + buffer renamed + +| weechat | buffer_switch | pointer: buffer | + switching buffer + +| weechat | buffer_title_changed | pointer: buffer | + title of buffer changed + +| weechat | buffer_type_changed | pointer: buffer | + type of buffer changed + +| weechat | debug_dump | - | + dump request + +| weechat | filter_added | pointer: filter | + filter added + +| weechat | filter_removing | pointer: filter | + removing filter + +| weechat | filter_removed | - | + filter added + +| weechat | filter_enabled | - | + filters enabled + +| weechat | filter_disabled | - | + filters disabled + +| weechat | hotlist_changed | - | + hotlist changed + +| weechat | input_paste_pending | - | + paste pending + +| weechat | input_search | - | + input search + +| weechat | input_text_changed | - | + input text changed + +| weechat | input_text_cursor_moved | - | + input text cursor moved + +| weechat | key_pressed | string: key pressed | + key pressed + +| weechat | nicklist_changed | - | + nicklist has changed + +| weechat | partial_completion | - | + partial completion happened + +| weechat | quit | string: arguments for /quit | + command `/quit` issued by user + +| weechat | upgrade | - | + command `/upgrade` issued by user + +| weechat | weechat_highlight | string: message with prefix | + highlight happened + +| weechat | weechat_pv | string: message with prefix | + private message displayed + +| weechat | window_scrolled | pointer: window | + scroll in window + +| weechat | window_unzooming | pointer: current window | + unzooming window + +| weechat | window_unzoomed | pointer: current window | + window unzoomed + +| weechat | window_zooming | pointer: current window | + zomming window + +| weechat | window_zoomed | pointer: current window | + window zoomed + +| xfer | xfer_add | pointer: infolist with xfer info | + new xfer + +| xfer | xfer_send_ready | pointer: infolist with xfer info | + xfer ready + +| xfer | xfer_accept_resume | pointer: infolist with xfer info | + xfer accepts resume (send) + +| xfer | xfer_send_accept_resume | pointer: infolist with xfer info | + xfer accepts resume (send) + +| xfer | xfer_start_resume | pointer: infolist with xfer info | + start resume + +| xfer | xfer_resume_ready | pointer: infolist with xfer info | + xfer resume ready +|======================================== + +[NOTE] +^1^ 'xxx' is IRC server name, 'yyy' is IRC command name + +* 'callback': function called when signal is received, arguments: +** 'void *data': pointer +** 'const char *signal': signal received +** 'const char *type_data': type of data sent with signal: +*** 'WEECHAT_HOOK_SIGNAL_STRING' +*** 'WEECHAT_HOOK_SIGNAL_INT' +*** 'WEECHAT_HOOK_SIGNAL_POINTER' +** 'void *signal_data': data sent with signal +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_signal_cb (void *data, const char *signal, const char *type_data, + void *signal_data) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +/* catch signal "quit", sent by WeeChat when /quit command is executed */ +struct t_hook *my_signal_hook = weechat_hook_signal ("quit", + &my_signal_cb, NULL); +---------------------------------------- + +weechat_hook_signal_send +^^^^^^^^^^^^^^^^^^^^^^^^ + +Send a signal. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_hook_signal_send (const char *signal, const char *type_data, + void *signal_data); +---------------------------------------- + +Arguments: + +* 'signal': signal to send +* 'type_data': type of data sent with signal (see <<_weechat_hook_signal>>) +* 'signal_data': data sent with signal + +Example: + +[source,C] +---------------------------------------- +weechat_hook_signal_send ("my_signal", WEECHAT_HOOK_SIGNAL_STRING, my_string); +---------------------------------------- + +weechat_hook_config +^^^^^^^^^^^^^^^^^^^ + +Hook a configuration option. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_config (const char *option, + int (*callback)(void *data, + const char *option, + const char *value), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'option': option, format is fulll name, as used with command `/set` (for + example: `weechat.look.item_time_format`) +* 'callback': function called when configuration option is changed, arguments: +** 'void *data': pointer +** 'const char *option': name of option +** 'const char *value': new value for option +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_config_cb (void *data, const char *option, const char *value) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +/* catch changes to option "weechat.look.item_time_format" */ +struct t_hook *my_config_hook = weechat_hook_config ("weechat.look.item_time_format", + &my_config_cb, NULL); +---------------------------------------- + +weechat_hook_completion +^^^^^^^^^^^^^^^^^^^^^^^ + +Hook a completion. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_completion (const char *completion_item, + int (*callback)(void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'completion_item': name of completion item, after you can use '%(name)' in + a command hooked (argument 'completion') +* 'callback': function called when completion item is used (user is completing + something using this item), artuments: +** 'void *data': pointer +** 'const char *completion_item': name of completion item +** 'struct t_gui_buffer *buffer': buffer where completion is made +** 'struct t_gui_completion *completion': structure used to add words for + completion +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_completion_cb (void *data, const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + weechat_hook_completion_list_add (completion, "word1", + 0, WEECHAT_LIST_POS_SORT); + weechat_hook_completion_list_add (completion, "test_word2", + 0, WEECHAT_LIST_POS_SORT); + return WEECHAT_RC_OK; +} + +struct t_hook *my_completion_hook = weechat_hook_completion ("myitem", + &my_completion_cb, NULL); +---------------------------------------- + +weechat_hook_completion_list_add +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a word for a completion. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_hook_completion_list_add (struct t_gui_completion *completion, + const char *word, + int nick_completion, + const char *where); +---------------------------------------- + +Arguments: + +* 'completion': completion pointer +* 'word': word to add +* 'nick_completion': 1 if word is a nick, 0 if word it not a nick +* 'where': position where word will be inserted in list: +** 'WEECHAT_LIST_POS_SORT' +** 'WEECHAT_LIST_POS_BEGINNING' +** 'WEECHAT_LIST_POS_END' + +Example: + +[source,C] +---------------------------------------- +int +my_completion_cb (void *data, const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + weechat_hook_completion_list_add (completion, "word1", + 0, WEECHAT_LIST_POS_SORT); + weechat_hook_completion_list_add (completion, "test_word2", + 0, WEECHAT_LIST_POS_SORT); + return WEECHAT_RC_OK; +} + +struct t_hook *my_completion_hook = weechat_hook_completion ("myitem", + &my_completion_cb, NULL); +---------------------------------------- + +weechat_hook_modifier +^^^^^^^^^^^^^^^^^^^^^ + +Hook a modifier. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_modifier (const char *modifier, + char *(*callback)(void *data, + const char *modifier, + const char *modifier_data, + const char *string), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'modifier': modifier name, list of modifiers used by Weechat or plugins: + +[width="100%",cols="^1,^2,3,4,4",options="header"] +|======================================== +| Plugin | Modifier | Modifier data | String | Output + +| charset | charset_decode | plugin.buffer_name | + any string | + string decoded from charset found for plugin/buffer to UTF-8 + +| charset | charset_encode | plugin.buffer_name | + any string | + string encoded from UTF-8 to charset found for plugin/buffer + +| irc | irc_color_decode | "1" to keep colors, "0" to remove colors | + any string | + string with WeeChat color codes, or without color + +| irc | irc_color_encode | "1" to keep colors, "0" to remove colors | + any string | + string with IRC color codes, or without color + +| irc | irc_in_xxx ^1^ | server name | + content of message received from IRC server | + new content of message + +| irc | irc_out_xxx ^1^ | server name | + content of message about to be sent to IRC server | + new content of message + +| weechat | input_text_content | string with buffer pointer ("0x123..") | + input buffer (from user) | + new content of input buffer + +| weechat | input_text_display | string with buffer pointer ("0x123..") | + input buffer (from user), without cursor tag | + new content of input buffer, for display only (input buffer is not changed) + +| weechat | input_text_display_with_cursor | string with buffer pointer ("0x123..") | + input buffer (from user), with cursor tag | + new content of input buffer, for display only (input buffer is not changed) + +| weechat | weechat_print | plugin;buffer_name;tags | + message printed | + new message printed +|======================================== + +[NOTE] +^1^ 'xxx' is IRC command name + +* 'callback': function called when modifier is received, arguments: +** 'void *data': pointer +** 'const char *modifier': name of modifier +** 'const char *modifier_data': data for modifier +** 'const char *string': string to modify (function must return copy of this + string, no changes are allowed in this string) +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to new hook, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +char * +my_modifier_cb (void *data, const char *modifier, + const char *modifier_data, + const char *string) +{ + char *result; + int length; + + if (!string) + return NULL; + + length = strlen (string) + 5; + result = malloc (length); + if (result) + { + /* add "xxx" to any message printed */ + snprintf (result, length, "%s xxx", string); + } + + return result; +} + +struct t_hook *my_modifier_hook = weechat_hook_modifier ("weechat_print", + &my_modifier_cb, NULL); +---------------------------------------- + +weechat_hook_modifier_exec +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Execute modifier(s). + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_hook_modifier_exec (const char *modifier, + const char *modifier_data, + const char *string); +---------------------------------------- + +Arguments: + +* 'modifier': modifier name +* 'modifier_data': modifier data +* 'string': string to modify + +Return value: + +* string modifier, NULL if no changes in string were made by modifier(s) + +Example: + +[source,C] +---------------------------------------- +char *new_string = weechat_hook_modifier_exec ("my_modifier", + my_data, my_string); +---------------------------------------- + +weechat_hook_info +^^^^^^^^^^^^^^^^^ + +Hook an information: callback will return pointer to info asked. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_info (const char *info_name, + const char *description, + const char *(*callback)(void *data, + const char *info_name, + const char *arguments), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'info_name': name of info +* 'description': description +* 'callback': function called when info is asked, arguments: +** 'void *data': pointer +** 'const char *info_name': name of info to return +** 'const char *arguments': additional arguments, depending on info +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* content of info asked, NULL if not found + +Example: + +[source,C] +---------------------------------------- +const char * +my_info_cb (void *data, const char *info_name, const char *arguments) +{ + /* ... */ + return pointer_to_string; +} + +/* add info "my_info" */ +struct t_hook *my_info = weechat_hook_info ("my_info", + "Some info about something", + &my_info_cb, NULL); +---------------------------------------- + +weechat_hook_infolist +^^^^^^^^^^^^^^^^^^^^^ + +Hook an infolist: callback will return pointer to infolist asked. + +Prototype: + +[source,C] +---------------------------------------- +struct t_hook *weechat_hook_infolist (const char *infolist_name, + const char *description, + const char *(*callback)(void *data, + const char *infolist_name, + void *pointer, + const char *arguments), + void *callback_data); +---------------------------------------- + +Arguments: + +* 'infolist_name': name of infolist +* 'description': description +* 'callback': function called when infolist is asked, arguments: +** 'void *data': pointer +** 'const char *infolist_name': name of infolist to return +** 'void *pointer': pointer to an something infolist must return (to get only + one item in infolist) +** 'const char *arguments': additional arguments, depending on infolist +* 'callback_data': pointer given to callback when it is called by WeeChat + +Return value: + +* pointer to infolist asked, NULL if not found + +Example: + +[source,C] +---------------------------------------- +struct t_infolist * +my_infolist_cb (void *data, const char *infolist_name, void *pointer, + const char *arguments) +{ + /* ... build infolist ... */ + return my_infolist; +} + +/* add info "my_infolist" */ +struct t_hook *my_infolist = weechat_hook_infolist ("my_infolist", + "Infolist with some data", + &my_infolist_cb, NULL); +---------------------------------------- + +weechat_unhook +^^^^^^^^^^^^^^ + +Unhook something hooked. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_unhook (struct t_hook *hook); +---------------------------------------- + +Arguments: + +* 'hook': something hooked with "weechat_hook_xxxx()" + +Example: + +[source,C] +---------------------------------------- +struct t_hook *my_hook = weechat_hook_command ( /* ... */ ); +/* ... */ +weechat_unhook (my_hook); +---------------------------------------- + +weechat_unhook_all +^^^^^^^^^^^^^^^^^^ + +Unhook everything that has been hooked by current plugin. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_unhook_all (); +---------------------------------------- + +Example: + +[source,C] +---------------------------------------- +weechat_unhook_all (); +---------------------------------------- + +[[buffers]] +Buffers +~~~~~~~ + +Functions to create/query/close buffers. + +weechat_buffer_new +^^^^^^^^^^^^^^^^^^ + +Open a new buffer. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_buffer *weechat_buffer_new (const char *name, + int (*input_callback)(void *data, + struct t_gui_buffer *buffer, + const char *input_data), + void *input_callback_data, + int (*close_callback)(void *data, + struct t_gui_buffer *buffer), + void *close_callback_data); +---------------------------------------- + +Arguments: + +* 'name': name of buffer (must be unique for plugin) +* 'input_callback': function called when input text is entered on buffer, + arguments: +*** 'void *data': pointer +*** 'struct t_gui_buffer *buffer': buffer pointer +*** 'const char *input_data': input data +* 'callback_data': pointer given to input callback when it is called by WeeChat +* 'close_callback': function called when buffer is closed, arguments: +*** 'void *data': pointer +*** 'struct t_gui_buffer *buffer': buffer pointer +* 'callback_data': pointer given to close callback when it is called by WeeChat + +Return value: + +* pointer to new buffer, NULL if error occured + +Example: + +[source,C] +---------------------------------------- +int +my_input_cb (void *data, struct t_gui_buffer *buffer, const char *input_data) +{ + weechat_printf (buffer, "Text: %s", input_data); + return WEECHAT_RC_OK; +} + +int +my_close_cb (void *data, struct t_gui_buffer *buffer) +{ + weechat_printf (NULL, "Buffer '%s' will be closed!", + weechat_buffer_get_string (buffer, "name")); + return WEECHAT_RC_OK; +} + +struct t_gui_buffer *my_buffer = weechat_buffer_new ("my_buffer", + &my_input_cb, NULL, + &my_close_cb, NULL); +---------------------------------------- + +weechat_current_buffer +^^^^^^^^^^^^^^^^^^^^^^ + +Return pointer to current buffer (buffer displayed by current window). + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_buffer *weechat_current_buffer (); +---------------------------------------- + +Return value: + +* pointer to current buffer + +Example: + +[source,C] +---------------------------------------- +weechat_printf (weechat_current_buffer (), "Text on current buffer"); +---------------------------------------- + +weechat_buffer_search +^^^^^^^^^^^^^^^^^^^^^ + +Search a buffer by plugin and/or buffer name. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_buffer *weechat_buffer_search (const char *plugin, + const char *name); +---------------------------------------- + +Arguments: + +* 'plugin': name of plugin +* 'name': name of buffer, if it is NULL or empty string, the current buffer is + returned (buffer displayed by current window) + +Return value: + +* pointer to buffer found, NULL if not found + +Example: + +[source,C] +---------------------------------------- +struct t_gui_buffer *weechat_buffer = weechat_buffer_search ("core", "weechat"); +struct t_gui_buffer *my_buffer = weechat_buffer_search ("myplugin", "my_buffer"); +---------------------------------------- + +weechat_buffer_clear +^^^^^^^^^^^^^^^^^^^^ + +Clear content of a buffer. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_buffer_clear (struct t_gui_buffer *buffer); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer + +Example: + +[source,C] +---------------------------------------- +struct t_gui_buffer *my_buffer = weechat_buffer_search ("myplugin", "my_buffer"); +if (my_buffer) +{ + weechat_buffer_clear (my_buffer); +} +---------------------------------------- + +weechat_buffer_close +^^^^^^^^^^^^^^^^^^^^ + +Close a buffer. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_buffer_close (struct t_gui_buffer *buffer); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer + +Example: + +[source,C] +---------------------------------------- +struct t_gui_buffer *my_buffer = weechat_buffer_new ("my_buffer", + &my_input_cb, NULL, + &my_close_cb, NULL); +/* ... */ +weechat_buffer_close (my_buffer); +---------------------------------------- + +weechat_buffer_get_integer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get integer value of a buffer property. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_buffer_get_integer (struct t_gui_buffer *buffer, + const char *property); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'property': property name: +** 'number': number of buffer (1 to # opened buffers) +** 'num_displayed': number of windows displaying buffer +** 'notify': notify level for buffer +** 'lines_hidden': 1 if at least one line is hidden on buffer (filtered), or 0 + if all lines are displayed +** 'prefix_max_length': max length for prefix in this buffer +** 'time_for_each_line': 1 if time is displayed for each line in buffer + (default), 0 otherwise +** 'text_search': text search type: 0 = disabled, 1 = backward, 2 = forward +** 'text_search_exact': 1 if text search is exact (case sensitive) +** 'text_search_found': 1 if text found, 0 otherwise + +Return value: + +* integer value of property + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "my buffer number is: %d", + weechat_buffer_get_integer (my_buffer, "number")); +---------------------------------------- + +weechat_buffer_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get string value of a buffer property. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_buffer_get_string (struct t_gui_buffer *buffer, + const char *property); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'property': property name: +** 'plugin': name of plugin which created this buffer ("core" for WeeChat main + buffer) +** 'name': name of buffer +** 'short_name': short name of buffer +** 'tilte': title of buffer +** 'input': input text +** 'localvar_xxx': get content of local variable "xxx" (replace "xxx" by the + name of variable you want to read) + +Return value: + +* string value of property + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "name / short name of buffer are: %s / %s", + weechat_buffer_get_string (my_buffer, "name"), + weechat_buffer_get_string (my_buffer, "short_name")); +---------------------------------------- + +weechat_buffer_get_pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get pointer value of a buffer property. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_buffer_pointer (struct t_gui_buffer *buffer, + const char *property); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'property': property name: +** 'plugin': name of plugin which created this buffer ("core" for WeeChat main + buffer) +** 'plugin': plugin pointer + +Return value: + +* pointer value of property + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "plugin pointer of my buffer: %lx", + weechat_buffer_get_pointer (my_buffer, "plugin")); +---------------------------------------- + +weechat_buffer_set +^^^^^^^^^^^^^^^^^^ + +Set string value of a buffer property. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_buffer_set (struct t_gui_buffer *buffer, const char *property, + const char *value); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'property' and 'value': property name, with its value: + +[width="100%",cols="^2,4,8",options="header"] +|======================================== +| Name | Value | Description + +| hotlist | "+", "-", WEECHAT_HOTLIST_LOW, WEECHAT_HOTLIST_MESSAGE, + WEECHAT_HOTLIST_PRIVATE, WEECHAT_HOTLIST_HIGHLIGHT | + "+": enable hotlist (global setting, buffer pointer is not used) + + "-": disable hotlist (global setting, buffer pointer is not used) + + priority: add buffer to hotlist with this priority + +| unread | N/A | + set unread marker on current line for buffer + +| display | "1", "auto" | + "1": switch to this buffer in current window + + "auto": switch to this buffer in current window, read marker is not reset + for current buffer + +| name | any string | + set new name for buffer + +| short_name | any string | + set new short name for buffer + +| type | "formatted" or "free" | + set type for buffer: "formatted" (for printing chat messages), or "free" for + free content + +| notify | "0", "1", "2", "3" | + set notify level for buffer: "0" = never add to hotlist, "1" = add for + highlights only, "2" = add for highlights and messages, "3" = add for all + messages + +| title | any string | + set new title for buffer + +| time_for_each_line | "0" or "1" | + "0" to hide time for all lines in buffer, "1" to see time for all lines + (default for a new buffer) + +| nicklist | "0" or "1" | + "0" to remove nicklist for buffer, "1" to add nicklist for buffer + +| nicklist_case_sensitive | "0" or "1" | + "0" to have case insensitive nicklist, "1" to have case sensitive nicklist + +| nicklist_display_groups | "0" or "1" | + "0" to hide nicklist groups, "1" to display nicklist groups + +| highlight_words | "-" or comma separated list of words | + "-" is a special value to disable any highlight on this buffer, or comma + separated list of words to highlight in this buffer, for example: + "abc,def,ghi" + +| highlight_tags | comma separated list of tags | + comma separated list of tags to highlight in this buffer + +| key_bind_xxx | any string | + bind a new key 'xxx', specific to this buffer, value is command to execute + for this key + +| key_unbind_xxx | N/A | + unbind key 'xxx' for this buffer + +| input | any string | + set new value for buffer input + +| input_get_unknown_commands | "0" or "1" | + "0" to disable unknown commands on this buffer (default behaviour), "1" to + get unknown commands, for example if user type "/unknowncmd", buffer will + receive it (no error about unknown command) + +| localvar_set_xxx | any string | + set new value for local variable 'xxx' (variable is created if it does not + exist) + +| localvar_del_xxx | N/A | + remove local variable 'xxx' +|======================================== + +Example: + +[source,C] +---------------------------------------- +/* disable hotlist (for all buffers) */ +weechat_buffer_set (NULL, "hotlist", "-"); + +/* enable again hotlist */ +weechat_buffer_set (NULL, "hotlist", "+"); + +/* change buffer name */ +weechat_buffer_set (my_buffer, "name", "my_new_name"); + +/* add new local variable "toto" with value "my_value" */ +weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); + +/* remove local variable "toto" */ +weechat_buffer_set (my_buffer, "localvar_del_toto", NULL); +---------------------------------------- + +weechat_buffer_set_pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Set pointer value of a buffer property. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_buffer_set_pointer (struct t_gui_buffer *buffer, const char *property, + void *pointer); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'property' and 'value': property name, with its value: +** 'close_callback': set close callback function +** 'close_callback_data': set close callback data +** 'input_callback': set input callback function +** 'input_callback_data': set input callback data + +Example: + +[source,C] +---------------------------------------- +int +my_close_cb (void *data, struct t_gui_buffer *buffer) +{ + /* ... */ + return WEECHAT_RC_OK; +} + +weechat_buffer_set_pointer (NULL, "close_callback", &my_close_cb); +---------------------------------------- + +weechat_buffer_string_replace_local_var +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Replace local variables in a string by their value, using buffer local +variables. + +Prototype: + +[source,C] +---------------------------------------- +char *weechat_buffer_string_replace_local_var (struct t_gui_buffer *buffer, + const char *string); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'string': string with text and local variables using format "$var" + +Return value: + +* string with value for local variables + +Example: + +[source,C] +---------------------------------------- +weechat_buffer_set (my_buffer, "localvar_set_toto", "my_value"); + +char *str = weechat_buffer_string_replace_local_var (my_buffer, + "test with $toto"); +/* str contains "test with my_value" */ +---------------------------------------- + +[[windows]] +Windows +~~~~~~~ + +Functions to query windows. + +weechat_current_window +^^^^^^^^^^^^^^^^^^^^^^ + +Return pointer to current window. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_window *weechat_current_window (); +---------------------------------------- + +Return value: + +* pointer to current window + +Example: + +[source,C] +---------------------------------------- +struct t_gui_window *current_window = weechat_current_window (); +---------------------------------------- + +weechat_window_get_integer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get integer value of a window property. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_window_get_integer (struct t_gui_window *window, + const char *property); +---------------------------------------- + +Arguments: + +* 'window': window pointer +* 'property': property name: +** 'win_x': X position of window in terminal (0 is first column) +** 'win_y': Y position of window in terminal (0 is first column) +** 'win_width': width of window, in chars +** 'win_height': height of window, in chars +** 'win_width_pct': percentage size, compared to parent window (if 50, width + is half) +** 'win_height_pct': percentage size, compared to parent window (if 50, height + is half) +** 'win_chat_x': X position of chat window in terminal (0 is first column) +** 'win_chat_y': Y position of chat window in terminal (0 is first column) +** 'win_chat_width': width of chat window, in chars +** 'win_chat_height': height of chat window, in chars +** 'first_line_displayed': 1 if first line of buffer is displayed on screen, + otherwise 0 +** 'scroll': 1 if scroll is active on window (last line not displayed) +** 'scroll_lines_after': number of lines not displayed after last one + displayed (when scrolling) + +Return value: + +* integer value of property + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "current window is at position (x,y): (%d,%d)", + weechat_window_get_integer (weechat_current_window, "win_x"), + weechat_window_get_integer (weechat_current_window, "win_y")); +---------------------------------------- + +weechat_window_get_string +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get string value of a window property. NOT USED TODAY, reserved for future +version. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_window_get_string (struct t_gui_window *window, + const char *property); +---------------------------------------- + +Arguments: + +* 'window': window pointer +* 'property': property name + +Return value: + +* string value of property + +weechat_window_get_pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Get pointer value of a window property. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_window_get_pointer (struct t_gui_window *window, + const char *property); +---------------------------------------- + +Arguments: + +* 'window': window pointer +* 'property': property name: +** 'current': current window pointer +** 'buffer': pointer to buffer displayed by window + +Return value: + +* pointer value of property + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "current window pointer is: %lx, buffer displayed is: %lx", + weechat_window_get_pointer (NULL, "current"), + weechat_window_get_integer (weechat_current_window, "buffer")); +---------------------------------------- + +[[nicklist]] +Nicklist +~~~~~~~~ + +Functions for buffer nicklist. + +weechat_nicklist_add_group +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a group in a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_nick_group *weechat_nicklist_add_group (struct t_gui_buffer *buffer, + struct t_gui_nick_group *parent_group, + const char *name, + const char *color, + int visible); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'parent_group': pointer to parent of group, NULL if group has no parent + (nicklist root) +* 'name': group name +* 'visible': +** '1': group and sub-groups/nicks are visible +** '0': group and sub-groups/nicks are hidden +* 'color': color option name: +*** WeeChat option name (from weechat.color.xxx), for example 'chat_delimiters' +*** color with optional background, for example 'yellow' or 'yellow,red' +*** bar color name: +**** 'bar_fg': foreground color for bar +**** 'bar_delim': delimiters color for bar +**** 'bar_bg': background color for bar + +[NOTE] +The group name can begin with one or more digits, followed by pipe, and then +group name. When such string is found at beginning, it's used to sort groups +in nicklist. For examples groups "1|test" and "2|abc" will be sorted: "test" +first, "abc" second, whereas "test" and "abc" will be sorted: "abc" first, +"test" second. + +Return value: + +* pointer to new group, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +struct t_gui_nick_group *my_group = weechat_nicklist_add_group (my_buffer, + my_parent_group, + "test_group", + "weechat.color.nicklist_group", 1); +---------------------------------------- + +weechat_nicklist_search_group +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search a group in a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_nick_group *weechat_nicklist_search_group (struct t_gui_buffer *buffer, + struct t_gui_nick_group *from_group, + const char *name); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'from_group': search from this group only, if NULL, then search in whole + nicklist +* 'name': group name to search + +Return value: + +* pointer to group found, NULL if not found + +Example: + +[source,C] +---------------------------------------- +struct t_gui_nick_group *ptr_group = weechat_nicklist_search_group (my_buffer, + NULL, "test_group"); +---------------------------------------- + +weechat_nicklist_add_nick +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a nick in a group. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_nick_group *weechat_nicklist_add_nick (struct t_gui_buffer *buffer, + struct t_gui_nick_group *group, + const char *name, + const char *color, + const char *prefix, + const char *prefix_color, + int visible); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'group': group pointer +* 'name': nick name +* 'color': color option name: +*** WeeChat option name (from weechat.color.xxx), for example 'chat_delimiters' +*** color with optional background, for example 'yellow' or 'yellow,red' +*** bar color name: +**** 'bar_fg': foreground color for bar +**** 'bar_delim': delimiters color for bar +**** 'bar_bg': background color for bar +* 'prefix': prefix displayed before nick +* 'prefix_color': color option name: +** WeeChat option name (from weechat.color.xxx), for example 'chat_delimiters' +** color with optional background, for example 'yellow' or 'yellow,red' +** bar color name: +*** 'bar_fg': foreground color for bar +*** 'bar_delim': delimiters color for bar +*** 'bar_bg': background color for bar +* 'visible': +** '1': nick is visible +** '0': nick is hidden + +Return value: + +* pointer to new nick, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +struct t_gui_nick *my_nick = + weechat_nicklist_add_nick (my_buffer, my_group, + "test_nick", + (nick_away) ? "weechat.color.nicklist_away" : "bar_fg", + "@", "lightgreen", + 1); +---------------------------------------- + +weechat_nicklist_search_nick +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Search a nick in a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_nick *weechat_nicklist_search_nick (struct t_gui_buffer *buffer, + struct t_gui_nick_group *from_group, + const char *name); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'from_group': search from this group only, if NULL, then search in whole + nicklist +* 'name': nick name to search + +Return value: + +* pointer to nick found, NULL if not found + +Example: + +[source,C] +---------------------------------------- +struct t_gui_nick *ptr_nick = weechat_nicklist_search_nick (my_buffer, + NULL, "test_nick"); +---------------------------------------- + +weechat_nicklist_remove_group +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove a group from a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_nicklist_remove_group (struct t_gui_buffer *buffer, + struct t_gui_nick_group *group); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'group': group pointer to remove (all sub-groups/nicks will be removed too) + +Example: + +[source,C] +---------------------------------------- +weechat_nicklist_remove_group (my_buffer, my_group); +---------------------------------------- + +weechat_nicklist_remove_nick +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove a nick from a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_nicklist_remove_nick (struct t_gui_buffer *buffer, + struct t_gui_nick *nick); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer +* 'nick': nick pointer to remove + +Example: + +[source,C] +---------------------------------------- +weechat_nicklist_remove_nick (my_buffer, my_nick); +---------------------------------------- + +weechat_nicklist_remove_all +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove all groups/nicks from a nicklist. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_nicklist_remove_all (struct t_gui_buffer *buffer); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer + +Example: + +[source,C] +---------------------------------------- +weechat_nicklist_remove_all (my_buffer); +---------------------------------------- + +[[bars]] +Bars +~~~~ + +Functions for bars. + +weechat_bar_item_search +^^^^^^^^^^^^^^^^^^^^^^^ + +Search a bar item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_bar_item *weechat_bar_item_search (const char *name); +---------------------------------------- + +Arguments: + +* 'name': bar item name + +Return value: + +* pointer to bar item found, NULL if bar item was not found + +Example: + +[source,C] +---------------------------------------- +struct t_gui_bar_item *bar_item = weechat_bar_item_search ("myitem"); +---------------------------------------- + +weechat_bar_item_new +^^^^^^^^^^^^^^^^^^^^ + +Create a new bar item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_bar_item *weechat_bar_item_new (const char *name, + char *(build_callback)(void *data, + struct t_gui_bar_item *item, + struct t_gui_window *window), + void *build_callback_data); +---------------------------------------- + +Arguments: + +* 'name': bar item name +* 'build_callback': function called when bar item is built: it must return + content of bar item +* 'build_callback_data': pointer given to build callback, when it is called by + WeeChat + +Return value: + +* pointer to new bar item, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +char * +my_build_callback (void *data, + struct t_gui_bar_item *item, + struct t_gui_window *window) +{ + return strdup ("my content"); +} + +struct t_gui_bar_item *my_item = weechat_bar_item_new ("myitem", + &my_build_callback, + NULL); +---------------------------------------- + +weechat_bar_item_update +^^^^^^^^^^^^^^^^^^^^^^^ + +Update content of a bar item, by calling its build callback. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_bar_item_update (const char *name); +---------------------------------------- + +Arguments: + +* 'name': bar item name + +Example: + +[source,C] +---------------------------------------- +eechat_bar_item_update ("myitem"); +---------------------------------------- + +weechat_bar_item_remove +^^^^^^^^^^^^^^^^^^^^^^^ + +Remove a bar item. + +Prototype: + +[source,C] +---------------------------------------- +oid weechat_bar_item_remove (struct t_gui_bar_item *item); +---------------------------------------- + +Arguments: + +* 'item': bar item pointer + +Example: + +[source,C] +---------------------------------------- +weechat_bar_item_remove (&my_item); +---------------------------------------- + +weechat_bar_search +^^^^^^^^^^^^^^^^^^ + +Search a bar. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_bar_item *weechat_bar_search (const char *name); +---------------------------------------- + +Arguments: + +* 'name': bar name + +Return value: + +* pointer to bar found, NULL if bar was not found + +Example: + +[source,C] +---------------------------------------- +struct t_gui_bar *bar = weechat_bar_search ("mybar"); +---------------------------------------- + +weechat_bar_new +^^^^^^^^^^^^^^^ + +Create a new bar. + +Prototype: + +[source,C] +---------------------------------------- +struct t_gui_bar *weechat_bar_new (const char *name, + const char *hidden, + const char *priority, + const char *type, + const char *condition, + const char *position, + const char *filling_top_bottom, + const char *filling_left_right, + const char *size, + const char *size_max, + const char *color_fg, + const char *color_delim, + const char *color_bg, + const char *separator, + const char *items); +---------------------------------------- + +Arguments: + +* 'name': bar name +* 'hidden': +** 'on': bar is hidden +** 'off': bas is visible +* 'priority': bar priority (integer) +* 'type': +** 'root': bar displayed once, outside windows +** 'window': bar displayed in each window +* 'condition': condition for displaying bar, one of following: +** 'active': bar is displayed in active window only +** 'inactive': bar is displayed in inactive window(s) only +** 'nicklist': bar is displayed in window(s) with nicklist +* 'position': 'top', 'bottom', 'left' or 'right' +* 'filling_top_bottom': +** 'horizontal': items are filled horizontally (space after each item) +** 'vertical': items are filled vertically (new line after each item) +** 'columns_horizontal': items are filled horizontally, displayed with columns +** 'columns_vertical': items are filled vertically, displayed with columns +* 'filling_left_right': +** 'horizontal': items are filled horitontally (space after each item) +** 'vertical': items are filled verticaly (new line after each item) +** 'columns_horizontal': items are filled horizontally, displayed with columns +** 'columns_vertical': items are filled vertically, displayed with columns +* 'size': bar size in chars (0 means automatic size) +* 'size_max': max size for bar (0 means no max size) +* 'color_fg': color for text in bar +* 'color_delim': color for delimiters in bar +* 'color_bg': background color for bar +* 'separator': +** 'on': bar has separator line with other windows/bars +** 'off': no separator +* 'items': list of items in bar, separated by comma (space between items), or + "+" (glued items) + +Return value: + +* pointer to new bar, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +struct t_gui_bar *my_bar = weechat_bar_new ("mybar", + "off", + 100, + "window", + "", + "top", + "horizontal", + "vertical", + "0", + "5", + "default", + "cyan", + "blue", + "off", + "time,buffer_number+buffer_name"); +---------------------------------------- + +weechat_bar_set +^^^^^^^^^^^^^^^ + +Set a new value for a bar property. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_bar_set (struct t_gui_bar *bar, const char *property, + const char *value); +---------------------------------------- + +Arguments: + +* 'name': bar name +* 'property': name, hidden, priority, conditions, position, filling_top_bottom, + filling_left_right, size, size_max, color_fg, color_delim, color_bg, + separator, items (see <<_weechat_bar_new>>) +* 'value': new value for property + +Return value: + +* 1 if new value was set, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +weechat_bar_set (mybar, "position", "bottom"); +---------------------------------------- + +weechat_bar_update +^^^^^^^^^^^^^^^^^^ + +Refresh content of a bar on screen. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_bar_update (const char *name); +---------------------------------------- + +Arguments: + +* 'name': bar name + +Example: + +[source,C] +---------------------------------------- +weechat_bar_update ("mybar"); +---------------------------------------- + +weechat_bar_remove +^^^^^^^^^^^^^^^^^^ + +Remove a bar. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_bar_remove (struct t_gui_bar *bar); +---------------------------------------- + +Arguments: + +* 'bar': bar pointer + +Example: + +[source,C] +---------------------------------------- +weechat_bar_remove (mybar); +---------------------------------------- + +[[commands]] +Commands +~~~~~~~~ + +Functions for executing WeeChat commands. + +weechat_command +^^^^^^^^^^^^^^^ + +Execute a command. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_command (struct t_gui_buffer *buffer, const char *command); +---------------------------------------- + +Arguments: + +* 'buffer': buffer pointer (command is executed on this buffer, use NULL for + WeeChat core buffer) +* 'command': command to eecute (if beginning with a "/"), or text is sent to + buffer (without leading "/") + +Example: + +[source,C] +---------------------------------------- +weechat_command (weechat_buffer_search ("irc", "freenode.#weechat"), + "/whois FlashCode"); +---------------------------------------- + +[[network]] +Network +~~~~~~~ + +Network functions. + +weechat_network_pass_proxy +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Establish a connection/authentification to a proxy. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_network_pass_proxy (const char *proxy, + int sock, + const char *address, + int port); +---------------------------------------- + +Arguments: + +* 'proxy': proxy name to use +* 'sock': socket to use +* 'address': address (hostname or IP) +* 'port': port + +Return value: + +* 1 if connection is ok, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +if (weechat_network_pass_proxy ("myproxy", sock, "irc.freenode.net", 6667)) +{ + /* OK */ +} +else +{ + /* error */ +} +---------------------------------------- + +weechat_network_connect_to +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Establish a connection to a remote host. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_network_connect_to (const char *proxy, + int sock, + unsigned long address, + int port); +---------------------------------------- + +Arguments: + +* 'proxy': proxy name to use +* 'sock': socket to use +* 'address': address (hostname or IP) +* 'port': port + +Return value: + +* 1 if connection is ok, 0 if an error occured + +Example: + +[source,C] +---------------------------------------- +struct sockaddr_in addr; +socklen_t length; +unsigned long address; + +memset (&addr, 0, sizeof (struct sockaddr_in)); +length = sizeof (addr); +getsockname (sock, (struct sockaddr *) &addr, &length); +addr.sin_family = AF_INET; +address = ntohl (addr.sin_addr.s_addr); + +if (weechat_network_connect_to (NULL, sock, address, 6667)) +{ + /* OK */ +} +else +{ + /* error */ +} +---------------------------------------- + +[[infos]] +Infos +~~~~~ + +Functions to get infos. + +weechat_info_get +^^^^^^^^^^^^^^^^ + +Get info from WeeChat or a plugin. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_info_get (const char *info_name, const char *arguments); +---------------------------------------- + +Arguments: + +* 'info_name': name of info to read: +include::autogen/plugin_api/infos.txt[] +* 'arguments': arguments for info asked (optional, NULL if no argument is + needed) + +Return value: + +* string with info asked, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "Current WeeChat version is: %s (compiled on %s)", + weechat_info_get ("version", NULL), + weechat_info_get ("date", NULL)); +weechat_printf (NULL, "WeeChat home is: %s", + weechat_info_get ("weechat_dir")); +---------------------------------------- + +[[infolists]] +Infolists +~~~~~~~~~ + +An infolist is a list of "items". Each item contains variables. + +For example, infolist "irc_server" has N items (N is number of IRC servers +defined). For each item, there is variables like "name", "buffer", +"is_connected", ... + +Each variable has a type and a value. Possible types are: + +* 'integer': any integer value +* 'string': any string value +* 'pointer': any pointer +* 'buffer': buffer with fixed length, containing any data +* 'time': time value + +weechat_infolist_new +^^^^^^^^^^^^^^^^^^^^ + +Create a new infolist. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist *weechat_infolist_new (); +---------------------------------------- + +Return value: + +* pointer to new infolist + +Example: + +[source,C] +---------------------------------------- +struct t_infolist *infolist = weechat_infolist_new (); +---------------------------------------- + +weechat_infolist_new_item +^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add an item in an infolist. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_item *weechat_infolist_new_item (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Return value: + +* pointer to new item + +Example: + +[source,C] +---------------------------------------- +struct t_infolist_item *item = weechat_infolist_new_item (infolist); +---------------------------------------- + +weechat_infolist_new_var_integer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add an integer variable to an infolist item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_var *weechat_infolist_new_var_integer (struct t_infolist_item *item, + const char *name, + int value); +---------------------------------------- + +Arguments: + +* 'item': infolist item pointer +* 'name': variable name +* 'value': integer value + +Return value: + +* pointer to new variable + +Example: + +[source,C] +---------------------------------------- +struct t_infolist_var *var = weechat_infolist_new_variable_integer (item, + "my_integer", 123); +---------------------------------------- + +weechat_infolist_new_var_string +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a string variable to an infolist item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_var *weechat_infolist_new_var_string (struct t_infolist_item *item, + const char *name, + const char *value); +---------------------------------------- + +Arguments: + +* 'item': infolist item pointer +* 'name': variable name +* 'value': string value + +Return value: + +* pointer to new variable + +Example: + +[source,C] +---------------------------------------- +struct t_infolist_var *var = weechat_infolist_new_variable_integer (item, + "my_string", "value"); +---------------------------------------- + +weechat_infolist_new_var_pointer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a pointer variable to an infolist item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_var *weechat_infolist_new_var_pointer (struct t_infolist_item *item, + const char *name, + void *pointer); +---------------------------------------- + +Arguments: + +* 'item': infolist item pointer +* 'name': variable name +* 'pointer': pointer + +Return value: + +* pointer to new variable + +Example: + +[source,C] +---------------------------------------- +struct t_infolist_var *var = weechat_infolist_new_variable_pointer (item, + "my_pointer", &something); +---------------------------------------- + +weechat_infolist_new_var_buffer +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a buffer variable to an infolist item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_var *weechat_infolist_new_var_buffer (struct t_infolist_item *item, + const char *name, + void *pointer, + int size); +---------------------------------------- + +Arguments: + +* 'item': infolist item pointer +* 'name': variable name +* 'pointer': pointer to buffer +* 'size': size of buffer + +Return value: + +* pointer to new variable + +Example: + +[source,C] +---------------------------------------- +char buffer[256]; +/* ... */ +struct t_infolist_var *var = weechat_infolist_new_variable_buffer (item, "my_buffer", + &buffer, sizeof (buffer)); +---------------------------------------- + +weechat_infolist_new_var_time +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Add a time variable to an infolist item. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist_var *weechat_infolist_new_var_time (struct t_infolist_item *item, + const char *name, + time_t time); +---------------------------------------- + +Arguments: + +* 'item': infolist item pointer +* 'name': variable name +* 'time': time value + +Return value: + +* pointer to new variable + +Example: + +[source,C] +---------------------------------------- +struct t_infolist_var *var = weechat_infolist_new_variable_time (item, + "my_time", time (NULL)); +---------------------------------------- + +weechat_infolist_get +^^^^^^^^^^^^^^^^^^^^ + +Get infolist from WeeChat or a plugin. + +Prototype: + +[source,C] +---------------------------------------- +struct t_infolist *weechat_infolist_get (const char *infolist_name, + void *pointer, + const char *arguments); +---------------------------------------- + +Arguments: + +* 'infolist_name': name of infolist to read: +include::autogen/plugin_api/infolists.txt[] +* 'pointer': pointer to an item, to get only this item in infolist (optional, + can be NULL) +* 'arguments': arguments for infolist asked (optional, NULL if no argument is + needed) + +Return value: + +* pointer to infolist, NULL if an error occured + +Example: + +[source,C] +---------------------------------------- +struct t_infolist *infolist = weechat_infolist_get ("irc_server", NULL, NULL); +---------------------------------------- + +weechat_infolist_next +^^^^^^^^^^^^^^^^^^^^^ + +Move "cursor" to next item in an infolist. The first call to this function for +an infolist moves cursor to first item in infolist. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_infolist_next (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Return value: + +* 1 if pointer is now on next item, 0 if end of list was reached + +Example: + +[source,C] +---------------------------------------- +if (weechat_infolist_next (infolist)) +{ + /* read variables in item... */ +} +else +{ + /* no more item available */ +} +---------------------------------------- + +weechat_infolist_prev +^^^^^^^^^^^^^^^^^^^^^ + +Move "cursor" to previous item in an infolist. The first call to this function +for an infolist moves cursor to last item in infolist. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_infolist_prev (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Return value: + +* 1 if pointer is now on previous item, 0 if beginning of list was reached + +Example: + +[source,C] +---------------------------------------- +if (weechat_infolist_prev (infolist)) +{ + /* read variables in item... */ +} +else +{ + /* no more item available */ +} +---------------------------------------- + +weechat_infolist_reset_item_cursor +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Reset "cursor" for infolist. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_infolist_reset_item_cursor (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Example: + +[source,C] +---------------------------------------- +weechat_infolist_reset_item_cursor (infolist); +---------------------------------------- + +weechat_infolist_fields +^^^^^^^^^^^^^^^^^^^^^^^ + +Get list of fields for current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_infolist_fields (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Return value: + +* string with list of fields for current infolist item. List is comma + separated, and contains letter for type, followed by variable name. Types + are: "i" (integer), "s" (string), "p" (pointer), "b" (buffer), "t" (time). + +Example: + +[source,C] +---------------------------------------- +const char *fields = weechat_infolist_fields (infolist); +/* fields contains something like: + "i:my_integer,s:my_string,p:my_pointer,b:my_buffer,t:my_time" */ +---------------------------------------- + +weechat_infolist_integer +^^^^^^^^^^^^^^^^^^^^^^^^ + +Get value of integer variable in current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +int weechat_infolist_integer (struct t_infolist *infolist, const char *var); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer +* 'var': variable name (must be type "integer") + +Return value: + +* integer value of variable + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "integer value = %d", + weechat_infolist_integer (infolist, "my_integer")); +---------------------------------------- + +weechat_infolist_string +^^^^^^^^^^^^^^^^^^^^^^^ + +Get value of string variable in current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +const char *weechat_infolist_string (struct t_infolist *infolist, const char *var); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer +* 'var': variable name (must be type "string") + +Return value: + +* string value of variable + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "string value = %s", + weechat_infolist_string (infolist, "my_string")); +---------------------------------------- + +weechat_infolist_pointer +^^^^^^^^^^^^^^^^^^^^^^^^ + +Get value of pointer variable in current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_infolist_pointer (struct t_infolist *infolist, const char *var); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer +* 'var': variable name (must be type "pointer") + +Return value: + +* pointer value of variable + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "pointer value = 0x%lx", + weechat_infolist_pointer (infolist, "my_pointer")); +---------------------------------------- + +weechat_infolist_buffer +^^^^^^^^^^^^^^^^^^^^^^^ + +Get value of buffer variable in current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +void *weechat_infolist_buffer (struct t_infolist *infolist, const char *var, + int *size); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer +* 'var': variable name (must be type "buffer") +* 'size': pointer to integer variable, will be set with buffer size + +Return value: + +* buffer pointer + +Example: + +[source,C] +---------------------------------------- +nt size; +oid *pointer = weechat_infolist_buffer (infolist, "my_buffer", &size); +eechat_printf (NULL, "buffer pointer = 0x%lx, size = %d", + pointer, size); +---------------------------------------- + +weechat_infolist_time +^^^^^^^^^^^^^^^^^^^^^ + +Get value of time variable in current infolist item. + +Prototype: + +[source,C] +---------------------------------------- +time_t weechat_infolist_time (struct t_infolist *infolist, const char *var); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer +* 'var': variable name (must be type "time") + +Return value: + +* time value of variable + +Example: + +[source,C] +---------------------------------------- +weechat_printf (NULL, "time value = 0x%ld", + weechat_infolist_time (infolist, "my_time")); +---------------------------------------- + +weechat_infolist_free +^^^^^^^^^^^^^^^^^^^^^ + +Free an infolist. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_infolist_free (struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'infolist': infolist pointer + +Example: + +[source,C] +---------------------------------------- +weechat_infolist_free (infolist); +---------------------------------------- + +[[upgrade]] +Upgrade +~~~~~~~ + +Functions for upgrading WeeChat. + +weechat_upgrade_new +^^^^^^^^^^^^^^^^^^^ + +Create or read a file for upgrade. + +Prototype: + +[source,C] +---------------------------------------- +struct t_upgrade_file *weechat_upgrade_new (const char *filename, int write); +---------------------------------------- + +Arguments: + +* 'filename': name of file (extension ".upgrade" will be added to this name by + WeeChat) +* 'write': +** '1': create file (write mode, before upgrade) +** '0': read file (after upgrade) + +Return value: + +* pointer to new upgrade file + +Example: + +[source,C] +---------------------------------------- +struct t_upgrade_file *upgrade_file = weechat_upgrade_new ("my_file", 1); +---------------------------------------- + +weechat_upgrade_write_object +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Write an object in upgrade file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_upgrade_file *weechat_upgrade_write_object (struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist); +---------------------------------------- + +Arguments: + +* 'upgrade_file': upgrade file pointer +* 'object_id': id for object +* 'infolist': infolist to write in file + +Return value: + +* 1 if ok, 0 if error + +Example: + +[source,C] +---------------------------------------- +if (weechat_upgrade_write_object (upgrade_file, 1, &infolist)) +{ + /* ok */ +} +else +{ + /* error */ +} +---------------------------------------- + +weechat_upgrade_read +^^^^^^^^^^^^^^^^^^^^ + +Read an upgrade file. + +Prototype: + +[source,C] +---------------------------------------- +struct t_upgrade_file *weechat_upgrade_read (struct t_upgrade_file *upgrade_file, + int (*callback_read)(void *data, + struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist), + void *callback_read_data); +---------------------------------------- + +Arguments: + +* 'upgrade_file': upgrade file pointer +* 'callback_read': callback called for each object read in upgrade file +* 'callback_read_data': pointer given to read callback when it is called by + WeeChat + +Return value: + +* 1 if ok, 0 if error + +Example: + +[source,C] +---------------------------------------- +int +my_upgrade_read_cb (struct t_upgrade_file *upgrade_file, + int object_id, + struct t_infolist *infolist) +{ + /* read variables... */ + return WEECHAT_RC_OK; +} + +weechat_upgrade_read (upgrade_file, &my_upgrade_read_cb, NULL); +---------------------------------------- + +weechat_upgrade_close +^^^^^^^^^^^^^^^^^^^^^ + +Close an upgrade file. + +Prototype: + +[source,C] +---------------------------------------- +void weechat_upgrade_close (struct t_upgrade_file *upgrade_file); +---------------------------------------- + +Arguments: + +* 'upgrade_file': upgrade file pointer + +Example: + +[source,C] +---------------------------------------- +weechat_upgrade_close (upgrade_file); +---------------------------------------- diff --git a/doc/en/weechat_quickstart.en.txt b/doc/en/weechat_quickstart.en.txt index 6cedf1467..bf8dadb23 100644 --- a/doc/en/weechat_quickstart.en.txt +++ b/doc/en/weechat_quickstart.en.txt @@ -1,7 +1,6 @@ -WeeChat quick start guide +WeeChat Quick Start Guide ========================= FlashCode <flashcode@flashtux.org> -v0.3.0-dev, 2009-05-15 [[start]] diff --git a/doc/en/weechat_scripting.en.txt b/doc/en/weechat_scripting.en.txt new file mode 100644 index 000000000..668618991 --- /dev/null +++ b/doc/en/weechat_scripting.en.txt @@ -0,0 +1,426 @@ +WeeChat Scripting Guide +======================= +FlashCode <flashcode@flashtux.org> + + +This manual documents WeeChat chat client, it is part of WeeChat. + +Latest version of this document can be found on this page: +http://weechat.flashtux.org/doc.php + + +[[introduction]] +Introduction +------------ + +WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and +light, designed for many operating systems. + +This manual documents way to write scripts for WeeChat, using one of five +supported script languages: perl, python, ruby, lua or tcl. + +[NOTE] +Almost all examples in this doc are written in Python, but API is the same for +other languages. + +[[scripts_in_weechat]] +Scripts in WeeChat +------------------ + +[[languages_specifities]] +Languages specificities +~~~~~~~~~~~~~~~~~~~~~~~ + +Some things are specific to languages: + +* perl: +** functions are called with `weechat::xxx(arg1, arg2, ...);` +* python: +** you have to `import weechat` +** functions `print*` are called `prnt*` in python (because 'print' is reserved + keyword) +** functions are called with `weechat.xxx(arg1, arg2, ...)` +* ruby: +** you have to define 'weechat_init' and call register inside +** functions are called with `Weechat.xxx(arg1, arg2, ...)` +* tcl: +** functions are called with `weechat::xxx arg1 arg2 ...` + +[[register]] +Register +~~~~~~~~ + +All WeeChat scripts must "register" themselves to WeeChat, and this must be +first WeeChat function called in script. + +Prorotype: + +[source,python] +---------------------------------------- +weechat.register(name, author, version, license, description, shutdown_function, charset) +---------------------------------------- + +Arguments: + +* 'name': string, internal name of script +* 'author': string, author name +* 'version': string, script version +* 'license': string, script license +* 'description': string, short description of script +* 'shutdown_function': string, name of function called when script is unloaded +* 'charset': string, script charset (optional, if your script is UTF-8, you + can use blank value here, because UTF-8 is default charset) + +[[script_example]] +Script example +~~~~~~~~~~~~~~ + +Exemple of script, for each language: + +* perl: + +[source,perl] +---------------------------------------- +weechat::register("test_perl", "FlashCode", "1.0", "GPL3", "Test script", "", ""); +weechat::print("", "Hello, from perl script!"); +---------------------------------------- + +* python: + +[source,python] +---------------------------------------- +import weechat + +weechat.register("test_python", "FlashCode", "1.0", "GPL3", "Test script", "", "") +weechat.prnt("", "Hello, from python script!") +---------------------------------------- + +* ruby: + +[source,ruby] +---------------------------------------- +def weechat_init + Weechat.register("test_ruby", "FlashCode", "1.0", "GPL3", "Test script", "", "") + Weechat.print("", "Hello, from ruby script!") + return Weechat::WEECHAT_RC_OK +end +---------------------------------------- + +* lua: + +[source,lua] +---------------------------------------- +weechat.register("test_lua", "FlashCode", "1.0", "GPL3", "Test script", "", "") +weechat.print("", "Hello, from lua script!") +---------------------------------------- + +* tcl: + +// [source,tcl] +---------------------------------------- +weechat::register "test_tcl" "FlashCode" "1.0" "GPL3" "Test script" "" "" +weechat::print "" "Hello, from tcl script!" +---------------------------------------- + +[[load_script]] +Load script +~~~~~~~~~~~ + +You have to use command, depending on language: + +---------------------------------------- +/perl load perl/script.pl +/python load python/script.py +/ruby load ruby/script.rb +/lua load lua/script.lua +/tcl load tcl/script.tcl +---------------------------------------- + +You can make link in directory 'language/autoload' to autoload script when +WeeChat is starting. + +For example with perl: + +---------------------------------------- +$ cd ~/.weechat/perl/autoload +$ ln -s ../script.pl +---------------------------------------- + +[[script_api]] +Script API +---------- + +Script API is almost the same as C plugin API. +You can look at 'WeeChat Plugin API Reference' for detail about each function +in API: prototype, arguments, return values, examples. + +It's important to make difference between a 'plugin' and a 'script': a +'plugin' is a binary file compiled and loaded with command `/plugin`, whereas +a 'script' is a text file loaded with a plugin like 'perl' with command +`/perl`. + +When your script 'test.py' calls a WeeChat API function, path is like that: + +........................................ + (script API) (C API) + \/ \/ +test.py -------> python plugin (python.so) -------> WeeChat core +........................................ + +When WeeChat calls a callback in your script 'test.py', it's reverse of +previous path: + +........................................ + (C API) (script API) + \/ \/ +WeeChat core -------> python plugin (python.so) -------> test.py +........................................ + +Functions +~~~~~~~~~ + +List of functions in script API: + +* general: +** 'register' +* plugins: +** 'plugin_get_name' +* strings: +** 'charset_set' +** 'iconv_to_internal' +** 'iconv_from_internal' +** 'gettext' +** 'ngettext' +** 'string_remove_color' +* directories: +** 'mkdir_home' +** 'mkdir' +** 'mkdir_parents' +* sorted lists: +** 'list_new' +** 'list_add' +** 'list_search' +** 'list_casesearch' +** 'list_get' +** 'list_set' +** 'list_next' +** 'list_prev' +** 'list_string' +** 'list_size' +** 'list_remove' +** 'list_remove_all' +** 'list_free' +* configuration files: +** 'config_new' +** 'config_new_section' +** 'config_search_section' +** 'config_new_option' +** 'config_search_option' +** 'config_string_to_boolean' +** 'config_option_reset' +** 'config_option_set' +** 'config_option_set_null' +** 'config_option_unset' +** 'config_option_rename' +** 'config_option_is_null' +** 'config_option_default_is_null' +** 'config_boolean' +** 'config_boolean_default' +** 'config_integer' +** 'config_integer_default' +** 'config_string' +** 'config_string_default' +** 'config_color' +** 'config_color_default' +** 'config_write_option' +** 'config_write_line' +** 'config_write' +** 'config_read' +** 'config_reload' +** 'config_option_free' +** 'config_section_free_options' +** 'config_section_free' +** 'config_free' +** 'config_get' +** 'config_get_plugin' +** 'config_is_set_plugin' +** 'config_set_plugin' +** 'config_unset_plugin' +* display: +** 'prefix' +** 'color' +** 'print' (for python: 'prnt') +** 'print_date_tags' (for python: 'prnt_date_tags') +** 'print_y' (for python: 'prnt_y') +** 'log_print' +* hooks: +** 'hook_command' +** 'hook_command_run' +** 'hook_timer' +** 'hook_fd' +** 'hook_process' +** 'hook_connect' +** 'hook_print' +** 'hook_signal' +** 'hook_signal_send' +** 'hook_config' +** 'hook_completion' +** 'hook_completion_list_add' +** 'hook_modifier' +** 'hook_modifier_exec' +** 'hook_info' +** 'hook_infolist' +** 'unhook' +** 'unhook_all' +* buffers: +** 'buffer_new' +** 'buffer_search' +** 'current_buffer' +** 'buffer_clear' +** 'buffer_close' +** 'buffer_get_integer' +** 'buffer_get_string' +** 'buffer_get_pointer' +** 'buffer_set' +* windows: +** 'current_window' +** 'window_get_integer' +** 'window_get_string' +** 'window_get_pointer' +** 'window_set_title' +* nicklist: +** 'nicklist_add_group' +** 'nicklist_search_group' +** 'nicklist_add_nick' +** 'nicklist_search_nick' +** 'nicklist_remove_group' +** 'nicklist_remove_nick' +** 'nicklist_remove_all' +* bars: +** 'bar_item_search' +** 'bar_item_new' +** 'bar_item_update' +** 'bar_item_remove' +** 'bar_search' +** 'bar_new' +** 'bar_set' +** 'bar_update' +** 'bar_remove' +* commands: +** 'command' +* infos: +** 'info_get' +* infolists: +** 'infolist_new' +** 'infolist_new_var_integer' +** 'infolist_new_var_string' +** 'infolist_new_var_pointer' +** 'infolist_new_var_time' +** 'infolist_get' +** 'infolist_next' +** 'infolist_prev' +** 'infolist_fields' +** 'infolist_integer' +** 'infolist_string' +** 'infolist_pointer' +** 'infolist_time' +** 'infolist_free' +* upgrade: +** 'upgrade_new' +** 'upgrade_write_object' +** 'upgrade_read' +** 'upgrade_close' + +Constants +~~~~~~~~~ + +List of constants in script API: + +* 'WEECHAT_RC_OK' +* 'WEECHAT_RC_OK_EAT' +* 'WEECHAT_RC_ERROR' +* 'WEECHAT_CONFIG_READ_OK' +* 'WEECHAT_CONFIG_READ_MEMORY_ERROR' +* 'WEECHAT_CONFIG_READ_FILE_NOT_FOUND' +* 'WEECHAT_CONFIG_WRITE_OK' +* 'WEECHAT_CONFIG_WRITE_ERROR' +* 'WEECHAT_CONFIG_WRITE_MEMORY_ERROR' +* 'WEECHAT_CONFIG_OPTION_SET_OK_CHANGED' +* 'WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE' +* 'WEECHAT_CONFIG_OPTION_SET_ERROR' +* 'WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND' +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET' +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_RESET' +* 'WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED' +* 'WEECHAT_CONFIG_OPTION_UNSET_ERROR' +* 'WEECHAT_LIST_POS_SORT' +* 'WEECHAT_LIST_POS_BEGINNING' +* 'WEECHAT_LIST_POS_END' +* 'WEECHAT_HOTLIST_LOW' +* 'WEECHAT_HOTLIST_MESSAGE' +* 'WEECHAT_HOTLIST_PRIVATE' +* 'WEECHAT_HOTLIST_HIGHLIGHT' +* 'WEECHAT_HOOK_PROCESS_RUNNING' +* 'WEECHAT_HOOK_PROCESS_ERROR' +* 'WEECHAT_HOOK_CONNECT_OK' +* 'WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND' +* 'WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND' +* 'WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED' +* 'WEECHAT_HOOK_CONNECT_PROXY_ERROR' +* 'WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR' +* 'WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR' +* 'WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR' +* 'WEECHAT_HOOK_CONNECT_MEMORY_ERROR' +* 'WEECHAT_HOOK_SIGNAL_STRING' +* 'WEECHAT_HOOK_SIGNAL_INT' +* 'WEECHAT_HOOK_SIGNAL_POINTER' + +Differences with C API +~~~~~~~~~~~~~~~~~~~~~~ + +Pointers +^^^^^^^^ + +As you probably know, there is not really "pointers" in scripts. So when API +functions return pointer, it is converted to string for script. + +For example, if function return pointer 0x1234ab56, script will get string +"0x1234ab56". + +And when an API function expects a pointer in arguments, script must give that +string value. C plugin will convert it to real pointer before calling C API +function. + +Empty string or "0x0" are allowed, they means NULL in C. +For example, to print data on core buffer (WeeChat main buffer), you can do: + +[source,python] +---------------------------------------- +weechat.prnt("", "hey!") +---------------------------------------- + +[WARNING] +In many functions, for speed reasons, WeeChat does not check if your pointer +is correct or not. It's your job to check you're giving a valid pointer, +otherwise you may see a nice crash report ;) + +Callbacks +^^^^^^^^^ + +Almost all WeeChat callbacks must return WEECHAT_RC_OK or WEECHAT_RC_ERROR +(exception is modifier callback, which returns a string). + +C callbacks are using a "data" argument, which is a pointer. In script API, +this "data" is a string with a any value (it's not a pointer). + +For example: + +[source,python] +---------------------------------------- +weechat.hook_timer(1000, 0, 1, "my_timer_cb", "my data!") + +def my_timer_cb(data, remaining_calls): + # this will display: "my data!" + weechat.prnt("", data) + return weechat.WEECHAT_RC_OK +---------------------------------------- diff --git a/doc/en/weechat_tester.en.txt b/doc/en/weechat_tester.en.txt index 241a3aaa4..cbe74a85a 100644 --- a/doc/en/weechat_tester.en.txt +++ b/doc/en/weechat_tester.en.txt @@ -1,7 +1,6 @@ -WeeChat tester's Guide +WeeChat Tester's Guide ====================== FlashCode <flashcode@flashtux.org> -v0.3.0-dev, 2009-05-15 [[purpose]] diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt new file mode 100644 index 000000000..242dff163 --- /dev/null +++ b/doc/en/weechat_user.en.txt @@ -0,0 +1,1165 @@ +WeeChat User's Guide +==================== +FlashCode <flashcode@flashtux.org> + + +This manual documents WeeChat chat client, it is part of WeeChat. + +Latest version of this document can be found on this page: +http://weechat.flashtux.org/doc.php + + +[[introduction]] +Introduction +------------ + +WeeChat (Wee Enhanced Environment for Chat) is a free chat client, fast and +light, designed for many operating systems. + +[[features]] +Features +~~~~~~~~ + +Main features are: + +* multi-protocols (IRC and other soon) +* multi-servers connection (with SSL, IPv6, proxy) +* many GUI: Curses (wxWidgets, Gtk and Qt under development) +* small, fast and light +* customizable and extensible with plugins and scripts +* compliant with IRC RFCs http://www.ietf.org/rfc/rfc1459.txt[1459], + http://www.ietf.org/rfc/rfc2810.txt[2810], + http://www.ietf.org/rfc/rfc2811.txt[2811], + http://www.ietf.org/rfc/rfc2812.txt[2812] and + http://www.ietf.org/rfc/rfc2813.txt[2813] +* multi-platform (GNU/Linux, *BSD, MacOS X, Windows and other) +* 100% GPL, free software + +WeeChat homepage is here: http://weechat.flashtux.org/ + +[[pre-requisites]] +Pre-requisites +~~~~~~~~~~~~~~ + +In order to install WeeChat, you need: + +* a running GNU/Linux system (with compiler tools for source + package), or compatible OS (see above) +* 'root' privileges (to install WeeChat in a system directory) +* ncurses library + + +[[install]] +Installation +------------ + +[[binary_packages]] +Binary packages +~~~~~~~~~~~~~~~ + +Binary packages are available for many distributions, including: + +* Debian (or any Debian compatible distribution): `apt-get install weechat` +* Mandriva/RedHat (or any RPM compatible distribution): + `rpm -i /path/to/weechat-x.y.z-1.i386.rpm` +* Gentoo: `emerge weechat` + +Some additional packages may be useful, like weechat-plugins. + +For other distributions, please look at your manual for installation +instructions. + +[[source_package]] +Source package +~~~~~~~~~~~~~~ + +WeeChat can be compiled with cmake or autotools (cmake is recommended way). + +With cmake +^^^^^^^^^^ + +* Installation in system directories (requires 'root' privileges): + +---------------------------------------- +$ mkdir build +$ cd build +$ cmake .. +$ make +% make install (as root) +---------------------------------------- + +* Installation in custom directory: + +---------------------------------------- +$ mkdir build +$ cd build +$ cmake .. -DPREFIX=/path/to/directory +$ make +$ make install +---------------------------------------- + +With autotools +^^^^^^^^^^^^^^ + +* Installation in system directories (requires 'root' privileges): + +---------------------------------------- +$ ./configure +$ make +% make install (as root) +---------------------------------------- + +* Installation in custom directory: + +---------------------------------------- +$ ./configure --prefix=/path/to/directory +$ make +$ make install +---------------------------------------- + +[[git_sources]] +Git sources +~~~~~~~~~~~ + +Warning: GIT sources are for advanced users: it may not compile or not be +stable. You're warned! + +To get GIT sources, issue this command: + +---------------------------------------- +$ git clone git://git.sv.gnu.org/weechat.git +---------------------------------------- + +If you're using autotools (and not cmake), execute this script: + +---------------------------------------- +$ ./autogen.sh +---------------------------------------- + +Then follow instructions for source package (see <<source_package>>). + + +[[usage]] +Usage +----- + +[[running_weechat]] +Running WeeChat +~~~~~~~~~~~~~~~ + +Command line arguments: + +-a, --no-connect:: + Disable auto-connect to servers at startup + +-d, --dir 'path':: + Set path as home for WeeChat (used for configuration files, logs, user + plugins and scripts), default value is '~/.weechat' (note: directory is + created if not found by WeeChat) + +-h, --help:: + Display help + +-k, --keys:: + Display WeeChat default keys + +-l, --license:: + Display WeeChat license + +-p, --no-plugin:: + Disable plugins auto-load + +-v, --version:: + Display WeeChat version + +plugin:option:: + Option for plugin (see doc for each plugin) + +To start WeeChat, issue this command: + +---------------------------------------- +$ weechat-curses +---------------------------------------- + +When you run WeeChat for the first time, a default configuration file is +created, with default options. The default configuration file is: +'~/.weechat/weechat.conf'. + +You can edit this file at your convenience to configure WeeChat or you can set +parameters with `/set` command in WeeChat (see <<weechat_commands>>). + +[[screen_layout]] +Screen layout +~~~~~~~~~~~~~ + +Example of terminal with WeeChat: + +........................................ +┌─────────────────────────────────────────────────────────────────────────────────────────┐ +│Welcome to #test, this is a test channel │ +│12:52:27 --> | flashy (n=flashcod@hellix.flashtux.org) has joined #test │@ChanServ │ +│12:52:27 -- | Nicks #test: [@ChanServ @flashy +_FlashB0t joe mike] │@flashy │ +│12:52:27 -- | Channel #test: 5 nicks (2 ops, 0 halfop, 1 voice, 2 normal) │+_FlashB0t│ +│12:52:27 -- | Channel created on Tue Jan 27 06:30:17 2009 │joe │ +│12:54:15 flashy | hey! │mike │ +│12:55:01 joe | hi flashy! │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│ │ │ +│[12:55] [4] [irc] 3:freenode/#test(+n){5}* [Act: 4,2] │ +│[flashy] hi joe!█ │ +└─────────────────────────────────────────────────────────────────────────────────────────┘ +........................................ + +Screen is composed by following areas: + +* chat area (middle of screen) with chat lines, and for each line: +** time +** prefix (before "|") +** message (after "|") +* bars around chat area, default bars are: +** 'title' bar, above chat area +** 'status' bar, below chat area +** 'input' bar, below status bar +** 'nicklist' bar, on the right + +Bar 'status' has following default items: + +[width="100%",cols="^3,^3,10",options="header"] +|======================================== +| Item | Example | Description + +| time | `[12:55]` | + time + +| buffer_count | `[4]` | + number of opened buffers + +| buffer_plugin | `[irc]` | + plugin of current buffer + +| buffer_number | `3` | + current buffer number + +| buffer_name | `freenode/#test(+n)` | + current buffer name + +| buffer_nicklist_count | `{5}` | + number of nicks in nicklist + +| buffer_filter | `*` | + filtering indicator: `*` means some lines are filtered (hidden), empty value + means all lines are displayed + +| lag | `[Lag: 2.5]` | + lag indicator, in seconds (hidden if lag is low) + +| hotlist | `[Act: 4,2]` | + list of buffers with activity (unread messages) + +| completion | `abc(2) def(5)` | + list of words for completion, with number of possible completions for each + word + +| scroll | `-MORE(50)-` | + scroll indicator, with number of lines below last line displayed +|======================================== + +Bar 'input' has following default items: + +[width="100%",cols="^3,^6,8",options="header"] +|======================================== +| Item | Example | Description + +| input_paste | `[Paste 7 lines ? [ctrl-Y] Yes [ctrl-N] No]` | + question to user for pasting lines + +| input_prompt | `[nick]` | + input prompt (nick for irc plugin) + +| away | `(away)` | + away indicator + +| input_search | `[Text search]` | + text search indicator + +| input_text | `bla bla...` | + input text +|======================================== + +[[key_bindings]] +Default key bindings +~~~~~~~~~~~~~~~~~~~~ + +Keys for command line +^^^^^^^^^^^^^^^^^^^^^ + +[width="100%",cols="^.^4,.^15",options="header"] +|======================================== +| Keys | Description + +| Left arrow + + Ctrl + B | + Go to previous char in command line + +| Right arrow + + Ctrl + F | + Go to next char in command line + +| Ctrl + left arrow + + Alt + B | + Go to previous word in command line + +| Ctrl + right arrow + + Alt + F | + Go to next word in command line + +| Home + + Ctrl + A | + Go to the beginning of command line + +| End + + Ctrl + E | + Go to the end of command line + +| Ctrl + C then B | + Insert code for bold text + +| Ctrl + C then C | + Insert code for colored text + +| Ctrl + C then I | + Insert code for italic text + +| Ctrl + C then O | + Insert code for color reset + +| Ctrl + C then R | + Insert code for reverse color + +| Ctrl + C then U | + Insert code for underlined text + +| Delete + + Ctrl + D | + Delete next char in command line + +| Backspace + + Ctrl + H | + Delete previous char in command line + +| Ctrl + K | + Delete from cursor until end of command line (deleted string is copied to + clipboard) + +| Ctrl + R | + Search for text in buffer history (two times: search exact text) + +| Ctrl + T | + Transpose chars + +| Ctrl + U | + Delete from cursor until beginning of command line (deleted string is copied + to clipboard) + +| Ctrl + W | + Delete previous word of command line (deleted string is copied to clipboard) + +| Ctrl + Y | + Paste clipboard content + +| Tab | + Complete command or nick (Tab again: find next completion) + +| Shift + Tab | + Without completion: do a partial completion, with pending completion: + complete with previous completion + +| Any char | + Insert char at cursor position in command line + +| Enter + + Ctrl + J + + Ctrl + M | + Execute command or send message (in search mode: stop search) + +| Up arrow | + Call previous command/message (in search mode: search up) + +| Down arrow | + Call next command/message (in search mode: search down) + +| Ctrl + up arrow | + Call previous command/message in global history (common for all buffers) + +| Ctrl + down arrow | + Call next command/message in global history (common for all buffers) + +| Alt + D | + Delete next word in command line (deleted string is copied to clipboard) + +| Alt + K | + Grab a key and insert its code in command line + +| Alt + R | + Delete entire command line +|======================================== + +Keys for buffers / windows +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +[width="100%",cols="^.^4,.^15",options="header"] +|======================================== +| Keys | Description + +| Ctrl + L | + Redraw whole window + +| Ctrl + S then Ctrl + U | + Set unread marker on all buffers + +| Page up | + Scroll up one page in buffer history + +| Page down | + Scroll down one page in buffer history + +| Alt + Page up | + Scroll up a few lines in buffer history + +| Alt + Page down | + Scroll down a few lines in buffer history + +| Alt + Home | + Scroll to top of buffer + +| Alt + End | + Scroll to bottom of buffer + +| Alt + left arrow + + Alt + up arrow + + Ctrl + P + + F5 | + Switch to previous buffer + +| Alt + right arrow + + Alt + down arrow + + Ctrl + N + + F6 | + Switch to next buffer + +| F7 | + Switch to previous window + +| F8 | + Switch to next window + +| F9 | + Scroll buffer's title on the left + +| F10 | + Scroll buffer's title on the right + +| F11 | + Scroll up one page in nicklist + +| F12 | + Scroll down one page in nicklist + +| Alt + F11 | + Go to the beginning of nicklist + +| Alt + F12 | + Go to the end of nicklist + +| Alt + A | + Switch to next buffer with activity (with priority: highlight, message, + other) + +| Alt + J then Alt + L | + Switch to last buffer + +| Alt + J then Alt + R | + Switch to IRC raw buffer + +| Alt + digit (0-9) | + Switch to buffer by number (0 = 10) + +| Alt + J then number (01-99) | + Switch to buffer by number + +| Alt + N | + Scroll to next highlight + +| Alt + P | + Scroll to previous highlight + +| Alt + U | + Scroll to first unread line in buffer + +| Alt + W then Alt + arrow | + Switch to window with direction + +| Alt + Z | + Zoom on current window (Alt + Z again: restore initial windows state, before + zoom) + +| Alt + < | + Switch to previous buffer in list of visited buffers + +| Alt + > | + Switch to next buffer in list of visited buffers +|======================================== + +Other keys +^^^^^^^^^^ + +[width="100%",cols="^.^4,.^15",options="header"] +|======================================== +| Keys | Description + +| Alt + H | + Clear hotlist (activity notification on other buffers) + +| Alt + S | + Switch current IRC server on servers buffer (if option + "irc.look.one_server_buffer" is enabled) + +| Alt + = | + Toggle filters on/off +|======================================== + +[[command_line]] +Command line +~~~~~~~~~~~~ + +WeeChat command line (at the bottom of window) lets you execute commands or +send text to buffer. + +Syntax +^^^^^^ + +Commands begin with "/" char, followed by name of command. For example, to see +list of all options: + +---------------------------------------- +/set +---------------------------------------- + +Text sent to a buffer is any text that does not begin with "/" char. +For example, to send text 'hello' on current buffer: + +---------------------------------------- +hello +---------------------------------------- + +However, it is possible to start with "/" char, by adding another. +For example, to send text '/set' on current buffer: + +---------------------------------------- +//set +---------------------------------------- + +Colors +^^^^^^ + +For some plugins like IRC, you can use color codes and attributes, as +follow (press Ctrl-C then following letter, with optional value): + +^Cb:: + bold text + +^Ccxx:: + text color `xx` (see list of colors below) + +^Ccxx,yy:: + text color `xx` and background `yy` (see list of colors below) + +^Co:: + disable color and attributes + +^Cr:: + reverse video (revert text color with background) + +^Cu:: + underlined text + +[NOTE] +The same code (without number for ^Cc) may be used to stop the +attribute. + +Color codes for ^Cc are: + +[width="20%",cols="^1m,2"] +|======================================== +| 00 | white +| 01 | black +| 02 | dark blue +| 03 | dark green +| 04 | light red +| 05 | dark red +| 06 | magenta +| 07 | orange +| 08 | yellow +| 09 | light green +| 10 | cyan +| 11 | light cyan +| 12 | light blue +| 13 | light magenta +| 14 | gray +| 15 | light gray (white) +|======================================== + +Example: display of "hello everybody!" with "hello" in light blue bold and +"everybody" in light red underlined: + +---------------------------------------- +^Cc12^Cbhello^Cb^Cc04^Cu everybody^Cu^Cc! +---------------------------------------- + +[[weechat_options]] +WeeChat options (weechat.conf) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +include::autogen/user/weechat_options.txt[] + +Colors for Curses GUI are: + +[width="50%",cols="^3m,8"] +|======================================== +| default | default terminal color (transparent for background) +| black | black +| red | dark red +| lightred | light red +| green | dark green +| lightgreen | light green +| brown | brown +| yellow | yellow +| blue | dark blue +| lightblue | light blue +| magenta | dark magenta +| lightmagenta | light magenta +| cyan | dark cyan +| lightcyan | light cyan +| white | white +|======================================== + +[[weechat_commands]] +WeeChat commands +~~~~~~~~~~~~~~~~ + +include::autogen/user/weechat_commands.txt[] + + +[[plugins]] +Plugins +------- + +To learn more about plugin or script development (thru API), please read +'WeeChat Plugin API Reference' or 'WeeChat Scripting Guide'. + +[[plugins_in_weechat]] +Plugins in WeeChat +~~~~~~~~~~~~~~~~~~ + +A plugin is dynamic library, written in C and compiled, which is loaded by +WeeChat. +Under GNU/Linux, the file has ".so" extension, ".dll" under Windows. + +Plugins found are automatically loaded when WeeChat is starting, and it is +possible to load or unload plugins while WeeChat is running. + +It's important to make difference between a 'plugin' and a 'script': a +'plugin' is a binary file compiled and loaded with command `/plugin`, whereas +a 'script' is a text file loaded with a plugin like 'perl' with command +`/perl`. + +You can use command `/plugin` to load/unload a plugin, or list all loaded +plugins. +When a plugin is unloaded, all buffers created by this plugin are +automatically closed. + +Examples to load, unload or list plugins: + +---------------------------------------- +/plugin load irc +/plugin unload irc +/plugin list +---------------------------------------- + +Default plugins are: + +[width="50%",cols=">1s,5",options="header"] +|======================================== +| Plugin | Description +| alias | Define alias for commands +| aspell | Spell checking for command line +| charset | Charset decoding/encoding for buffers +| demo | Demo plugin (not compiled by default) +| fifo | FIFO pipe used to remotely send commands to WeeChat +| irc | IRC chat protocol +| logger | Log buffers to files +| perl | Perl scripting API +| python | Python scripting API +| ruby | Ruby scripting API +| lua | Lua scripting API +| tcl | Tcl scripting API +| xfer | File transfer and direct chat +|======================================== + +[[alias_plugin]] +Alias plugin +~~~~~~~~~~~~ + +Alias plugin lets you create alias for commands (from WeeChat or other +plugins). + +Commands +^^^^^^^^ + +include::autogen/user/alias_commands.txt[] + +[[aspell_plugin]] +Aspell plugin +~~~~~~~~~~~~ + +Aspell plugin lets you check spelling in command line. It is possible to use +many languages by buffer. + +Options (aspell.conf) +^^^^^^^^^^^^^^^^^^^^^ + +include::autogen/user/aspell_options.txt[] + +Commands +^^^^^^^^ + +include::autogen/user/aspell_commands.txt[] + +[[charset_plugin]] +Charset plugin +~~~~~~~~~~~~~~ + +Charset plugin lets you decode or encode data using charsets. + +There is default charset for decode/encode, and specific charsets for buffers +(or group of buffers). + +This plugin is optional, but recommended: if it's not loaded, WeeChat +can only read/write UTF-8 data. + +Charset plugin should be autoloaded by WeeChat at startup. To be sure plugin +is loaded, try: + +---------------------------------------- +/charset +---------------------------------------- + +If command is not found, then load plugin with command: + +---------------------------------------- +/plugin load charset +---------------------------------------- + +If plugin is not found, then you should compile again WeeChat with +plugins and Charset support. + +When Charset plugin starts, it displays terminal and internal charsets. +Terminal charset depends on your locale, and internal is UTF-8. + +For example: + +........................................ +charset: terminal: ISO-8859-15, internal: UTF-8 +........................................ + +Options (charset.conf) +^^^^^^^^^^^^^^^^^^^^^^ + +include::autogen/user/charset_options.txt[] + +Commands +^^^^^^^^ + +include::autogen/user/charset_commands.txt[] + +Set charset +^^^^^^^^^^^ + +To set global decode and encode charsets, use command `/set`. + +For example: + +---------------------------------------- +/set charset.default.decode ISO-8859-15 +/set charset.default.encode ISO-8859-15 +---------------------------------------- + +If global decode charset is not set (for example during first +load of Charset plugin), it will be automatically set to terminal +charset (if it's different from UTF-8), or by default to 'ISO-8859-1'. + +Default encode value is empty, so it sends by default with +internal charset (UTF-8). + +To set IRC server charset, use command `/charset` on server buffer. +If you give only charset, then it will set decoding and encoding values. + +For example: + +---------------------------------------- +/charset ISO-8859-15 +---------------------------------------- + +It's equivalent to: + +---------------------------------------- +/charset decode ISO-8859-15 +/charset encode ISO-8859-15 +---------------------------------------- + +To set IRC channel (or private) charset, use same commands as server, +but on channel (or private) buffer. + +To see all charsets used, use following command: + +---------------------------------------- +/set charset.* +---------------------------------------- + +Troubleshooting +^^^^^^^^^^^^^^^ + +For any problem with charsets, please look at 'WeeChat FAQ'. + +[[fifo_plugin]] +Fifo plugin +~~~~~~~~~~~ + +You can remote control WeeChat, by sending commands or text to a FIFO pipe (if +option "plugins.var.fifo.fifo" is enabled, it is by default). + +The FIFO pipe is located in '~/.weechat/' and is called 'weechat_fifo_xxxxx' +(where 'xxxxx' is the process ID (PID) of running WeeChat). + +Syntax for the FIFO pipe commands/text is one of following: + +........................................ + plugin.buffer *text or command here + *text or command here +........................................ + +Some examples: + +* nick change on IRC server freenode to "newnick": + +---------------------------------------- +$ echo 'irc.server.freenode */nick newnick' >~/.weechat/weechat_fifo_12345 +---------------------------------------- + +* display text on IRC #weechat channel: + +---------------------------------------- +$ echo 'irc.freenode.#weechat *hello!' >~/.weechat/weechat_fifo_12345 +---------------------------------------- + +* display text on current buffer: + +---------------------------------------- +$ echo '*hello!' >~/.weechat/weechat_fifo_12345 +---------------------------------------- + +* send two commands to unload/reload Perl scripts (you have to separate them + with "\n"): + +---------------------------------------- +$ echo -e '*/perl unload\n*/perl autoload' >~/.weechat/weechat_fifo_12345 +---------------------------------------- + +You can write a script to send command to all running WeeChat at same time, +for example: + +[source,shell] +---------------------------------------- +#!/bin/sh +if [ $# -eq 1 ]; then + for fifo in ~/.weechat/weechat_fifo_* + do + echo -e "$1" >$fifo + done +fi +---------------------------------------- + +If the script is called "auto_weechat_command", you can run it with: + +---------------------------------------- +$ ./auto_weechat_command 'irc.freenode.#weechat *hello' +---------------------------------------- + +[[irc_plugin]] +IRC plugin +~~~~~~~~~~ + +The IRC plugin is designed to chat through IRC protocol with other people. + +It is multi-servers, and offers all supported IRC commands including DCC chat +and file transfer (via xfer plugin, see <<xfer_plugin>>). + +Command line options +^^^^^^^^^^^^^^^^^^^^ + +It is possible to give URL for one or many IRC servers, as follow: + +---------------------------------------- +irc[6][s]://[pseudo[:mot_passe]@]irc.example.org[:port][/channel][,channel[...] +---------------------------------------- + +Example to join '#weechat' and '#toto' on server 'irc.freenode.net' server, +default port (6667), with nick 'nono': + +---------------------------------------- +$ weechat-curses irc://nono@irc.freenode.net/#weechat,#toto +---------------------------------------- + +Options (irc.conf) +^^^^^^^^^^^^^^^^^^ + +include::autogen/user/irc_options.txt[] + +Commands +^^^^^^^^ + +include::autogen/user/irc_commands.txt[] + +[[logger_plugin]] +Logger plugin +~~~~~~~~~~~~~ + +The Logger plugin lets you save content of buffers to files, with options +about what and how it is saved. + +Options (logger.conf) +^^^^^^^^^^^^^^^^^^^^^ + +include::autogen/user/logger_options.txt[] + +Commands +^^^^^^^^ + +include::autogen/user/logger_commands.txt[] + +Log levels +^^^^^^^^^^ + +Logging is made with a level for each buffer. Default level is 9 (log +all messages displayed on buffer). +You can change level for one buffer, or a group of buffers. + +Possible levels are 0 to 9. Zero means "do not log anything" and 9 means +"log all messages". + +Plugins are using different levels for messages displayed. +IRC plugin uses following levels: + +* level 1: message from user (on channel or private) +* level 2: nick change (you or someone else) +* level 3: any server message (except join/part/quit) +* level 4: server message join/part/quit + +So if you set level 3 for an IRC channel, WeeChat will log all messages, +but not join/part/quit. + +Some examples: + +* set level 3 for IRC channel #weechat: + +---------------------------------------- +/set logger.level.irc.freenode.#weechat 3 +---------------------------------------- + +* set level 3 for freenode server buffer: + +---------------------------------------- +/set logger.level.irc.server.freenode 3 +---------------------------------------- + +* set level 3 for all channels on server freenode: + +---------------------------------------- +/set logger.level.irc.freenode 3 +---------------------------------------- + +* set level 2 for all IRC buffers: + +---------------------------------------- +/set logger.level.irc 2 +---------------------------------------- + +Filenames masks +^^^^^^^^^^^^^^^ + +It is possible to define a filename mask for each buffer, and use local buffer +variables to build filename. To see local variables for current buffer: + +---------------------------------------- +/buffer localvar +---------------------------------------- + +For example if you want one directory by IRC server and one file by channel +inside: + +---------------------------------------- +/set logger.mask.irc "irc/$server/$channel.weechatlog" +---------------------------------------- + +You'll have following files: + +........................................ +~/.weechat/ + |--- logs/ + |--- irc/ + |--- freenode/ + | freenode.weechatlog + | #weechat.weechatlog + | #mychan.weechatlog + |--- oftc/ + | oftc.weechatlog + | #chan1.weechatlog + | #chan2.weechatlog +........................................ + +[[scripts_plugins]] +Scripts plugins +~~~~~~~~~~~~~~~ + +WeeChat provides 5 scripting plugins: Perl, Python, Ruby, Lua and Tcl. +These plugins can load, execute and unload scripts for these languages. + +For more information about how to write scripts, or WeeChat API for +scripts, please read 'WeeChat Scripting Guide'. + +You can find some scripts for WeeChat here: +http://weechat.flashtux.org/plugins.php + +Perl commands +^^^^^^^^^^^^^ + +include::autogen/user/perl_commands.txt[] + +Python commands +^^^^^^^^^^^^^^^ + +include::autogen/user/python_commands.txt[] + +Ruby commands +^^^^^^^^^^^^^ + +include::autogen/user/ruby_commands.txt[] + +Lua commands +^^^^^^^^^^^^ + +include::autogen/user/lua_commands.txt[] + +Tcl commands +^^^^^^^^^^^^ + +include::autogen/user/tcl_commands.txt[] + +[[xfer_plugin]] +Xfer plugin +~~~~~~~~~~~ + +Xfer plugin brings: + +* direct chat (between two hosts, without server): for example "DCC Chat" via + IRC plugin +* file transfer, for example "DCC" via IRC plugin + +Options (xfer.conf) +^^^^^^^^^^^^^^^^^^^^^ + +include::autogen/user/xfer_options.txt[] + +Commands +^^^^^^^^ + +include::autogen/user/xfer_commands.txt[] + + +[[authors]] +Authors +------- + +[[developers]] +Developers +~~~~~~~~~~ + +FlashCode (Sébastien Helleu):: + main developer + +Kolter (Emmanuel Bouthenot):: + developer, debian packager + +[[contributors]] +Contributors +~~~~~~~~~~~~ + +Ptitlouis:: + first debian packager + +Jiri Golembiovsky:: + czech translation, patches + +Pavel Shevchuk:: + russian translation + +Frank Zacharias:: + german translation + +Voroskoi:: + hungarian translation + +Rudolf Polzer:: + patches + +Jim Ramsay:: + patches + +Odin:: + SuSE RPM + +Pistos:: + patches + +Gwenn:: + patches + + +[[support]] +Support +------- + +Before asking for support, be sure you've read documentation and FAQ provided +with WeeChat (documentation is this document, if you don't read all lines +until this sentence, you can start again!). + +Ways to get support: + +* IRC: server 'irc.freenode.net', channels '#weechat' (english) and + '#weechat-fr' (french) +* WeeChat forum: http://forums.flashtux.org/ +* Mailing list: +** subscribe: http://mail.nongnu.org/mailman/listinfo/weechat-support +** send mail to weechat-support@nongnu.org +** archives: http://mail.nongnu.org/archive/html/weechat-support |