1

i am working on a C project using a snake_case syntax for naming my functions. However, a lib i need to uses CamelCase for all of its function names.

To avoid doing a long header full of static inline definitions, i wonder if i could be possible to take advantage of linked script, to dynamically convert the objects identifiers from CamelCase to snake_case.

Is it possible?

Edhyjox
  • 11
  • 1
  • What sources do you have? Do you have the foreign lib source or just a `.so`? In either case, you'll need a script to parse the source or symtab to get a list of translations to feed a linker script or a `.h`. Just function names or also global variables? Please edit your question and post some examples of input symbols and corresponding output symbols. Do you have individual `.c/.o` files? – Craig Estey Jun 27 '23 at 00:06
  • I'm not sure that a _linker_ can change identifiers, but perhaps make pairs mean the same thing. Anyway, objcopy of GNU's binutils can redefine symbols. Please [edit] your question and tell us what target system, compiler, linker, and binary tools you use. – the busybee Jun 27 '23 at 07:02
  • 1
    Using some consistent style for your own code is one thing. Trying to force that same style to third party code and libraries is a different thing. I would not suggest to mess around with those symbols and just use them as they are defined. That also helps distinguishing whether a function is from some external library or your own code – Gerhardh Jun 27 '23 at 07:24

0 Answers0