我最近看到一些代码,我特别不清楚类似的函数指针吗?typedef函数指针
以下是函数指针。
我也对以下三个函数感到困惑,参数类型为“cairo_output_stream_t”,但cairo_output_stream_t结构包含有三个函数指针的成员。我无法理解下面的功能在做什么。
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是一个枚举
严......什么? – 2013-12-10 10:57:04