/trunk/Examples/python/contract/example.i

# · Swig · 21 lines · 17 code · 3 blank · 1 comment · 0 complexity · a7b9ad69a3977beb3c3457947f4b485d MD5 · raw file

  1. /* File : example.i */
  2. %module example
  3. %contract gcd(int x, int y) {
  4. require:
  5. x >= 0;
  6. y >= 0;
  7. }
  8. %contract fact(int n) {
  9. require:
  10. n >= 0;
  11. ensure:
  12. fact >= 1;
  13. }
  14. %inline %{
  15. extern int gcd(int x, int y);
  16. extern int fact(int n);
  17. extern double Foo;
  18. %}