Discussion:
Name shortening in C
Add Reply
Joukj
2021-09-30 13:57:33 UTC
Reply
Permalink
Hi all,

when I use the option /name=short when compiling C-code long names are
mangled in a 32-character string. All is documented in the
CXX$DEMANGLER_DB. files.
I would like to create a routine that I can feed with a string and which
gives the shortened string as output, without needing to (inefficiently)
read all the CXX$DEMANGLER_DB. files.

The question is : is the algorithm which is used documented/available?


Regards
Jouk
hb
2021-09-30 14:50:58 UTC
Reply
Permalink
Post by Joukj
Hi all,
when I use the option /name=short when compiling C-code long names are
mangled in a 32-character string. All is documented in the
CXX$DEMANGLER_DB. files.
I would like to create a routine that I can feed with a string and which
gives the shortened string as output, without needing to (inefficiently)
read all the  CXX$DEMANGLER_DB. files.
The question is : is the algorithm which is used documented/available?
          Regards
              Jouk
It's documented, try "$ help cc /names":

A shortened name consists of the first 23 characters of the
name followed by a 7-character Cyclic Redundancy Check (CRC)
computed by looking at the full name, and then a "$".
...
Craig A. Berry
2021-09-30 16:16:18 UTC
Reply
Permalink
Post by Joukj
Hi all,
when I use the option /name=short when compiling C-code long names are
mangled in a 32-character string. All is documented in the
CXX$DEMANGLER_DB. files.
I would like to create a routine that I can feed with a string and which
gives the shortened string as output, without needing to (inefficiently)
read all the  CXX$DEMANGLER_DB. files.
The question is : is the algorithm which is used documented/available?
I've got implementations in C and Perl here:

https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/
Joukj
2021-10-01 06:24:26 UTC
Reply
Permalink
Post by Craig A. Berry
Post by Joukj
Hi all,
when I use the option /name=short when compiling C-code long names are
mangled in a 32-character string. All is documented in the
CXX$DEMANGLER_DB. files.
I would like to create a routine that I can feed with a string and
which gives the shortened string as output, without needing to
(inefficiently) read all the CXX$DEMANGLER_DB. files.
The question is : is the algorithm which is used documented/available?
https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/
Thanks,

I'll check it out

Jouk
Joukj
2021-10-04 09:53:13 UTC
Reply
Permalink
Post by Craig A. Berry
Post by Joukj
Hi all,
when I use the option /name=short when compiling C-code long names are
mangled in a 32-character string. All is documented in the
CXX$DEMANGLER_DB. files.
I would like to create a routine that I can feed with a string and
which gives the shortened string as output, without needing to
(inefficiently) read all the CXX$DEMANGLER_DB. files.
The question is : is the algorithm which is used documented/available?
https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/
The C-version worked fine for me. A version with only the main-program
#ifdef'd out will be inserted in the Freetype package.
(They designed a method to create an .opt file for creating a shareable
image from the C-header files. You need a proper shertening for "long"
names in that case)

Thanks again Craig

Jouk

Loading...