lib/a_star: adds doc to Link class
[nit.git] / tests / test_ni_super.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_super.nit.h"
15
16 /*
17 C implementation of super::B::(super::A::id)
18
19 Imported methods signatures:
20 void NativeString_to_s( char * str ) for string::NativeString::to_s
21 char * String_to_cstring( String recv ) for string::String::to_cstring
22 String B_id___super( B recv ) to call super
23 */
24 String B_id___impl( B recv )
25 {
26 char *new_name;
27 char *prefix = "B special ";
28 char *super_name = String_to_cstring( B_id___super( recv ) );
29
30 new_name = calloc( strlen( prefix )+strlen( super_name )+1, sizeof(char) );
31 strcpy( new_name, prefix );
32 strcpy( new_name+strlen( prefix ), super_name );
33 new_name[ strlen( prefix )+strlen( super_name ) ] = '\0';
34
35 return NativeString_to_s( new_name );
36 }