global variable

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11249 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Baozeng Ding 2009-06-07 01:44:39 +00:00
commit 25f17ae463
5 changed files with 183 additions and 72 deletions

View file

@ -25,7 +25,7 @@ double dvar = 0;
char *strvar = 0;
const char cstrvar[] = "Goodbye";
int *iptrvar = 0;
char name[256] = "Dave";
char name[5] = "Dave";
char path[256] = "/home/beazley";
@ -53,8 +53,8 @@ void print_vars() {
printf("strvar = %s\n", strvar ? strvar : "(null)");
printf("cstrvar = %s\n", cstrvar ? cstrvar : "(null)");
printf("iptrvar = %p\n", iptrvar);
printf("name = %s\n", name);
printf("ptptr = %p (%d, %d)\n", ptptr, ptptr ? ptptr->x : 0, ptptr ? ptptr->y : 0);
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 ) );
printf("pt = (%d, %d)\n", pt.x, pt.y);
printf("status = %d\n", status);
}
@ -67,6 +67,10 @@ int *new_int(int value) {
return ip;
}
int value_int(int *value) {
return *value;
}
/* A function to create a point */
Point *new_Point(int x, int y) {