[cairo] fflush in copy_page

Jost Boekemeier jost2345 at yahoo.de
Thu Sep 16 08:50:01 PDT 2004


[this fflush in finish_page might be a good idea, but
I don't understand the reason you've given]

> The binding is for Gauche, a scheme
> interpreter.

That's very good!  Would it possible to write the code
so that it could be used by other scheme
implementations, too?


> cairo_png_surface_create
> receive a file pointer as its arguments, and file
> pointer has a
> buffering feature.

Assuming your users call 

 (call-with-output-file
  (lambda (port)
    (cairo-png-surface-create 
     port 
     (cairo-get-std-format) 
     10 10)
    ...
   ) "/tmp/test.png")
 
Your C code would extract the FILE pointer from the
port and then call cairo_png_surface_create().
It also registers a callback that is called when the
scheme implementation wants to close the port (because
of call/cc we cannot close the port when the user
escapes from the above procedure).  So shortly before
the port is gc'ed, the callback is called and the file
is closed.


> We don't have a reference to file
> pointer in the

How do you implement ports?


Jost


	

	
		
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 100MB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de



More information about the cairo mailing list