#include #include static cairo_status_t read_func (void *closure, unsigned char *data, unsigned int length) { return CAIRO_STATUS_READ_ERROR; } int main (int argc, char **argv) { cairo_surface_t *surface; surface = cairo_image_surface_create_from_png_stream (read_func, NULL); printf ("type: %d, status: %d\n", cairo_surface_get_type (surface), cairo_surface_status (surface)); cairo_surface_destroy (surface); }