Name: Anonymous 2010-04-09 3:53
I'm trying to decide on a naming convention for my C library. Do I do pthreads/libpng/etc style, using capital letters only for constants and macros?
Do I do CamelCase?
Or do I do something even more crazy?
I'm definitely leaning towards pure lowercase. It's not really more work to write, and it's a lot easier to read afterwards. Plus it's really consistent with the standard library, among others.
What convention do /prog/lodites use?
typedef struct foo {
int* bar;
} foo_t;
void foo_init(foo_t* self) {
self->bar = (int*) malloc(sizeof(int) * 5);
}
void foo_destroy(foo_t* self) {
free(self->bar);
}Do I do CamelCase?
typedef struct Foo {
int* bar;
} Foo;
void FooInit(Foo* self) {
self->bar = (int*) malloc(sizeof(int) * 5);
}
void FooDestroy(Foo* self) {
free(self->bar);
}Or do I do something even more crazy?
I'm definitely leaning towards pure lowercase. It's not really more work to write, and it's a lot easier to read afterwards. Plus it's really consistent with the standard library, among others.
What convention do /prog/lodites use?