2021-03-16 10:49:09 +09:00
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
* Some of the source code in this file came from fs / cifs / cifs_unicode . c
* cifs_unicode : Unicode kernel case support
*
* Function :
* Convert a unicode character to upper or lower case using
* compressed tables .
*
* Copyright ( c ) International Business Machines Corp . , 2000 , 2009
*
*
* Notes :
* These APIs are based on the C library functions . The semantics
* should match the C functions but with expanded size operands .
*
* The upper / lower functions are based on a table created by mkupr .
* This is a compressed table of upper and lower case conversion .
*
*/
2023-08-17 01:22:30 +01:00
# ifndef _SMB_UNICODE_H
# define _SMB_UNICODE_H
2021-03-16 10:49:09 +09:00
# include <asm/byteorder.h>
# include <linux/types.h>
# include <linux/nls.h>
2022-09-15 22:49:11 +09:00
# include <linux/unicode.h>
2023-08-17 01:22:30 +01:00
# include "../../nls/nls_ucs2_utils.h"
2021-03-16 10:49:09 +09:00
# ifdef __KERNEL__
int smb_strtoUTF16 ( __le16 * to , const char * from , int len ,
2021-05-26 17:57:12 +09:00
const struct nls_table * codepage ) ;
2021-03-30 14:25:35 +09:00
char * smb_strndup_from_utf16 ( const char * src , const int maxlen ,
2021-05-26 17:57:12 +09:00
const bool is_unicode ,
const struct nls_table * codepage ) ;
2021-03-30 14:25:35 +09:00
int smbConvertToUTF16 ( __le16 * target , const char * source , int srclen ,
2021-05-26 17:57:12 +09:00
const struct nls_table * cp , int mapchars ) ;
2022-09-15 22:49:11 +09:00
char * ksmbd_extract_sharename ( struct unicode_map * um , const char * treename ) ;
2021-03-16 10:49:09 +09:00
# endif
2023-08-17 01:22:30 +01:00
# endif /* _SMB_UNICODE_H */