Another merge with master.

Change Doxygen error codes to start at 740 instead of at 720 as the latter was
taken by Scilab in the meanwhile.

Resolve conflicts in autodoc_runme.py once again.
This commit is contained in:
Vadim Zeitlin 2015-02-16 23:46:39 +01:00
commit 300ccce46c
419 changed files with 18675 additions and 1315 deletions

View file

@ -485,11 +485,10 @@ guile: $(SRCDIR_SRCS)
$(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ISRCS) $(SRCDIR_SRCS)
$(LDSHARED) $(CFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
guile_cpp: $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
$(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO): $(SRCDIR_SRCS)
guile_cpp: $(SRCDIR_SRCS)
$(SWIG) -c++ -guile -Linkage passive $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
$(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(INCLUDES) $(GUILE_CFLAGS) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
$(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) $(CPP_DLLIBS) -o $@
$(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(OBJS) $(IOBJS) $(GUILE_LIBS) $(LIBS) $(CPP_DLLIBS) -o $(GUILE_LIBPREFIX)$(TARGET)$(GUILE_SO)
guile_externalhdr:
$(SWIG) -guile -external-runtime $(TARGET)
@ -596,7 +595,7 @@ java_cpp: $(SRCDIR_SRCS)
# ----------------------------------------------------------------
java_compile: $(SRCDIR_SRCS)
$(COMPILETOOL) $(JAVAC) $(JAVACFLAGS) $(addprefix $(SRCDIR),$(JAVASRCS))
$(COMPILETOOL) $(JAVAC) $(addprefix $(SRCDIR),$(JAVASRCS))
# -----------------------------------------------------------------
# Run java example
@ -633,9 +632,6 @@ java_clean:
ROOT_DIR = @ROOT_DIR@
JSINCLUDES = @JSCOREINC@ @JSV8INC@
JSDYNAMICLINKING = @JSCOREDYNAMICLINKING@ @JSV8DYNAMICLINKING@
JSSO =@JSSO@
JSLDSHARED = @JSLDSHARED@
JSCXXSHARED = @JSCXXSHARED@
NODEJS = @NODEJS@
NODEGYP = @NODEGYP@
@ -731,7 +727,7 @@ javascript_clean:
rm -rf build
rm -f *_wrap* $(RUNME)
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@JSSO@ *.$(SO)
rm -f *.@OBJEXT@ *@SO@
rm -f binding.gyp example-gypcopy.cxx
cd $(ROOT_DIR)/Tools/javascript && $(MAKE) -s clean
@ -1096,7 +1092,7 @@ ruby_version:
# -----------------------------------------------------------------
ruby_clean:
rm -f *_wrap* *~ .~* myruby@EXEEXT@ *.pm
rm -f *_wrap* *~ .~* myruby@EXEEXT@
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *$(RUBY_SO)
@ -1668,7 +1664,6 @@ endif
# ----------------------------------------------------------------
# Build a R dynamically loadable module (C++)
# ----------------------------------------------------------------
r_cpp: $(SRCDIR_CXXSRCS)
$(SWIG) -c++ -r $(SWIGOPT) -o $(RCXXSRCS) $(INTERFACEPATH)
ifneq ($(SRCDIR_CXXSRCS),)
@ -1700,6 +1695,57 @@ r_clean:
rm -f *.@OBJEXT@ *@SO@ NAMESPACE
rm -f $(RRSRC) $(RUNME).Rout .RData
##################################################################
##### SCILAB ######
##################################################################
SCILAB = @SCILAB@
SCILAB_INC= @SCILABINCLUDE@
SCILAB_OPT = @SCILABOPT@
SCILAB_LIBPREFIX = lib
# ----------------------------------------------------------------
# Build a C dynamically loadable module
# ----------------------------------------------------------------
scilab:
$(SWIG) -scilab $(SWIGOPT) -o $(ISRCS) $(INTERFACEPATH)
$(CC) -c $(CCSHARED) $(CPPFLAGS) $(CFLAGS) $(SCILAB_INC) $(INCLUDES) $(ISRCS) $(SRCDIR_SRCS) $(SRCDIR_CSRCS)
$(LDSHARED) $(CFLAGS) $(LDFLAGS) $(IOBJS) $(OBJS) $(LIBS) -o $(SCILAB_LIBPREFIX)$(TARGET)$(SO)
# ----------------------------------------------------------------
# Build a C++ dynamically loadable module
# ----------------------------------------------------------------
scilab_cpp:
$(SWIG) -c++ -scilab $(SWIGOPT) -o $(ICXXSRCS) $(INTERFACEPATH)
$(CXX) -c $(CCSHARED) $(CPPFLAGS) $(CXXFLAGS) $(SCILAB_INC) $(INCLUDES) $(ICXXSRCS) $(SRCDIR_SRCS) $(SRCDIR_CXXSRCS)
$(CXXSHARED) $(CXXFLAGS) $(LDFLAGS) $(IOBJS) $(OBJS) $(LIBS) $(CPP_DLLIBS) -o $(SCILAB_LIBPREFIX)$(TARGET)$(SO)
# -----------------------------------------------------------------
# Running a Scilab example
# -----------------------------------------------------------------
scilab_run:
env LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH $(RUNTOOL) $(SCILAB) $(SCILAB_OPT) -f $(SRCDIR)$(RUNME).sci $(RUNPIPE)
# -----------------------------------------------------------------
# Scilab version
# -----------------------------------------------------------------
scilab_version:
echo `$(SCILAB) -version | head -1`
# -----------------------------------------------------------------
# Cleaning the scilab examples
# -----------------------------------------------------------------
scilab_clean:
rm -f *_wrap* *~ .~*
rm -f core @EXTRA_CLEAN@
rm -f *.@OBJEXT@ *@SO@
rm -f *.sce
##################################################################
##### Go ######
##################################################################

View file

@ -29,9 +29,15 @@ EXTRA_CXXFLAGS =
EXTRA_LDFLAGS =
TARGET = example_wrap
SWIGOPT = -outcurrentdir
DSRCS = *.d
DFLAGS = -ofrunme
ifeq (,$(SRCDIR))
DSRCS = *.d
else
DSRCS = *.d $(addprefix ../$(SRCDIR)$(VERSION_DIR),runme.d)
endif
check: build
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' d_run
@ -44,7 +50,10 @@ build:
else \
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' EXTRA_CFLAGS='$(EXTRA_CFLAGS)' EXTRA_LDFLAGS='$(EXTRA_LDFLAGS)' SWIG='$(SWIG)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' INTERFACE='example.i' SRCS='' d; \
fi
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' DSRCS='../$(SRCDIR)$(VERSION_DIR)runme.d $(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' DSRCS='$(DSRCS)' DFLAGS='$(DFLAGS)' d_compile
clean:
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' d_clean
if [ -d $(VERSION_DIR) ]; then \
$(MAKE) -C $(VERSION_DIR) -f $(EXAMPLES_TOP)/Makefile SRCDIR='../$(SRCDIR)' d_clean; \
fi
test -f $(VERSION_DIR)runme.d || rm -rf $(VERSION_DIR) # Only delete dir if out of source

View file

@ -0,0 +1,16 @@
# see top-level Makefile.in
class
constants
contract
enum
funcptr
matrix
matrix2
pointer
simple
std_list
std_vector
struct
template
variables

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,28 @@
/* File : example.cxx */
#include "example.h"
#define M_PI 3.14159265358979323846
/* Move the shape to a new location */
void Shape::move(double dx, double dy) {
x += dx;
y += dy;
}
int Shape::nshapes = 0;
double Circle::area() {
return M_PI*radius*radius;
}
double Circle::perimeter() {
return 2*M_PI*radius;
}
double Square::area() {
return width*width;
}
double Square::perimeter() {
return 4*width;
}

View file

@ -0,0 +1,34 @@
/* File : example.h */
class Shape {
public:
Shape() {
nshapes++;
}
virtual ~Shape() {
nshapes--;
}
double x, y;
void move(double dx, double dy);
virtual double area() = 0;
virtual double perimeter() = 0;
static int nshapes;
};
class Circle : public Shape {
private:
double radius;
public:
Circle(double r) : radius(r) { }
virtual double area();
virtual double perimeter();
};
class Square : public Shape {
private:
double width;
public:
Square(double w) : width(w) { }
virtual double area();
virtual double perimeter();
};

View file

@ -0,0 +1,9 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
/* Let's just grab the original header file here */
%include "example.h"

View file

@ -0,0 +1,52 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// ----- Object creation -----
printf("Creating some objects:\n");
c = new_Circle(10)
s = new_Square(10)
// ----- Access a static member -----
printf("\nA total of %i shapes were created\n", Shape_nshapes_get());
// ----- Member data access -----
// Set the location of the object
Shape_x_set(c, 20);
Shape_y_set(c, 30);
Shape_x_set(s, -10);
Shape_y_set(s, 5);
printf("\nHere is their current position:\n");
printf(" Circle = (%f, %f)\n", Shape_x_get(c), Shape_y_get(c));
printf(" Square = (%f, %f)\n", Shape_x_get(s), Shape_y_get(s));
// ----- Call some methods -----
printf("\nHere are some properties of the shapes:\n");
function print_shape(o)
printf(" area = %f\n", Shape_area(o));
printf(" perimeter = %f\n", Shape_perimeter(o));
endfunction
print_shape(c);
print_shape(s);
printf("\nGuess I will clean up now\n");
// Note: this invokes the virtual destructor
delete_Circle(c);
delete_Square(s);
printf("%i shapes remain\n", Shape_nshapes_get());
printf("Goodbye\n");
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS =
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,30 @@
/* File : example.i */
%module example
/* Wraps enums and constants as Scilab variables (instead of functions) */
%scilabconst(1);
/* A few preprocessor macros */
#define ICONST 42
#define FCONST 2.1828
#define CCONST 'x'
#define CCONST2 '\n'
#define SCONST "Hello World"
#define SCONST2 "\"Hello World\""
/* This should work just fine */
#define EXPR ICONST + 3*(FCONST)
/* This shouldn't do anything */
#define EXTERN extern
/* Neither should this (BAR isn't defined) */
#define FOO (ICONST + BAR)
/* The following directives also produce constants */
%constant int iconst = 37;
%constant double fconst = 3.14;

View file

@ -0,0 +1,18 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
example_Init();
printf("\nTest constants\n");
printf("ICONST = %i (should be 42)\n", ICONST);
printf("FCONST = %5.4f (should be 2.1828)\n", FCONST);
printf("SCONST = ''%s'' (should be ''Hello World'')\n", SCONST);
printf("EXPR = %5.4f (should be 48.5484)\n", EXPR);
printf("iconst = %i (should be 37)\n", iconst);
printf("fconst = %3.2f (should be 3.14)\n", fconst);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,23 @@
/* File : example.c */
/* A global variable */
double Foo = 3.0;
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {
int g;
g = y;
while (x > 0) {
g = x;
x = y % x;
y = g;
}
return g;
}
int fact(int n) {
if (n <= 0) return 1;
return n*fact(n-1);
}

View file

@ -0,0 +1,21 @@
/* File : example.i */
%module example
%contract gcd(int x, int y) {
require:
x >= 0;
y >= 0;
}
%contract fact(int n) {
require:
n >= 0;
ensure:
fact >= 1;
}
%inline %{
extern int gcd(int x, int y);
extern int fact(int n);
extern double Foo;
%}

View file

@ -0,0 +1,46 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// Call our gcd() function
x = 42;
y = 105;
g = gcd(x, y);
printf("The gcd of %d and %d is %d\n", x, y, g);
// Call our fact() function
x = 5;
g = fact(x);
printf("The fact of %d is %d\n", x, g);
// Manipulate the Foo global variable
// Output its current value
printf("Foo = %f\n", Foo_get());
// Change its value
Foo_set(3.1415926);
// See if the change took effect
printf("Foo = %f\n", Foo_get());
// Check error messages when violating contract
ierr = execstr('gcd(-42, 105)', 'errcatch');
if ierr <> 20003 then
error("gcd(-42, 105) must provoke a RunTimeError")
end
ierr = execstr('fact(-4)', 'errcatch');
if ierr <> 20003 then
error("fact(-4) must provoke a RunTimeError")
end
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,37 @@
/* File : example.c */
#include "example.h"
#include <stdio.h>
void Foo::enum_test(speed s) {
if (s == IMPULSE) {
printf("IMPULSE speed\n");
} else if (s == WARP) {
printf("WARP speed\n");
} else if (s == LUDICROUS) {
printf("LUDICROUS speed\n");
} else {
printf("Unknown speed\n");
}
}
void enum_test(color c, Foo::speed s) {
if (c == RED) {
printf("color = RED, ");
} else if (c == BLUE) {
printf("color = BLUE, ");
} else if (c == GREEN) {
printf("color = GREEN, ");
} else {
printf("color = Unknown color!, ");
}
if (s == Foo::IMPULSE) {
printf("speed = IMPULSE speed\n");
} else if (s == Foo::WARP) {
printf("speed = WARP speed\n");
} else if (s == Foo::LUDICROUS) {
printf("speed = LUDICROUS speed\n");
} else {
printf("speed = Unknown speed!\n");
}
}

View file

@ -0,0 +1,13 @@
/* File : example.h */
enum color { RED, BLUE, GREEN };
class Foo {
public:
Foo() { }
enum speed { IMPULSE, WARP, LUDICROUS };
void enum_test(speed s);
};
void enum_test(color c, Foo::speed s);

View file

@ -0,0 +1,10 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
%include "example.h"

View file

@ -0,0 +1,36 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
example_Init();
printf("\nTest enums\n");
printf("*** color ***\n");
printf(" RED_get() = %i\n", RED_get());
printf(" BLUE_get() = %i\n", BLUE_get());
printf(" GREEN_get() = %i\n", GREEN_get());
printf("\n*** Foo::speed ***\n")
printf(" Foo_IMPULSE = %i\n", Foo_IMPULSE_get());
printf(" Foo_WARP = %i\n", Foo_WARP_get());
printf(" Foo_LUDICROUS = %i\n", Foo_LUDICROUS_get());
printf("\nTest enums as argument of functions\n");
enum_test(RED_get(), Foo_IMPULSE_get());
enum_test(BLUE_get(), Foo_WARP_get());
enum_test(GREEN_get(), Foo_LUDICROUS_get());
enum_test(1234, 5678);
printf("\nTest enums as argument of class methods\n");
f = new_Foo();
Foo_enum_test(f, Foo_IMPULSE_get());
Foo_enum_test(f, Foo_WARP_get());
Foo_enum_test(f, Foo_LUDICROUS_get());
delete_Foo(f);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,19 @@
/* File : example.c */
int do_op(int a, int b, int (*op)(int,int)) {
return (*op)(a,b);
}
int add(int a, int b) {
return a+b;
}
int sub(int a, int b) {
return a-b;
}
int mul(int a, int b) {
return a*b;
}
int (*funcvar)(int,int) = add;

View file

@ -0,0 +1,9 @@
/* file: example.h */
extern int do_op(int,int, int (*op)(int,int));
extern int add(int,int);
extern int sub(int,int);
extern int mul(int,int);
extern int (*funcvar)(int,int);

View file

@ -0,0 +1,11 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
/* Wrap a function taking a pointer to a function */
extern int do_op(int a, int b, int (*op)(int, int));
extern int (*funcvar)(int,int);

View file

@ -0,0 +1,22 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
a = 37
b = 42
// Now call our C function with a bunch of callbacks
printf("Trying some C callback functions\n");
printf(" a = %i\n", a);
printf(" b = %i\n", b);
printf(" ADD(a,b) = %i\n", do_op(a,b,funcvar_get()));
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,61 @@
/* FILE : matrix.c : some simple 4x4 matrix operations */
#include <stdlib.h>
#include <stdio.h>
double **new_matrix() {
int i;
double **M;
M = (double **) malloc(4*sizeof(double *));
M[0] = (double *) malloc(16*sizeof(double));
for (i = 0; i < 4; i++) {
M[i] = M[0] + 4*i;
}
return M;
}
void destroy_matrix(double **M) {
free(M[0]);
free(M);
}
void print_matrix(double **M) {
int i,j;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
printf("%10g ", M[i][j]);
}
printf("\n");
}
}
void mat_mult(double **m1, double **m2, double **m3) {
int i,j,k;
double temp[4][4];
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++) {
temp[i][j] = 0;
for (k = 0; k < 4; k++)
temp[i][j] += m1[i][k]*m2[k][j];
}
for (i = 0; i < 4; i++)
for (j = 0; j < 4; j++)
m3[i][j] = temp[i][j];
}

View file

@ -0,0 +1,36 @@
%module example
// FILE : matrix.i
%{
void set_m(double **M, int i, int j, double val) {
M[i][j] = val;
}
double get_m(double **M, int i, int j) {
return M[i][j];
}
%}
%inline {
/*** Matrix Operations ***/
extern double **new_matrix();
/* Creates a new matrix and returns a pointer to it */
extern void destroy_matrix(double **M);
/* Destroys the matrix M */
extern void print_matrix(double **M);
/* Prints out the matrix M */
extern void set_m(double **M, int i, int j, double val);
/* Sets M[i][j] = val*/
extern double get_m(double **M, int i, int j);
/* Returns M[i][j] */
extern void mat_mult(double **a, double **b, double **c);
/* Multiplies matrix a by b and places the result in c*/
}

View file

@ -0,0 +1,43 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// create a new matrix
x = new_matrix();
for i = 0 : 3;
for j = 0 : 3;
set_m(x, i, j, i+j);
end;
end;
// print the matrix
print_matrix(x);
// another matrix
y = new_matrix();
for i = 0 : 3;
for j = 0 : 3;
set_m(y, i, j, i-j);
end;
end;
// print the matrix
print_matrix(y);
// mat_mult the two matrix, and the result is stored in a new matrix
z = new_matrix();
mat_mult(x, y, z);
print_matrix(z);
//destroy the matrix
destroy_matrix(x);
destroy_matrix(y);
destroy_matrix(z);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,118 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
// Double matrix functions
double sumDoubleMatrix(double *inputMatrix, int nbRow, int nbCol)
{
int i;
double total = 0.0;
for (i=0; i<nbRow*nbCol; i++)
{
total += inputMatrix[i];
}
return total;
}
void squareDoubleMatrix(double *inputMatrix, int nbRow, int nbCol, double** resultMatrix, int* nbRowRes, int* nbColRes)
{
int i;
int size = nbRow * nbCol;
*nbRowRes = nbRow;
*nbColRes = nbCol;
*resultMatrix = (double*) malloc(size * sizeof(double));
for (i=0; i<size; i++)
{
(*resultMatrix)[i] = inputMatrix[i] * inputMatrix[i];
}
}
void getDoubleMatrix(double **resultMatrix, int *nbRowRes, int *nbColRes)
{
int i;
int size;
*nbRowRes = 5;
*nbColRes = 3;
size = (*nbRowRes) * (*nbColRes);
*resultMatrix = (double*) malloc(size * sizeof(double));
for (i=0; i<size; i++)
{
(*resultMatrix)[i] = i*2;
}
}
// Integer matrix functions
int sumIntegerMatrix(int *inputMatrix, int nbRow, int nbCol)
{
int i;
int total = 0;
for (i=0; i<nbRow*nbCol; i++)
{
total += inputMatrix[i];
}
return total;
}
void squareIntegerMatrix(int *inputMatrix, int nbRow, int nbCol, int** resultMatrix, int* nbRowRes, int* nbColRes)
{
int i;
int size = nbRow * nbCol;
*nbRowRes = nbRow;
*nbColRes = nbCol;
*resultMatrix = (int*) malloc(size * sizeof(int));
for (i=0; i<size; i++)
{
(*resultMatrix)[i] = inputMatrix[i] * inputMatrix[i];
}
}
void getIntegerMatrix(int **resultMatrix, int *nbRowRes, int *nbColRes)
{
int i;
int size;
*nbRowRes = 5;
*nbColRes = 3;
size = (*nbRowRes) * (*nbColRes);
*resultMatrix = (int*) malloc(size * sizeof(int));
for (i=0; i<size; i++)
{
(*resultMatrix)[i] = i*2;
}
}
// String matrix functions
char* concatStringVector(char **inputVector, int size)
{
int i;
int resultSize;
char *result;
resultSize = 3 * size + 1;
result = calloc(resultSize, sizeof(char));
strcpy(result, inputVector[0]);
for (i=1; i<size; i++)
{
strcat(result, " ");
strcat(result, (const char*) inputVector[i]);
}
return result;
}
void getStringVector(char ***resultVector, int *sizeRes)
{
int i;
*sizeRes = 12;
*resultVector = (char**) malloc((*sizeRes) * sizeof(char*));
for (i=0; i<*sizeRes; i++)
{
char* pc = (char*) calloc(3, sizeof(char));
sprintf(pc, "%d", i);
(*resultVector)[i] = pc;
}
}

View file

@ -0,0 +1,26 @@
%module example
%include matrix.i
%apply (double *IN, int IN_ROWCOUNT, int IN_COLCOUNT) { (double *inputMatrix, int nbRow, int nbCol) }
%apply (double **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) { (double **resultMatrix, int *nbRowRes, int *nbColRes) }
%apply (int *IN, int IN_ROWCOUNT, int IN_COLCOUNT) { (int *inputMatrix, int nbRow, int nbCol) }
%apply (int **OUT, int *OUT_ROWCOUNT, int *OUT_COLCOUNT) { (int **resultMatrix, int *nbRowRes, int *nbColRes) }
%apply (char **IN, int IN_SIZE) { (char **inputVector, int size) }
%apply (char ***OUT, int *OUT_SIZE) { (char ***resultVector, int *sizeRes) }
%inline %{
extern double sumDoubleMatrix(double *inputMatrix, int nbRow, int nbCol);
extern void squareDoubleMatrix(double *inputMatrix, int nbRow, int nbCol, double **resultMatrix, int *nbRowRes, int *nbColRes);
extern void getDoubleMatrix(double **resultMatrix, int *nbRowRes, int *nbColRes);
extern int sumIntegerMatrix(int *inputMatrix, int nbRow, int nbCol);
extern void squareIntegerMatrix(int *inputMatrix, int nbRow, int nbCol, int **resultMatrix, int *nbRowRes, int *nbColRes);
extern void getIntegerMatrix(int **resultMatrix, int *nbRowRes, int *nbColRes);
extern char* concatStringVector(char **inputVector, int size);
extern void getStringVector(char ***resultVector, int *sizeRes);
%}

View file

@ -0,0 +1,24 @@
double sumitems(double *first, int nbRow, int nbCol);
void main(){
/**
* --> myMatrix=[ 103 3 1 12;0 0 2043 1];
* --> sumitems(myMatrix);
* 32
*/
double B[] = {1,3,4,9,2,8,3,2}; /* Declare the matrix */
int rowB = 2, colB = 4;
printf("sumitems: %6.2f\n",sumitems(B, rowB, colB));
/**
* --> myOtherMatrix=generateValues();
* --> size(myOtherMatrix);
*/
int numberRow, numberCol, i;
double * matrix=getValues(&numberRow, &numberCol);
printf("Matrix of size [%d,%d]",numberRow, numberCol);
for(i=0; i < numberRow*numberCol; i++)
{
printf("A[%d] = %5.2f\n",i,matrix[i]);
}
}

View file

@ -0,0 +1,51 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// Test lib double matrix functions
disp("Call lib function getDoubleMatrix()");
doubleMatrix = getDoubleMatrix();
disp(doubleMatrix);
disp("Call lib function sumDoubleMatrix()");
s = sumDoubleMatrix(doubleMatrix);
disp(s);
disp("Call lib function squareDoubleMatrix()");
sqrd = squareDoubleMatrix(doubleMatrix);
disp(sqrd);
// Test lib integer matrix functions
disp("Call lib function getIntegerMatrix()");
integerMatrix = getIntegerMatrix();
disp(integerMatrix);
disp("Call lib function sumIntegerMatrix()");
s = sumIntegerMatrix(integerMatrix);
disp(s);
disp("Call lib function squareIntegerMatrix()");
sqri = squareIntegerMatrix(integerMatrix);
disp(sqri);
// Test lib string matrix functions
disp("Call lib function getStringVector()");
stringVector = getStringVector();
disp(stringVector);
disp("Call lib function concatStringVector()");
stringVector2 = concatStringVector(stringVector);
disp(stringVector2);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,16 @@
/* File : example.c */
void add(int *x, int *y, int *result) {
*result = *x + *y;
}
void sub(int *x, int *y, int *result) {
*result = *x - *y;
}
int divide(int n, int d, int *r) {
int q;
q = n/d;
*r = n - q*d;
return q;
}

View file

@ -0,0 +1,30 @@
/* File : example.i */
%module example
%{
extern void add(int *, int *, int *);
extern void sub(int *, int *, int *);
extern int divide(int, int, int *);
%}
/* This example illustrates a couple of different techniques
for manipulating C pointers */
/* First we'll use the pointer library */
extern void add(int *x, int *y, int *result);
%include cpointer.i
%pointer_functions(int, intp);
/* Next we'll use some typemaps */
%include typemaps.i
extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
/* Next we'll use typemaps and the %apply directive */
%apply int *OUTPUT { int *r };
extern int divide(int n, int d, int *r);

View file

@ -0,0 +1,47 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// First create some objects using the pointer library.
printf("Testing the pointer library\n")
a = new_intp();
b = new_intp();
c = new_intp(); // Memory for result
intp_assign(a, 37);
intp_assign(b, 42);
printf(" a = %d\n", intp_value(a));
printf(" b = %d\n", intp_value(b));
printf(" c = %d\n", intp_value(c));
// Call the add() function with some pointers
add(a, b, c);
// Now get the result
r = intp_value(c);
printf(" 37 + 42 = %d\n", r);
// Clean up the pointers
delete_intp(a);
delete_intp(b);
delete_intp(c);
// Now try the typemap library
// This should be much easier. Now how it is no longer
// necessary to manufacture pointers.
printf("Trying the typemap library\n");
r = sub(37, 42);
printf(" 37 - 42 = %d\n", r);
// Now try the version with multiple return values
printf("Testing multiple return values\n");
[q, r] = divide(42, 37);
printf(" 42/37 = %d remainder %d\n", q, r);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,18 @@
/* File : example.c */
/* A global variable */
double Foo = 3.0;
/* Compute the greatest common divisor of positive integers */
int gcd(int x, int y) {
int g;
g = y;
while (x > 0) {
g = x;
x = y % x;
y = g;
}
return g;
}

View file

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

View file

@ -0,0 +1,29 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// Call our gcd() function
x = 42;
y = 105;
g = gcd(x,y);
printf("The gcd of %d and %d is %d\n",x,y,g);
// Manipulate the Foo global variable
// Get its default value (see in example.c)
defaultValue = Foo_get()
if defaultValue <> 3 then pause; end
// Change its value
Foo_set(3.1415926)
// See if the change took effect
if Foo_get() <> 3.1415926 then pause,end
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS = example.cxx
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,61 @@
/* File : example.cpp */
#include "example.h"
#include <iostream>
#include <iterator>
#include <algorithm>
#include <numeric>
#include <sstream>
template <typename T>
std::list<T> concat_list(const std::list<T> list, const std::list<T> other_list)
{
std::list<T> out_list(list);
out_list.insert(out_list.end(), other_list.begin(), other_list.end());
return out_list;
}
// int lists
std::list<int> create_integer_list(const int rangemin, const int rangemax)
{
std::list<int> out_list;
for (int i = rangemin; i <= rangemax; i++)
{
out_list.push_back(i);
}
return out_list;
}
int sum_integer_list(const std::list<int>& list)
{
return std::accumulate(list.begin(), list.end(), 0);
}
std::list<int> concat_integer_list(const std::list<int> list, const std::list<int> other_list)
{
return concat_list<int>(list, other_list);
}
// string lists
std::list<std::string> create_string_list(const char* svalue)
{
std::list<std::string> out_list;
std::string str(svalue);
std::istringstream iss(str);
std::copy(std::istream_iterator<std::string>(iss),
std::istream_iterator<std::string>(),
std::inserter<std::list<std::string> >(out_list, out_list.begin()));
return out_list;
}
std::list<std::string> concat_string_list(const std::list<std::string> list, const std::list<std::string> other_list)
{
return concat_list<std::string>(list, other_list);
}

View file

@ -0,0 +1,14 @@
/* File : example.h */
#include <list>
#include <string>
// integer lists
std::list<int> create_integer_list(const int size, const int value);
int sum_integer_list(const std::list<int>& list);
std::list<int> concat_integer_list(const std::list<int> list, const std::list<int> other_list);
// string lists
std::list<std::string> create_string_list(const char* value);
std::list<std::string> concat_string_list(const std::list<std::string> list, const std::list<std::string> other_list);

View file

@ -0,0 +1,19 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
%include stl.i
%include std_list.i
/* instantiate the required template specializations */
namespace std
{
%template(IntList) list<int>;
%template(StringList) list<std::string>;
}
%include "example.h"

View file

@ -0,0 +1,39 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
example_Init();
// This example shows how to use C++ fonctions with STL lists arguments
// Here, STL lists are converted from/to Scilab matrices (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS is not defined)
// integer lists
disp("Example of passing matrices of int as list arguments of C++ functions.");
disp("get a list of int {1...4} from create_integer_list():");
is = create_integer_list(1, 4);
disp(is);
disp("get the sum of this list elements with sum_integer_list():")
sum = sum_integer_list(is);
disp(is);
is2 = create_integer_list(3, 6);
disp("concat this list with the list of int {3...6} with concat_integer_list():");
is3 = concat_integer_list(is, is2);
disp(is3);
// string lists
disp("Example of passing matrices of string as list arguments of C++ functions.");
disp("get a list of string {''aa'', ''bb'', ''cc'', ''dd''} with create_string_list():");
ss = create_string_list("aa bb cc dd");
disp(ss);
ss2 = create_string_list("cc dd ee ff");
disp("concat this list with the list of string {''cc'', ''dd'', ''ee'', ''ff''} with concat_string_list():");
ss3 = concat_string_list(ss, ss2);
disp(ss3);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS =
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,25 @@
/* File : example.h */
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
double average(std::vector<int> v) {
return std::accumulate(v.begin(),v.end(),0.0)/v.size();
}
std::vector<double> half(const std::vector<double>& v) {
std::vector<double> w(v);
for (unsigned int i=0; i<w.size(); i++)
w[i] /= 2.0;
return w;
}
void halve_in_place(std::vector<double>& v) {
// would you believe this is the same as the above?
std::transform(v.begin(),v.end(),v.begin(),
std::bind2nd(std::divides<double>(),2.0));
}

View file

@ -0,0 +1,19 @@
/* File : example.i */
%module example
%warnfilter(SWIGWARN_SCILAB_TRUNCATED_NAME) std::vector::get_allocator;
%{
#include "example.h"
%}
%include stl.i
/* instantiate the required template specializations */
namespace std {
%template(IntVector) vector<int>;
%template(DoubleVector) vector<double>;
}
/* Let's just grab the original header file here */
%include "example.h"

View file

@ -0,0 +1,37 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
example_Init();
disp(mean([1,2,3,4]));
// ... or a wrapped std::vector<int>
v = new_IntVector();
for i = 1:4
IntVector_push_back(v, i);
end;
disp(average(v));
// half will return a Scilab matrix.
// Call it with a Scilab matrix...
disp(half([1.0, 1.5, 2.0, 2.5, 3.0]));
// ... or a wrapped std::vector<double>
v = new_DoubleVector();
for i = 1:4
DoubleVector_push_back(v, i);
end;
disp(half(v));
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS =
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCS='$(SRCS)' SRCDIR='$(SRCDIR)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,11 @@
%module example
%rename(Bar) Foo;
%inline %{
typedef struct {
int x;
} Foo;
%}

View file

@ -0,0 +1,18 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// Test use of a struct (Bar)
a = new_Bar();
Bar_x_set(a, 100);
printf("a.x = %d (Should be 100)\n", Bar_x_get(a));
delete_Bar(a);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
CXXSRCS =
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' CXXSRCS='$(CXXSRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab_cpp
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,32 @@
/* File : example.h */
// Some template definitions
template<class T> T max(T a, T b) { return a>b ? a : b; }
template<class T> class vector {
T *v;
int sz;
public:
vector(int _sz) {
v = new T[_sz];
sz = _sz;
}
T &get(int index) {
return v[index];
}
void set(int index, T &val) {
v[index] = val;
}
#ifdef SWIG
%extend {
T getitem(int index) {
return $self->get(index);
}
void setitem(int index, T val) {
$self->set(index,val);
}
}
#endif
};

View file

@ -0,0 +1,17 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
/* Let's just grab the original header file here */
%include "example.h"
/* Now instantiate some specific template declarations */
%template(maxint) max<int>;
%template(maxdouble) max<double>;
%template(vecint) vector<int>;
%template(vecdouble) vector<double>;

View file

@ -0,0 +1,45 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
example_Init();
// Call some templated functions
printf("maxint(3, 7) = %i\n", maxint(3, 7));
printf("maxdouble(3.14, 2.18) = %3.2f\n", maxdouble(3.14, 2.18));
// Create some class
iv = new_vecint(100);
dv = new_vecdouble(1000);
for i = 0:100
vecint_setitem(iv, i, 2*i);
end
for i = 0:100
vecdouble_setitem(dv, i, 1.0/(i+1));
end
isum = 0
for i = 0:100
isum = isum + vecint_getitem(iv, i);
end
printf("isum = %i\n", isum);
dsum = 0
for i = 0:100
dsum = dsum + vecdouble_getitem(dv, i);
end
printf("dsum = %3.2f\n", dsum);
delete_vecint(iv);
delete_vecdouble(dv);
exit

View file

@ -0,0 +1,15 @@
TOP = ../..
SWIG = $(TOP)/../preinst-swig
SRCS = example.c
TARGET = example
INTERFACE = example.i
check: build
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_run
build:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' SRCS='$(SRCS)' SWIG='$(SWIG)' \
TARGET='$(TARGET)' INTERFACE='$(INTERFACE)' scilab
clean:
$(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' scilab_clean

View file

@ -0,0 +1,95 @@
/* File : example.c */
/* I'm a file containing some C global variables */
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
# define _CRT_SECURE_NO_DEPRECATE
#endif
#include <stdio.h>
#include <stdlib.h>
#include "example.h"
int ivar = 0;
short svar = 0;
long lvar = 0;
unsigned int uivar = 0;
unsigned short usvar = 0;
unsigned long ulvar = 0;
signed char scvar = 0;
unsigned char ucvar = 0;
char cvar = 0;
float fvar = 0;
double dvar = 0;
char *strvar = 0;
const char cstrvar[] = "Goodbye";
int *iptrvar = 0;
char name[256] = "Dave";
char path[256] = "/home/beazley";
/* Global variables involving a structure */
Point *ptptr = 0;
Point pt = { 10, 20 };
/* A variable that we will make read-only in the interface */
int status = 1;
/* A debugging function to print out their values */
void print_vars() {
printf("ivar = %d\n", ivar);
printf("svar = %d\n", svar);
printf("lvar = %ld\n", lvar);
printf("uivar = %u\n", uivar);
printf("usvar = %u\n", usvar);
printf("ulvar = %lu\n", ulvar);
printf("scvar = %d\n", scvar);
printf("ucvar = %u\n", ucvar);
printf("fvar = %g\n", fvar);
printf("dvar = %g\n", dvar);
printf("cvar = %c\n", cvar);
printf("strvar = %s\n", strvar ? strvar : "(null)");
printf("cstrvar = %s\n", cstrvar);
printf("iptrvar = %p\n", (void *)iptrvar);
printf("name = %s\n", name);
printf("ptptr = %p (%d, %d)\n", (void *)ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0);
printf("pt = (%d, %d)\n", pt.x, pt.y);
printf("status = %d\n", status);
}
/* A function to create an integer (to test iptrvar) */
int *new_int(int value) {
int *ip = (int *) malloc(sizeof(int));
*ip = value;
return ip;
}
int value_int(int *value) {
return *value;
}
/* A function to create a point */
Point *new_Point(int x, int y) {
Point *p = (Point *) malloc(sizeof(Point));
p->x = x;
p->y = y;
return p;
}
char * Point_print(Point *p) {
static char buffer[256];
if (p) {
sprintf(buffer,"(%d,%d)", p->x,p->y);
} else {
sprintf(buffer,"null");
}
return buffer;
}
void pt_print() {
printf("(%d, %d)\n", pt.x, pt.y);
}

View file

@ -0,0 +1,6 @@
/* File: example.h */
typedef struct {
int x,y;
} Point;

View file

@ -0,0 +1,52 @@
/* File : example.i */
%module example
%{
#include "example.h"
%}
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK
/* Some global variable declarations */
%inline %{
extern int ivar;
extern short svar;
extern long lvar;
extern unsigned int uivar;
extern unsigned short usvar;
extern unsigned long ulvar;
extern signed char scvar;
extern unsigned char ucvar;
extern char cvar;
extern float fvar;
extern double dvar;
extern char *strvar;
extern const char cstrvar[];
extern int *iptrvar;
extern char name[256];
extern Point *ptptr;
extern Point pt;
%}
/* Some read-only variables */
%immutable;
%inline %{
extern int status;
extern char path[256];
%}
%mutable;
/* Some helper functions to make it easier to test */
%inline %{
extern void print_vars();
extern int *new_int(int value);
extern int value_int(int *value);
extern Point *new_Point(int x, int y);
extern char *Point_print(Point *p);
extern void pt_print();
%}

View file

@ -0,0 +1,73 @@
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
disp(lasterror());
exit(ierr);
end
// Try to set the values of some global variables
ivar_set(42);
svar_set(-31000);
lvar_set(65537);
uivar_set(uint32(123456));
usvar_set(uint16(61000));
ulvar_set(654321);
scvar_set(int8(-13));
ucvar_set(uint8(251));
cvar_set("S");
fvar_set(3.14159);
dvar_set(2.1828);
strvar_set("Hello World");
iptrvar_set(new_int(37));
ptptr_set(new_Point(37,42));
name_set("Bill");
// Now print out the values of the variables
printf("Variables (values printed from Scilab)\n");
printf("ivar = %i\n", ivar_get());
printf("svar = %i\n", svar_get());
printf("lvar = %i\n", lvar_get());
printf("uivar = %i\n", uivar_get());
printf("usvar = %i\n", usvar_get());
printf("ulvar = %i\n", ulvar_get());
printf("scvar = %i\n", scvar_get());
printf("ucvar = %i\n", ucvar_get());
printf("fvar = %f\n", fvar_get());
printf("dvar = %f\n", dvar_get());
printf("cvar = %s\n", cvar_get());
printf("strvar = %s\n", strvar_get());
printf("cstrvar = %s\n", cstrvar_get());
printf("iptrvar = %i\n", value_int(iptrvar_get()));
printf("name = %s\n", name_get());
printf("ptptr = %s\n", Point_print(ptptr_get()));
printf("pt = %s\n", Point_print(pt_get()));
printf("status = %d\n", status_get());
printf("\nVariables (values printed from C)\n");
print_vars()
// Immutable variables
printf("\nNow I''m going to try and modify some read only variables\n");
printf(" Tring to set ''path''\n");
try
path_set("Whoa!");
printf("Hey, what''s going on?!?! This shouldn''t work\n");
catch
printf("Good.\n");
end
printf(" Trying to set ''status''\n");
try
status_set(0);
printf("Hey, what''s going on?!?! This shouldn''t work\n");
catch
printf("Good.\n");
end
// Structure
printf("\nI''m going to try and update a structure variable.\n");
pt_set(ptptr_get());
printf("The new value is %s\n", Point_print(pt_get()));
exit

View file

@ -8,6 +8,11 @@
%include "std_string.i"
#ifdef SWIGSCILAB
%rename(ProcBase) ProtectedBase;
%rename(PubBase) PublicBase;
#endif
%feature("director") PublicBase;
%feature("director") ProtectedBase;

View file

@ -4,6 +4,10 @@
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) DirectorTest;
#if defined(SWIGSCILAB)
%rename(DirTest) DirectorTest;
#endif
%apply signed char {char, const char};
%apply const signed char & {const char &};

View file

@ -1,5 +1,5 @@
/* Test %apply for char *, signed char *, unsigned char *
This won't work in all situations, so does not necessarily have to be implemented. See
/* Test %apply for char *, signed char *, unsigned char *
This won't work in all situations, so does not necessarily have to be implemented. See
http://groups.google.com.ai/group/comp.lang.c++.moderated/browse_thread/thread/ad5873ce25d49324/0ae94552452366be?lnk=raot */
%module(directors="1") apply_strings
@ -7,6 +7,11 @@
%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) DigitsGlobalB;
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK) DigitsGlobalC;
#if defined(SWIGSCILAB)
%rename(TNum) TNumber;
%rename(DirTest) DirectorTest;
#endif
%apply char * {UCharPtr};
%apply char * {SCharPtr};
%apply const char * {CUCharPtr};
@ -53,12 +58,12 @@ typedef struct {
TAscii DigitsMemberA[20];
TAscii *DigitsMemberB;
} TNumber;
TAscii DigitsGlobalA[20];
TAscii DigitsGlobalB[] = {(unsigned char)'A', (unsigned char)'B', 0};
TAscii *DigitsGlobalC;
%}
%}
// Director test
%feature("director");

