nitdoc: migrate clipboard to jQuery.UI widget
[nit.git] / tests / test_ni_primitives.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_primitives.nit.h"
15
16 #include <stdlib.h>
17
18 /*
19 C implementation of test_ni_primitives::Object::opposite
20 */
21 int Object_opposite___impl( Object recv, int v )
22 {
23 return v == 0;
24 }
25
26 /*
27 C implementation of test_ni_primitives::Object::plus_10
28 */
29 char Object_plus_10___impl( Object recv, char v )
30 {
31 return v + 10;
32 }
33
34 /*
35 C implementation of test_ni_primitives::Object::plus_1000
36 */
37 bigint Object_plus_1000___impl( Object recv, bigint v )
38 {
39 return v + 1000;
40 }
41
42 /*
43 C implementation of test_ni_primitives::Object::multiply_by_100
44 */
45 float Object_multiply_by_100___impl( Object recv, float v )
46 {
47 return v * 100;
48 }
49
50 /*
51 C implementation of test_ni_primitives::Object::print_ns
52 */
53 void Object_print_ns___impl( Object recv, char * s )
54 {
55 printf( "%s\n", s );
56 }