typedef void (*tmr_func_t)(struct timer *tp); - Minix
This is a discussion on typedef void (*tmr_func_t)(struct timer *tp); - Minix ; hi
would someone please explain to me this typedef in line 01321 of
appendix b:
typedef void (*tmr_func_t)(struct timer *tp);
i figure its a void datatype, but i don't know what the
(*tmr_func_t)(struct timer *tp); is supposed to say...the book ...
-
typedef void (*tmr_func_t)(struct timer *tp);
hi
would someone please explain to me this typedef in line 01321 of
appendix b:
typedef void (*tmr_func_t)(struct timer *tp);
i figure its a void datatype, but i don't know what the
(*tmr_func_t)(struct timer *tp); is supposed to say...the book also
mentions how the timer struct makes use of tmr_func_t but to me this
definition doesnt make sense as it doesnt conform to my understnading
of a typedef as
"typedef existing_type new_type_name"
thanx,
martin
-
Re: typedef void (*tmr_func_t)(struct timer *tp);
sancho1980 wrote:
> hi
> would someone please explain to me this typedef in line 01321 of
> appendix b:
>
> typedef void (*tmr_func_t)(struct timer *tp);
>
> i figure its a void datatype, but i don't know what the
> (*tmr_func_t)(struct timer *tp); is supposed to say...the book also
> mentions how the timer struct makes use of tmr_func_t but to me this
> definition doesnt make sense as it doesnt conform to my understnading
> of a typedef as
>
> "typedef existing_type new_type_name"
The typedef reads as "tmr_func_t is a user defined type name for a
pointer to a function (returning void) that takes a pointer to a timer
structure as an argument."
HTH
--
Lew
-
Re: typedef void (*tmr_func_t)(struct timer *tp);
sancho1980 wrote:
> typedef void (*tmr_func_t)(struct timer *tp);
The new type tmr_func_t is defined as the pointer to a function
returning nothing (void) and expecting a pointer to a 'struct timer'
> i figure its a void datatype, but i don't know what the
> (*tmr_func_t)(struct timer *tp); is supposed to say...the book also
> mentions how the timer struct makes use of tmr_func_t but to me this
> definition doesnt make sense as it doesnt conform to my understnading
> of a typedef as
>
> "typedef existing_type new_type_name"
Read it this way (as you put it):
typedef void (*)(struct timer *) tmr_func_t;
[ -- existing_type -- ] [ new type ]
Ciao
Giovanni
--
A computer is like an air conditioner,
it stops working when you open Windows.
Registered Linux user #337974 < http://giovanni.homelinux.net/ >