Date: Mon, 21 Oct 1996 09:53:27 +0900 (JST) From: Michael Hancock <michaelh@cet.co.jp> To: phk@FreeBSD.ORG Cc: current@FreeBSD.ORG Subject: Re: <sys/queue.h> Message-ID: <Pine.SV4.3.93.961021094920.20316A-100000@parkplace.cet.co.jp> In-Reply-To: <24020.845822819@critter.tfs.com>
next in thread | previous in thread | raw e-mail | index | archive | help
For a good explanation of why you only want to use typedefs for scalar types and function types see "Expert C Programming" by Van der Linden, SunPress. It's a biased book, but it does contain a lot of good stuff on C. Regards, Mike Hancock On Sun, 20 Oct 1996, Poul-Henning Kamp wrote: > As much as I like this file there's one detail that I hate: > > /* > * Singly-linked List definitions. > */ > #define SLIST_HEAD(name, type) \ > struct name { \ > - struct type *slh_first; /* first element */ \ > + type *slh_first; /* first element */ \ > } > > If I have something like this: > > typedef struct geom_req_s geom_req; > > struct geom_req_s { > ... > }; > > How can I add a any of the types from <sys/types.h> to this data-type > in a clean fashion ? All other use the typedef, but for the queues > I have to use the struct name. > > Is it too late to fix this oversight in <sys/queue.h> ? >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SV4.3.93.961021094920.20316A-100000>