Hi,
you should be able to put a pointer in the structure in the .h
file. Then in your .m file define another structure with all your
objc/cocoa specific parts.
Then you might need to typedef yourstuff to void *. Then just cast
to and from the void * to your mac specific structure. That way the
C code doesn't need to know about the objc structures.
eg. in the camera.h
typedef struct {
PyObject_HEAD
char* device_name; // unieke name of the device
long size; // size of the image in our
buffer to draw
void * apple_junk;
SDL_Surface* surf;
unsigned char *pbuffer;
unsigned char *buffer;
} PyCameraObject;
Then have your struct defined in your camera_mac.m something like
this:
typedef struct {
TimeScale timeScale;
TimeValue lastTime;
NSTimeInterval startTime;
NSTimer *frameTimer;
SeqGrabComponent component; // A type used by the Sequence
Grabber API
SGChannel channel; // Channel of the Sequence Grabber
GWorldPtr gWorld; // Pointer to the struct that
holds the data of the captured image
Rect boundsRect; // bounds of the image frame
ImageSequence decompressionSequence;
} AppleJunk;
Then you'll need to allocate some room for that, and also dealloc
it. Probably with some functions defined in your .m too that get
called from the camera_dealloc, and Camera (...) functions in the
_camera.c.
AppleJunk myapplejunk = (AppleJunk)(cameraobj->apple_junk);
cameraobj.apple_junk = (void *) malloc(sizeof(AppleJunk));
free(cameraobj.apple_junk);
etc.
Hope that helps.
cu,