updated the .TP cleanup for coherency in the key description pages.
[midnight-commander.git] / src / charsets.h
blob12a4d35698aa975d839199a7620881de116fb2c7
1 #ifndef __CHARSETS_H__
2 #define __CHARSETS_H__
4 #ifdef HAVE_CHARSET
6 #define UNKNCHAR '\001'
8 #define CHARSETS_INDEX "mc.charsets"
10 extern int n_codepages;
12 extern unsigned char conv_displ[256];
13 extern unsigned char conv_input[256];
15 struct codepage_desc {
16 char *id;
17 char *name;
20 extern struct codepage_desc *codepages;
22 char *get_codepage_id (int n);
23 int get_codepage_index (const char *id);
24 int load_codepages_list (void);
25 void free_codepages_list (void);
26 char *init_translation_table (int cpsource, int cpdisplay);
27 void convert_to_display (char *str);
28 void convert_from_input (char *str);
29 void convert_string (unsigned char *str);
31 /* Convert single characters */
32 static inline int
33 convert_to_display_c (int c)
35 if (c < 0 || c >= 256)
36 return c;
37 return conv_displ[c];
40 static inline int
41 convert_from_input_c (int c)
43 if (c < 0 || c >= 256)
44 return c;
45 return conv_input[c];
48 #else /* !HAVE_CHARSET */
50 #define convert_to_display_c(c) (c)
51 #define convert_from_input_c(c) (c)
52 #define convert_to_display(str) do {} while (0)
53 #define convert_from_input(str) do {} while (0)
55 #endif /* HAVE_CHARSET */
57 #endif /* __CHARSETS_H__ */