Re: How to get a string from C library into PHP via SWIG?
| From: | Eric Fowler | Date: | Tue, 05 Jan 2010 23:38:35 +0000 |
| Subject: | Re: How to get a string from C library into PHP via SWIG? | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300837@lists.php.net to get a copy of this message | ||
A little more information: my crashes all relate to handling the char
datatype. Floats and ints are happy.
I suspect that a char type in PHP is not the same as a char type in C.
But I am not sure at all.
More recently I have used cmalloc.i to allocate arrays of chars and
floats. The floats are happy, the chars crash upon allocation.
Weird.
Eric
On Tue, Jan 5, 2010 at 2:56 PM, Nathan Nobbe <quickshiftin@gmail.com> wrote:
> On Tue, Jan 5, 2010 at 3:42 PM, Eric Fowler <eric.fowler@gmail.com> wrote:
>>
>> Hm, that could work, but it does produce overhead.
>
> you should consider your overall communication paradigm. im very loosely
> familiar w/ swig, basically ive heard of it ...
> anyways, you have a few options for communication,
> . shell (call php from C or the other way around)
> . php extension, this may not make sense depending on what your C is doing
> and is by far the most complex
> . network protocol, socket, http or other..
> can you tell us a little bit more about what youre trying to accomplish and
> specifically how C and php are communicating in general in your application?
> -nathan