diff options
Diffstat (limited to 'src/ccl.c')
| -rw-r--r-- | src/ccl.c | 34 |
1 files changed, 5 insertions, 29 deletions
| @@ -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. */ |
| 41 | Lisp_Object Qccl_program; | 41 | static 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. */ |
| 45 | Lisp_Object Qcode_conversion_map; | 45 | static Lisp_Object Qcode_conversion_map; |
| 46 | Lisp_Object Qcode_conversion_map_id; | 46 | static 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. */ |
| 50 | Lisp_Object Qccl_program_idx; | 50 | static 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. */ |
| 59 | Lisp_Object Vccl_program_table; | 59 | static 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 | |||
| 1934 | int | ||
| 1935 | check_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 | |||
| 1956 | DEFUN ("ccl-program-p", Fccl_program_p, Sccl_program_p, 1, 1, 0, | 1932 | DEFUN ("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. |
| 1958 | See the documentation of `define-ccl-program' for the detail of CCL program. */) | 1934 | See the documentation of `define-ccl-program' for the detail of CCL program. */) |