Use of Hooks and Extended Hook structures...

This forum is for general developer support questions.
Post Reply
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Use of Hooks and Extended Hook structures...

Post by Belxjander »

Are there any limitations of scope when using CallHookPkt() from Utility.Library,

Or as long as there is a Valid Hook structure given the Object and Method Pointers provided to the hook in question may be formated
in any way seen fit by the individual developer using it?

I'm currently working on the expansion of Languages which register with perception.library for IME support in Keyboard Input Post-Entry-Edit-Conversion based on a custom Tree expansion from Conversion Tables.

If anyone can help with the logical end of the coding and verification if would be appreciated, I don't expect anyone else to do the hard-slog bookwork I am stuck with for the full scale conversion data-set which requires a lot of manual labour and verification.
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Use of Hooks and Extended Hook structures...

Post by thomasrapp »

IMHO CallHookPkt(hook,obj,msg) does nothing more than to call hook->h_Entry(hook,obj,msg). All other fields and extensions are for use by the programmer. I am unsure however about the h_MinNode field. You should leave it for system use IMHO.
Belxjander
Posts: 314
Joined: Mon May 14, 2012 10:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Use of Hooks and Extended Hook structures...

Post by Belxjander »

thomasrapp wrote:IMHO CallHookPkt(hook,obj,msg) does nothing more than to call hook->h_Entry(hook,obj,msg). All other fields and extensions are for use by the programmer. I am unsure however about the h_MinNode field. You should leave it for system use IMHO.
The only field I am looking at using is h_Data and using it as an embedded system structure within nodes of a private list.

I'm using the extended struct LanguageContext { struct Semaphore LockNode; struct Hook Hook; APTR UtilityLib; ...}; and expanding from it using TagItem arrays.

Is there any possible catch-22 I have missed here?

P.S. The "LanguageContext" in this usage is 100% undefined in the current project sources due to overload reuse of an equivalent structure.
I have no source issues or errors in any related code as the structure is used internally by the IME with only TagItem access mappings publicly defined for access
User avatar
thomasrapp
Posts: 310
Joined: Sat Jun 18, 2011 11:22 pm

Re: Use of Hooks and Extended Hook structures...

Post by thomasrapp »

The h_Data field is completely free for your use. Ususally it is used to supply additional data to the h_Entry routine which does not fit into obj or msg.
Post Reply