1 //========================================================================
5 // Copyright 2001-2002 Glyph & Cog, LLC
7 //========================================================================
17 #include "CharTypes.h"
20 struct CMapVectorEntry;
23 //------------------------------------------------------------------------
28 // Create the CMap specified by <collection> and <cMapName>. Sets
29 // the initial reference count to 1. Returns NULL on failure.
30 static CMap *parse(CMapCache *cache, GString *collectionA,
38 // Return collection name (<registry>-<ordering>).
39 GString *getCollection() { return collection; }
41 // Return true if this CMap matches the specified <collectionA>, and
43 GBool match(GString *collectionA, GString *cMapNameA);
45 // Return the CID corresponding to the character code starting at
46 // <s>, which contains <len> bytes. Sets *<nUsed> to the number of
47 // bytes used by the char code.
48 CID getCID(char *s, int len, int *nUsed);
50 // Return the writing mode (0=horizontal, 1=vertical).
51 int getWMode() { return wMode; }
55 CMap(GString *collectionA, GString *cMapNameA);
56 CMap(GString *collectionA, GString *cMapNameA, int wModeA);
57 void useCMap(CMapCache *cache, char *useName);
58 void copyVector(CMapVectorEntry *dest, CMapVectorEntry *src);
59 void addCodeSpace(CMapVectorEntry *vec, Guint start, Guint end,
61 void addCIDs(Guint start, Guint end, Guint nBytes, CID firstCID);
62 void freeCMapVector(CMapVectorEntry *vec);
66 int wMode; // writing mode (0=horizontal, 1=vertical)
67 CMapVectorEntry *vector; // vector for first byte (NULL for
72 //------------------------------------------------------------------------
74 #define cMapCacheSize 4
82 // Get the <cMapName> CMap for the specified character collection.
83 // Increments its reference count; there will be one reference for
84 // the cache plus one for the caller of this function. Returns NULL
86 CMap *getCMap(GString *collection, GString *cMapName);
90 CMap *cache[cMapCacheSize];