[gs-cvs] gs/src

L. Peter Deutsch lpd at casper.ghostscript.com
Tue Jul 9 07:04:21 PDT 2002


Update of /cvs/ghostscript/gs/src
In directory casper:/tmp/cvs-serv21022/src

Modified Files:
	gscedata.c gscedata.h gscencs.c gscencs.h 
Log Message:

Adds a procedure for testing whether a string was returned by
gs_c_glyph_name.  Allows the font copying code to share these strings,
substantially reducing the load on the garbage collector.


Index: gscedata.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscedata.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gscedata.c	14 Jun 2002 13:31:53 -0000	1.3
+++ gscedata.c	9 Jul 2002 14:04:19 -0000	1.4
@@ -817,6 +817,8 @@
 't','h','r','e','e','q','u','a','r','t','e','r','s','e','m','d','a','s','h',  /*N(19,0)*/
 0};
 
+const int gs_c_known_encoding_total_chars = 5483;
+
 const int gs_c_known_encoding_max_length = 19;
 
 const ushort gs_c_known_encoding_offsets[] = {

Index: gscedata.h
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscedata.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- gscedata.h	14 Jun 2002 13:31:54 -0000	1.2
+++ gscedata.h	9 Jul 2002 14:04:19 -0000	1.3
@@ -21,6 +21,7 @@
 #define N_OFFSET(e) ((e) >> NUM_LEN_BITS)
 
 extern const char gs_c_known_encoding_chars[];
+extern const int gs_c_known_encoding_total_chars;
 extern const int gs_c_known_encoding_max_length;
 extern const ushort gs_c_known_encoding_offsets[];
 extern const int gs_c_known_encoding_count;

Index: gscencs.c
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscencs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- gscencs.c	9 Jun 2002 23:08:23 -0000	1.5
+++ gscencs.c	9 Jul 2002 14:04:19 -0000	1.6
@@ -87,6 +87,17 @@
 }
 
 /*
+ * Test whether a string is one that was returned by gs_c_glyph_name.
+ */
+bool
+gs_is_c_glyph_name(const byte *str, uint len)
+{
+    return (str >= (const byte *)gs_c_known_encoding_chars &&
+	    (str - (const byte *)gs_c_known_encoding_chars) <
+	      gs_c_known_encoding_total_chars);
+}
+
+/*
  * Return the glyph number corresponding to a string (the inverse of
  * gs_c_glyph_name), or gs_no_glyph if the glyph name is not known.
  */

Index: gscencs.h
===================================================================
RCS file: /cvs/ghostscript/gs/src/gscencs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- gscencs.h	14 Jun 2002 01:57:44 -0000	1.3
+++ gscencs.h	9 Jul 2002 14:04:19 -0000	1.4
@@ -57,8 +57,13 @@
 int gs_c_glyph_name(gs_glyph glyph, gs_const_string *pstr);
 
 /*
+ * Test whether a string is one that was returned by gs_c_glyph_name.
+ */
+bool gs_is_c_glyph_name(const byte *str, uint len);
+
+/*
  * Return the glyph number corresponding to a string (the inverse of
- * gs_c_glyph_name), or gs_no_glyph if the glyph name is not known.
+ * gs_c_glyph_name), or GS_NO_GLYPH if the glyph name is not known.
  */
 gs_glyph gs_c_name_glyph(const byte *str, uint len);
 




More information about the gs-cvs mailing list