add missing files from initial check in
change camel case to match SWIG conventions git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9182 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a9d5f49c4a
commit
0218fdeb27
7 changed files with 328 additions and 5 deletions
49
Examples/test-suite/r/simple_array.i
Normal file
49
Examples/test-suite/r/simple_array.i
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
%module simple_array
|
||||
extern int x[10];
|
||||
extern double y[7];
|
||||
|
||||
|
||||
struct BarArray {
|
||||
int i;
|
||||
double d;
|
||||
};
|
||||
|
||||
extern struct BarArray bars[2];
|
||||
|
||||
void initArray();
|
||||
|
||||
%inline %{
|
||||
|
||||
struct BarArray {
|
||||
int i;
|
||||
double d;
|
||||
};
|
||||
|
||||
|
||||
int x[10];
|
||||
double y[7];
|
||||
struct BarArray bars[2];
|
||||
|
||||
void
|
||||
initArray()
|
||||
{
|
||||
int i, n;
|
||||
|
||||
n = sizeof(x)/sizeof(x[0]);
|
||||
for(i = 0; i < n; i++)
|
||||
x[i] = i;
|
||||
|
||||
n = sizeof(y)/sizeof(y[0]);
|
||||
for(i = 0; i < n; i++)
|
||||
y[i] = ((double) i)/ ((double) n);
|
||||
|
||||
n = sizeof(bars)/sizeof(bars[0]);
|
||||
for(i = 0; i < n; i++) {
|
||||
bars[i].i = x[i+2];
|
||||
bars[i].d = y[i+2];
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue