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:
Dave Beazley 2002-11-30 22:01:28 +00:00
commit 516036631c
1508 changed files with 125983 additions and 44037 deletions

View file

@ -0,0 +1,4 @@
#! /bin/sh -e
${SWIG:=swig} -php4 -phpfull -c++ -withcxx example.cxx example.i
phpize && ./configure && make clean && make

View 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

View 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);
};

View file

@ -0,0 +1,9 @@
extern char *s;
extern int x;
class Sync {
public:
int x;
char *s;
void printer(void);
};

View file

@ -0,0 +1,7 @@
%module example
%{
#include "example.h"
%}
%include "example.h"

View 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();
?>