lib: fixing visibility of intern use only Curl Response class
[nit.git] / tests / test_ni_accessor.nit.c
1 /* This file is part of NIT ( http://www.nitlanguage.org ).
2 *
3 * Copyright 2011 Alexis Laferrière <alexis.laf@xymus.net>
4 *
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
11 * another product.
12 */
13
14 #include "test_ni_accessor.nit.h"
15
16 /*
17 C implementation of test_ni_accessor::A::print_all
18
19 Imported methods signatures:
20 char * String_to_cstring( String recv ) for string::String::to_cstring
21 String A_r( A recv ) for test_ni_accessor::A::r
22 String A_rw( A recv ) for test_ni_accessor::A::rw
23 */
24 void A_print_all___impl( A recv )
25 {
26 printf( "%s %s\n",
27 String_to_cstring( A_r( recv ) ),
28 String_to_cstring( A_rw( recv ) ) );
29 }
30
31 /*
32 C implementation of test_ni_accessor::A::modify
33
34 Imported methods signatures:
35 String new_String_from_cstring( char * str ) for string::String::from_cstring
36 void A_w__eq( A recv, String w ) for test_ni_accessor::A::w=
37 void A_rw__eq( A recv, String rw ) for test_ni_accessor::A::rw=
38 */
39 void A_modify___impl( A recv )
40 {
41 A_w__assign( recv, new_String_from_cstring( "w set from native" ) );
42 A_rw__assign( recv, new_String_from_cstring( "rw set from native" ) );
43 }
44
45 /*
46 C implementation of test_ni_accessor::B::print_and_modify
47
48 Imported methods signatures:
49 String A_rw( A recv ) for test_ni_accessor::A::rw
50 void A_rw__assign( A recv, String value ) for test_ni_accessor::A::rw=
51 char * String_to_cstring( String recv ) for string::String::to_cstring
52 String new_String_from_cstring( char * str ) for string::String::from_cstring
53 */
54 void B_print_and_modify___impl( B recv, A a )
55 {
56 printf( "%s\n", String_to_cstring( A_rw( a ) ) );
57 A_rw__assign( a, new_String_from_cstring( "set from native" ) );
58 printf( "%s\n", String_to_cstring( A_rw( a ) ) );
59 }