diff options
Diffstat (limited to 'Examples/python/contract/example.i')
-rw-r--r-- | Examples/python/contract/example.i | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/Examples/python/contract/example.i b/Examples/python/contract/example.i new file mode 100644 index 0000000..8fd1a80 --- /dev/null +++ b/Examples/python/contract/example.i @@ -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; +%} |