[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Passing pointers from mex->octave->mex
From: |
Michael Goffioul |
Subject: |
Re: Passing pointers from mex->octave->mex |
Date: |
Thu, 13 Oct 2011 13:58:28 +0100 |
On Thu, Oct 13, 2011 at 1:39 PM, José Vallet <address@hidden> wrote:
> Hello.
>
> I have a C library with which I can create and manipulate some structures.
> What I would like to do (from octave):
>
> 1 - Call the C function that creates the structure, and somehow store a
> pointer to the structure for later use.
> 2 - Do some other things
> 3 - Call another C function from the library that will manipulate the
> created structure. Therefore I need to pass the pointer to the structure
>
> How to make octave to store a pointer to a structure created in a mex file
> and how to pass that pointer to another mex file?
I had to solve a similar problem and simply stored pointers as uint32
or uint64 in octave (depending on the architecture). Then the C code
does conversion to/from actual pointers. Not very elegant, but it works.
There's some discussion about having a proper pointer type in octave,
but that won't help in real MEX files; this would only be available in
OCT files.
Michael.