From f854db17ff7932c297d4f0dabd925eedf58dd8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 12 Oct 2025 17:37:24 +0200 Subject: [PATCH] core: add hdata for hooks New hooks: - hook - hook_command - hook_command_run - hook_completion - hook_config - hook_connect - hook_fd - hook_focus - hook_hdata - hook_hsignal - hook_info - hook_info_hashtable - hook_infolist - hook_line - hook_modifier - hook_print - hook_process - hook_signal - hook_timer - hook_url New lists (for hooks of type "hook"): - weechat_hooks_command, last_weechat_hook_command - weechat_hooks_command_run, last_weechat_hook_command_run - weechat_hooks_completion, last_weechat_hook_completion - weechat_hooks_config, last_weechat_hook_config - weechat_hooks_connect, last_weechat_hook_connect - weechat_hooks_fd, last_weechat_hook_fd - weechat_hooks_focus, last_weechat_hook_focus - weechat_hooks_hdata, last_weechat_hook_hdata - weechat_hooks_hsignal, last_weechat_hook_hsignal - weechat_hooks_info, last_weechat_hook_info - weechat_hooks_info_hashtable, last_weechat_hook_info_hashtable - weechat_hooks_infolist, last_weechat_hook_infolist - weechat_hooks_line, last_weechat_hook_line - weechat_hooks_modifier, last_weechat_hook_modifier - weechat_hooks_print, last_weechat_hook_print - weechat_hooks_process, last_weechat_hook_process - weechat_hooks_signal, last_weechat_hook_signal - weechat_hooks_timer, last_weechat_hook_timer - weechat_hooks_url, last_weechat_hook_url --- CHANGELOG.md | 1 + po/cs.po | 71 ++++++++++++++++++++++++++- po/de.po | 74 ++++++++++++++++++++++++++++- po/es.po | 68 +++++++++++++++++++++++++- po/fr.po | 64 ++++++++++++++++++++++++- po/hu.po | 67 +++++++++++++++++++++++++- po/it.po | 68 +++++++++++++++++++++++++- po/ja.po | 72 +++++++++++++++++++++++++++- po/pl.po | 72 +++++++++++++++++++++++++++- po/pt.po | 72 +++++++++++++++++++++++++++- po/pt_BR.po | 68 +++++++++++++++++++++++++- po/ru.po | 67 +++++++++++++++++++++++++- po/sr.po | 74 ++++++++++++++++++++++++++++- po/tr.po | 72 +++++++++++++++++++++++++++- po/weechat.pot | 62 +++++++++++++++++++++++- src/core/core-hook.c | 45 ++++++++++++++++++ src/core/core-hook.h | 3 ++ src/core/hook/hook-command-run.c | 25 ++++++++++ src/core/hook/hook-command-run.h | 3 ++ src/core/hook/hook-command.c | 38 ++++++++++++++- src/core/hook/hook-command.h | 3 ++ src/core/hook/hook-completion.c | 26 ++++++++++ src/core/hook/hook-completion.h | 3 ++ src/core/hook/hook-config.c | 25 ++++++++++ src/core/hook/hook-config.h | 3 ++ src/core/hook/hook-connect.c | 47 ++++++++++++++++++ src/core/hook/hook-connect.h | 3 ++ src/core/hook/hook-fd.c | 26 ++++++++++ src/core/hook/hook-fd.h | 3 ++ src/core/hook/hook-focus.c | 26 +++++++++- src/core/hook/hook-focus.h | 3 ++ src/core/hook/hook-hdata.c | 27 ++++++++++- src/core/hook/hook-hdata.h | 3 ++ src/core/hook/hook-hsignal.c | 25 ++++++++++ src/core/hook/hook-hsignal.h | 3 ++ src/core/hook/hook-info-hashtable.c | 29 +++++++++++ src/core/hook/hook-info-hashtable.h | 3 ++ src/core/hook/hook-info.c | 27 +++++++++++ src/core/hook/hook-info.h | 3 ++ src/core/hook/hook-infolist.c | 28 +++++++++++ src/core/hook/hook-infolist.h | 3 ++ src/core/hook/hook-line.c | 30 +++++++++++- src/core/hook/hook-line.h | 3 ++ src/core/hook/hook-modifier.c | 25 ++++++++++ src/core/hook/hook-modifier.h | 3 ++ src/core/hook/hook-print.c | 29 +++++++++++ src/core/hook/hook-print.h | 3 ++ src/core/hook/hook-process.c | 37 ++++++++++++++- src/core/hook/hook-process.h | 3 ++ src/core/hook/hook-signal.c | 25 ++++++++++ src/core/hook/hook-signal.h | 3 ++ src/core/hook/hook-timer.c | 31 ++++++++++++ src/core/hook/hook-timer.h | 3 ++ src/core/hook/hook-url.c | 33 ++++++++++++- src/core/hook/hook-url.h | 3 ++ src/plugins/plugin-api.c | 40 ++++++++++++++++ 56 files changed, 1655 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33cff60a8..8f1cdb4f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ SPDX-License-Identifier: GPL-3.0-or-later ### Added - core: add option weechat.completion.cycle +- core: add hdata for hooks ### Changed diff --git a/po/cs.po b/po/cs.po index 0f6e44af1..3059dd809 100644 --- a/po/cs.po +++ b/po/cs.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:24+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -13687,6 +13687,75 @@ msgstr "filtr" msgid "history of commands in buffer" msgstr "historie příkazů" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "historie příkazů" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Neběží žádný příkaz" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "doplnění:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "nepřipojen" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "Seznam trigerů:" + +msgid "hook \"url\"" +msgstr "" + #, fuzzy msgid "hotlist" msgstr "řetězec zobrazený mezi buffery v hotlistu" diff --git a/po/de.po b/po/de.po index 67fe3b012..ce181d3ce 100644 --- a/po/de.po +++ b/po/de.po @@ -28,7 +28,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-05 09:24+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -15059,6 +15059,78 @@ msgstr "Filter" msgid "history of commands in buffer" msgstr "Verlaufspeicher von Befehlen in einem Buffer" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "Verlaufspeicher der Befehle" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Es wird im Moment kein Befehl ausgeführt" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "Vervollständigung:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "nicht verbunden" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +#, fuzzy +#| msgid "hook types" +msgid "hook \"process\"" +msgstr "Hook-Typen" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +#| msgid "hook types" +msgid "hook \"timer\"" +msgstr "Hook-Typen" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "Hotliste" diff --git a/po/es.po b/po/es.po index bc5945ee1..1cbdf1f56 100644 --- a/po/es.po +++ b/po/es.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -14006,6 +14006,72 @@ msgstr "filtro" msgid "history of commands in buffer" msgstr "historial de comandos en el buffer" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "historial de comandos" + +msgid "hook \"command_run\"" +msgstr "" + +#, fuzzy +msgid "hook \"completion\"" +msgstr "compilado en" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "no conectado" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "opciones para proxies" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "lista de actividad" diff --git a/po/fr.po b/po/fr.po index df0d615e5..9df6d07bf 100644 --- a/po/fr.po +++ b/po/fr.po @@ -23,8 +23,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" -"PO-Revision-Date: 2025-09-11 21:09+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" +"PO-Revision-Date: 2025-10-12 17:30+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -14765,6 +14765,66 @@ msgstr "filtre" msgid "history of commands in buffer" msgstr "historique des commandes dans le tampon" +msgid "hook" +msgstr "hook" + +msgid "hook \"command\"" +msgstr "hook \"command\"" + +msgid "hook \"command_run\"" +msgstr "hook \"command_run\"" + +msgid "hook \"completion\"" +msgstr "hook \"completion\"" + +msgid "hook \"config\"" +msgstr "hook \"config\"" + +msgid "hook \"connect\"" +msgstr "hook \"connect\"" + +msgid "hook \"fd\"" +msgstr "hook \"fd\"" + +msgid "hook \"focus\"" +msgstr "hook \"focus\"" + +msgid "hook \"hdata\"" +msgstr "hook \"hdata\"" + +msgid "hook \"hsignal\"" +msgstr "hook \"hsignal\"" + +msgid "hook \"info\"" +msgstr "hook \"info\"" + +msgid "hook \"info_hashtable\"" +msgstr "hook \"info_hashtable\"" + +msgid "hook \"infolist\"" +msgstr "hook \"infolist\"" + +msgid "hook \"line\"" +msgstr "hook \"line\"" + +msgid "hook \"modifier\"" +msgstr "hook \"modifier\"" + +msgid "hook \"print\"" +msgstr "hook \"print\"" + +msgid "hook \"process\"" +msgstr "hook \"process\"" + +msgid "hook \"signal\"" +msgstr "hook \"signal\"" + +msgid "hook \"timer\"" +msgstr "hook \"timer\"" + +msgid "hook \"url\"" +msgstr "hook \"url\"" + msgid "hotlist" msgstr "hotlist" diff --git a/po/hu.po b/po/hu.po index 8cff0ac27..89b15f74c 100644 --- a/po/hu.po +++ b/po/hu.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -13086,6 +13086,71 @@ msgstr "" msgid "history of commands in buffer" msgstr "%s belső parancsok:\n" +msgid "hook" +msgstr "" + +#, fuzzy +msgid "hook \"command\"" +msgstr "%s belső parancsok:\n" + +msgid "hook \"command_run\"" +msgstr "" + +#, fuzzy +msgid "hook \"completion\"" +msgstr "lefordítva:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "nincs csatlakozva" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "Aliaszok listája:\n" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "" diff --git a/po/it.po b/po/it.po index 499d9999b..8da4fd207 100644 --- a/po/it.po +++ b/po/it.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -14005,6 +14005,72 @@ msgstr "filtro" msgid "history of commands in buffer" msgstr "cronologia dei comandi nel buffer" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "cronologia dei comandi" + +msgid "hook \"command_run\"" +msgstr "" + +#, fuzzy +msgid "hook \"completion\"" +msgstr "compilato il" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "non connesso" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "opzioni per i proxy" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "hotlist" diff --git a/po/ja.po b/po/ja.po index f812e2113..e7d051c57 100644 --- a/po/ja.po +++ b/po/ja.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -14703,6 +14703,76 @@ msgstr "filtr" msgid "history of commands in buffer" msgstr "historia komend w buforze" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "historia komend" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Żadna komenda nie jest uruchomiona" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "dopełnienie:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "nie połączony" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +#| msgid "hooks for triggers" +msgid "hook \"timer\"" +msgstr "hooki dla triggerów" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "hotlista" diff --git a/po/pt.po b/po/pt.po index 819ad8c08..43fee8995 100644 --- a/po/pt.po +++ b/po/pt.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -14386,6 +14386,76 @@ msgstr "filtro" msgid "history of commands in buffer" msgstr "histórico de comandos do buffer" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "histórico de comandos" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Nenhum comando a executar" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "completação:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "não conectado" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +#| msgid "hooks for triggers" +msgid "hook \"timer\"" +msgstr "hooks de acionadores" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "hotlist" diff --git a/po/pt_BR.po b/po/pt_BR.po index 96b782cb9..d5964168b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -13510,6 +13510,72 @@ msgstr "filtro" msgid "history of commands in buffer" msgstr "histórico de comandos no buffer" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "histórico de comandos" + +msgid "hook \"command_run\"" +msgstr "" + +#, fuzzy +msgid "hook \"completion\"" +msgstr "compilado em" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "não conectado" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "opções para proxys" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "" diff --git a/po/ru.po b/po/ru.po index 6cabb4789..c1173e358 100644 --- a/po/ru.po +++ b/po/ru.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-05-04 09:25+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -13139,6 +13139,71 @@ msgstr "" msgid "history of commands in buffer" msgstr "Внутренние команды %s:\n" +msgid "hook" +msgstr "" + +#, fuzzy +msgid "hook \"command\"" +msgstr "Внутренние команды %s:\n" + +msgid "hook \"command_run\"" +msgstr "" + +#, fuzzy +msgid "hook \"completion\"" +msgstr "собран:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "отключен" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +msgid "hook \"timer\"" +msgstr "Список сокращений:\n" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "" diff --git a/po/sr.po b/po/sr.po index 1d3ed3ccb..63abcdd71 100644 --- a/po/sr.po +++ b/po/sr.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-09-22 11:16+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -14331,6 +14331,78 @@ msgstr "филтер" msgid "history of commands in buffer" msgstr "историја команди у баферу" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "историја команди" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Не извршава се ниједна команда" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "довршавање:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "није повезан" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +#, fuzzy +#| msgid "hook types" +msgid "hook \"process\"" +msgstr "типови куке" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +#| msgid "hook types" +msgid "hook \"timer\"" +msgstr "типови куке" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "врућа листа" diff --git a/po/tr.po b/po/tr.po index fd7fc1274..7c430c002 100644 --- a/po/tr.po +++ b/po/tr.po @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2025-07-06 09:25+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -14595,6 +14595,76 @@ msgstr "süzgeç" msgid "history of commands in buffer" msgstr "arabellekteki komutların geçmişi" +msgid "hook" +msgstr "" + +#, fuzzy +#| msgid "history of commands" +msgid "hook \"command\"" +msgstr "komutların geçmişi" + +#, fuzzy +#| msgid "No command is running" +msgid "hook \"command_run\"" +msgstr "Çalışan bir komut yok" + +#, fuzzy +#| msgid "completion:" +msgid "hook \"completion\"" +msgstr "tamamlama:" + +msgid "hook \"config\"" +msgstr "" + +#, fuzzy +#| msgid "not connected" +msgid "hook \"connect\"" +msgstr "bağlanmadı" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +#, fuzzy +#| msgid "hooks for triggers" +msgid "hook \"timer\"" +msgstr "tetik kancaları" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "sıcak liste" diff --git a/po/weechat.pot b/po/weechat.pot index 52ae7ecd5..9331ed858 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -23,7 +23,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2025-09-11 21:08+0200\n" +"POT-Creation-Date: 2025-10-12 17:27+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -11950,6 +11950,66 @@ msgstr "" msgid "history of commands in buffer" msgstr "" +msgid "hook" +msgstr "" + +msgid "hook \"command\"" +msgstr "" + +msgid "hook \"command_run\"" +msgstr "" + +msgid "hook \"completion\"" +msgstr "" + +msgid "hook \"config\"" +msgstr "" + +msgid "hook \"connect\"" +msgstr "" + +msgid "hook \"fd\"" +msgstr "" + +msgid "hook \"focus\"" +msgstr "" + +msgid "hook \"hdata\"" +msgstr "" + +msgid "hook \"hsignal\"" +msgstr "" + +msgid "hook \"info\"" +msgstr "" + +msgid "hook \"info_hashtable\"" +msgstr "" + +msgid "hook \"infolist\"" +msgstr "" + +msgid "hook \"line\"" +msgstr "" + +msgid "hook \"modifier\"" +msgstr "" + +msgid "hook \"print\"" +msgstr "" + +msgid "hook \"process\"" +msgstr "" + +msgid "hook \"signal\"" +msgstr "" + +msgid "hook \"timer\"" +msgstr "" + +msgid "hook \"url\"" +msgstr "" + msgid "hotlist" msgstr "" diff --git a/src/core/core-hook.c b/src/core/core-hook.c index d98e7d9ef..1824ebf9c 100644 --- a/src/core/core-hook.c +++ b/src/core/core-hook.c @@ -37,6 +37,7 @@ #include "core-debug.h" #include "core-hook.h" #include "core-hashtable.h" +#include "core-hdata.h" #include "core-infolist.h" #include "core-log.h" #include "core-signal.h" @@ -793,6 +794,50 @@ unhook_all (void) } } +/* + * Returns hdata for hook. + */ + +struct t_hdata * +hook_hdata_hook_cb (const void *pointer, void *data, const char *hdata_name) +{ + struct t_hdata *hdata; + int hook_type; + char str_list[128]; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, "prev_hook", "next_hook", + 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook, plugin, POINTER, 0, NULL, "plugin"); + HDATA_VAR(struct t_hook, subplugin, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook, type, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, deleted, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, running, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, priority, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, callback_pointer, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, callback_data, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, hook_data, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook, prev_hook, POINTER, 0, NULL, hdata_name); + HDATA_VAR(struct t_hook, next_hook, POINTER, 0, NULL, hdata_name); + for (hook_type = 0; hook_type < HOOK_NUM_TYPES; hook_type++) + { + snprintf (str_list, sizeof (str_list), + "weechat_hooks_%s", hook_type_string[hook_type]); + hdata_new_list (hdata, str_list, &weechat_hooks[hook_type], + WEECHAT_HDATA_LIST_CHECK_POINTERS); + snprintf (str_list, sizeof (str_list), + "last_weechat_hook_%s", hook_type_string[hook_type]); + hdata_new_list (hdata, str_list, &last_weechat_hook[hook_type], 0); + } + } + return hdata; +} + /* * Adds a hook in an infolist. * diff --git a/src/core/core-hook.h b/src/core/core-hook.h index 19604c6e4..4e186f329 100644 --- a/src/core/core-hook.h +++ b/src/core/core-hook.h @@ -153,6 +153,9 @@ extern void unhook (struct t_hook *hook); extern void unhook_all_plugin (struct t_weechat_plugin *plugin, const char *subplugin); extern void unhook_all (void); +extern struct t_hdata *hook_hdata_hook_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_add_to_infolist (struct t_infolist *infolist, struct t_hook *hook, const char *arguments); diff --git a/src/core/hook/hook-command-run.c b/src/core/hook/hook-command-run.c index 9af298c7c..5750d047a 100644 --- a/src/core/hook/hook-command-run.c +++ b/src/core/hook/hook-command-run.c @@ -30,6 +30,7 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -203,6 +204,30 @@ hook_command_run_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for command_run hook. + */ + +struct t_hdata * +hook_command_run_hdata_hook_command_run_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_command_run, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command_run, command, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command_run, keep_spaces_right, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds command_run hook data in the infolist item. * diff --git a/src/core/hook/hook-command-run.h b/src/core/hook/hook-command-run.h index ace3beb3e..4ceba7385 100644 --- a/src/core/hook/hook-command-run.h +++ b/src/core/hook/hook-command-run.h @@ -51,6 +51,9 @@ extern struct t_hook *hook_command_run (struct t_weechat_plugin *plugin, extern int hook_command_run_exec (struct t_gui_buffer *buffer, const char *command); extern void hook_command_run_free_data (struct t_hook *hook); +extern struct t_hdata *hook_command_run_hdata_hook_command_run_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_command_run_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_command_run_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-command.c b/src/core/hook/hook-command.c index f0551474c..145300894 100644 --- a/src/core/hook/hook-command.c +++ b/src/core/hook/hook-command.c @@ -29,9 +29,10 @@ #include #include "../weechat.h" +#include "../core-hook.h" #include "../core-arraylist.h" #include "../core-config.h" -#include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-list.h" #include "../core-log.h" @@ -1047,6 +1048,41 @@ hook_command_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for command hook. + */ + +struct t_hdata * +hook_command_hdata_hook_command_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_command, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, command, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, args, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, args_description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, completion, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, cplt_num_templates, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, cplt_templates, POINTER, 0, "*,cplt_num_templates", NULL); + HDATA_VAR(struct t_hook_command, cplt_templates_static, POINTER, 0, "*,cplt_num_templates", NULL); + HDATA_VAR(struct t_hook_command, cplt_template_num_args, INTEGER, 0, "*,cplt_num_templates", NULL); + HDATA_VAR(struct t_hook_command, cplt_template_args, POINTER, 0, "*,cplt_num_templates", NULL); + HDATA_VAR(struct t_hook_command, cplt_template_num_args_concat, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_command, cplt_template_args_concat, POINTER, 0, "*,cplt_template_num_args_concat", NULL); + HDATA_VAR(struct t_hook_command, keep_spaces_right, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds command hook data in the infolist item. * diff --git a/src/core/hook/hook-command.h b/src/core/hook/hook-command.h index 05100da8f..4c9a33bea 100644 --- a/src/core/hook/hook-command.h +++ b/src/core/hook/hook-command.h @@ -98,6 +98,9 @@ extern int hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, const char *string); extern void hook_command_display_error_unknown (const char *command); extern void hook_command_free_data (struct t_hook *hook); +extern struct t_hdata *hook_command_hdata_hook_command_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_command_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_command_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-completion.c b/src/core/hook/hook-completion.c index 29f3d9a45..32363ae8a 100644 --- a/src/core/hook/hook-completion.c +++ b/src/core/hook/hook-completion.c @@ -30,10 +30,12 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" #include "../../gui/gui-completion.h" +#include "../../plugins/plugin.h" /* @@ -180,6 +182,30 @@ hook_completion_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for completion hook. + */ + +struct t_hdata * +hook_completion_hdata_hook_completion_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_completion, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_completion, completion_item, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_completion, description, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds completion hook data in the infolist item. * diff --git a/src/core/hook/hook-completion.h b/src/core/hook/hook-completion.h index 509d6c742..bde2ccf20 100644 --- a/src/core/hook/hook-completion.h +++ b/src/core/hook/hook-completion.h @@ -53,6 +53,9 @@ extern void hook_completion_exec (struct t_weechat_plugin *plugin, struct t_gui_buffer *buffer, struct t_gui_completion *completion); extern void hook_completion_free_data (struct t_hook *hook); +extern struct t_hdata *hook_completion_hdata_hook_completion_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_completion_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_completion_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-config.c b/src/core/hook/hook-config.c index 92e501b49..8c81aa595 100644 --- a/src/core/hook/hook-config.c +++ b/src/core/hook/hook-config.c @@ -30,9 +30,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -149,6 +151,29 @@ hook_config_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for config hook. + */ + +struct t_hdata * +hook_config_hdata_hook_config_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_config, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_config, option, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds config hook data in the infolist item. * diff --git a/src/core/hook/hook-config.h b/src/core/hook/hook-config.h index 4d66aa853..6e711d56b 100644 --- a/src/core/hook/hook-config.h +++ b/src/core/hook/hook-config.h @@ -45,6 +45,9 @@ extern struct t_hook *hook_config (struct t_weechat_plugin *plugin, void *callback_data); extern void hook_config_exec (const char *option, const char *value); extern void hook_config_free_data (struct t_hook *hook); +extern struct t_hdata *hook_config_hdata_hook_config_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_config_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_config_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-connect.c b/src/core/hook/hook-connect.c index b7acc9f42..111e4fc47 100644 --- a/src/core/hook/hook-connect.c +++ b/src/core/hook/hook-connect.c @@ -34,6 +34,7 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-network.h" @@ -312,6 +313,52 @@ hook_connect_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for connect hook. + */ + +struct t_hdata * +hook_connect_hdata_hook_connect_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_connect, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, proxy, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, address, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, port, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, ipv6, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, sock, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, retry, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, gnutls_sess, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, gnutls_cb, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, gnutls_dhkey_size, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, gnutls_priorities, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, local_hostname, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, child_read, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, child_write, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, child_recv, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, child_send, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, child_pid, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, hook_child_timer, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_connect, hook_fd, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_connect, handshake_hook_fd, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_connect, handshake_hook_timer, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_connect, handshake_fd_flags, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, handshake_ip_address, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_connect, sock_v4, INTEGER, 0, TO_STR(HOOK_CONNECT_MAX_SOCKETS), NULL); + HDATA_VAR(struct t_hook_connect, sock_v6, INTEGER, 0, TO_STR(HOOK_CONNECT_MAX_SOCKETS), NULL); + } + return hdata; +} + /* * Adds connect hook data in the infolist item. * diff --git a/src/core/hook/hook-connect.h b/src/core/hook/hook-connect.h index 1a6ab97ac..a1dd9b6fa 100644 --- a/src/core/hook/hook-connect.h +++ b/src/core/hook/hook-connect.h @@ -94,6 +94,9 @@ extern int hook_connect_gnutls_set_certificates (gnutls_session_t tls_session, int pk_algos_len, gnutls_retr2_st *answer); extern void hook_connect_free_data (struct t_hook *hook); +extern struct t_hdata *hook_connect_hdata_hook_connect_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_connect_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_connect_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-fd.c b/src/core/hook/hook-fd.c index aa928ca0d..02d687003 100644 --- a/src/core/hook/hook-fd.c +++ b/src/core/hook/hook-fd.c @@ -33,9 +33,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../../gui/gui-chat.h" +#include "../../plugins/plugin.h" struct pollfd *hook_fd_pollfd = NULL; /* file descriptors for poll() */ @@ -311,6 +313,30 @@ hook_fd_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for fd hook. + */ + +struct t_hdata * +hook_fd_hdata_hook_fd_cb (const void *pointer, void *data, const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_fd, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_fd, fd, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_fd, flags, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_fd, error, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds fd hook data in the infolist item. * diff --git a/src/core/hook/hook-fd.h b/src/core/hook/hook-fd.h index 001290613..e79a84dad 100644 --- a/src/core/hook/hook-fd.h +++ b/src/core/hook/hook-fd.h @@ -54,6 +54,9 @@ extern struct t_hook *hook_fd (struct t_weechat_plugin *plugin, int fd, void *callback_data); extern void hook_fd_exec (void); extern void hook_fd_free_data (struct t_hook *hook); +extern struct t_hdata *hook_fd_hdata_hook_fd_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_fd_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_fd_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-focus.c b/src/core/hook/hook-focus.c index 636f55032..8b5bab900 100644 --- a/src/core/hook/hook-focus.c +++ b/src/core/hook/hook-focus.c @@ -29,8 +29,9 @@ #include #include "../weechat.h" -#include "../core-hashtable.h" #include "../core-hook.h" +#include "../core-hashtable.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -294,6 +295,29 @@ hook_focus_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for focus hook. + */ + +struct t_hdata * +hook_focus_hdata_hook_focus_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_focus, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_focus, area, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds focus hook data in the infolist item. * diff --git a/src/core/hook/hook-focus.h b/src/core/hook/hook-focus.h index 6bfb0821f..f8d878fa4 100644 --- a/src/core/hook/hook-focus.h +++ b/src/core/hook/hook-focus.h @@ -47,6 +47,9 @@ extern struct t_hook *hook_focus (struct t_weechat_plugin *plugin, extern struct t_hashtable *hook_focus_get_data (struct t_hashtable *hashtable_focus1, struct t_hashtable *hashtable_focus2); extern void hook_focus_free_data (struct t_hook *hook); +extern struct t_hdata *hook_focus_hdata_hook_focus_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_focus_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_focus_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-hdata.c b/src/core/hook/hook-hdata.c index 917f5ce20..9868f3003 100644 --- a/src/core/hook/hook-hdata.c +++ b/src/core/hook/hook-hdata.c @@ -29,12 +29,13 @@ #include #include "../weechat.h" +#include "../core-hook.h" #include "../core-hashtable.h" #include "../core-hdata.h" -#include "../core-hook.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -176,6 +177,30 @@ hook_hdata_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for hdata hook. + */ + +struct t_hdata * +hook_hdata_hdata_hook_hdata_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_hdata, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_hdata, hdata_name, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_hdata, description, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds hdata hook data in the infolist item. * diff --git a/src/core/hook/hook-hdata.h b/src/core/hook/hook-hdata.h index b5f0fbcf5..0a94ca916 100644 --- a/src/core/hook/hook-hdata.h +++ b/src/core/hook/hook-hdata.h @@ -48,6 +48,9 @@ extern struct t_hook *hook_hdata (struct t_weechat_plugin *plugin, extern struct t_hdata *hook_hdata_get (struct t_weechat_plugin *plugin, const char *hdata_name); extern void hook_hdata_free_data (struct t_hook *hook); +extern struct t_hdata *hook_hdata_hdata_hook_hdata_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_hdata_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_hdata_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-hsignal.c b/src/core/hook/hook-hsignal.c index 7603f3905..5d70fb163 100644 --- a/src/core/hook/hook-hsignal.c +++ b/src/core/hook/hook-hsignal.c @@ -30,6 +30,7 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -204,6 +205,30 @@ hook_hsignal_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for hsignal hook. + */ + +struct t_hdata * +hook_hsignal_hdata_hook_hsignal_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_hsignal, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_hsignal, signals, STRING, 0, "*,num_signals", NULL); + HDATA_VAR(struct t_hook_hsignal, num_signals, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds hsignal hook data in the infolist item. * diff --git a/src/core/hook/hook-hsignal.h b/src/core/hook/hook-hsignal.h index ec72e0401..51c5dddb6 100644 --- a/src/core/hook/hook-hsignal.h +++ b/src/core/hook/hook-hsignal.h @@ -49,6 +49,9 @@ extern struct t_hook *hook_hsignal (struct t_weechat_plugin *plugin, extern int hook_hsignal_send (const char *signal, struct t_hashtable *hashtable); extern void hook_hsignal_free_data (struct t_hook *hook); +extern struct t_hdata *hook_hsignal_hdata_hook_hsignal_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_hsignal_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_hsignal_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-info-hashtable.c b/src/core/hook/hook-info-hashtable.c index b895b5b7f..375ecfa27 100644 --- a/src/core/hook/hook-info-hashtable.c +++ b/src/core/hook/hook-info-hashtable.c @@ -30,9 +30,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -184,6 +186,33 @@ hook_info_hashtable_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for info_hashtable hook. + */ + +struct t_hdata * +hook_info_hashtable_hdata_hook_info_hashtable_cb (const void *pointer, + void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_info_hashtable, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info_hashtable, info_name, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info_hashtable, description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info_hashtable, args_description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info_hashtable, output_description, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds info_hashtable hook data in the infolist item. * diff --git a/src/core/hook/hook-info-hashtable.h b/src/core/hook/hook-info-hashtable.h index eb8ad4b80..9187dada9 100644 --- a/src/core/hook/hook-info-hashtable.h +++ b/src/core/hook/hook-info-hashtable.h @@ -54,6 +54,9 @@ extern struct t_hashtable *hook_info_get_hashtable (struct t_weechat_plugin *plu const char *info_name, struct t_hashtable *hashtable); extern void hook_info_hashtable_free_data (struct t_hook *hook); +extern struct t_hdata *hook_info_hashtable_hdata_hook_info_hashtable_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_info_hashtable_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_info_hashtable_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-info.c b/src/core/hook/hook-info.c index 0b7aa0400..818462d5d 100644 --- a/src/core/hook/hook-info.c +++ b/src/core/hook/hook-info.c @@ -30,9 +30,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -178,6 +180,31 @@ hook_info_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for info hook. + */ + +struct t_hdata * +hook_info_hdata_hook_info_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_info, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info, info_name, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info, description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_info, args_description, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds info hook data in the infolist item. * diff --git a/src/core/hook/hook-info.h b/src/core/hook/hook-info.h index 03718c4dc..38e0bd5e0 100644 --- a/src/core/hook/hook-info.h +++ b/src/core/hook/hook-info.h @@ -51,6 +51,9 @@ extern char *hook_info_get (struct t_weechat_plugin *plugin, const char *info_name, const char *arguments); extern void hook_info_free_data (struct t_hook *hook); +extern struct t_hdata *hook_info_hdata_hook_info_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_info_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_info_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-infolist.c b/src/core/hook/hook-infolist.c index a9aa86231..8dd0d2539 100644 --- a/src/core/hook/hook-infolist.c +++ b/src/core/hook/hook-infolist.c @@ -30,9 +30,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -185,6 +187,32 @@ hook_infolist_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for infolist hook. + */ + +struct t_hdata * +hook_infolist_hdata_hook_infolist_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_infolist, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_infolist, infolist_name, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_infolist, description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_infolist, pointer_description, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_infolist, args_description, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds infolist hook data in the infolist item. * diff --git a/src/core/hook/hook-infolist.h b/src/core/hook/hook-infolist.h index a48553898..3110daeec 100644 --- a/src/core/hook/hook-infolist.h +++ b/src/core/hook/hook-infolist.h @@ -56,6 +56,9 @@ extern struct t_infolist *hook_infolist_get (struct t_weechat_plugin *plugin, void *pointer, const char *arguments); extern void hook_infolist_free_data (struct t_hook *hook); +extern struct t_hdata *hook_infolist_hdata_hook_infolist_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_infolist_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_infolist_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-line.c b/src/core/hook/hook-line.c index 003c4624c..b1558ddaf 100644 --- a/src/core/hook/hook-line.c +++ b/src/core/hook/hook-line.c @@ -29,8 +29,9 @@ #include #include "../weechat.h" -#include "../core-hashtable.h" #include "../core-hook.h" +#include "../core-hashtable.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -235,6 +236,33 @@ hook_line_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for line hook. + */ + +struct t_hdata * +hook_line_hdata_hook_line_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_line, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_line, buffer_type, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_line, buffers, STRING, 0, "*,num_buffers", NULL); + HDATA_VAR(struct t_hook_line, num_buffers, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_line, tags_count, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_line, tags_array, STRING, 0, "*,tags_count", NULL); + } + return hdata; +} + /* * Adds line hook data in the infolist item. * diff --git a/src/core/hook/hook-line.h b/src/core/hook/hook-line.h index 5794fbc44..dbeb42126 100644 --- a/src/core/hook/hook-line.h +++ b/src/core/hook/hook-line.h @@ -55,6 +55,9 @@ extern struct t_hook *hook_line (struct t_weechat_plugin *plugin, void *callback_data); extern void hook_line_exec (struct t_gui_line *line); extern void hook_line_free_data (struct t_hook *hook); +extern struct t_hdata *hook_line_hdata_hook_line_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_line_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_line_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-modifier.c b/src/core/hook/hook-modifier.c index e3a7a40c1..b5eab8135 100644 --- a/src/core/hook/hook-modifier.c +++ b/src/core/hook/hook-modifier.c @@ -30,9 +30,11 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" +#include "../../plugins/plugin.h" /* @@ -181,6 +183,29 @@ hook_modifier_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for modifier hook. + */ + +struct t_hdata * +hook_modifier_hdata_hook_modifier_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_modifier, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_modifier, modifier, STRING, 0, NULL, NULL); + } + return hdata; +} + /* * Adds modifier hook data in the infolist item. * diff --git a/src/core/hook/hook-modifier.h b/src/core/hook/hook-modifier.h index 1d469a13b..d1f3d4564 100644 --- a/src/core/hook/hook-modifier.h +++ b/src/core/hook/hook-modifier.h @@ -49,6 +49,9 @@ extern char *hook_modifier_exec (struct t_weechat_plugin *plugin, const char *modifier_data, const char *string); extern void hook_modifier_free_data (struct t_hook *hook); +extern struct t_hdata *hook_modifier_hdata_hook_modifier_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_modifier_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_modifier_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-print.c b/src/core/hook/hook-print.c index 3e4109db8..7e418bd8d 100644 --- a/src/core/hook/hook-print.c +++ b/src/core/hook/hook-print.c @@ -30,12 +30,14 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" #include "../../gui/gui-buffer.h" #include "../../gui/gui-color.h" #include "../../gui/gui-line.h" +#include "../../plugins/plugin.h" /* @@ -212,6 +214,33 @@ hook_print_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for print hook. + */ + +struct t_hdata * +hook_print_hdata_hook_print_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_print, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_print, buffer, POINTER, 0, NULL, "buffer"); + HDATA_VAR(struct t_hook_print, tags_count, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_print, tags_array, STRING, 0, "*,tags_count", NULL); + HDATA_VAR(struct t_hook_print, message, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_print, strip_colors, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds print hook data in the infolist item. * diff --git a/src/core/hook/hook-print.h b/src/core/hook/hook-print.h index 6d4c98bbf..ee03b9b64 100644 --- a/src/core/hook/hook-print.h +++ b/src/core/hook/hook-print.h @@ -59,6 +59,9 @@ extern struct t_hook *hook_print (struct t_weechat_plugin *plugin, extern void hook_print_exec (struct t_gui_buffer *buffer, struct t_gui_line *line); extern void hook_print_free_data (struct t_hook *hook); +extern struct t_hdata *hook_print_hdata_hook_print_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_print_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_print_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-process.c b/src/core/hook/hook-process.c index 867c27d34..3421885e7 100644 --- a/src/core/hook/hook-process.c +++ b/src/core/hook/hook-process.c @@ -34,8 +34,9 @@ #include #include "../weechat.h" -#include "../core-hashtable.h" #include "../core-hook.h" +#include "../core-hashtable.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -914,6 +915,40 @@ hook_process_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for process hook. + */ + +struct t_hdata * +hook_process_hdata_hook_process_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_process, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, command, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, options, HASHTABLE, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, detached, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, timeout, LONG, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, child_read, INTEGER, 0, "3", NULL); + HDATA_VAR(struct t_hook_process, child_write, INTEGER, 0, "3", NULL); + HDATA_VAR(struct t_hook_process, child_pid, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_process, hook_fd, POINTER, 0, "3", "hook"); + HDATA_VAR(struct t_hook_process, hook_timer, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_process, buffer, STRING, 0, "3", NULL); + HDATA_VAR(struct t_hook_process, buffer_size, INTEGER, 0, "3", NULL); + HDATA_VAR(struct t_hook_process, buffer_flush, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds process hook data in the infolist item. * diff --git a/src/core/hook/hook-process.h b/src/core/hook/hook-process.h index e592e9eb7..10fbce59f 100644 --- a/src/core/hook/hook-process.h +++ b/src/core/hook/hook-process.h @@ -74,6 +74,9 @@ extern struct t_hook *hook_process_hashtable (struct t_weechat_plugin *plugin, void *callback_data); extern void hook_process_exec (void); extern void hook_process_free_data (struct t_hook *hook); +extern struct t_hdata *hook_process_hdata_hook_process_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_process_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_process_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-signal.c b/src/core/hook/hook-signal.c index 2e94448f8..1d567b70a 100644 --- a/src/core/hook/hook-signal.c +++ b/src/core/hook/hook-signal.c @@ -30,6 +30,7 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -255,6 +256,30 @@ hook_signal_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for signal hook. + */ + +struct t_hdata * +hook_signal_hdata_hook_signal_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_signal, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_signal, signals, STRING, 0, "*,num_signals", NULL); + HDATA_VAR(struct t_hook_signal, num_signals, INTEGER, 0, NULL, NULL); + } + return hdata; +} + /* * Adds signal hook data in the infolist item. * diff --git a/src/core/hook/hook-signal.h b/src/core/hook/hook-signal.h index fc234d8c4..5ee37c4f2 100644 --- a/src/core/hook/hook-signal.h +++ b/src/core/hook/hook-signal.h @@ -53,6 +53,9 @@ extern void hook_signal_extract_flags (const char *signal, extern int hook_signal_send (const char *signal, const char *type_data, void *signal_data); extern void hook_signal_free_data (struct t_hook *hook); +extern struct t_hdata *hook_signal_hdata_hook_signal_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_signal_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_signal_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-timer.c b/src/core/hook/hook-timer.c index 05add6e27..55d821f4c 100644 --- a/src/core/hook/hook-timer.c +++ b/src/core/hook/hook-timer.c @@ -31,10 +31,12 @@ #include "../weechat.h" #include "../core-hook.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-util.h" #include "../../gui/gui-chat.h" +#include "../../plugins/plugin.h" time_t hook_last_system_time = 0; /* used to detect system clock skew */ @@ -372,6 +374,35 @@ hook_timer_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for timer hook. + */ + +struct t_hdata * +hook_timer_hdata_hook_timer_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_timer, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_timer, interval, LONG, 0, NULL, NULL); + HDATA_VAR(struct t_hook_timer, align_second, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_timer, remaining_calls, INTEGER, 0, NULL, NULL); + HDATA_VAR_NAME(struct t_hook_timer, last_exec.tv_sec, "last_exec", TIME, 0, NULL, NULL); + HDATA_VAR_NAME(struct t_hook_timer, last_exec.tv_usec, "last_exec_usec", LONG, 0, NULL, NULL); + HDATA_VAR_NAME(struct t_hook_timer, next_exec.tv_sec, "next_exec", TIME, 0, NULL, NULL); + HDATA_VAR_NAME(struct t_hook_timer, next_exec.tv_usec, "next_exec_usec", LONG, 0, NULL, NULL); + } + return hdata; +} + /* * Adds timer hook data in the infolist item. * diff --git a/src/core/hook/hook-timer.h b/src/core/hook/hook-timer.h index 14a3c3525..84d18b9ff 100644 --- a/src/core/hook/hook-timer.h +++ b/src/core/hook/hook-timer.h @@ -56,6 +56,9 @@ extern struct t_hook *hook_timer (struct t_weechat_plugin *plugin, extern int hook_timer_get_time_to_next (void); extern void hook_timer_exec (void); extern void hook_timer_free_data (struct t_hook *hook); +extern struct t_hdata *hook_timer_hdata_hook_timer_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_timer_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_timer_print_log (struct t_hook *hook); diff --git a/src/core/hook/hook-url.c b/src/core/hook/hook-url.c index 9a9bb0a14..018444c8a 100644 --- a/src/core/hook/hook-url.c +++ b/src/core/hook/hook-url.c @@ -35,8 +35,9 @@ #include #include "../weechat.h" -#include "../core-hashtable.h" #include "../core-hook.h" +#include "../core-hashtable.h" +#include "../core-hdata.h" #include "../core-infolist.h" #include "../core-log.h" #include "../core-string.h" @@ -398,6 +399,36 @@ hook_url_free_data (struct t_hook *hook) hook->hook_data = NULL; } +/* + * Returns hdata for url hook. + */ + +struct t_hdata * +hook_url_hdata_hook_url_cb (const void *pointer, void *data, + const char *hdata_name) +{ + struct t_hdata *hdata; + + /* make C compiler happy */ + (void) pointer; + (void) data; + + hdata = hdata_new (NULL, hdata_name, NULL, NULL, 0, 0, NULL, NULL); + if (hdata) + { + HDATA_VAR(struct t_hook_url, callback, POINTER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, url, STRING, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, options, HASHTABLE, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, timeout, LONG, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, thread_id, LONG, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, thread_created, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, thread_running, INTEGER, 0, NULL, NULL); + HDATA_VAR(struct t_hook_url, hook_timer, POINTER, 0, NULL, "hook"); + HDATA_VAR(struct t_hook_url, output, HASHTABLE, 0, NULL, NULL); + } + return hdata; +} + /* * Adds url hook data in the infolist item. * diff --git a/src/core/hook/hook-url.h b/src/core/hook/hook-url.h index 3876a4d43..b8fd8eefd 100644 --- a/src/core/hook/hook-url.h +++ b/src/core/hook/hook-url.h @@ -57,6 +57,9 @@ extern struct t_hook *hook_url (struct t_weechat_plugin *plugin, const void *callback_pointer, void *callback_data); extern void hook_url_free_data (struct t_hook *hook); +extern struct t_hdata *hook_url_hdata_hook_url_cb (const void *pointer, + void *data, + const char *hdata_name); extern int hook_url_add_to_infolist (struct t_infolist_item *item, struct t_hook *hook); extern void hook_url_print_log (struct t_hook *hook); diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 822e5e566..0366eb043 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -736,6 +736,46 @@ plugin_api_init (void) &gui_filter_hdata_filter_cb, NULL, NULL); hook_hdata (NULL, "history", N_("history of commands in buffer"), &gui_history_hdata_history_cb, NULL, NULL); + hook_hdata (NULL, "hook", N_("hook"), + &hook_hdata_hook_cb, NULL, NULL); + hook_hdata (NULL, "hook_command", N_("hook \"command\""), + &hook_command_hdata_hook_command_cb, NULL, NULL); + hook_hdata (NULL, "hook_command_run", N_("hook \"command_run\""), + &hook_command_run_hdata_hook_command_run_cb, NULL, NULL); + hook_hdata (NULL, "hook_completion", N_("hook \"completion\""), + &hook_completion_hdata_hook_completion_cb, NULL, NULL); + hook_hdata (NULL, "hook_config", N_("hook \"config\""), + &hook_config_hdata_hook_config_cb, NULL, NULL); + hook_hdata (NULL, "hook_connect", N_("hook \"connect\""), + &hook_connect_hdata_hook_connect_cb, NULL, NULL); + hook_hdata (NULL, "hook_fd", N_("hook \"fd\""), + &hook_fd_hdata_hook_fd_cb, NULL, NULL); + hook_hdata (NULL, "hook_focus", N_("hook \"focus\""), + &hook_focus_hdata_hook_focus_cb, NULL, NULL); + hook_hdata (NULL, "hook_hdata", N_("hook \"hdata\""), + &hook_hdata_hdata_hook_hdata_cb, NULL, NULL); + hook_hdata (NULL, "hook_hsignal", N_("hook \"hsignal\""), + &hook_hsignal_hdata_hook_hsignal_cb, NULL, NULL); + hook_hdata (NULL, "hook_info", N_("hook \"info\""), + &hook_info_hdata_hook_info_cb, NULL, NULL); + hook_hdata (NULL, "hook_info_hashtable", N_("hook \"info_hashtable\""), + &hook_info_hashtable_hdata_hook_info_hashtable_cb, NULL, NULL); + hook_hdata (NULL, "hook_infolist", N_("hook \"infolist\""), + &hook_infolist_hdata_hook_infolist_cb, NULL, NULL); + hook_hdata (NULL, "hook_line", N_("hook \"line\""), + &hook_line_hdata_hook_line_cb, NULL, NULL); + hook_hdata (NULL, "hook_modifier", N_("hook \"modifier\""), + &hook_modifier_hdata_hook_modifier_cb, NULL, NULL); + hook_hdata (NULL, "hook_print", N_("hook \"print\""), + &hook_print_hdata_hook_print_cb, NULL, NULL); + hook_hdata (NULL, "hook_process", N_("hook \"process\""), + &hook_process_hdata_hook_process_cb, NULL, NULL); + hook_hdata (NULL, "hook_signal", N_("hook \"signal\""), + &hook_signal_hdata_hook_signal_cb, NULL, NULL); + hook_hdata (NULL, "hook_timer", N_("hook \"timer\""), + &hook_timer_hdata_hook_timer_cb, NULL, NULL); + hook_hdata (NULL, "hook_url", N_("hook \"url\""), + &hook_url_hdata_hook_url_cb, NULL, NULL); hook_hdata (NULL, "hotlist", N_("hotlist"), &gui_hotlist_hdata_hotlist_cb, NULL, NULL); hook_hdata (NULL, "input_undo", N_("structure with undo for input line"),