2014-08-19 07:55:31 -07:00
|
|
|
/* regular struct */
|
|
|
|
struct Named1 {
|
|
|
|
field: int;
|
|
|
|
}
|
|
|
|
struct @free(test_free) Named2 {
|
|
|
|
field: int;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* typedef */
|
|
|
|
type Typedef1: int;
|
|
|
|
type @free(def_free) Typedef2: int;
|
|
|
|
|
|
|
|
/* opaque */
|
|
|
|
struct Opaque1;
|
|
|
|
struct @free(opaque_free) Opaque2;
|
|
|
|
|
|
|
|
/* pointers */
|
2016-11-10 07:20:19 -08:00
|
|
|
type Pointer1: ptr(char);
|
|
|
|
type Pointer2: free(ptr(char), ptr_free);
|
2014-08-19 07:55:31 -07:00
|
|
|
|
|
|
|
class Free_Func {
|
|
|
|
methods {
|
|
|
|
foo {
|
|
|
|
params {
|
2015-05-18 08:13:08 -07:00
|
|
|
idx: int;
|
2014-08-19 07:55:31 -07:00
|
|
|
}
|
2017-09-22 08:10:42 -07:00
|
|
|
return: mstring @owned;
|
2014-08-19 07:55:31 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|