View file

@ -1,5 +1,9 @@
%module array_member
#if defined(SWIGSCILAB)
%rename(RayPkt) RayPacketData;
#endif
%inline %{
typedef struct Foo {

View file

@ -1,4 +1,9 @@
%module array_typedef_memberin
#if defined(SWIGSCILAB)
%rename(ExDetail) ExampleDetail;
#endif
%inline %{
typedef short Eight[8];
typedef const short ConstEight[8];

View file

@ -7,6 +7,10 @@ This test case tests that various types of arrays are working.
#include <stdlib.h>
%}
#if defined(SWIGSCILAB)
%rename(ArrSt) ArrayStruct;
#endif
%inline %{
#define ARRAY_LEN 2

View file

@ -2,16 +2,20 @@
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) kMaxIOCTLSpaceParmsSize;
#define kMaxIOCTLSpaceParmsSize 128
#ifdef SWIGSCILAB
%rename(Parms) sm_channel_ix_dump_parms;
#endif
#define kMaxIOCTLSpaceParmsSize 128
%{
#define kMaxIOCTLSpaceParmsSize 128
#define kMaxIOCTLSpaceParmsSize 128
%}
%inline %{
typedef struct sm_channel_ix_dump_parms {
unsigned data[(kMaxIOCTLSpaceParmsSize - ((4*sizeof(int)) + (2*sizeof(unsigned))))/sizeof(unsigned)];
} SM_CHANNEL_IX_DUMP_PARMS;
typedef struct sm_channel_ix_dump_parms {
unsigned data[(kMaxIOCTLSpaceParmsSize - ((4*sizeof(int)) + (2*sizeof(unsigned))))/sizeof(unsigned)];
} SM_CHANNEL_IX_DUMP_PARMS;
%}

View file

@ -1,5 +1,10 @@
// bool typemaps check
%module bools
#if defined(SWIGSCILAB)
%rename(BoolSt) BoolStructure;
#endif
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
%warnfilter(SWIGWARN_RUBY_WRONG_NAME) constbool; /* Ruby, wrong class name */

View file

@ -57,6 +57,22 @@
return pf(a);
}
#if defined(__SUNPRO_CC)
// workaround for: Error: Could not find a match for foobar_T<T>(int, extern "C" int(*)(int)).
extern "C" {
typedef int (*foobar_int_int)(int a);
typedef double (*foobar_double_double)(double a);
};
template <class T>
int foobar_T(int a, foobar_int_int pf) {
return pf(a);
}
template <class T>
double foobar_T(double a, foobar_double_double pf) {
return pf(a);
}
#endif
template <class T>
const T& ident(const T& x) {
return x;

View file

@ -9,13 +9,9 @@ below.
%warnfilter(SWIGWARN_TYPEMAP_VARIN_UNDEF) global_char_array1; // Unable to set variable of type char[]
%warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG) global_const_char; // Setting a const char * variable may leak memory.
#ifdef SWIG_ALLEGRO_CL
%{
#include <stdio.h>
%}
#endif
%{
#define OTHERLAND_MSG "Little message from the safe world."
#define CPLUSPLUS_MSG "A message from the deep dark world of C++, where anything is possible."
static char *global_str = NULL;

View file

@ -143,6 +143,7 @@ CPP_TEST_CASES += \
class_scope_weird \
compactdefaultargs \
const_const_2 \
constant_directive \
constant_pointers \
constover \
constructor_copy \
@ -298,6 +299,7 @@ CPP_TEST_CASES += \
nested_directors \
nested_comment \
nested_scope \
nested_template_base \
nested_workaround \
newobject1 \
null_pointer \
@ -306,6 +308,7 @@ CPP_TEST_CASES += \
operator_pointer_ref \
operbool \
ordering \
overload_arrays \
overload_bool \
overload_copy \
overload_extend \
@ -514,6 +517,7 @@ CPP11_TEST_CASES = \
cpp11_decltype \
cpp11_default_delete \
cpp11_delegating_constructors \
cpp11_director_enums \
cpp11_explicit_conversion_operators \
cpp11_final_override \
cpp11_function_objects \

View file

@ -0,0 +1,28 @@
%module constant_directive
// %constant and struct
%{
struct Type1 {
Type1(int val = 0) : val(val) {}
int val;
};
static Type1 TYPE1_CONSTANT1(1);
static Type1 TYPE1_CONST2(2);
static Type1 TYPE1_CONST3(3);
%}
struct Type1 {
Type1(int val = 0) : val(val) {}
int val;
};
%inline %{
Type1 getType1Instance() { return Type1(111); }
%}
%constant Type1 TYPE1_CONSTANT1;
%constant Type1 TYPE1_CONSTANT2 = TYPE1_CONST2;
%constant Type1 *TYPE1_CONSTANT3 = &TYPE1_CONST3;
%constant int TYPE_INT = 0;

View file

@ -4,6 +4,11 @@ This testcase primarily test constant pointers, eg int* const. Only a getter is
%module constant_pointers
#if defined(SWIGSCILAB)
%rename(MbrVar) MemberVariablesTest;
%rename(RetVal) ReturnValuesTest;
#endif
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
%warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK_MSG); /* Setting a pointer/reference variable may leak memory. */

View file

@ -5,13 +5,13 @@
%nocopyctor Bar<double>;
%inline %{
struct Foo1 {
int x;
Foo1(int _x = 2) : x(_x)
{
}
}
};
struct Foo2 {
@ -25,7 +25,7 @@ struct Foo3 {
struct Foo4 {
Foo4() { }
protected:
Foo4(const Foo4& ) { }
};
@ -33,7 +33,7 @@ protected:
struct Foo4a {
Foo4a() { }
private:
Foo4a(const Foo4a& ) { }
};
@ -53,7 +53,7 @@ struct Foo8 {
};
template <class T>
class Bar
class Bar
{
public:
int x;
@ -73,7 +73,7 @@ public:
%include "std_vector.i"
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON) || defined(SWIGR) || defined(SWIGOCTAVE) || defined(SWIGRUBY) || defined(SWIGJAVASCRIPT)
#if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGPYTHON) || defined(SWIGR) || defined(SWIGOCTAVE) || defined(SWIGRUBY) || defined(SWIGJAVASCRIPT) || defined(SWIGSCILAB)
#define SWIG_GOOD_VECTOR
%ignore std::vector<Space::Flow>::vector(size_type);
%ignore std::vector<Space::Flow>::resize(size_type);
@ -126,7 +126,7 @@ public:
template <class T>
struct ModelUtils_T {};
}
}
}
%}
@ -144,13 +144,13 @@ namespace Space1 {
class TotalReturnSwap {
public:
TotalReturnSwap() {}
};
};
template <class T>
class TotalReturnSwap_T {
public:
TotalReturnSwap_T() {}
};
};
}
}

