[net.micro.mac] C Compatibility Problems - SKEL.c

sjl@amdahl.UUCP (Steve Langdon) (03/21/85)

The community of Mac programmers using C are faced with an unpleasant
compatibility problem.  Megamax C naming conventions do not follow
Apple's recommendations and it is very painful to convert programs
written for the Megamax compiler to run with compilers that do adhere to
Apple's standard.  I discovered the problem while attempting to bring
up SKEL.c on Mac C (from Consulair Corp.) and SUMacC.

It is extremely tedious to translate a large number of identifiers even
when you have the UNIX text processing tools available.  A Mac user
without UNIX access would have a really bad time performing the conversion.
I, along with many UNIX users dislike reaching for the shift key, but I
consider Megamax's decision to use lower case names a piece of crass
stupidity.  An imperfect standard is better than no standard in this
situation, and I hate to think about the hours that will be wasted if
Megamax do not conform.

I have a translated version of SKEL.c which works with Mac C and compiles
cleanly on SUMacC (I should have the SUMacC version running soon).  It
should be posted soon but I am attempting to coordinate the distribution
with the author and the original (Megamax) C translator.  Mac C and
SUMacC are fairly compatible so a few #ifdefs are sufficient to take care
of the differences between these compliers.

For those unfamiliar with Apple's naming convention I have included the
pertinent section of the SUMacC document.

>Naming conventions.
>
>     Since Pascal is case insensitive,  some  of  the  names
>present in the original Pascal header files had inconsistent
>case conventions.  Apple realized the headaches  this  could
>cause  for C programmers, and in October 84 released a small
>set of rules that govern case in names.  When you invent new
>names, you should use these rules.
>
>1.  The first character of a name is upper case if the  sym-
>    bol  is:   a  toolbox routine name, a type, an assembler
>    global symbol.
>    e.g.: InitGraf, MoveTo, ProcPtr, MonkeyLives
>
>2.  The first character of a name is lower case if the  sym-
>    bol is:  a field, a constant, a variable.
>    e.g.: shiftKey, everyEvent, fInvisible
>
>3.  If the name consists of multiple words, the subwords are
>    capitalized.
>
>4.  If there are acronyms within the name,  they  are  cased
>    the same.
>    e.g.: fCTS, ctsHold, TEHandle, TENew, eofErr
>
-- 
Stephen J. Langdon                  ...!{ihnp4,hplabs,sun,nsc}!amdahl!sjl

[ The article above is not an official statement from any organization
  in the known universe. ]

mmr@akguc.UUCP (M.R. Reynolds [Mickey]) (03/23/85)

The recent upgrade to Megamax' C compiler includes a utility
to convert toolbox names from mixed case (a la Inside Mac) to
all lower case and back.  According to Megamax, the program 
works on any type of file including library, source or object.
Therefore, compatability with other C compilers should be
improved.