Re: How to get a string from C library into PHP via SWIG?

From: Date: Tue, 05 Jan 2010 23:14:01 +0000
Subject: Re: How to get a string from C library into PHP via SWIG?
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-300835@lists.php.net to get a copy of this message
On Tue, Jan 5, 2010 at 4:05 PM, Eric Fowler <eric.fowler@gmail.com> wrote: > I have a software library that parses strings into a C language > structure. It is a utility for C programmers. > > It contains a utility function that takes the output structure and > formats it as a string for display. > > The goal is to demonstrate the functionality by permitting users to > enter strings into a text box and press a button. > The string will be passed into my code, parsed, formatted as a > different kind of string, and returned, where it will be > displayed on the web site. > > The code is being shipped as a Windows DLL but for the web site I am > working with Linux dynamic libraries (*.so). > I am able to call functions within the binary from PHP now, but > pointers within PHP are not working far less crossing the > PHP/C Line Of Death without dying. > > Eric please keep the responses on list for the benefit of others. well, if you have an .so, honestly i might spend the effort to wrap it up in a simple extension. > but if you want to roll something out quickly, i would probly just invoke it over the shell via shell_exec() or similar. > i cant imagine what sort of noticeable impact you would see in performance going over the shell in this case. honestly, i think the question is how much work do you want to do. also, do you intend to share this functionality w/ other php programers, that might be an argument for an extension. do you already have a C based program that loads up the library from the cli and uses STDIN / STDOUT, if so i think going over the shell is a no-brainer.. -nathan

« previous php.general (#300835) next »