1 /* This file is part of NIT ( http://www.nitlanguage.org ).
3 * Copyright 2011 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_null.nit.h"
17 C implementation of test_ni_null::A::is_int_null
19 Imported methods signatures:
20 int Int_is_null( nullable_Int value ) to check if a nullable Int is a Int
21 bigint bigint_as_not_null( nullable_Int value ) to cast from nullable Int to Int
23 int A_is_int_null___impl( A recv
, nullable_Int ni
)
25 return Int_is_null( ni
);
29 C implementation of test_ni_null::A::is_a_null
31 Imported methods signatures:
32 int A_is_null( nullable_A value ) to check if a nullable A is a A
33 A A_as_not_null( nullable_A value ) to cast from nullable A to A
35 int A_is_a_null___impl( A recv
, nullable_A na
)
37 return A_is_null( na
);
41 C implementation of test_ni_null::A::get_nullable_string
43 Imported methods signatures:
44 String new_String_from_cstring( char * str ) for string::String::from_cstring
45 nullable_String String_as_nullable( String value ) to cast from String to nullable String
47 nullable_String
A_get_nullable_string___impl( A recv
, int get_nulled
)
55 return String_as_nullable( new_String_from_cstring( "something" ) );