File Index
Files and directories
Sign in
FILE

consolemap.h

File preview with syntax highlighting.

linux-6.19.14/include/linux/consolemap.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * consolemap.h
 4 *
 5 * Interface between console.c, selection.c  and consolemap.c
 6 */
 7#ifndef __LINUX_CONSOLEMAP_H__
 8#define __LINUX_CONSOLEMAP_H__
 9
10enum translation_map {
11	LAT1_MAP,
12	GRAF_MAP,
13	IBMPC_MAP,
14	USER_MAP,
15
16	FIRST_MAP = LAT1_MAP,
17	LAST_MAP = USER_MAP,
18};
19
20#include <linux/types.h>
21
22struct vc_data;
23
24#ifdef CONFIG_CONSOLE_TRANSLATIONS
25u16 inverse_translate(const struct vc_data *conp, u16 glyph, bool use_unicode);
26unsigned short *set_translate(enum translation_map m, struct vc_data *vc);
27int conv_uni_to_pc(struct vc_data *conp, long ucs);
28u32 conv_8bit_to_uni(unsigned char c);
29int conv_uni_to_8bit(u32 uni);
30void console_map_init(void);
31bool ucs_is_double_width(uint32_t cp);
32bool ucs_is_zero_width(uint32_t cp);
33u32 ucs_recompose(u32 base, u32 mark);
34u32 ucs_get_fallback(u32 cp);
35#else
36static inline u16 inverse_translate(const struct vc_data *conp, u16 glyph,
37		bool use_unicode)
38{
39	return glyph;
40}
41
42static inline unsigned short *set_translate(enum translation_map m,
43		struct vc_data *vc)
44{
45	return NULL;
46}
47
48static inline int conv_uni_to_pc(struct vc_data *conp, long ucs)
49{
50	return ucs > 0xff ? -1 : ucs;
51}
52
53static inline u32 conv_8bit_to_uni(unsigned char c)
54{
55	return c;
56}
57
58static inline int conv_uni_to_8bit(u32 uni)
59{
60	return uni & 0xff;
61}
62
63static inline void console_map_init(void) { }
64
65static inline bool ucs_is_double_width(uint32_t cp)
66{
67	return false;
68}
69
70static inline bool ucs_is_zero_width(uint32_t cp)
71{
72	return false;
73}
74
75static inline u32 ucs_recompose(u32 base, u32 mark)
76{
77	return 0;
78}
79
80static inline u32 ucs_get_fallback(u32 cp)
81{
82	return 0;
83}
84#endif /* CONFIG_CONSOLE_TRANSLATIONS */
85
86#endif /* __LINUX_CONSOLEMAP_H__ */
~/ Read-only file preview.