Merge: doc: fixed some typos and other misc. corrections
[nit.git] / c_src / core__fixed_ints_text._ffi.c
1 /*
2 Extern implementation of Nit module fixed_ints_text
3 */
4 #include <stdlib.h>
5 #include <stdio.h>
6 #include <stdint.h>
7 #include "core__fixed_ints_text._ffi.h"
8 #ifdef ANDROID
9 #include <android/log.h>
10 #define PRINT_ERROR(...) (void)__android_log_print(ANDROID_LOG_WARN, "Nit", __VA_ARGS__)
11 #else
12 #define PRINT_ERROR(...) fprintf(stderr, __VA_ARGS__)
13 #endif
14 #line 20 "../lib/core/text/fixed_ints_text.nit"
15
16
17 #include <inttypes.h>
18 long core__fixed_ints_text___Int8_to_s_len___impl( int8_t self )
19 {
20 #line 26 "../lib/core/text/fixed_ints_text.nit"
21
22
23 return snprintf(NULL, 0, "%"PRIi8, self);
24 }
25 void core__fixed_ints_text___Int8_native_to_s___impl( int8_t self, char* nstr, long strlen )
26 {
27 #line 31 "../lib/core/text/fixed_ints_text.nit"
28
29
30 snprintf(nstr, strlen, "%"PRIi8, self);
31 }
32 long core__fixed_ints_text___Int16_to_s_len___impl( int16_t self )
33 {
34 #line 49 "../lib/core/text/fixed_ints_text.nit"
35
36
37 return snprintf(NULL, 0, "%"PRIi16, self);
38 }
39 void core__fixed_ints_text___Int16_native_to_s___impl( int16_t self, char* nstr, long strlen )
40 {
41 #line 54 "../lib/core/text/fixed_ints_text.nit"
42
43
44 snprintf(nstr, strlen, "%"PRIi16, self);
45 }
46 long core__fixed_ints_text___UInt16_to_s_len___impl( uint16_t self )
47 {
48 #line 73 "../lib/core/text/fixed_ints_text.nit"
49
50
51 return snprintf(NULL, 0, "%"PRIu16, self);
52 }
53 void core__fixed_ints_text___UInt16_native_to_s___impl( uint16_t self, char* nstr, long strlen )
54 {
55 #line 78 "../lib/core/text/fixed_ints_text.nit"
56
57
58 snprintf(nstr, strlen, "%"PRIu16, self);
59 }
60 long core__fixed_ints_text___Int32_to_s_len___impl( int32_t self )
61 {
62 #line 97 "../lib/core/text/fixed_ints_text.nit"
63
64
65 return snprintf(NULL, 0, "%"PRIi32, self);
66 }
67 void core__fixed_ints_text___Int32_native_to_s___impl( int32_t self, char* nstr, long strlen )
68 {
69 #line 102 "../lib/core/text/fixed_ints_text.nit"
70
71
72 snprintf(nstr, strlen, "%"PRIi32, self);
73 }
74 long core__fixed_ints_text___UInt32_to_s_len___impl( uint32_t self )
75 {
76 #line 121 "../lib/core/text/fixed_ints_text.nit"
77
78
79 return snprintf(NULL, 0, "%"PRIu32, self);
80 }
81 void core__fixed_ints_text___UInt32_native_to_s___impl( uint32_t self, char* nstr, long strlen )
82 {
83 #line 126 "../lib/core/text/fixed_ints_text.nit"
84
85
86 snprintf(nstr, strlen, "%"PRIu32, self);
87 }