[GUI] HToolkit 1.0 released
Wolfgang Jeltsch
wolfgang@jeltsch.net
Thu, 24 Jul 2003 12:18:33 +0200
On Wednesday, 2003-07-23, 10:11, CEST, Krasimir Angelov wrote:
> [...]
> > By the way, are you still using functions with an arbitrary number of
> > arguments? (I mean those declared with the ellipsis, like printf.) This
> > would be a problem when creating Ada bindings. But meanwhile I'm not so
> > interested in Ada bindings anymore, but rather am looking for a good
> > Haskell GUI library ;-).
>
> The functions with an arbitrary number of arguments are problem for both
> Haskell and Ada. I use only functions constant number of arguments and the
> arguments are always of scalar types (int, BOOL, char *, ...).
Ok, I probably mixed something up here. GTK+ uses functions with an arbitrary
number of arguments but you didn't use them in HToolkit.
The problem for creating Ada bindings is that there is no standard mapping of
(void *) to an Ada type. But if you want to handle pointers to values of
arbitrary type but not to functions, you can use (char *) instead of (void *)
like malloc etc. do. Besides that this allows portable Ada bindings, it has
the advantage that on some platforms the pointer may take less space. If you
have, e.g, one code and one data segment, a function pointer and a char
pointer each have to store only the offset address while a void pointer has
to store also the kind of segment.
> Krasimir
Wolfgang