aboutsummaryrefslogtreecommitdiffstats
path: root/src/ccl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ccl.c')
-rw-r--r--src/ccl.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/ccl.c b/src/ccl.c
index 39b9bc32f09..66e0f2c6169 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -38,16 +38,16 @@ Lisp_Object Qccl, Qcclp;
38 38
39/* This symbol is a property which associates with ccl program vector. 39/* This symbol is a property which associates with ccl program vector.
40 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */ 40 Ex: (get 'ccl-big5-encoder 'ccl-program) returns ccl program vector. */
41Lisp_Object Qccl_program; 41static Lisp_Object Qccl_program;
42 42
43/* These symbols are properties which associate with code conversion 43/* These symbols are properties which associate with code conversion
44 map and their ID respectively. */ 44 map and their ID respectively. */
45Lisp_Object Qcode_conversion_map; 45static Lisp_Object Qcode_conversion_map;
46Lisp_Object Qcode_conversion_map_id; 46static Lisp_Object Qcode_conversion_map_id;
47 47
48/* Symbols of ccl program have this property, a value of the property 48/* Symbols of ccl program have this property, a value of the property
49 is an index for Vccl_protram_table. */ 49 is an index for Vccl_protram_table. */
50Lisp_Object Qccl_program_idx; 50static Lisp_Object Qccl_program_idx;
51 51
52/* Table of registered CCL programs. Each element is a vector of 52/* Table of registered CCL programs. Each element is a vector of
53 NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the 53 NAME, CCL_PROG, RESOLVEDP, and UPDATEDP, where NAME (symbol) is the
@@ -56,7 +56,7 @@ Lisp_Object Qccl_program_idx;
56 CCL_PROG is already resolved to index numbers or not, UPDATEDP (t 56 CCL_PROG is already resolved to index numbers or not, UPDATEDP (t
57 or nil) is the flat to tell if the CCL program is updated after it 57 or nil) is the flat to tell if the CCL program is updated after it
58 was once used. */ 58 was once used. */
59Lisp_Object Vccl_program_table; 59static Lisp_Object Vccl_program_table;
60 60
61/* Return a hash table of id number ID. */ 61/* Return a hash table of id number ID. */
62#define GET_HASH_TABLE(id) \ 62#define GET_HASH_TABLE(id) \
@@ -1929,30 +1929,6 @@ setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog)
1929} 1929}
1930 1930
1931 1931
1932/* Check if CCL is updated or not. If not, re-setup members of CCL. */
1933
1934int
1935check_ccl_update (struct ccl_program *ccl)
1936{
1937 Lisp_Object slot, ccl_prog;
1938
1939 if (ccl->idx < 0)
1940 return 0;
1941 slot = AREF (Vccl_program_table, ccl->idx);
1942 if (NILP (AREF (slot, 3)))
1943 return 0;
1944 ccl_prog = ccl_get_compiled_code (AREF (slot, 0), &ccl->idx);
1945 if (! VECTORP (ccl_prog))
1946 return -1;
1947 ccl->size = ASIZE (ccl_prog);
1948 ccl->prog = XVECTOR (ccl_prog)->contents;
1949 ccl->eof_ic = XINT (AREF (ccl_prog, CCL_HEADER_EOF));
1950 ccl->buf_magnification = XINT (AREF (ccl_prog, CCL_HEADER_BUF_MAG));
1951 ASET (slot, 3, Qnil);
1952 return 0;
1953}
1954
1955
1956DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, 1932DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0,
1957 doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code. 1933 doc: /* Return t if OBJECT is a CCL program name or a compiled CCL program code.
1958See the documentation of `define-ccl-program' for the detail of CCL program. */) 1934See the documentation of `define-ccl-program' for the detail of CCL program. */)