Hello! I've been playing around with displaying images in the Emacs SLIME REPL from MIT/GNU Scheme, works very nicely so far. Now I've tried to get a halfway decent binding for cairo (http://cairographics.org) working, but run into a problem:
There is a function cairo_status_t [an int] cairo_surface_write_to_png_stream( cairo_surface_t *surface, [the graphical data, just an alien] cairo_write_func_t write_func, [the actual callback function] void *closure); [some arbitrary data that is passed to the callback] cairo_write_func_t is defined as follows: cairo_status_t (*cairo_write_func_t) (void *closure, const unsigned char *data, unsigned int length); [see http://cairographics.org/manual/cairo-PNG-Support.html] I'd like to make this accessible from Scheme, preferably by just calling it in C, and returning all the data it writes as a vector8 (so a string). I've not been successful in declaring the callback, and if I just return a char* from a wrapper function, it will be truncated at the first #\nul. How can I either implement the callback, so that I get at the data and length in a Scheme function, or so that I can read all the incoming data in C, and then pass it all back to Scheme correctly? Thanks for any help, greetings! Peter _______________________________________________ MIT-Scheme-devel mailing list MIT-Scheme-devel@gnu.org https://lists.gnu.org/mailman/listinfo/mit-scheme-devel