summaryrefslogtreecommitdiff
path: root/src/tools/apinames.c
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2023-03-07 07:28:32 +0100
committerWerner Lemberg <wl@gnu.org>2023-03-07 07:28:32 +0100
commit092f9d9874756380240f91716aef5e67c66f437d (patch)
tree4e070766fce63e2fc33db2256d54294c979de6ff /src/tools/apinames.c
parent72a8d652187b8bb82d7cee3abc63c9ac66909ffe (diff)
downloadfreetype2-092f9d9874756380240f91716aef5e67c66f437d.tar.gz
[apinames] Fix VMS handling of overly long function names.
Based on ideas from Jouk Jansen <joukj@hrem.nano.tudelft.nl>. * src/tools/vms_shorten_symbol.c: New file, taken from https://sourceforge.net/p/vms-ports/vmsshortsym/ci/default/tree/vms_shorten_symbol.c with some minor edits to allow compilation with C++ and being included in another source code file. * src/tools/apinames.c: Include `vms_shorten_symbol.c`. (PROGRAM_VERSION): Set to '0.5'. (names_dump) [OUTPUT_VMS_OPT]: Call `vms_shorten_symbol` to get unique function identifiers not longer than 31 characters.
Diffstat (limited to 'src/tools/apinames.c')
-rw-r--r--src/tools/apinames.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/tools/apinames.c b/src/tools/apinames.c
index e1b085172..8c395aea3 100644
--- a/src/tools/apinames.c
+++ b/src/tools/apinames.c
@@ -22,8 +22,10 @@
#include <string.h>
#include <ctype.h>
+#include "vms_shorten_symbol.c"
+
#define PROGRAM_NAME "apinames"
-#define PROGRAM_VERSION "0.4"
+#define PROGRAM_VERSION "0.5"
#define LINEBUFF_SIZE 1024
@@ -214,12 +216,23 @@ names_dump( FILE* out,
break;
case OUTPUT_VMS_OPT:
- fprintf( out, "GSMATCH=LEQUAL,2,0\n"
- "CASE_SENSITIVE=YES\n"
- "SYMBOL_VECTOR=(-\n" );
- for ( nn = 0; nn < num_names - 1; nn++ )
- fprintf( out, " %s=PROCEDURE,-\n", the_names[nn].name );
- fprintf( out, " %s=PROCEDURE)\n", the_names[num_names - 1].name );
+ fprintf( out, "case_sensitive=YES\n" );
+
+ for ( nn = 0; nn < num_names; nn++ )
+ {
+ char short_symbol[32];
+
+
+ if ( vms_shorten_symbol( the_names[nn].name, short_symbol, 1 ) == -1 )
+ panic( "could not shorten name '%s'", the_names[nn].name );
+ fprintf( out, "symbol_vector = ( %s = PROCEDURE)\n", short_symbol );
+
+ strcat( the_names[nn].name , "64__" );
+
+ if ( vms_shorten_symbol( the_names[nn].name, short_symbol, 1 ) == -1 )
+ panic( "could not shorten name '%s'", the_names[nn].name );
+ fprintf( out, "symbol_vector = ( %s = PROCEDURE)\n", short_symbol );
+ }
break;