[gmpi] Re: low level API

  • From: jeffmcc@xxxxxxxxxx
  • To: gmpi@xxxxxxxxxxxxx
  • Date: Wed, 02 Feb 2005 10:29:23 +1300

> Also on Mac OS X the C pointer functions are used when
> crossing CFM/PEF  and Mach-O boundaries. And maybe later

The convention with a dispatcher is to pass the object
pointer as the first argument...

void dispatcher( void *object_ptr, ....

...so, although that's plain C code, it's also the same
signature as C++ (standard calling convention) where the
'this' pointer is secretly passed as the first argument.

so, a clever plugin can 'cheat' and treat the call as C++. 
You get the portability of plain C, but no performance
penalty when talking to a C++ plugin.

The advantage of a dispatcher is you can extend the API by
adding new opcodes, you don't change the binary interface,
makes backward/forward compatibilty very easy.


>
> On 1.2.2005, at 21:26, Ron Kuper wrote:
>
> >>>>
> > Even those things are very fundamental.  A dispatcher
> > based API has merits, but might not work.  An object API
> > has merits, but is notoriously fugly in C.
> > <<<
> >
> > I would like to see a dispatcher based API (for
> > retaining the requirement of C ABI), but have it
> > immediately drop into a C++ object heirarchy.  Not that
> > I want to emulate it necessary, but MFC does this in
> bridging Win32 messaging with a class library.
>
> Also on Mac OS X the C pointer functions are used when
> crossing CFM/PEF  and Mach-O boundaries. And maybe later
> will be used again when running  up to another new binary
> object model.
>
> PM
>
>
> ----------------------------------------------------------
> ------------ Generalized Music Plugin Interface (GMPI)
> public discussion list Participation in this list is
> contingent upon your abiding by the following rules:
> Please stay on topic.  You are responsible for your own
> words.  Please respect your fellow subscribers.  Please do
> not redistribute anyone else's words without their
> permission.
>
> Archive: //www.freelists.org/archives/gmpi
> Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe"
> to unsubscribe
>

----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules:  Please stay on topic.  You are responsible for your own
words.  Please respect your fellow subscribers.  Please do not
redistribute anyone else's words without their permission.

Archive: //www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe

Other related posts: