1 //========================================================================
5 // Copyright 2001-2003 Glyph & Cog, LLC
7 //========================================================================
14 #ifdef USE_GCC_PRAGMAS
19 #include "CharTypes.h"
26 struct CMapVectorEntry;
29 //------------------------------------------------------------------------
34 // Create the CMap specified by <collection> and <cMapName>. Sets
35 // the initial reference count to 1. Returns NULL on failure.
36 static CMap *parse(CMapCache *cache, GString *collectionA,
44 // Return collection name (<registry>-<ordering>).
45 GString *getCollection() { return collection; }
47 // Return true if this CMap matches the specified <collectionA>, and
49 GBool match(GString *collectionA, GString *cMapNameA);
51 // Return the CID corresponding to the character code starting at
52 // <s>, which contains <len> bytes. Sets *<nUsed> to the number of
53 // bytes used by the char code.
54 CID getCID(char *s, int len, int *nUsed);
56 // Return the writing mode (0=horizontal, 1=vertical).
57 int getWMode() { return wMode; }
61 CMap(GString *collectionA, GString *cMapNameA);
62 CMap(GString *collectionA, GString *cMapNameA, int wModeA);
63 void useCMap(CMapCache *cache, char *useName);
64 void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
65 void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
67 void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID);
68 void freeCMapVector(CMapVectorEntry *vec);
72 int wMode; // writing mode (0=horizontal, 1=vertical)
73 CMapVectorEntry *vector; // vector for first byte (NULL for
81 //------------------------------------------------------------------------
83 #define cMapCacheSize 4
91 // Get the <cMapName> CMap for the specified character collection.
92 // Increments its reference count; there will be one reference for
93 // the cache plus one for the caller of this function. Returns NULL
95 CMap *getCMap(GString *collection, GString *cMapName);
99 CMap *cache[cMapCacheSize];