If I typedef like this:
typedef int (read_proc_t)(char *page, char **start, off_t off,
int count, int *eof, void *data);
as defined here
What is this technique called?
If I typedef this way, which means I create a type read_proc_t; later, I create my own version of read-proc-t, which is my_read_proc and I have a struct like this:
struct test {
read_proc_t read_proc;
}
struct test t;
I can do something like this:
t.read_proc_t = my_read_proc;
Is this correct? Normally, if I typedef read_proc_t as a function pointer:
typedef int (*read_proc_t)(char *page, char **start, off_t off,
int count, int *eof, void *data);
I would have to assign my_read_proc function address to the function pointer, like this:
(*t.read_proc_t) = &my_read_proc;
In which circumstance do I choose one?