repo.or.cz
/
geevi.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
geevi: set window default size
[geevi.git]
/
im.c
blob
0957c8b1ac93541ec60e047aabae43968ce3c7fa
1
#include <stdlib.h>
2
#include <string.h>
3
#include
"im.h"
4
5
static struct
im fa
;
6
7
static struct
im
*
get_fa
()
8
{
9
fa
.
map
[
'a'
] =
"ش"
;
10
fa
.
map
[
'b'
] =
"ذ"
;
11
fa
.
map
[
'c'
] =
"ز"
;
12
fa
.
map
[
'd'
] =
"ی"
;
13
fa
.
map
[
'e'
] =
"ث"
;
14
fa
.
map
[
'f'
] =
"ب"
;
15
fa
.
map
[
'g'
] =
"ل"
;
16
fa
.
map
[
'h'
] =
"ا"
;
17
fa
.
map
[
'i'
] =
"ه"
;
18
fa
.
map
[
'j'
] =
"ت"
;
19
fa
.
map
[
'k'
] =
"ن"
;
20
fa
.
map
[
'l'
] =
"م"
;
21
fa
.
map
[
'm'
] =
"پ"
;
22
fa
.
map
[
'n'
] =
"د"
;
23
fa
.
map
[
'o'
] =
"خ"
;
24
fa
.
map
[
'p'
] =
"ح"
;
25
fa
.
map
[
'q'
] =
"ض"
;
26
fa
.
map
[
'r'
] =
"ق"
;
27
fa
.
map
[
's'
] =
"س"
;
28
fa
.
map
[
't'
] =
"ف"
;
29
fa
.
map
[
'u'
] =
"ع"
;
30
fa
.
map
[
'v'
] =
"ر"
;
31
fa
.
map
[
'w'
] =
"ص"
;
32
fa
.
map
[
'x'
] =
"ط"
;
33
fa
.
map
[
'y'
] =
"غ"
;
34
fa
.
map
[
'z'
] =
"ظ"
;
35
36
fa
.
map
[
'A'
] =
"ؤ"
;
37
fa
.
map
[
'B'
] =
""
;
38
fa
.
map
[
'C'
] =
"ژ"
;
39
fa
.
map
[
'D'
] =
"ي"
;
40
fa
.
map
[
'E'
] =
"ٍ"
;
41
fa
.
map
[
'F'
] =
"إ"
;
42
fa
.
map
[
'G'
] =
"أ"
;
43
fa
.
map
[
'H'
] =
"آ"
;
44
fa
.
map
[
'I'
] =
"ّ"
;
45
fa
.
map
[
'J'
] =
"ة"
;
46
fa
.
map
[
'K'
] =
"»"
;
47
fa
.
map
[
'L'
] =
"«"
;
48
fa
.
map
[
'M'
] =
"ء"
;
49
fa
.
map
[
'N'
] =
"ٔ"
;
50
fa
.
map
[
'O'
] =
"]"
;
51
fa
.
map
[
'P'
] =
"["
;
52
fa
.
map
[
'Q'
] =
"ْ"
;
53
fa
.
map
[
'R'
] =
"ً"
;
54
fa
.
map
[
'S'
] =
"ئ"
;
55
fa
.
map
[
'T'
] =
"ُ"
;
56
fa
.
map
[
'U'
] =
"َ"
;
57
fa
.
map
[
'V'
] =
"ٰ"
;
58
fa
.
map
[
'W'
] =
"ٌ"
;
59
fa
.
map
[
'X'
] =
"ٓ"
;
60
fa
.
map
[
'Y'
] =
"ِ"
;
61
fa
.
map
[
'Z'
] =
"ك"
;
62
63
fa
.
map
[
';'
] =
"ک"
;
64
fa
.
map
[
'
\'
'
] =
"گ"
;
65
fa
.
map
[
'['
] =
"ج"
;
66
fa
.
map
[
']'
] =
"چ"
;
67
fa
.
map
[
'
\\
'
] =
"
\\
"
;
68
fa
.
map
[
'/'
] =
"/"
;
69
fa
.
map
[
','
] =
"و"
;
70
fa
.
map
[
'.'
] =
"."
;
71
72
fa
.
map
[
':'
] =
":"
;
73
fa
.
map
[
'"'
] =
"؛"
;
74
fa
.
map
[
'{'
] =
"}"
;
75
fa
.
map
[
'}'
] =
"{"
;
76
fa
.
map
[
'|'
] =
"|"
;
77
fa
.
map
[
'?'
] =
"؟"
;
78
fa
.
map
[
'<'
] =
">"
;
79
fa
.
map
[
'>'
] =
"<"
;
80
81
fa
.
map
[
'`'
] =
""
;
82
fa
.
map
[
'1'
] =
"۱"
;
83
fa
.
map
[
'2'
] =
"۲"
;
84
fa
.
map
[
'3'
] =
"۳"
;
85
fa
.
map
[
'4'
] =
"۴"
;
86
fa
.
map
[
'5'
] =
"۵"
;
87
fa
.
map
[
'6'
] =
"۶"
;
88
fa
.
map
[
'7'
] =
"۷"
;
89
fa
.
map
[
'8'
] =
"۸"
;
90
fa
.
map
[
'9'
] =
"۹"
;
91
fa
.
map
[
'0'
] =
"۰"
;
92
fa
.
map
[
'-'
] =
"-"
;
93
fa
.
map
[
'='
] =
"="
;
94
fa
.
map
[
'~'
] =
"÷"
;
95
fa
.
map
[
'!'
] =
"!"
;
96
fa
.
map
[
'@'
] =
"٬"
;
97
fa
.
map
[
'#'
] =
"٫"
;
98
fa
.
map
[
'$'
] =
"﷼"
;
99
fa
.
map
[
'%'
] =
"٪"
;
100
fa
.
map
[
'^'
] =
"×"
;
101
fa
.
map
[
'&'
] =
"،"
;
102
fa
.
map
[
'*'
] =
"*"
;
103
fa
.
map
[
'('
] =
")"
;
104
fa
.
map
[
')'
] =
"("
;
105
fa
.
map
[
'_'
] =
"ـ"
;
106
fa
.
map
[
'+'
] =
"+"
;
107
return
&
fa
;
108
}
109
110
struct
im
*
im_get
(
char
*
name
)
111
{
112
if
(!
strcmp
(
name
,
"fa"
))
113
return
get_fa
();
114
return
NULL
;
115
}
116
117
char
*
im_char
(
struct
im
*
im
,
int
c
)
118
{
119
if
(
c
<
256
&&
im
->
map
[
c
])
120
return
im
->
map
[
c
];
121
return
NULL
;
122
}