chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] typedef question


From: Peter Keller
Subject: [Chicken-users] typedef question
Date: Sun, 29 Sep 2002 01:46:12 -0500
User-agent: Mutt/1.2i

Hello,

So, is the main problem in supporting typedefs that chicken doesn't know
how big the type actually is?

I'm writing a little program that spews out some (define-foreign-type ...)
stuff like this after a gigantic configure run to figure out things
about the machine:

(define-foreign-type size_t "unsigned int")

for most POSIX types we care about, and a lot of other common, but not really
standard, types that you'll find on various OSes.

Now, my question is this, I wrote my program to only support arithmetic
types.  However, if you knew the size of non-arithmetic(read:arrays and
structures) types, would that be useful to you?

The ultimate goal of what I'm writing is to allow chicken when it installs
to figure out the types it needs right away and build a list that users can
include somehow into their code like how sys/types.h is used in C.

I can do the POSIX stuff first, then add things for various libraries
people have written that depend on things like off_t and what not. This
way, there can be ONE place where all of this stuff is defined, and it
will be correct for each architecture chicken is compiled on.

I've found I've implemented the above foreign type TWICE for two different
things I've worked on, and I don't know what will happen when both of
those things are used simulatneously in another piece of code. That screams
that it should be inside of chicken, and if I can find enough time tomorrow,
it might be. :)

-pete





reply via email to

[Prev in Thread] Current Thread [Next in Thread]