BSD 4_1c_2 development
[unix-history] / usr / doc / lisp / ch8auxc.c
CommitLineData
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 */
4struct listoffixnumscell
5{ struct listoffixnumscell *cdr;
6 int *fixnum;
7};
8
9struct listcell
10{ struct listcell *cdr;
11 int car;
12};
13
14cfoo(a,b,c,d)
15int *a;
16double b[];
17int *c[];
18struct 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
28struct listcell *
29cmemq(element,list)
30int element;
31struct listcell *list;
32{
33 for( ; list && element != list->car ; list = list->cdr);
34 return(list);
35}