1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Copyright 2012 Alexis Laferrière <alexis.laf@xymus.net>
5 * This file is free software, which comes along with NIT. This software is
6 * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
8 * PARTICULAR PURPOSE. You can modify it is you want, provided this header
9 * is kept unaltered, and a notification of the changes is added.
10 * You are allowed to redistribute it and sell it, alone or is a part of
14 #include "test_ni_global_ref.nit.h"
16 ToBePreserved global_tbp
= NULL
;
19 C implementation of test_ni_references::A::save_as_global
21 Imported methods signatures:
22 void ToBePreserved_output( ToBePreserved recv ) for test_ni_references::ToBePreserved::(kernel::Object::output)
24 void A_save_as_global___impl( A recv
, ToBePreserved tbp
) {
25 if ( global_tbp
!= NULL
) {
26 ToBePreserved_decr_ref( global_tbp
);
30 ToBePreserved_incr_ref( global_tbp
);
34 C implementation of test_ni_references::A::recover_unsafe
36 ToBePreserved
A_recover_unsafe___impl( A recv
) {
41 C implementation of test_ni_references::A::recover
43 Imported methods signatures:
44 nullable_ToBePreserved ToBePreserved_as_nullable( ToBePreserved value ) to cast from ToBePreserved to nullable ToBePreserved
46 nullable_ToBePreserved
A_recover___impl( A recv
) {
47 if ( global_tbp
!= NULL
) {
48 return ToBePreserved_as_nullable( global_tbp
);
50 return null_ToBePreserved();