~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/smb/client/cifs_unicode.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  * cifs_unicode:  Unicode kernel case support
  4  *
  5  * Function:
  6  *     Convert a unicode character to upper or lower case using
  7  *     compressed tables.
  8  *
  9  *   Copyright (c) International Business Machines  Corp., 2000,2009
 10  *
 11  * Notes:
 12  *     These APIs are based on the C library functions.  The semantics
 13  *     should match the C functions but with expanded size operands.
 14  *
 15  *     The upper/lower functions are based on a table created by mkupr.
 16  *     This is a compressed table of upper and lower case conversion.
 17  */
 18 #ifndef _CIFS_UNICODE_H
 19 #define _CIFS_UNICODE_H
 20 
 21 #include <asm/byteorder.h>
 22 #include <linux/types.h>
 23 #include <linux/nls.h>
 24 #include "../../nls/nls_ucs2_utils.h"
 25 
 26 /*
 27  * Macs use an older "SFM" mapping of the symbols above. Fortunately it does
 28  * not conflict (although almost does) with the mapping above.
 29  */
 30 
 31 #define SFM_DOUBLEQUOTE ((__u16) 0xF020)
 32 #define SFM_ASTERISK    ((__u16) 0xF021)
 33 #define SFM_QUESTION    ((__u16) 0xF025)
 34 #define SFM_COLON       ((__u16) 0xF022)
 35 #define SFM_GRTRTHAN    ((__u16) 0xF024)
 36 #define SFM_LESSTHAN    ((__u16) 0xF023)
 37 #define SFM_PIPE        ((__u16) 0xF027)
 38 #define SFM_SLASH       ((__u16) 0xF026)
 39 #define SFM_SPACE       ((__u16) 0xF028)
 40 #define SFM_PERIOD      ((__u16) 0xF029)
 41 
 42 /*
 43  * Mapping mechanism to use when one of the seven reserved characters is
 44  * encountered.  We can only map using one of the mechanisms at a time
 45  * since otherwise readdir could return directory entries which we would
 46  * not be able to open
 47  *
 48  * NO_MAP_UNI_RSVD  = do not perform any remapping of the character
 49  * SFM_MAP_UNI_RSVD = map reserved characters using SFM scheme (MAC compatible)
 50  * SFU_MAP_UNI_RSVD = map reserved characters ala SFU ("mapchars" option)
 51  *
 52  */
 53 #define NO_MAP_UNI_RSVD         0
 54 #define SFM_MAP_UNI_RSVD        1
 55 #define SFU_MAP_UNI_RSVD        2
 56 
 57 #ifdef __KERNEL__
 58 int cifs_from_utf16(char *to, const __le16 *from, int tolen, int fromlen,
 59                     const struct nls_table *cp, int map_type);
 60 int cifs_utf16_bytes(const __le16 *from, int maxbytes,
 61                      const struct nls_table *codepage);
 62 int cifs_strtoUTF16(__le16 *, const char *, int, const struct nls_table *);
 63 char *cifs_strndup_from_utf16(const char *src, const int maxlen,
 64                               const bool is_unicode,
 65                               const struct nls_table *codepage);
 66 extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen,
 67                               const struct nls_table *cp, int mapChars);
 68 extern int cifs_remap(struct cifs_sb_info *cifs_sb);
 69 extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen,
 70                                      int *utf16_len, const struct nls_table *cp,
 71                                      int remap);
 72 #endif
 73 
 74 wchar_t cifs_toupper(wchar_t in);
 75 
 76 #endif /* _CIFS_UNICODE_H */
 77 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php