View file

@ -1,14 +1,14 @@
%module constructor_exception
%inline %{
class Error {
class MyError {
};
class SomeClass {
public:
SomeClass(int x) {
if (x < 0) {
throw Error();
throw MyError();
}
}
};
@ -17,7 +17,7 @@ class Test {
SomeClass o;
public:
Test(int x) try : o(x) { }
catch (Error &) {
catch (MyError &) {
}
catch (int) {
}

View file

@ -20,9 +20,13 @@
Bar(){ }
Bar(int){ }
#if !defined(__SUNPRO_CC)
operator int() { return 0; }
#endif
operator int&() { static int num = 0; return num; }
#if !defined(__SUNPRO_CC)
operator Foo<T>() { return Foo<T>(); }
#endif
operator Foo<T>&() { return *(new Foo<T>()); }
};
}

View file

@ -18,6 +18,12 @@ struct ConstExpressions {
static const int LLL = 300;
constexpr int MMM() { return 400; }
constexpr const int NNN() { return 500; }
// Regression tests for support added in SWIG 3.0.4:
static constexpr const int JJJ1 = 101;
constexpr static int KKK1 = 201;
// Regression tests for https://github.com/swig/swig/issues/284 :
explicit constexpr ConstExpressions(int) { }
constexpr explicit ConstExpressions(double) { }
};
%}

View file

@ -0,0 +1,14 @@
%module(directors="1") cpp11_director_enums
%warnfilter(SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR) Cpp11DirectorEnumsCallback::g;
%director Cpp11DirectorEnumsCallback;
%inline %{
enum class Color { Red, Green, Blue=10 };
struct Cpp11DirectorEnumsCallback {
virtual Color f(Color c) = 0;
virtual const Color & g(const Color &c) = 0;
virtual ~Cpp11DirectorEnumsCallback() {}
};
%}

View file

@ -198,7 +198,7 @@ enum UnmanagedExceptions {
UnmanagedSystemException,
UnmanagedArgumentException,
UnmanagedArgumentNullException,
UnmanagedArgumentOutOfRangeException,
UnmanagedArgumentOutOfRangeException
};
void check_exception(UnmanagedExceptions e) {

View file

@ -77,17 +77,17 @@ public:
Number quadruple(Number n) {
n.Value *= 4;
return n;
};
}
Number times8(const Number& num) {
Number n(num);
n.Value *= 8;
return n;
};
}
Number times12(const Number* num) {
Number n(*num);
n.Value *= 12;
return n;
};
}
%}
// Test $csinput expansion

