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 <[email protected]>
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
_______________________________________________ Weechat-dev mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/weechat-dev
