xref: /titanic_41/usr/src/lib/libbc/libc/gen/common/codeset.h (revision 450396635f70344c58b6b1e4db38cf17ff34445c)
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 1989 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*
28  * codeset information
29  */
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"
32 
33 #ifndef lint
34 /* static  char *sccsid = "%Z%%M%	%I%	%E% SMI"; */
35 #endif
36 
37 #include <stdio.h>
38 #define NAME_SIZE 14		/* Length of the code set name */
39 
40 struct _code_header {
41 	char code_name[NAME_SIZE+1];	/* code set name */
42 	int code_id;			/* code set id */
43 	int code_info_size;		/* size of code set info */
44 };
45 
46 struct _code_set_info {
47 	char code_name[NAME_SIZE+1];	/* code set name */
48 	int code_id;			/* code ID */
49 	char *code_info;		/* code information */
50 	int open_flag;			/* Am I open library ? */
51 };
52 
53 #define EUC_SET		"euc"
54 #define XCCS_SET	"xccs"
55 #define ISO2022_SET	"iso2022"
56 
57 #define CODESET_NONE	0
58 #define CODESET_EUC	2
59 #define CODESET_XCCS	3
60 #define CODESET_ISO2022	4
61 #define CODESET_USER 	100
62 
63 #define ERROR -1
64 #define ERROR_NO_LIB	-2		/* dlopen failed */
65 #define ERROR_NO_SYM	-3		/* dlsym failed */
66 
67 #ifdef DEBUG
68 #define LIBRARY_PATH 	"/tmp/"
69 #else
70 #define LIBRARY_PATH 	"/usr/lib/"
71 #endif
72 
73 void *_ml_open_library();
74