PageRenderTime 25ms CodeModel.GetById 13ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

/tutorial/external/C/c_glue1.c

http://github.com/tybor/Liberty
C | 54 lines | 40 code | 13 blank | 1 comment | 3 complexity | 65a3f067a24527cf5acd7e9147d5809d MD5 | raw file
 1/* Hand-written C code to be used with example1.e */
 2
 3#include <stdio.h>
 4
 5void integer_to_c(int i){
 6  printf("%d\n",i);
 7}
 8
 9void character_to_c(char c){
10  printf("'%c'\n",c);
11}
12
13void boolean_to_c(int b){
14  printf("%d\n",b);
15}
16
17void real_32_to_c(float r){
18  printf("%f\n",r);
19}
20
21void real_64_to_c(double d){
22  printf("%f\n",d);
23}
24
25void string_storage_to_c(char *s){
26  printf("%s",s);
27}
28
29void any_to_c(void *a){
30  if (a == NULL) {
31    printf("NULL\n");
32  }
33  else {
34    printf("not NULL\n");
35  }
36}
37
38int c_int2eiffel(void){
39  return -6;
40}
41
42char c_char2eiffel(void){
43  return '\n';
44}
45
46
47void set_integer_attribute(int*attribute){
48  *attribute=2;
49}
50
51int hello(void) {
52  printf("Hello");
53  return 1;
54}