Home | History | Annotate | Download | only in smbsrv
      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 (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 /*
     22  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     23  * Use is subject to license terms.
     24  */
     25 
     26 #ifndef	_SMBSRV_CODEPAGE_H
     27 #define	_SMBSRV_CODEPAGE_H
     28 
     29 #pragma ident	"@(#)codepage.h	1.1	07/10/25 SMI"
     30 
     31 #include <smbsrv/string.h>
     32 #include <smbsrv/smb_i18n.h>
     33 
     34 #ifdef __cplusplus
     35 extern "C" {
     36 #endif
     37 
     38 /*
     39  * Labels to define whether a code page table entry is an uppercase
     40  * character, a lowercase character or neither. One of these values
     41  * should appear in the ctype field of the code page tables.
     42  */
     43 #define	CODEPAGE_ISNONE		0x00
     44 #define	CODEPAGE_ISUPPER	0x01
     45 #define	CODEPAGE_ISLOWER	0x02
     46 
     47 /*
     48  * The structure of a code page entry. Each code page table will
     49  * consist of an array of 256 codepage entries.
     50  *
     51  * ctype indicates case of the value.
     52  * upper indicates the uppercase equivalent value.
     53  * lower indicates the lowercase equivalent value.
     54  */
     55 typedef struct codepage {
     56 	unsigned char ctype;
     57 	mts_wchar_t upper;
     58 	mts_wchar_t lower;
     59 } codepage_t;
     60 
     61 /*
     62  * Global pointer to the current code page. This is
     63  * defaulted to a standard ASCII table.
     64  */
     65 extern codepage_t usascii_codepage[];
     66 
     67 /*
     68  * This buffer is used to store the language string for display.
     69  */
     70 #define	CODEPAGE_BUFSIZ		48
     71 
     72 extern int oem_language_set(char *language);
     73 extern unsigned int oem_get_smb_cpid(void);
     74 extern unsigned int oem_get_telnet_cpid(void);
     75 
     76 extern int codepage_isupper(int c);
     77 extern int codepage_islower(int c);
     78 extern int codepage_toupper(int c);
     79 extern int codepage_tolower(int c);
     80 
     81 #ifdef __cplusplus
     82 }
     83 #endif
     84 
     85 #endif	/* _SMBSRV_CODEPAGE_H */
     86