annotate src/mule-ccl.h @ 422:95016f13131a r21-2-19

Import from CVS: tag r21-2-19
author cvs
date Mon, 13 Aug 2007 11:25:01 +0200
parents e804706bfb8c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1 /* Header for CCL (Code Conversion Language) interpreter.
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
2 Copyright (C) 1995,1999 Electrotechnical Laboratory, JAPAN.
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3 Licensed to the Free Software Foundation.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5 This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7 GNU Emacs is free software; you can redistribute it and/or modify
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 the Free Software Foundation; either version 2, or (at your option)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10 any later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12 GNU Emacs is distributed in the hope that it will be useful,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15 GNU General Public License for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18 along with GNU Emacs; see the file COPYING. If not, write to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
22 /* Synched up with: FSF Emacs 20.3.10 */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 398
diff changeset
24 #ifndef _CCL_H
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 398
diff changeset
25 #define _CCL_H
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
26
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
27 /* Macros for exit status of CCL program. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
28 #define CCL_STAT_SUCCESS 0 /* Terminated successfully. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
29 #define CCL_STAT_SUSPEND_BY_SRC 1 /* Terminated by empty input. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
30 #define CCL_STAT_SUSPEND_BY_DST 2 /* Terminated by output buffer full. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
31 #define CCL_STAT_INVALID_CMD 3 /* Terminated because of invalid
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
32 command. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
33 #define CCL_STAT_QUIT 4 /* Terminated because of quit. */
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
34
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 /* Structure to hold information about running CCL code. Read
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36 comments in the file ccl.c for the detail of each field. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37 struct ccl_program {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 int size; /* Size of the compiled code. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 Lisp_Object *prog; /* Pointer into the compiled code. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
40 int ic; /* Instruction Counter (index for PROG). */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
41 int eof_ic; /* Instruction Counter for end-of-file
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
42 processing code. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
43 int reg[8]; /* CCL registers, reg[7] is used for
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
44 condition flag of relational
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
45 operations. */
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
46 int private_state; /* CCL instruction may use this
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
47 for private use, mainly for preservation
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
48 internal states for suspending.
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
49 This variable is set to 0 when ccl is
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
50 set up. */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
51 int last_block; /* Set to 1 while processing the last
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
52 block. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
53 int status; /* Exit status of the CCL program. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
54 int buf_magnification; /* Output buffer magnification. How
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
55 many times bigger the output buffer
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
56 should be than the input buffer. */
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
57 int stack_idx; /* How deep the call of CCL_Call is nested. */
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
58 };
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
59
418
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
60
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
61 #define CCL_MODE_ENCODING 0
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
62 #define CCL_MODE_DECODING 1
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
63
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 398
diff changeset
64 int ccl_driver (struct ccl_program *ccl, CONST unsigned char *source,
418
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
65 unsigned_char_dynarr *destination, int src_bytes,
e804706bfb8c Import from CVS: tag r21-2-17
cvs
parents: 412
diff changeset
66 int *consumed, int conversion_mode);
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
67 void setup_ccl_program (struct ccl_program *ccl, Lisp_Object val);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
68
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
69 /* Alist of fontname patterns vs corresponding CCL program. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
70 extern Lisp_Object Vfont_ccl_encoder_alist;
422
95016f13131a Import from CVS: tag r21-2-19
cvs
parents: 418
diff changeset
71 extern Lisp_Object Qccl_program;
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
72
412
697ef44129c6 Import from CVS: tag r21-2-14
cvs
parents: 398
diff changeset
73 #endif /* _CCL_H */