Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
403001ff
Commit
403001ff
authored
Mar 23, 2004
by
bar@bar.intranet.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uca-dump.c:
Don't dump default implicit weights
parent
0d091038
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
12 deletions
+30
-12
strings/uca-dump.c
strings/uca-dump.c
+30
-12
No files found.
strings/uca-dump.c
View file @
403001ff
...
...
@@ -8,10 +8,10 @@ typedef unsigned short uint16;
struct
uca_item_st
{
uchar
num
;
uint16
weight
[
4
][
8
];
uint16
weight
[
4
][
9
];
};
#if
1
#if
0
#define MY_UCA_NPAGES 1024
#define MY_UCA_NCHARS 64
#define MY_UCA_CMASK 63
...
...
@@ -30,8 +30,10 @@ int main(int ac, char **av)
struct
uca_item_st
uca
[
64
*
1024
];
size_t
code
,
page
,
w
;
int
pagemaxlen
[
MY_UCA_NPAGES
];
int
pageloaded
[
MY_UCA_NPAGES
];
bzero
(
uca
,
sizeof
(
uca
));
bzero
(
pageloaded
,
sizeof
(
pageloaded
));
while
(
fgets
(
str
,
sizeof
(
str
),
stdin
))
{
...
...
@@ -69,7 +71,10 @@ int main(int ac, char **av)
if
(
codenum
>
1
)
{
/* Multi-character weight */
/* Multi-character weight,
i.e. contraction.
Not supported yet.
*/
continue
;
}
...
...
@@ -97,10 +102,13 @@ int main(int ac, char **av)
s
=
endptr
;
partnum
++
;
}
}
/* Mark that a character from this page was loaded */
pageloaded
[
code
>>
MY_UCA_PSHIFT
]
++
;
}
/* Now set implicit weights */
for
(
code
=
0
;
code
<=
0xFFFF
;
code
++
)
{
...
...
@@ -156,6 +164,12 @@ int main(int ac, char **av)
size_t
nchars
=
0
;
size_t
mchars
;
/*
Skip this page if no weights were loaded
*/
if
(
!
pageloaded
[
page
])
continue
;
/*
Calculate maximum weight
...
...
@@ -176,9 +190,8 @@ int main(int ac, char **av)
maxnum
=
maxnum
<
num
?
num
:
maxnum
;
}
if
(
!
maxnum
)
maxnum
=
1
;
maxnum
++
;
switch
(
maxnum
)
{
case
0
:
mchars
=
8
;
break
;
...
...
@@ -190,14 +203,16 @@ int main(int ac, char **av)
}
pagemaxlen
[
page
]
=
maxnum
;
printf
(
"uint16 page%03Xdata[]= { /* %04X (%d weights per char) */
\n
"
,
page
,
page
*
MY_UCA_NCHARS
,
maxnum
);
/*
Now print this page
*/
printf
(
"uint16 page%03Xdata[]= { /* %04X (%d weights per char) */
\n
"
,
page
,
page
*
MY_UCA_NCHARS
,
maxnum
);
for
(
offs
=
0
;
offs
<
MY_UCA_NCHARS
;
offs
++
)
{
uint16
weight
[
8
];
...
...
@@ -249,7 +264,10 @@ int main(int ac, char **av)
printf
(
"uint16 *ucaw[%d]={
\n
"
,
MY_UCA_NPAGES
);
for
(
page
=
0
;
page
<
MY_UCA_NPAGES
;
page
++
)
{
printf
(
"page%03Xdata%s%s"
,
page
,
page
<
MY_UCA_NPAGES
-
1
?
","
:
""
,
(
page
+
1
)
%
4
?
""
:
"
\n
"
);
if
(
!
pageloaded
[
page
])
printf
(
"NULL %s%s"
,
page
<
MY_UCA_NPAGES
-
1
?
","
:
""
,
(
page
+
1
)
%
4
?
""
:
"
\n
"
);
else
printf
(
"page%03Xdata%s%s"
,
page
,
page
<
MY_UCA_NPAGES
-
1
?
","
:
""
,
(
page
+
1
)
%
4
?
""
:
"
\n
"
);
}
printf
(
"};
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment