diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-10-08 16:04:56 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-10-08 16:04:56 +0100 |
commit | e170ee146791061f4fcc9523a901cdc1c6c8525b (patch) | |
tree | 658a5b13168d59d68e8493f180d23cb898cb5d90 /src/duk-libdom.h | |
parent | c2c05535f6a758d58fd3d7e995ef320778a9eb01 (diff) | |
download | nsgenbind-e170ee146791061f4fcc9523a901cdc1c6c8525b.tar.gz nsgenbind-e170ee146791061f4fcc9523a901cdc1c6c8525b.tar.bz2 |
Split out idl to c name conversion
Diffstat (limited to 'src/duk-libdom.h')
-rw-r--r-- | src/duk-libdom.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/duk-libdom.h b/src/duk-libdom.h index dd27420..73b7233 100644 --- a/src/duk-libdom.h +++ b/src/duk-libdom.h @@ -96,4 +96,19 @@ int output_method_cdata(FILE* outf, struct genbind_node *node, enum genbind_meth */ int output_ctype(FILE *outf, struct genbind_node *node, bool identifier); +/** + * Generate a C name from an IDL name. + * + * The IDL interface names are camelcase and not similar to libdom naming so it + * is necessary to convert them to a libdom compatible class name. This + * implementation is simple ASCII capable only and cannot cope with multibyte + * codepoints. + * + * The algorithm is: + * - copy characters to output lowering their case + * - if the previous character in the input name was uppercase and the current + * one is lowercase insert an underscore before the *previous* character. + */ +char *gen_idl2c_name(const char *idlname); + #endif |