Merge branch 'master' into doxygen

Merge with ~3.0.1 sources from master.
This commit is contained in:
Vadim Zeitlin 2014-04-30 18:37:57 +02:00
commit 1ebd2334b8
1593 changed files with 51732 additions and 28076 deletions

View file

@ -4,19 +4,18 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
LIBS = -lm
SWIGOPT =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -1,5 +1,5 @@
# see top-level Makefile.in
# (see also top-level configure.in kludge)
# (see also top-level configure.ac kludge)
callback
class
constants

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -1,14 +1,7 @@
/* File : example.c */
/* File : example.cxx */
#include "example.h"
#include <math.h>
#ifndef M_PI
# define M_PI 3.14159265358979323846
#endif
int Shape::get_nshapes() {
return nshapes;
}
#define M_PI 3.14159265358979323846
/* Move the shape to a new location */
void Shape::move(double dx, double dy) {
@ -18,22 +11,18 @@ void Shape::move(double dx, double dy) {
int Shape::nshapes = 0;
void Circle::set_radius( double r ) {
radius = r;
}
double Circle::area(void) {
double Circle::area() {
return M_PI*radius*radius;
}
double Circle::perimeter(void) {
double Circle::perimeter() {
return 2*M_PI*radius;
}
double Square::area(void) {
double Square::area() {
return width*width;
}
double Square::perimeter(void) {
double Square::perimeter() {
return 4*width;
}

View file

@ -10,10 +10,9 @@ public:
}
double x, y;
void move(double dx, double dy);
virtual double area(void) = 0;
virtual double perimeter(void) = 0;
virtual double area() = 0;
virtual double perimeter() = 0;
static int nshapes;
static int get_nshapes();
};
class Circle : public Shape {
@ -21,10 +20,8 @@ private:
double radius;
public:
Circle(double r) : radius(r) { }
~Circle() { }
void set_radius( double r );
virtual double area(void);
virtual double perimeter(void);
virtual double area();
virtual double perimeter();
};
class Square : public Shape {
@ -32,7 +29,6 @@ private:
double width;
public:
Square(double w) : width(w) { }
~Square() { }
virtual double area(void);
virtual double perimeter(void);
virtual double area();
virtual double perimeter();
};

View file

@ -7,4 +7,3 @@
/* Let's just grab the original header file here */
%include "example.h"

View file

@ -14,7 +14,7 @@ print " Created square\n";
# ----- Access a static member -----
print "\nA total of " . Shape::get_nshapes() . " shapes were created\n";
print "\nA total of " . Shape::nshapes() . " shapes were created\n";
# ----- Member data access -----
@ -54,7 +54,7 @@ $s = NULL;
# the square.
$o = NULL;
print Shape::get_nshapes() . " shapes remain\n";
print Shape::nshapes() . " shapes remain\n";
print "Goodbye\n";
?>

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -1,6 +1,6 @@
/* File : example.c */
void add(double *x, double *y, double *result) {
void add(int *x, int *y, int *result) {
*result = *x + *y;
}

View file

@ -1,6 +1,11 @@
/* File : example.i */
%module example
%{
extern void add(int *, int *, int *);
extern void sub(int *, int *, int *);
%}
/* This example illustrates a couple of different techniques
for manipulating C pointers */

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT = -noproxy
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -4,19 +4,18 @@ CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
LIBS = -lm
SWIGOPT =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile $(SWIGLIB) CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -1,6 +1,12 @@
/* File : example.i */
%module example
%{
extern void add(double *, double *, double *);
extern void sub(int *, int *, int *);
extern int divide(int, int, int *);
%}
/* This example illustrates a couple of different techniques
for manipulating C pointers */

View file

@ -15,7 +15,7 @@
print " c = $c\n";
# Call the add() function wuth some pointers
add(&$a,&$b,&$c);
add($a,$b,$c);
print " $a + $b = $c\n";

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

0
Examples/php/pragmas/runme.php Executable file → Normal file
View file

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -1,10 +1,8 @@
/* File : example.i */
%module example
%{
extern double Foo;
%}
%inline %{
extern int gcd(int x, int y);
extern double Foo;
void print_Foo();
int gcd(int x, int y);
%}

0
Examples/php/simple/runme.php Executable file → Normal file
View file

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php_cpp
static::
static:
$(MAKE) -f $(TOP)/Makefile CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_cpp_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT = -noproxy
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -6,19 +6,18 @@ INTERFACE = example.i
LIBS =
SWIGOPT =
all::
check: build
$(MAKE) -f $(TOP)/Makefile php_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' \
php
static::
static:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SWIG='$(SWIG)' \
SWIGOPT='$(SWIGOPT)' TARGET='myphp' INTERFACE='$(INTERFACE)' \
php_static
clean::
clean:
$(MAKE) -f $(TOP)/Makefile php_clean
rm -f $(TARGET).php
check: all
$(MAKE) -f $(TOP)/Makefile php_run

View file

@ -51,7 +51,7 @@ void print_vars() {
printf("dvar = %g\n", dvar);
printf("cvar = %c\n", cvar);
printf("strvar = %s\n", strvar ? strvar : "(null)");
printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)");
printf("cstrvar = %s\n", cstrvar);
printf("iptrvar = %p\n", iptrvar);
printf("name = %c%c%c%c%c\n", name[0],name[1],name[2],name[3],name[4]);
printf("ptptr = %p %s\n", ptptr, Point_print( ptptr ) );