How to c-lambda printf?
I am searching for a way to specify a variable argument list in c-lambda to use functions like printf in Scheme. Is there a way?
Afficher les réponses par date
If I get you right, pass a list to C as a scmobj and read out its contents from there. Let the list and wiki know what macros you used to read the contents of different variable types (pair slot, string, fixnum etc) there, afaik this remains to be documented in the wiki/ml. Brgds 2011/11/21 Vok Vojwo <ceving@gmail.com>
I am searching for a way to specify a variable argument list in c-lambda to use functions like printf in Scheme. Is there a way? _______________________________________________ Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
2011/11/22 Mikael <mikael.rcv@gmail.com>:
If I get you right, pass a list to C as a scmobj and read out its contents from there.
No I only want to wrap syslog: void syslog(int priority, const char *format, ...); And the question is: how to map a C ellipsis? What I do right now is this: (define syslog (c-lambda (int nonnull-char-string) void "syslog")) This works but without any formating. Before I start to decode scmobjs I throw away syslogs formating functionality and do it in Scheme. But if it would be possible to map a C ellipsis, I would like to use it, because it will be faster than the Scheme version. I can not find a description in the documentation how to do it and so I think it is not possible out of the box. I only want to make sure that I did not oversee anything.
participants (2)
-
Mikael -
Vok Vojwo