From owner-freebsd-hackers Wed Sep 23 05:16:42 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA15178 for freebsd-hackers-outgoing; Wed, 23 Sep 1998 05:16:42 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from gilgamesch.bik-gmbh.de (gilgamesch.bik-gmbh.de [194.233.237.91]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA15171 for ; Wed, 23 Sep 1998 05:16:39 -0700 (PDT) (envelope-from cracauer@gilgamesch.bik-gmbh.de) Received: (from cracauer@localhost) by gilgamesch.bik-gmbh.de (8.8.8/8.7.3) id OAA22072; Wed, 23 Sep 1998 14:16:19 +0200 (MET DST) Message-ID: <19980923141618.A21991@cons.org> Date: Wed, 23 Sep 1998 14:16:18 +0200 From: Martin Cracauer To: Niall Smart , hackers@FreeBSD.ORG Subject: Re: Quick code style question. References: <98Sep23.123042bst.19713@gateway.euristix.ie> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1i In-Reply-To: <98Sep23.123042bst.19713@gateway.euristix.ie>; from Niall Smart on Wed, Sep 23, 1998 at 11:10:38AM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In <98Sep23.123042bst.19713@gateway.euristix.ie>, Niall Smart wrote: > Hi, > > I was adding support for an environment variable which specifies an > alternate /etc/services file for getservent() et al when I noticed > that netdb.h exports a private interface used internally in libc: > > /* > * PRIVATE functions specific to the FreeBSD implementation > */ > > /* DO NOT USE THESE, THEY ARE SUBJECT TO CHANGE AND ARE NOT PORTABLE!!! */ > void _sethosthtent __P((int)); > void _endhosthtent __P((void)); > void _sethostdnsent __P((int)); > [snip] > > Surely it would be much better if these were either protected by a > _NETDB_INTERNAL_ macro or moved into a separate header in lib/libc/net. > Which of these two is preferable? Not speaking for the FreeBSD project and not commenting on your getservent() changes, I think the macros would do. The amount of information for the new header file is small and it would be consistent with #ifdef KERNEL in sys/ and machine/. FreeBSD generally doesn't use sperate header files for private information. On the technical side, the macro solution is also better because it easily supports more than two levels of visibility and it is easy to raise or lower the level of visibilty from inside another header file or on the compiler command line. Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message