Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site watmath.UUCP Path: utzoo!watmath!idallen From: idallen@watmath.UUCP Newsgroups: net.unix,net.lang.c,net.unix-wizards Subject: Qualified Names mean you don't break the C Library Message-ID: <8430@watmath.UUCP> Date: Mon, 23-Jul-84 19:54:57 EDT Article-I.D.: watmath.8430 Posted: Mon Jul 23 19:54:57 1984 Date-Received: Tue, 24-Jul-84 04:17:11 EDT References: <2065@rlgvax.UUCP>, <142@pyuxt.UUCP>, <8241@watmath.UUCP>, <297@watdcsu.UUCP>, <8248@watmath.UUCP> Organization: U of Waterloo, Ontario Lines: 27 If you don't have unique names for things like printf and getchar, names that are identifiable so that no programmer will use them by mistake, then you can never have one C Library routine call another C Library routine, because the called routine might have been accidentally redefined to do something that the Library doesn't expect. If I write a do-nothing function called malloc() and put it in my program, every C Library routine that uses malloc() breaks. This is a bad thing. I do not want to have to learn all the names of every routine that ever is, was, or will be put in the C Library. I want to be told "if you never use an external name like such-and-so, you will never break the library". The C Library should be calling a special internal name for malloc(); not a simple external name that you are likely to stumble across. If you *really* want to redefine the Library's malloc, you redefine the internal name -- but, it is very clear (by the form of the name) that you are doing something special. The B Programming Language has reserved identifiers containing a period for internal system use. My programs call printf() -- the library always calls .prntf(). If I never use an external with a period in it, I never mess up the library. Of course, this only works like this because most programs are two-tiered -- my source, and the library. When you start to apply this to different libraries, each needing its own convention for identifiers... argh. -- -IAN! (Ian! D. Allen) University of Waterloo