Back to index

texmacs  1.0.7.15
cmap.h
Go to the documentation of this file.
00001 /*  $Header: /home/cvsroot/dvipdfmx/src/cmap.h,v 1.15 2004/09/05 13:30:05 hirata Exp $
00002 
00003     This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
00004 
00005     Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
00006     the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
00007 
00008     This program is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     This program is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with this program; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
00021 */
00022 
00023 #ifndef _CMAP_H_
00024 #define _CMAP_H_
00025 
00026 #include "cid.h"
00027 
00028 #include <sys/types.h>
00029 
00030 typedef unsigned short CID;
00031 typedef unsigned short UCV16;
00032 
00033 /* Limits */
00034 #define CID_MAX_CID  65535
00035 #define CID_MAX      CID_MAX_CID
00036 
00037 #define CID_NOTDEF_CHAR   "\0\0"
00038 #define CID_NOTDEF        0
00039 
00040 #define UCS_NOTDEF_CHAR   "\377\375"
00041 #define UCS_NOTDEF        0xfffd
00042 
00043 /*
00044  * TYPE_IDENTITY and TYPE_CID_TO_CODE is not defined in the CMap spec.
00045  */
00046 #define CMAP_TYPE_IDENTITY    0
00047 #define CMAP_TYPE_CODE_TO_CID 1
00048 #define CMAP_TYPE_TO_UNICODE  2
00049 #define CMAP_TYPE_CID_TO_CODE 3
00050 
00051 #define CMAP_PROF_TYPE_INBYTES_MIN  0
00052 #define CMAP_PROF_TYPE_INBYTES_MAX  1
00053 #define CMAP_PROF_TYPE_OUTBYTES_MIN 2
00054 #define CMAP_PROF_TYPE_OUTBYTES_MAX 3
00055 
00056 typedef struct CMap CMap;
00057 
00058 
00059 /************************** CMAP_MAIN **************************/
00060 
00061 extern void CMap_set_verbose (void);
00062 extern void CMap_set_silent  (int value);
00063 
00064 extern CMap  *CMap_new     (void);
00065 extern void   CMap_release (CMap *cmap);
00066 
00067 extern int    CMap_is_valid    (CMap *cmap);
00068 extern int    CMap_is_Identity (CMap *cmap);
00069 extern int    CMap_get_profile (CMap *cmap, int type);
00070 
00071 extern char       *CMap_get_name (CMap *cmap);
00072 extern int         CMap_get_type (CMap *cmap);
00073 extern int         CMap_get_wmode(CMap *cmap);
00074 extern CIDSysInfo *CMap_get_CIDSysInfo(CMap *cmap);
00075 
00076 extern void   CMap_set_name   (CMap *cmap, const char *name);
00077 extern void   CMap_set_type   (CMap *cmap, int type);
00078 extern void   CMap_set_wmode  (CMap *cmap, int wmode);
00079 extern void   CMap_set_usecmap(CMap *cmap, CMap *ucmap);
00080 extern void   CMap_set_CIDSysInfo (CMap *cmap, const CIDSysInfo *csi);
00081 
00082 /* charName not supported */
00083 extern int   CMap_add_bfchar  (CMap *cmap,
00084                             const unsigned char *src, int srcdim,
00085                             const unsigned char *dest, int destdim);
00086 extern int   CMap_add_cidchar (CMap *cmap,
00087                             const unsigned char *src, int srcdim, CID dest);
00088 extern int   CMap_add_bfrange (CMap *cmap,
00089                             const unsigned char *srclo, const unsigned char *srchi, int srcdim,
00090                             const unsigned char *dest, int destdim);
00091 extern int   CMap_add_cidrange(CMap *cmap,
00092                             const unsigned char *srclo, const unsigned char *hi, int srcdim,
00093                             CID base);
00094 
00095 extern int CMap_add_notdefchar  (CMap *cmap, const unsigned char *src, int srcdim, CID dst);
00096 extern int CMap_add_notdefrange (CMap *cmap,
00097                              const unsigned char *srclo, const unsigned char *srchi, int srcdim,
00098                              CID dst);
00099 
00100 extern int  CMap_add_codespacerange (CMap *cmap,
00101                                  const unsigned char *codelo, const unsigned char *codehi, int dim);
00102 extern int  CMap_match_codespace    (CMap *cmap, const unsigned char *c, int dim);
00103 
00104 extern void CMap_decode_char (CMap *cmap,
00105                            const unsigned char **inbuf, long *inbytesleft,
00106                            unsigned char **outbuf, long *outbytesleft);
00107 
00108 extern long CMap_decode (CMap *cmap,
00109                       const unsigned char **inbuf,  long *inbytesleft,
00110                       unsigned char **outbuf, long *outbytesleft);
00111 
00112 extern void  CMap_cache_init  (void);
00113 extern CMap *CMap_cache_get   (int id);
00114 extern int   CMap_cache_find  (const char *cmap_name);
00115 extern void  CMap_cache_close (void);
00116 extern int   CMap_cache_add   (CMap *cmap);
00117 
00118 #endif /* _CMAP_H_ */