diff options
Diffstat (limited to 'Examples/chicken/overload')
-rw-r--r-- | Examples/chicken/overload/Makefile | 31 | ||||
-rw-r--r-- | Examples/chicken/overload/README | 2 | ||||
-rw-r--r-- | Examples/chicken/overload/example.cxx | 33 | ||||
-rw-r--r-- | Examples/chicken/overload/example.h | 14 | ||||
-rw-r--r-- | Examples/chicken/overload/example.i | 16 | ||||
-rw-r--r-- | Examples/chicken/overload/runme.scm | 45 |
6 files changed, 0 insertions, 141 deletions
diff --git a/Examples/chicken/overload/Makefile b/Examples/chicken/overload/Makefile deleted file mode 100644 index 019390192..000000000 --- a/Examples/chicken/overload/Makefile +++ /dev/null @@ -1,31 +0,0 @@ -TOP = ../.. -SWIGEXE = $(TOP)/../swig -SWIG_LIB_DIR = $(TOP)/../$(TOP_BUILDDIR_TO_TOP_SRCDIR)Lib -INTERFACE = example.i -SRCS = -CXXSRCS = example.cxx -TARGET = overload -INCLUDE = -SWIGOPT = -proxy -unhideprimitive -VARIANT = - -# uncomment the following lines to build a static exe -#CHICKEN_MAIN = runme.scm -#VARIANT = _static - -check: build - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_run - -build: $(TARGET) - -$(TARGET): $(INTERFACE) $(SRCS) - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' \ - SRCS='$(SRCS)' CXXSRCS='$(CXXSRCS)' CHICKEN_MAIN='$(CHICKEN_MAIN)' \ - SWIG_LIB_DIR='$(SWIG_LIB_DIR)' SWIGEXE='$(SWIGEXE)' \ - INCLUDE='$(INCLUDE)' SWIGOPT='$(SWIGOPT)' TARGET='$(TARGET)' \ - INTERFACE='$(INTERFACE)' CHICKENOPTS='$(CHICKENOPTS)' chicken$(VARIANT)_cpp - -clean: - $(MAKE) -f $(TOP)/Makefile SRCDIR='$(SRCDIR)' chicken_clean - rm -f example.scm - rm -f $(TARGET) diff --git a/Examples/chicken/overload/README b/Examples/chicken/overload/README deleted file mode 100644 index 9487c3f3e..000000000 --- a/Examples/chicken/overload/README +++ /dev/null @@ -1,2 +0,0 @@ -Overloading example from Chapter 5.14 of SWIG Core Documentation for -version 1.3. diff --git a/Examples/chicken/overload/example.cxx b/Examples/chicken/overload/example.cxx deleted file mode 100644 index 65e743941..000000000 --- a/Examples/chicken/overload/example.cxx +++ /dev/null @@ -1,33 +0,0 @@ -/* File : example.c */ - -#include "example.h" -#include <stdio.h> - -void foo(int x) { - printf("x is %d\n", x); -} - -void foo(char *x) { - printf("x is '%s'\n", x); -} - -Foo::Foo () { - myvar = 55; - printf ("Foo constructor called\n"); -} - -Foo::Foo (const Foo &) { - myvar = 66; - printf ("Foo copy constructor called\n"); -} - -void Foo::bar (int x) { - printf ("Foo::bar(x) method ... \n"); - printf("x is %d\n", x); -} - -void Foo::bar (char *s, int y) { - printf ("Foo::bar(s,y) method ... \n"); - printf ("s is '%s'\n", s); - printf ("y is %d\n", y); -} diff --git a/Examples/chicken/overload/example.h b/Examples/chicken/overload/example.h deleted file mode 100644 index 1c135d509..000000000 --- a/Examples/chicken/overload/example.h +++ /dev/null @@ -1,14 +0,0 @@ -/* File : example.h */ - -extern void foo (int x); -extern void foo (char *x); - -class Foo { - private: - int myvar; - public: - Foo(); - Foo(const Foo &); // Copy constructor - void bar(int x); - void bar(char *s, int y); -}; diff --git a/Examples/chicken/overload/example.i b/Examples/chicken/overload/example.i deleted file mode 100644 index 23a29986e..000000000 --- a/Examples/chicken/overload/example.i +++ /dev/null @@ -1,16 +0,0 @@ -/* File : example.i */ -%module example - -%{ -#include "example.h" -%} - -/* Let "Foo" objects be converted back and forth from TinyCLOS into - low-level CHICKEN SWIG procedures */ - -%typemap(clos_in) Foo * = SIMPLE_CLOS_OBJECT *; -%typemap(clos_out) Foo * = SIMPLE_CLOS_OBJECT *; - -/* Let's just grab the original header file here */ -%include "example.h" - diff --git a/Examples/chicken/overload/runme.scm b/Examples/chicken/overload/runme.scm deleted file mode 100644 index 168490f76..000000000 --- a/Examples/chicken/overload/runme.scm +++ /dev/null @@ -1,45 +0,0 @@ -;; This file demonstrates the overloading capabilities of SWIG - -(load-library 'example "overload.so") - -;; Low level -;; --------- - -(display " -Trying low level code ... - (foo 1) - (foo \"some string\") - (define A-FOO (new-Foo)) - (define ANOTHER-FOO (new-Foo A-FOO)) ;; copy constructor - (Foo-bar A-FOO 2) - (Foo-bar ANOTHER-FOO \"another string\" 3) -") - -(primitive:foo 1) -(primitive:foo "some string") -(define A-FOO (slot-ref (primitive:new-Foo) 'swig-this)) -(define ANOTHER-FOO (slot-ref (primitive:new-Foo A-FOO) 'swig-this)) ;; copy constructor -(primitive:Foo-bar A-FOO 2) -(primitive:Foo-bar ANOTHER-FOO "another string" 3) - -;; TinyCLOS -;; -------- - -(display " -Trying TinyCLOS code ... - (+foo+ 1) - (+foo+ \"some string\") - (define A-FOO (make <Foo>)) - (define ANOTHER-FOO (make <Foo> A-FOO)) ;; copy constructor - (-bar- A-FOO 2) - (-bar- ANOTHER-FOO \"another string\" 3) -") - -(foo 1) -(foo "some string") -(define A-FOO (make <Foo>)) -(define ANOTHER-FOO (make <Foo> A-FOO)) ;; copy constructor -(bar A-FOO 2) -(bar ANOTHER-FOO "another string" 3) - -(exit) |