swig/Examples/php4/simple/example.c
Kevin Ruland 24442fb756 Change example so it builds Foo_get() and Foo_set() wrappers. Use these
wrappers in the runme.php4.  Added wrapped method print_Foo() just to make
sure all is working.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7462 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2005-09-20 13:53:44 +00:00

22 lines
304 B
C

/* File : example.c */
/* A global variable */
double Foo = 3.0;
void print_Foo() {
printf("In C, Foo = %f\n",Foo);
}
/* 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;
}