| From | Sent On | Attachments |
|---|---|---|
| Matt | Apr 4, 2005 11:43 am | |
| Devon H. O'Dell | Apr 4, 2005 11:49 am | |
| Marc Olzheim | Apr 4, 2005 11:49 am | |
| Joerg Sonnenberger | Apr 4, 2005 11:51 am | |
| Dan Nelson | Apr 4, 2005 11:55 am | |
| Mike Meyer | Apr 5, 2005 4:50 am | |
| gilles chehade | Apr 5, 2005 4:50 am | |
| Dunceor . | Apr 5, 2005 4:50 am | |
| ra...@redshift.com | Apr 5, 2005 5:25 am | |
| Peter Jeremy | Apr 7, 2005 1:36 am | |
| Stijn Hoop | Apr 7, 2005 1:39 am | |
| ra...@redshift.com | Apr 7, 2005 1:50 am | |
| ra...@redshift.com | Apr 7, 2005 1:51 am | |
| Zera William Holladay | Apr 7, 2005 7:24 am | |
| Robert Watson | Apr 7, 2005 12:08 pm | |
| Michael Shalayeff | Jul 7, 2005 12:08 pm | |
| chaton | Jul 7, 2005 12:08 pm | |
| Juan J. Martínez | Jul 7, 2005 12:10 pm | |
| Juan J. Martínez | Jul 7, 2005 12:10 pm | |
| Mike Meyer | Jul 8, 2005 12:25 pm |
| Subject: | C programming question | |
|---|---|---|
| From: | Dan Nelson (dnel...@allantgroup.com) | |
| Date: | Apr 4, 2005 11:55:25 am | |
| List: | org.freebsd.freebsd-hackers | |
In the last episode (Apr 04), Matt said:
I need some help understanding some C code.
int (*if_ioctl) (struct ifnet *, int, caddr_t);
int (*if_watchdog) (int);
Can someone break down these declarations (if that's what they are)? Is this a form of typecasting? Thanks for your help.
The cdecl command (ports/devel/cutils) is good as decoding stuff like this. Those two lines declare variables that are pointers to functions.
$ cdecl explain "int (*if_ioctl) (struct ifnet *, int, caddr_t)"
declare if_ioctl as pointer to function (pointer to struct ifnet, int, addr_t)
returning int
$ cdecl explain "int (*if_watchdog) (int)"
declare if_watchdog as pointer to function (int) returning int
-- Dan Nelson dnel...@allantgroup.com





