1 //========================================================================
5 // Copyright 2001-2002 Glyph & Cog, LLC
7 //========================================================================
14 #ifdef USE_GCC_PRAGMAS
19 #include "CharTypes.h"
22 struct CMapVectorEntry;
25 //------------------------------------------------------------------------
30 // Create the CMap specified by <collection> and <cMapName>. Sets
31 // the initial reference count to 1. Returns NULL on failure.
32 static CMap *parse(CMapCache *cache, GString *collectionA,
40 // Return collection name (<registry>-<ordering>).
41 GString *getCollection() { return collection; }
43 // Return true if this CMap matches the specified <collectionA>, and
45 GBool match(GString *collectionA, GString *cMapNameA);
47 // Return the CID corresponding to the character code starting at
48 // <s>, which contains <len> bytes. Sets *<nUsed> to the number of
49 // bytes used by the char code.
50 CID getCID(char *s, int len, int *nUsed);
52 // Return the writing mode (0=horizontal, 1=vertical).
53 int getWMode() { return wMode; }
57 CMap(GString *collectionA, GString *cMapNameA);
58 CMap(GString *collectionA, GString *cMapNameA, int wModeA);
59 void useCMap(CMapCache *cache, char *useName);
60 void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
61 void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
63 void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID);
64 void freeCMapVector(CMapVectorEntry *vec);
68 int wMode; // writing mode (0=horizontal, 1=vertical)
69 CMapVectorEntry *vector; // vector for first byte (NULL for
74 //------------------------------------------------------------------------
76 #define cMapCacheSize 4
84 // Get the <cMapName> CMap for the specified character collection.
85 // Increments its reference count; there will be one reference for
86 // the cache plus one for the caller of this function. Returns NULL
88 CMap *getCMap(GString *collection, GString *cMapName);
92 CMap *cache[cMapCacheSize];