View file

@ -13,6 +13,27 @@
%inline %{
#include <string>
// All kinds of numbers: hex, octal (which pose special problems to Python), negative...
void trickyvalue1(int first, int pos = -1) {}
void trickyvalue2(int first, unsigned rgb = 0xabcdef) {}
void trickyvalue3(int first, int mode = 0644) {}
void doublevalue1(int first, double num = 0.0e-1) {}
void doublevalue2(int first, double num = -0.0E2) {}
// Long long arguments are not handled at Python level currently but still work.
void seek(long long offset = 0LL) {}
void seek2(unsigned long long offset = 0ULL) {}
void seek3(long offset = 0L) {}
void seek4(unsigned long offset = 0UL) {}
void seek5(unsigned long offset = 0U) {}
void seek6(unsigned long offset = 02U) {}
void seek7(unsigned long offset = 00U) {}
void seek8(unsigned long offset = 1U) {}
void seek9(long offset = 1L) {}
void seekA(long long offset = 1LL) {}
void seekB(unsigned long long offset = 1ULL) {}
// Anonymous arguments
int anonymous(int = 7771);
int anonymous(int x) { return x; }
@ -29,6 +50,12 @@
bool blah(speed s = FAST, flavor f = SWEET) { return (s == FAST && f == SWEET); };
};
// using base class enum in a derived class
class DerivedEnumClass : public EnumClass {
public:
void accelerate(speed s = SLOW) { }
};
// casts
const char * casts1(const char *m = (const char *) NULL) {
char *ret = NULL;
@ -199,6 +226,7 @@ namespace Space {
struct Klass {
int val;
Klass(int val = -1) : val(val) {}
static Klass inc(int n = 1, const Klass& k = Klass()) { return Klass(k.val + n); }
};
Klass constructorcall(const Klass& k = Klass()) { return k; }

View file

@ -1,6 +1,12 @@
%module(directors="1") director_frob;
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_THREAD_UNSAFE,SWIGWARN_TYPEMAP_DIRECTOROUT_PTR
#ifdef SWIGSCILAB
%rename(cb) coreCallbacks;
%rename(On3dEngRedrawn) coreCallbacksOn3dEngineRedrawnData;
%rename (_On3dEngRedrawn) coreCallbacks_On3dEngineRedrawnData;
#endif
%header %{
#include <iostream>
%}
@ -17,7 +23,7 @@
virtual ~Alpha() { };
virtual const char* abs_method() = 0;
};
struct Bravo : Alpha
{
const char* abs_method()
@ -26,14 +32,14 @@
}
};
struct Charlie : Bravo
struct Charlie : Bravo
{
const char* abs_method()
{
return "Charlie::abs_method()";
}
};
struct Delta : Charlie
{
};
@ -50,7 +56,9 @@
public:
Ops() : num(0) {}
virtual ~Ops() {}
#if !defined(__SUNPRO_CC)
virtual operator int() { return 0; }
#endif
virtual operator int **() const {
return (int **) 0;
}

