The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6fcc22a1f8
commit
516036631c
1508 changed files with 125983 additions and 44037 deletions
4
SWIG/Examples/php4/sync/BUILD.sh
Executable file
4
SWIG/Examples/php4/sync/BUILD.sh
Executable file
|
|
@ -0,0 +1,4 @@
|
|||
#! /bin/sh -e
|
||||
|
||||
${SWIG:=swig} -php4 -phpfull -c++ -withcxx example.cxx example.i
|
||||
phpize && ./configure && make clean && make
|
||||
15
SWIG/Examples/php4/sync/Makefile.old
Normal file
15
SWIG/Examples/php4/sync/Makefile.old
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
TOP = ../..
|
||||
SWIG = $(TOP)/../swig
|
||||
CXXSRCS = example.cxx
|
||||
TARGET = libexample
|
||||
INTERFACE = example.i
|
||||
SWIGOPT = -noproxy
|
||||
|
||||
all::
|
||||
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
|
||||
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' php4_cpp
|
||||
|
||||
clean::
|
||||
rm -f *_wrap* *.o core *~ *.so *.php php_example.h
|
||||
|
||||
check: all
|
||||
13
SWIG/Examples/php4/sync/example.cxx
Normal file
13
SWIG/Examples/php4/sync/example.cxx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#include "example.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int x = 42;
|
||||
char *s = "Test";
|
||||
|
||||
void Sync::printer(void) {
|
||||
|
||||
printf("The value of global s is %s\n", s);
|
||||
printf("The value of global x is %d\n", x);
|
||||
printf("The value of class s is %s\n", s);
|
||||
printf("The value of class x is %d\n", x);
|
||||
};
|
||||
9
SWIG/Examples/php4/sync/example.h
Normal file
9
SWIG/Examples/php4/sync/example.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
extern char *s;
|
||||
extern int x;
|
||||
|
||||
class Sync {
|
||||
public:
|
||||
int x;
|
||||
char *s;
|
||||
void printer(void);
|
||||
};
|
||||
7
SWIG/Examples/php4/sync/example.i
Normal file
7
SWIG/Examples/php4/sync/example.i
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%module example
|
||||
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
||||
%include "example.h"
|
||||
15
SWIG/Examples/php4/sync/runme.php4
Normal file
15
SWIG/Examples/php4/sync/runme.php4
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?
|
||||
|
||||
// Load module and PHP classes.
|
||||
include("example.php");
|
||||
|
||||
echo "Got new object\n";
|
||||
echo "Got string $s and value $x \n";
|
||||
|
||||
$s = new Sync();
|
||||
echo "Got new object\n";
|
||||
|
||||
$s->printer();
|
||||
|
||||
?>
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue