Some updates to HACKING

Russ Allbery rra at stanford.edu
Wed Feb 20 00:19:20 UTC 2002


I updated some of the information about generating POD documentation to
reflect the fact that I've been doing tons of development on podlators
since the last time I wrote about it in HACKING.  :)  podlators is up to
1.21, but 1.19 and later should all be equivalent for INN's purposes.

I also added, provisionally, the following style note which reflects what
I've been doing with new code, but I'm willing to rip it back out again if
people object.  :)  Let me know.  This is a style point with C that's been
widely debated on other mailing lists and free software projects that I
follow and the below seems to be the general consensus:

    *  Plain structs make perfectly reasonable abstract data types; it's not
       necessary to typedef the struct to something else.  Structs are
       actually very useful for opaque data structures, since you can
       predeclare them and then manipulate pointers to them without ever
       having to know what the contents look like.  Please try to avoid
       typedefs except for function pointers or other extremely confusing
       data types.  Also avoid using the _t suffix for any type; all types
       ending in _t are reserved by POSIX.  For typedefs of function pointer
       types, a suffix of _func usually works.

       This style point is currently widely violated inside of INN itself;
       INN originally made extensive use of typedefs.

I find it a lot easier to read code when I can see what's a struct and
what's a basic type of some sort and don't have to keep chasing down
typedefs to figure out what's what.

But as I say, I'm willing to change this if people object.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list