[Geany-devel] struct names / geany macro

Enrico Tröger enrico.troeger at xxxxx
Sun May 25 20:20:01 UTC 2008


On Thu, 22 May 2008 18:36:11 +0100, Nick Treleaven
<nick.treleaven at btinternet.com> wrote:

> Hi,
> There are a couple of things I'm wondering about changing for the API:
> 
> 1. Should we use underscores for struct names? E.g. _GeanyProject. I
> know GTK uses this, but I've read in C programming books that tag
> names with a leading underscore should not be used as the compiler
> uses them. Also it looks a bit ugly. But I don't know if there is a
> portability reason why GTK uses it.

I started using the underscores because I thought this is common
practise (at least I read a lot of code where underscores are used) and
at some point there were problems if structs and types had the same
name, so the easiest solution was to prefix the struct name with an
underscore. Alternatively, we could use a suffix like _s instead. But
this is a little more ugly ;-). But I don't think using different names
for structs and types isn't that bad. It helps differencing the various
symbols.


Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/devel/attachments/20080525/83d3cc60/attachment.pgp>


More information about the Devel mailing list