xref: /illumos-gate/usr/src/cmd/geniconvtbl/itm_util.h (revision ddb365bfc9e868ad24ccdcb0dc91af18b10df082)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (c) 1999 by Sun Microsystems, Inc.
24  * All rights reserved.
25  */
26 
27 #ifndef	_ITM_UTIL_H
28 #define	_ITM_UTIL_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 #include "iconv_tm.h"
35 #include "itmcomp.h"
36 
37 
38 /*
39  * function prototype
40  */
41 
42 void		itm_def_process(itm_data_t *);
43 
44 itmc_obj_t	*direction_unit(itmc_ref_t *, itm_data_t *,
45 				itmc_action_t *, itm_data_t *);
46 
47 itm_tbl_hdr_t	*obj_table(itm_type_t, itm_data_t *,
48 				itmc_obj_t *, itm_size_t);
49 itmc_ref_t	*obj_register(itm_type_t, itm_data_t *,
50 				void *, size_t, itm_place_t *, itm_type_t);
51 itmc_obj_t	*obj_list_append(itmc_obj_t *, itmc_obj_t *);
52 
53 /* conditions: range, escape sequence */
54 itm_tbl_hdr_t	*range_table(itm_data_t *, itmc_obj_t *);
55 itm_tbl_hdr_t	*escseq_table(itm_data_t *, itmc_obj_t *);
56 
57 /* action: map, operation */
58 itm_tbl_hdr_t	*map_table(itm_data_t *, itmc_map_t *, itmc_map_attr_t *);
59 itmc_map_t	*map_list_append(itmc_map_t *, itmc_map_t *);
60 itmc_obj_t	*op_self(itm_op_type_t);
61 itmc_obj_t	*op_unary(itm_op_type_t, void *, size_t);
62 itmc_obj_t	*op_unit(itm_op_type_t,
63 			void *, size_t, void *, size_t, void *, size_t);
64 itmc_obj_t	*op_self_num(itm_op_type_t, itm_num_t);
65 
66 /* expressions */
67 itm_expr_t	*expr_self_num(itm_expr_type_t, itm_num_t);
68 itm_expr_t	*expr_self(itm_expr_type_t, itm_data_t *);
69 itm_expr_t	*expr_unary(itm_expr_type_t, itm_expr_t *);
70 itm_expr_t	*expr_binary(itm_expr_type_t, itm_expr_t *, itm_expr_t *);
71 itm_expr_t	*expr_binary2(itm_expr_type_t, itm_expr_t *, itm_expr_t *);
72 itm_expr_t	*expr_assign(itm_expr_type_t, itm_data_t *, itm_expr_t *);
73 itm_expr_t	*expr_seq_to_int(itm_expr_t *);
74 
75 
76 extern int	data_compare(const itm_data_t *, const itm_data_t *);
77 extern char    	*dense_enc_index_to_byte_seq(long, long,
78 					unsigned char *, unsigned char *);
79 
80 #define	OBJ_REG_HEAD	(0)
81 #define	OBJ_REG_TAIL	(1)
82 
83 #ifdef	__cplusplus
84 }
85 #endif
86 
87 #endif /* !_ITM_UTIL_H */
88