View file

@ -12,10 +12,14 @@ struct OverloadBase {
};
struct OverloadDerived1 : OverloadBase {
virtual void nnn(int vvv) {}
// virtual void nnn() {}
#if defined(__SUNPRO_CC)
virtual void nnn() {}
#endif
};
struct OverloadDerived2 : OverloadBase {
// virtual void nnn(int vvv) {}
#if defined(__SUNPRO_CC)
virtual void nnn(int vvv) {}
#endif
virtual void nnn() {}
};
%}

View file

@ -7,13 +7,13 @@
class Foo {
private:
std::string a;
std::string a_;
public:
virtual ~Foo() {}
virtual std::string ping() { return "Foo::ping()"; }
virtual std::string pong() { return "Foo::pong();" + ping(); }
virtual std::string getA() { return this->a; }
virtual void setA(std::string a) { this->a = a; }
virtual std::string getA() { return this->a_; }
virtual void setA(std::string a) { this->a_ = a; }
static Foo* get_self(Foo *slf) {return slf;}

View file

@ -8,7 +8,20 @@ enum ForwardEnum2 { CCC, DDD };
%}
%inline %{
#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
/* ISO C forbids forward references to enum types [-Werror=pedantic] */
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
#if !defined(__SUNPRO_C)
enum ForwardEnum1;
enum ForwardEnum2;
enum ForwardEnum2;
enum ForwardEnum3;
#endif
%}
%inline %{
enum ForwardEnum1 get_enum1() { return AAA; }
enum ForwardEnum1 test_function1(enum ForwardEnum1 e) {
return e;
@ -16,22 +29,25 @@ enum ForwardEnum1 test_function1(enum ForwardEnum1 e) {
%}
%inline %{
enum ForwardEnum2;
enum ForwardEnum2;
enum ForwardEnum2 get_enum2() { return CCC; }
enum ForwardEnum2 test_function2(enum ForwardEnum2 e) {
return e;
}
enum ForwardEnum2;
%}
%inline %{
enum ForwardEnum3;
enum ForwardEnum3 { EEE, FFF };
enum ForwardEnum3 get_enum3() { return EEE; }
enum ForwardEnum3 test_function3(enum ForwardEnum3 e) {
return e;
}
enum ForwardEnum3;
%}
%inline %{
#if !defined(__SUNPRO_C)
enum ForwardEnum2;
enum ForwardEnum3;
#endif
%}
#endif

View file

@ -1,6 +1,13 @@
%module enum_macro
%inline %{
#if __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
/* comma at end of enumerator list [-Werror=pedantic] */
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
enum Greeks1
{
#define GREEK1 -1

View file

@ -14,10 +14,10 @@ enum AVPixelFormat2 {
%}
%inline %{
typedef struct AVCodecContext {
typedef struct AVCodecCtx {
enum AVPixelFormat pix_fmt;
enum AVPixelFormat2 pix_fmt2;
} AVCodecContext;
} AVCodecCtx;
enum AVPixelFormat global_fmt;
enum AVPixelFormat2 global_fmt2;
@ -29,7 +29,7 @@ enum AVPixelFormat * use_pixel_format_ptr(enum AVPixelFormat *px) {
return px;
}
const enum AVPixelFormat2 use_pixel_format2(const enum AVPixelFormat2 px) {
enum AVPixelFormat2 use_pixel_format2(const enum AVPixelFormat2 px) {
return px;
}
const enum AVPixelFormat2 * use_pixel_format_ptr2(const enum AVPixelFormat2 *px) {

4
Examples/test-suite/errors/.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
*.newerr
cpp_recursive_typedef.py
cpp_shared_ptr.py
xxx.py

View file

@ -1 +1 @@
c_extra_rblock.i:5: Error: Syntax error in input(1).
c_extra_rblock.i:5: Error: Syntax error. Extraneous '%}'

View file

@ -1 +1 @@
c_missing_semi.i:3: Error: Syntax error in input(1).
c_missing_semi.i:3: Error: Syntax error - possibly a missing semicolon.

View file

@ -1 +1 @@
cpp_extra_brackets.i:5: Error: Syntax error in input(3).
cpp_extra_brackets.i:5: Error: Unexpected ')'.

View file

@ -1 +1 @@
doxygen_unknown_command.i:4: Warning 720: Doxygen parser warning: unknown command "unknown".
doxygen_unknown_command.i:4: Warning 740: Doxygen parser warning: unknown command "unknown".

View file

@ -1 +1 @@
pp_missing_enddef.i:EOF: Error: Missing %enddef for macro starting on line 3
pp_missing_enddef.i:3: Error: Missing %enddef for macro starting here

View file

@ -1 +1 @@
pp_missing_endif.i:EOF: Error: Missing #endif for conditional starting on line 3
pp_missing_endif.i:3: Error: Missing #endif for conditional starting here

View file

@ -0,0 +1,7 @@
%module xxx
/* %beginfile and %endoffile are internal directives inserted when %include is
* used. Users should never use them directly, but test coverage for this
* error message still seems useful to have.
*/
%includefile "dummy.i" %beginfile

View file

@ -0,0 +1 @@
pp_missing_endoffile.i:6: Error: Missing %endoffile for file inclusion block starting here

View file

@ -1 +1 @@
pp_missing_rblock.i:EOF: Error: Unterminated %{ ... %} block starting on line 3
pp_missing_rblock.i:3: Error: Unterminated %{ ... %} block

Some files were not shown because too many files have changed in this diff Show more