Re: Passing C Style Function Callbacks in Cocoa
Re: Passing C Style Function Callbacks in Cocoa
- Subject: Re: Passing C Style Function Callbacks in Cocoa
- From: Fritz Anderson <email@hidden>
- Date: Mon, 12 Apr 2004 10:17:51 -0500
It does not appear you could just add a pointer to the TMioDin struct.
My reading of your third-party's header is that the structure they give
for it is a dummy, standing in for a longer, proprietary structure,
which they allocate and initialize with TMioDin_Create().
-- F
On 11 Apr 2004, at 11:04 AM, Vince Ackerman wrote:
On Apr 9, 2004, at 09:19, Fritz Anderson wrote:
1. Does the TMioDin struct contain a void * or long integer labelled
as a "user," "client," or "reference" value? That would be space in
the struct set aside for your use, and you could use it to store the
pointer to your associated object.
That's a possibility.... here's some of the 3rd party's header for
one of the usb devices I'm trying to communicate with. The TMioDin is
a struct with only one member. Could I add a pointer to the struct
with out screwing something up further downline? Most of the callbacks
in all of the devices have this same sort of struct. The TMioDin is
initialized by calling the create function with the handle to a
TMioDin, which is used by all the functions in their libraries to
comunicate with the device.
/**
TeleoMioDin reference structure.
This structure exists to permit type safety
for users of the device without
exposing the internals to all callers.
*/
typedef struct
{
uint8 tag;
} TMioDin;
/** Create a TMioDin.
\param tdm TeleoDeviceManager reference
\param address module address (or 0 if don't care)
\param dinDeviceIndex Din device on the MultiIO (0 - 3)
\param bound is the module specified already bound?
\param tmdin a variable to hold the new device
\return TELEO_OK (0) or an error value
*/
TeleoError TMioDin_Create( TeleoDeviceManager* tdm, cchar* address,
uint8 dinDeviceIndex, bool* bound, TMioDin** tmdin );
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.