xref: /titanic_44/usr/src/cmd/geniconvtbl/itm_util.h (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #include "iconv_tm.h"
37 #include "itmcomp.h"
38 
39 
40 /*
41  * function prototype
42  */
43 
44 void		itm_def_process(itm_data_t *);
45 
46 itmc_obj_t	*direction_unit(itmc_ref_t *, itm_data_t *,
47 				itmc_action_t *, itm_data_t *);
48 
49 itm_tbl_hdr_t	*obj_table(itm_type_t, itm_data_t *,
50 				itmc_obj_t *, itm_size_t);
51 itmc_ref_t	*obj_register(itm_type_t, itm_data_t *,
52 				void *, size_t, itm_place_t *, itm_type_t);
53 itmc_obj_t	*obj_list_append(itmc_obj_t *, itmc_obj_t *);
54 
55 /* conditions: range, escape sequence */
56 itm_tbl_hdr_t	*range_table(itm_data_t *, itmc_obj_t *);
57 itm_tbl_hdr_t	*escseq_table(itm_data_t *, itmc_obj_t *);
58 
59 /* action: map, operation */
60 itm_tbl_hdr_t	*map_table(itm_data_t *, itmc_map_t *, itmc_map_attr_t *);
61 itmc_map_t	*map_list_append(itmc_map_t *, itmc_map_t *);
62 itmc_obj_t	*op_self(itm_op_type_t);
63 itmc_obj_t	*op_unary(itm_op_type_t, void *, size_t);
64 itmc_obj_t	*op_unit(itm_op_type_t,
65 			void *, size_t, void *, size_t, void *, size_t);
66 itmc_obj_t	*op_self_num(itm_op_type_t, itm_num_t);
67 
68 /* expressions */
69 itm_expr_t	*expr_self_num(itm_expr_type_t, itm_num_t);
70 itm_expr_t	*expr_self(itm_expr_type_t, itm_data_t *);
71 itm_expr_t	*expr_unary(itm_expr_type_t, itm_expr_t *);
72 itm_expr_t	*expr_binary(itm_expr_type_t, itm_expr_t *, itm_expr_t *);
73 itm_expr_t	*expr_binary2(itm_expr_type_t, itm_expr_t *, itm_expr_t *);
74 itm_expr_t	*expr_assign(itm_expr_type_t, itm_data_t *, itm_expr_t *);
75 itm_expr_t	*expr_seq_to_int(itm_expr_t *);
76 
77 
78 extern int	data_compare(const itm_data_t *, const itm_data_t *);
79 extern char    	*dense_enc_index_to_byte_seq(long, long,
80 					unsigned char *, unsigned char *);
81 
82 #define	OBJ_REG_HEAD	(0)
83 #define	OBJ_REG_TAIL	(1)
84 
85 #ifdef	__cplusplus
86 }
87 #endif
88 
89 #endif /* !_ITM_UTIL_H */
90