I am recently saw some code, I am especially not clear of similar function pointer?
and below are function pointer.
I also is confused about below three function, the parameter type is "cairo_output_stream_t", but the cairo_output_stream_t structure contain member of there three function pointer. I can not understand what below function are doing.
typedef cairo_status_t (*cairo_output_stream_write_func_t) (cairo_output_stream_t *output_stream, const unsigned char *data, unsigned int length); typedef cairo_status_t (*cairo_output_stream_flush_func_t) (cairo_output_stream_t *output_stream); typedef cairo_status_t (*cairo_output_stream_close_func_t) (cairo_output_stream_t *output_stream); struct _cairo_output_stream { cairo_output_stream_write_func_t write_func; cairo_output_stream_flush_func_t flush_func; cairo_output_stream_close_func_t close_func; unsigned long position; cairo_status_t status; int closed; }; cairo_status_t is an enum