Dumb identifier name question

Hi all,

I'm currently in the process of implementing a priority queue which I hope
can be incorporated into glib in the future.  

I'm trying to copy the coding style from the gtk library, so I had a look
at how glib declares its data types.  In the process, I noticed something
that, if I've understood correctly, violates the C standard.

The include guards on the header files are of the form
#ifndef __G_FOO_H__
#define __G_FOO_H__

/* . . . */


And the typedefs for glib structure are of the form

typedef struct _GBar GBar;

According to K&R 2nd edition appendix B (p 241), introducing the C
standard library, "External identifiers that begin with an underscore are 
reserved for use by the library, as are all other identifiers that begin 
with an underscore and an upper-case letter or another underscore".

Now, the way I read it, both the include guards and the structure names 
are using identifiers that are reserved for the standard library.  

Is there some reason I'm missing that this is actually ideologically
sound in this case?  

I realise the practical chances of this causing a problem
are small, but then again the effort required to fix it is also basically

                                           Robert Merkel
                                          rgmerk mira net
For every fatal shooting, there were roughly three non-fatal shootings.
And, folks, this is just unacceptable in America.  It's just unacceptable.
And we're going to do something about it.
  -- George W. Bush.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]