microsoft / jacdac-c

Jacdac C Firmware library
https://aka.ms/jacdac
MIT License
12 stars 15 forks source link

prefix all functions with jd_ ? #3

Closed pelikhan closed 3 years ago

pelikhan commented 4 years ago

https://github.com/microsoft/jacdac-c/blob/052213885e2cfe9158869d22dd36b31206835513/inc/interfaces/core/jd_app.h#L3

jamesadevine commented 4 years ago

Probably a good idea, yes. I assume there is some sort of C library convention we should follow? At the moment though "jd_" is prefixed to "library" calls. We should use a different name prefix for low-level apis: "__jd_"

pelikhan commented 4 years ago

Just start everything with jd_, then maybe jd_ll_

pelikhan commented 4 years ago

same for an constants #define JD_ ... we want to be as consistent and conflict free as possible.

jamesadevine commented 4 years ago

Okie dokie, this is the first cut. Let me merge into jacdac-tiny first please.

mmoskal commented 4 years ago

All exported symbols should be jd_* or JD_*. I guess I would prefer _jd_* for internals, _ll_ suggests you can still call them, they are just low level.

As per C standard you cannot start names with _, but everyone does it anyways. I would avoid double underscore though.

jamesadevine commented 4 years ago

👍 for the underscore prefix!