Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(971)

Side by Side Diff: fusl/src/ctype/wctrans.c

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fusl/src/ctype/wcswidth.c ('k') | fusl/src/ctype/wcwidth.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <wctype.h>
2 #include <string.h>
3 #include "libc.h"
4
5 wctrans_t wctrans(const char *class)
6 {
7 if (!strcmp(class, "toupper")) return (wctrans_t)1;
8 if (!strcmp(class, "tolower")) return (wctrans_t)2;
9 return 0;
10 }
11
12 wint_t towctrans(wint_t wc, wctrans_t trans)
13 {
14 if (trans == (wctrans_t)1) return towupper(wc);
15 if (trans == (wctrans_t)2) return towlower(wc);
16 return wc;
17 }
18
19 wctrans_t __wctrans_l(const char *s, locale_t l)
20 {
21 return wctrans(s);
22 }
23
24 wint_t __towctrans_l(wint_t c, wctrans_t t, locale_t l)
25 {
26 return towctrans(c, t);
27 }
28
29 weak_alias(__wctrans_l, wctrans_l);
30 weak_alias(__towctrans_l, towctrans_l);
OLDNEW
« no previous file with comments | « fusl/src/ctype/wcswidth.c ('k') | fusl/src/ctype/wcwidth.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698