Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site gargoyle.UChicago.UUCP Path: utzoo!watmath!clyde!burl!mgnetp!ihnp4!gargoyle!toby From: toby@gargoyle.UChicago.UUCP (Toby Harness) Newsgroups: net.unix-wizards Subject: Re: long vs. short names Message-ID: <190@gargoyle.UChicago.UUCP> Date: Mon, 27-Aug-84 16:25:42 EDT Article-I.D.: gargoyle.190 Posted: Mon Aug 27 16:25:42 1984 Date-Received: Tue, 28-Aug-84 00:25:14 EDT References: <740@druky.UUCP> Organization: U. Chicago - Computer Science Lines: 42 > re: long vs. short identifiers; it seems to me that with a bit of > judiciousness, one can have it both ways: > instead of doggoneid1 being confused with > doggoneid2 in a truncating compiler, if you declare them > like this: 1doggoneid and > 2doggoneid, ie, make the unique part first instead of last, > then you have portable long ids. see any holes kids? ernie harkins That`s fine when one is writting new code, (and in fact should be considered necessary by any standard of good programming style) but it`s not so helpful when one is porting a piece of code who`s author gave no such consideration to unique identifers. I find myself spending too much time on the latter. Here is a short little script that I pass most 4.2 stuff through. #!/bin/sh # UNISRC_ID: @(#)cnam.sh 1.5 5/12/84 # printout C identifers greater that 15 characters # Toby Harness tmp=/tmp/cnam$$ tmpa=/tmp/cnama$$ trap 'rm -f $tmp $tmpa' 1 2 3 for i in $* do tr -cs '[a-z][A-Z][0-9]_' '[\012*]' < $i | grep '...............*' >> $tmp done sort -d $tmp | uniq > $tmpa fgrep `cut -c1-15 $tmpa | uniq -d` $tmpa rm $tmp $tmpa ------------------------------------------------ Note: The machines I deal with support 15 character external identifers. You may have to change the "grep" and the "cut" to fit your compiler/linker. Toby Harness Ogburn/Stouffer Center, University of Chicago ...ihnp4!gargoyle!toby