From: utzoo!decvax!harpo!seismo!hao!hplabs!sri-unix!gwyn@Brl-Vld.ARPA Newsgroups: net.unix-wizards Title: Re: Naming conventions for library functions Article-I.D.: sri-arpa.897 Posted: Wed Mar 30 07:54:31 1983 Received: Tue Apr 19 01:06:13 1983 From: Doug Gwyn (VLD/VMB) I missed some of this discussion, but I would like to point out that C can indeed be used successfully on non-UNIX systems. The best way to do this seems to be to have on hand a run-time library containing as many UNIX-compatible routines as possible: certainly stdio, and most of the other "section 3" routines. In turn, these routines can generally be written to use UNIX-like system interface calls when they need system services. I built an environment very like UNIX on a RSTS/E operating system in this way; the very same user interface can be provided on essentially any modern operating system. There is a well-established naming convention for externs that are in danger of being used unawares by a programmer: in C, prepend an underscore to "private system library" externs, use statics for externs that needn't be published, and only use non-underscore names in the documented run-time interface for general programmer use. (At assembly language level, the underscore may be mapped into some other character such as ., $, or in extreme emergency, Q8.)