This manual documents WeeChat chat client, it is part of WeeChat.
Latest version of this document can be found on this page: http://weechat.org/doc
1. 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.
2. 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.
2.1. Macros
The plugin must use some macros (to define some variables):
- WEECHAT_PLUGIN_NAME("name")
-
plugin name
- WEECHAT_PLUGIN_DESCRIPTION("description")
-
short description of plugin
- WEECHAT_PLUGIN_VERSION("1.0")
-
plugin version
- WEECHAT_PLUGIN_LICENSE("GPL3")
-
plugin license
2.2. Main functions
The plugin must use two functions:
-
weechat_plugin_init
-
weechat_plugin_end
2.2.1. weechat_plugin_init
This function is called when plugin is loaded by WeeChat.
Prototype: