[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Weechat-dev] description about hook_process in WeeChat plugin API r
From: |
Sébastien Helleu |
Subject: |
Re: [Weechat-dev] description about hook_process in WeeChat plugin API reference |
Date: |
Sat, 23 Apr 2016 20:56:55 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sun, Apr 24, 2016 at 02:29:20AM +0900, AYANOKOUZI, Ryuunosuke wrote:
> Dear all,
>
> Recently, 'hook_process' API function was updated[1]
> and become possible to hook internal function also.
>
> I have a question about C and Script (Python) API for 'hook_process'.
>
> 1. For C API case, If 'const char *command' is set "func:get_status",
> function 'get_status' is NEVER called by both parent and child process.
> 2. For Python API case, If 'command' is set "func:get_status",
> function 'get_status' IS called by child process.
> Is my understanding correct?
>
> [1]
> https://github.com/weechat/weechat/commit/51c3e0b9ec7ff5720d860168b7a5d60fb69226b8
>
> I am awaiting your reply.
>
> Sincerely yours,
> Ryuunosuke Ayanokouzi
> --
> AYANOKOUZI, Ryuunosuke <address@hidden>
Hi,
Yes, in C API, the callback (of hook_process) is called in the child process,
and then this callback can do anything with the command received (which is
"func:name"). So the function name is not really used (the callback can use it
if needed).
The behavior is different in scripting API, the callback is called too, and this
callback runs the function after "func:", so the callback is called only one
time in script, after the call to function in child.
--
Sébastien Helleu
web: weechat.org / flashtux.org
irc: FlashCode @ irc.freenode.net
signature.asc
Description: Digital signature