brians | 343bc11 | 2013-02-10 01:53:46 +0000 | [diff] [blame^] | 1 | %module aos |
| 2 | |
| 3 | %include "std_string.i"; |
| 4 | %include "stdint.i"; |
| 5 | |
| 6 | %{ |
| 7 | #include <time.h> |
| 8 | #include "aos/common/time.h" |
| 9 | #include "aos/common/queue.h" |
| 10 | static_assert(sizeof(int) == sizeof(clockid_t), |
| 11 | "Sizeof clockid_t has changed."); |
| 12 | %} |
| 13 | |
| 14 | %apply int { clockid_t }; |
| 15 | |
| 16 | // Makes the constructors from c++ types public so that this code can be called |
| 17 | // from other places. |
| 18 | %typemap(javabody) SWIGTYPE %{ |
| 19 | private long swigCPtr; |
| 20 | protected boolean swigCMemOwn; |
| 21 | |
| 22 | public $javaclassname(long cPtr, boolean cMemoryOwn) { |
| 23 | swigCMemOwn = cMemoryOwn; |
| 24 | swigCPtr = cPtr; |
| 25 | } |
| 26 | |
| 27 | public static long getCPtr($javaclassname obj) { |
| 28 | return (obj == null) ? 0 : obj.swigCPtr; |
| 29 | } |
| 30 | %} |
| 31 | |
| 32 | %rename(add) operator+; |
| 33 | %rename(subtract) operator-; |
| 34 | %rename(multiply) operator*; |
| 35 | %rename(divide) operator/; |
| 36 | %rename(modulo) operator%; |
| 37 | %rename(equalTo) operator==; |
| 38 | %rename(notEqual) operator!=; |
| 39 | %rename(greaterThan) operator>; |
| 40 | %rename(lessThan) operator<; |
| 41 | %rename(leq) operator<=; |
| 42 | %rename(geq) operator>=; |
| 43 | |
| 44 | %include "aos/common/time.h" |
| 45 | %include "aos/common/queue.h" |