DavisVaughan / rlib-principles

0 stars 0 forks source link

Namespacing #2

Open DavisVaughan opened 4 years ago

DavisVaughan commented 4 years ago

C doesn't have true namespaces, but pseudo-namespacing can be used through prefixing.

I think it makes sense to have an rlib level namespace prefix of r_ and then each .h file would have its own prefix based off the file name that would come after r_.

For example, attr.h might have:

r_attr_get() r_attr_set()

chr.h would have:

r_chr_get() r_chr_deref()

lionel- commented 4 years ago

I suspect this rule would get in the way of other more important naming rules. Ultimately the organisation of files should be an internal detail.