Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 1998 22:08:33 -0400 (EDT)
From:      Garrett Wollman <wollman@khavrinen.lcs.mit.edu>
To:        "Jordan K. Hubbard" <jkh@time.cdrom.com>
Cc:        committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/libexec/getty main.c 
Message-ID:  <199810090208.WAA21237@khavrinen.lcs.mit.edu>
In-Reply-To: <3634.907895816@time.cdrom.com>
References:  <Pine.BSF.3.96.981008173909.29521F-100000@opus.cts.cwu.edu> <3634.907895816@time.cdrom.com>

next in thread | previous in thread | raw e-mail | index | archive | help
<<On Thu, 08 Oct 1998 18:16:56 -0700, "Jordan K. Hubbard" <jkh@time.cdrom.com> said:

> See the change in question. :)

<bde>
All sorts of things wrong here.  Looking at the header file which
started all this:

	#include <stdio.h>
	#include <sys/cdefs.h>

System headers go first.  Header files should never include other
header files, except for certain system headers and as necessary to
meet formal Standards.

	/* for properties.c */
	typedef struct _property {
		struct _property *next;
		char *name;
		char *value;
	} *properties;

This violates just about every rule in style(9) pertaining to
structure declarations.

	/* for auth.c */
	#define _PATH_AUTHCONF	"/etc/auth.conf"

System paths go in <paths.h>.

	properties properties_read __P((FILE *fp));
	void	properties_free __P((properties list));
	char	*property_find __P((properties list, const char *name));
	char	*auth_getval __P((const char *name));

This breaks even more rules from style(9) pertaining to the
declaration of functions in heaer files.  This whole debacle
illustrates properties_read(), and non-Standard library functions
generally, should not take `FILE *' arguments.  It should be an fd, or
at the very least a `void *' so that clients of other interfaces
declared in the same file need not include <stdio.h>.  By preference
they should be declared in an entirely-separate header file.
</bde>

-GAWollman

--
Garrett A. Wollman   | O Siem / We are all family / O Siem / We're all the same
wollman@lcs.mit.edu  | O Siem / The fires of freedom 
Opinions not those of| Dance in the burning flame
MIT, LCS, CRS, or NSA|                     - Susan Aglukark and Chad Irschick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810090208.WAA21237>