Merged with recent changes from trunk.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2008-maciekd@11187 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Maciej Drwal 2009-04-11 16:46:47 +00:00
commit 8c74fa0f46
703 changed files with 21126 additions and 9266 deletions

View file

@ -0,0 +1,24 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
LIBS =
SWIGOPT =
all::
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -0,0 +1,13 @@
#include "example.h"
#include <stdio.h>
int x = 42;
char *s = (char *)"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();
?>