1 |
/* Header for CCL (Code Conversion Language) interpreter. |
/* Header for CCL (Code Conversion Language) interpreter. |
2 |
Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
Copyright (C) 1995 Electrotechnical Laboratory, JAPAN. |
3 |
Licensed to the Free Software Foundation. |
Licensed to the Free Software Foundation. |
4 |
|
Copyright (C) 2003 |
5 |
|
National Institute of Advanced Industrial Science and Technology (AIST) |
6 |
|
Registration Number H13PRO009 |
7 |
|
|
8 |
This file is part of GNU Emacs. |
This file is part of GNU Emacs. |
9 |
|
|
56 |
many times bigger the output buffer |
many times bigger the output buffer |
57 |
should be than the input buffer. */ |
should be than the input buffer. */ |
58 |
int stack_idx; /* How deep the call of CCL_Call is nested. */ |
int stack_idx; /* How deep the call of CCL_Call is nested. */ |
59 |
int eol_type; /* When the CCL program is used for |
int src_multibyte; /* 1 if the input buffer is multibyte. */ |
60 |
encoding by a coding system, set to |
int dst_multibyte; /* 1 if the output buffer is multibyte. */ |
|
the eol_type of the coding system. |
|
|
In other cases, always |
|
|
CODING_EOL_LF. */ |
|
|
int multibyte; /* 1 if the source text is multibyte. */ |
|
61 |
int cr_consumed; /* Flag for encoding DOS-like EOL |
int cr_consumed; /* Flag for encoding DOS-like EOL |
62 |
format when the CCL program is used |
format when the CCL program is used |
63 |
for encoding by a coding |
for encoding by a coding |
64 |
system. */ |
system. */ |
65 |
|
int consumed; |
66 |
|
int produced; |
67 |
int suppress_error; /* If nonzero, don't insert error |
int suppress_error; /* If nonzero, don't insert error |
68 |
message in the output. */ |
message in the output. */ |
69 |
int eight_bit_control; /* If nonzero, ccl_driver counts all |
int eight_bit_control; /* If nonzero, ccl_driver counts all |
77 |
coding_system. */ |
coding_system. */ |
78 |
|
|
79 |
struct ccl_spec { |
struct ccl_spec { |
80 |
struct ccl_program decoder; |
struct ccl_program ccl; |
|
struct ccl_program encoder; |
|
|
unsigned char valid_codes[256]; |
|
81 |
int cr_carryover; /* CR carryover flag. */ |
int cr_carryover; /* CR carryover flag. */ |
82 |
unsigned char eight_bit_carryover[MAX_MULTIBYTE_LENGTH]; |
unsigned char eight_bit_carryover[MAX_MULTIBYTE_LENGTH]; |
83 |
}; |
}; |
84 |
|
|
85 |
|
#define CODING_SPEC_CCL_PROGRAM(coding) ((coding)->spec.ccl.ccl) |
86 |
|
|
87 |
/* Alist of fontname patterns vs corresponding CCL program. */ |
/* Alist of fontname patterns vs corresponding CCL program. */ |
88 |
extern Lisp_Object Vfont_ccl_encoder_alist; |
extern Lisp_Object Vfont_ccl_encoder_alist; |
89 |
|
|
91 |
execution of ccl program CCL_PROG (symbol or vector). */ |
execution of ccl program CCL_PROG (symbol or vector). */ |
92 |
extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object)); |
extern int setup_ccl_program P_ ((struct ccl_program *, Lisp_Object)); |
93 |
|
|
94 |
extern int ccl_driver P_ ((struct ccl_program *, unsigned char *, |
extern void ccl_driver P_ ((struct ccl_program *, int *, int *, int, int, |
95 |
unsigned char *, int, int, int *)); |
Lisp_Object)); |
96 |
|
|
97 |
/* Vector of CCL program names vs corresponding program data. */ |
/* Vector of CCL program names vs corresponding program data. */ |
98 |
extern Lisp_Object Vccl_program_table; |
extern Lisp_Object Vccl_program_table; |
101 |
is an index for Vccl_protram_table. */ |
is an index for Vccl_protram_table. */ |
102 |
extern Lisp_Object Qccl_program_idx; |
extern Lisp_Object Qccl_program_idx; |
103 |
|
|
104 |
|
extern Lisp_Object Qccl, Qcclp; |
105 |
|
|
106 |
|
EXFUN (Fccl_program_p, 1); |
107 |
|
|
108 |
|
#define CHECK_CCL_PROGRAM(x) \ |
109 |
|
do { \ |
110 |
|
if (NILP (Fccl_program_p (x))) \ |
111 |
|
x = wrong_type_argument (Qcclp, (x)); \ |
112 |
|
} while (0); |
113 |
|
|
114 |
#endif /* EMACS_CCL_H */ |
#endif /* EMACS_CCL_H */ |