[TextEditor_mcc] Re: Welcome!

  • From: Ilkka Lehtoranta <ilkleht@xxxxxxxxxxx>
  • To: texteditor_mcc@xxxxxxxxxxxxx
  • Date: Fri, 8 Apr 2005 04:20:23 +0300 (EEST)

On Fri, 8 Apr 2005, Jens Langner wrote:

> Hmm. I have to admit that I am not completly uptodate with how MorphOS is
> dealing with that all today. Back when I wrote SDI_hook.h together with Dirk
> Stoecker it was more or less the only way to do that.
> But please feel free to propose a change here. What exactly would you change
> in SDI_hook.h? Please show some examples prior to changing SDI_hook.h

From SDI_hook.h:

    #define MakeHook(hookname, funcname)                                     \
      } static const struct SDI_EmulLibEntry Gate_##hookname =               \
      {SDI_TRAP_LIB, 0, (void(*)()) funcname};                               \
      struct Hook hookname = {{NULL, NULL}, (HOOKFUNC)&Gate_##hookname,      \
      NULL, NULL}

This could be replaced by

  #define MakeHook(hookname, funcname) struct Hook hookname = {{NULL, NULL}, \
   (HOOKFUNC)HookEntry, (HOOKFUNC)funcname, NULL}

and HOOKPROTO macro could be simply:
  #define HOOKPROTO(name, ret, obj, param) static SAVEDS ASM ret             \
    name(REG(a0, struct Hook *hook), REG(a2, obj), REG(a1, param))


This makes a hook work like it works on OS4 - parameters are placed in PPC 
regs using SysV ABI convention and hook doesnt need manual gating.

Probably this wasnt implemented in early versions and was overlooked since 
then. I will write new SDI_hook.h tomorrow and post it to this list for 
review.

> Until that, I would better propose to revert the MakeHookWithData() stuff
> Sebastian changed in SDI_hook.h. I guess he just missed that this
> MakeHook()/MakeStaticHook() are only allowed directly after the closing
> braces after a HOOKPROTO() definition. The current scheme doesn't allow to
> have two MakeHook() followed each other.
> 
> So, either we revert the stuff or we copy&paste the export hooks and make
> two out of them with removing the TRUE/FALSE h_Data alteration. Perhaps
> probably that would be even better than reverting sebastian's change as we
> would anyway change the ExportHook sooner or later.
> 
> Opinions?

Both are unproductive options. Better just update SDI_hook.h and it works 
again.


  Ilkka

-- 
www.morphos.de

_____________________________________________________________________________
TextEditor ML   - //www.freelists.org/list/texteditor_mcc
Listserver help - mailto:texteditor_mcc-request@xxxxxxxxxxxxx?Subject=HELP
Bugtracker......: http://sourceforge.net/tracker/?atid=731469&group_id=135025

Other related posts: