私は最近いくつかのコードを見ましたが、特に同様の関数ポインターが明確ではありませんか?
以下は関数ポインタです。
以下の 3 つの関数についても混乱しています。パラメーターの型は「cairo_output_stream_t」ですが、cairo_output_stream_t 構造体には 3 つの関数ポインターのメンバーが含まれています。以下の機能が何をしているのか理解できません。
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 は列挙型です