[Python-checkins] python/dist/src/Modules unicodedata.c,2.16,2.17

Andrew MacIntyre andymac@bullseye.apana.org.au
Fri, 14 Jun 2002 22:19:09 +1100 (edt)


On Thu, 13 Jun 2002, M.-A. Lemburg wrote:

> Guido van Rossum wrote:
> >>>Modified Files:
> >>>	unicodedata.c
> >>>Log Message:
> >>>_Py prefix is verboten for static entry points
> >>
> >>That's fine, but please mangle the names in a different way then,
> >>since the _Py was added to avoid compiler problems on some
> >>platform (don't remember which) where e.g. getname() is a system
> >>API.
> >
> >
> > Look carefully -- he called it _getucname.  (Generally I don't think
> > static function names should with an underscore though.)
>
> Even worse... that's not even allowed by ISO/ANSI C ;-)
>
> Seriously, I don't care what you name them, as long as they don't
> stir up compiler noises. How about using "unicode_" as prefix ?

The routine at the centre of this was originally called _getname() before
the _Py prefix was added.  There are also _gethash(), _cmpname() and
_getcode() as well, all in a block prefaced with the comment

  /* database code (cut and pasted from the unidb package) */

There are other statics with a leading underscore in this file too.

I note your name at the top of the file :-)

I don't have any particular favourite convention for this sort of thing,
although I was trying to maintain the pre-existing convention.  However,
going through the file I note that the prefix "unicodedata_" has been used
for some of the other statics - this IMHO is probably slightly more
fitting than "unicode_", no?

This file also seems to be indented with a mixture of spaces and tabs,
too.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andymac@bullseye.apana.org.au  | Snail: PO Box 370
        andymac@pcug.org.au            |        Belconnen  ACT  2616
Web:    http://www.andymac.org/        |        Australia