~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Examples/test-suite/li_typemaps.i

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
%include "typemaps.i"
4
4
 
5
5
%apply int &INOUT { int &INOUT2 };
 
6
%newobject out_foo;
6
7
%inline %{
7
8
 
 
9
struct Foo { int a; };
 
10
 
8
11
bool in_bool(bool *INPUT) { return *INPUT; }
9
12
int in_int(int *INPUT) { return *INPUT; }
10
13
long in_long(long *INPUT) { return *INPUT; }
47
50
void out_longlong(long long x, long long *OUTPUT) {  *OUTPUT = x; }
48
51
void out_ulonglong(unsigned long long x, unsigned long long *OUTPUT) {  *OUTPUT = x; }
49
52
 
 
53
/* Tests a returning a wrapped pointer and an output argument */
 
54
struct Foo *out_foo(int a, int *OUTPUT) {
 
55
  struct Foo *f = new struct Foo();
 
56
  f->a = a;
 
57
  *OUTPUT = a * 2;
 
58
  return f;
 
59
}
 
60
 
50
61
void outr_bool(bool x, bool &OUTPUT) {  OUTPUT = x; }
51
62
void outr_int(int x, int &OUTPUT) {  OUTPUT = x; }
52
63
void outr_short(short x, short &OUTPUT) {  OUTPUT = x; }