libclang C API coding standards

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

libclang C API coding standards

Dennis Luehring via cfe-dev
I'm working on adding some matchers support to libclang however I'm quiet confused with the preferred naming conventions

Current function naming:
 * clang_<c_type>_<method> (e.g. clang_CXCursorSet_insert)
 * clang_<c++type>_<method> (e.g. upper: clang_Cursor_getArgument lower: clang_index_getClientEntity )
 * clang_get<type><attr> (e.g. clang_getDiagnosticInSet)
Dispose and create seems a little more consistent with prefix of clang_create/clang_dispose however there are some which use dispose/create suffix (e.g. clang_IndexAction_*, clang_remap_*)

Even variable names for functions are consistent:
 * No names at all (clang_remap_dispose(CXRemapping))
 * Underscore names (e.g. unsigned index_options)
 * Camel case upper (e.g. unsigned NumTokens)
 * Camel case lower (e.g. unsigned *isGenerated)

With all of these different alternatives what should be used for new code?

cfe-dev mailing list
[hidden email]