Commit | Line | Data |
---|---|---|
3d6d4647 C |
1 | /* demonstration of c coded foreign integer-function */ |
2 | ||
3 | /* the following will be used to extract fixnums out of a list of fixnums */ | |
4 | struct listoffixnumscell | |
5 | { struct listoffixnumscell *cdr; | |
6 | int *fixnum; | |
7 | }; | |
8 | ||
9 | struct listcell | |
10 | { struct listcell *cdr; | |
11 | int car; | |
12 | }; | |
13 | ||
14 | cfoo(a,b,c,d) | |
15 | int *a; | |
16 | double b[]; | |
17 | int *c[]; | |
18 | struct listoffixnumscell *d; | |
19 | { | |
20 | printf("a: %d, b[0]: %f, b[1]: %f\n", *a, b[0], b[1]); | |
21 | printf(" c (first): %d c (second): %d\n", | |
22 | *c[0],*c[1]); | |
23 | printf(" ( %d %d ... )\n ", *(d->fixnum), *(d->cdr->fixnum)); | |
24 | b[1] = 3.1415926; | |
25 | return(3); | |
26 | } | |
27 | ||
28 | struct listcell * | |
29 | cmemq(element,list) | |
30 | int element; | |
31 | struct listcell *list; | |
32 | { | |
33 | for( ; list && element != list->car ; list = list->cdr); | |
34 | return(list); | |
35 | } |