mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[intl] Added build option -Dcodepoint=true (--disable-codepoint)
Codepoint lookup slows down ELinks, so you can do not enable it at compile time.
This commit is contained in:
parent
2e38104b40
commit
2129eadcbd
@ -31,6 +31,9 @@
|
|||||||
/* Define if you want: Local CGI support */
|
/* Define if you want: Local CGI support */
|
||||||
#mesondefine CONFIG_CGI
|
#mesondefine CONFIG_CGI
|
||||||
|
|
||||||
|
/* Define if you want: codepoint lookup */
|
||||||
|
#mesondefine CONFIG_CODEPOINT
|
||||||
|
|
||||||
/* Define if you want: Combining characters support */
|
/* Define if you want: Combining characters support */
|
||||||
#mesondefine CONFIG_COMBINE
|
#mesondefine CONFIG_COMBINE
|
||||||
|
|
||||||
|
@ -1676,6 +1676,9 @@ EL_ARG_DEPEND(CONFIG_COMBINE, combining, [CONFIG_UTF8:yes HAVE_WCWIDTH:yes], [Co
|
|||||||
EL_ARG_ENABLE(CONFIG_REPRODUCIBLE, reproducible, [Reproducible builds],
|
EL_ARG_ENABLE(CONFIG_REPRODUCIBLE, reproducible, [Reproducible builds],
|
||||||
[ --enable-reproducible enable reproducible build])
|
[ --enable-reproducible enable reproducible build])
|
||||||
|
|
||||||
|
EL_ARG_ENABLE(CONFIG_CODEPOINT, codepoint, [Check codepoints],
|
||||||
|
[ --disable-codepoint disable codepoint lookup])
|
||||||
|
|
||||||
AC_ARG_ENABLE(weehoofooboomookerchoo,
|
AC_ARG_ENABLE(weehoofooboomookerchoo,
|
||||||
[
|
[
|
||||||
Also check out the features.conf file for more information about features!
|
Also check out the features.conf file for more information about features!
|
||||||
|
@ -95,7 +95,7 @@ conf_data.set('CONFIG_X', get_option('x'))
|
|||||||
conf_data.set('CONFIG_XML', get_option('xml'))
|
conf_data.set('CONFIG_XML', get_option('xml'))
|
||||||
conf_data.set('CONFIG_QUICKJS', get_option('quickjs'))
|
conf_data.set('CONFIG_QUICKJS', get_option('quickjs'))
|
||||||
conf_data.set('CONFIG_MUJS', get_option('mujs'))
|
conf_data.set('CONFIG_MUJS', get_option('mujs'))
|
||||||
|
conf_data.set('CONFIG_CODEPOINT', get_option('codepoint'))
|
||||||
|
|
||||||
if conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') or conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
|
if conf_data.get('CONFIG_SCRIPTING_SPIDERMONKEY') or conf_data.get('CONFIG_ECMASCRIPT_SMJS') or conf_data.get('CONFIG_QUICKJS') or conf_data.get('CONFIG_MUJS')
|
||||||
conf_data.set('CONFIG_ECMASCRIPT', true)
|
conf_data.set('CONFIG_ECMASCRIPT', true)
|
||||||
|
@ -71,3 +71,4 @@ option('source-date-epoch', type: 'string', value: '', description: 'source date
|
|||||||
|
|
||||||
option('dgi', type: 'boolean', value: false, description: 'DOS Gateway Interface support')
|
option('dgi', type: 'boolean', value: false, description: 'DOS Gateway Interface support')
|
||||||
option('mujs', type: 'boolean', value: false, description: 'use mujs library')
|
option('mujs', type: 'boolean', value: false, description: 'use mujs library')
|
||||||
|
option('codepoint', type: 'boolean', value: true, description: 'whether check codepoints on Linux console')
|
||||||
|
@ -657,6 +657,7 @@ good_char:
|
|||||||
#endif /* CONFIG_COMBINE */
|
#endif /* CONFIG_COMBINE */
|
||||||
part->spaces[x] = (data == UCS_SPACE);
|
part->spaces[x] = (data == UCS_SPACE);
|
||||||
|
|
||||||
|
#ifdef CONFIG_CODEPOINT
|
||||||
if (codepoint_replacement(data) != -1) {
|
if (codepoint_replacement(data) != -1) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -666,7 +667,9 @@ good_char:
|
|||||||
copy_screen_chars(&POS(x++, y), schar, 1);
|
copy_screen_chars(&POS(x++, y), schar, 1);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
} else if (unicode_to_cell(data) == 0)
|
} else
|
||||||
|
#endif
|
||||||
|
if (unicode_to_cell(data) == 0)
|
||||||
continue;
|
continue;
|
||||||
else if (unicode_to_cell(data) == 2) {
|
else if (unicode_to_cell(data) == 2) {
|
||||||
schar->data = (unicode_val_T)data;
|
schar->data = (unicode_val_T)data;
|
||||||
|
@ -300,11 +300,12 @@ encode_utf8(unicode_val_T u)
|
|||||||
|
|
||||||
memset(utf_buffer, 0, 7);
|
memset(utf_buffer, 0, 7);
|
||||||
|
|
||||||
|
#ifdef CONFIG_CODEPOINT
|
||||||
if (!is_codepoint_supported(u)) {
|
if (!is_codepoint_supported(u)) {
|
||||||
BIN_SEARCH(unicode_7b, x, N_UNICODE_7B, u, s);
|
BIN_SEARCH(unicode_7b, x, N_UNICODE_7B, u, s);
|
||||||
if (s != -1) return (char *)unicode_7b[s].s;
|
if (s != -1) return (char *)unicode_7b[s].s;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (u < 0x80)
|
if (u < 0x80)
|
||||||
utf_buffer[0] = u;
|
utf_buffer[0] = u;
|
||||||
else if (u < 0x800)
|
else if (u < 0x800)
|
||||||
@ -1686,8 +1687,10 @@ get_cp_index(const char *name)
|
|||||||
|
|
||||||
/* create the list of codepoints supported by the terminal */
|
/* create the list of codepoints supported by the terminal */
|
||||||
|
|
||||||
#ifdef GIO_UNIMAP
|
#if defined(GIO_UNIMAP) && defined(CONFIG_CODEPOINT)
|
||||||
int cmpint(const void *a, const void *b) {
|
static int
|
||||||
|
cmpint(const void *a, const void *b)
|
||||||
|
{
|
||||||
if (* (int *) a < * (int *) b)
|
if (* (int *) a < * (int *) b)
|
||||||
return -1;
|
return -1;
|
||||||
else if (* (int *) a == * (int *) b)
|
else if (* (int *) a == * (int *) b)
|
||||||
@ -1696,7 +1699,9 @@ int cmpint(const void *a, const void *b) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void make_codepoints() {
|
void
|
||||||
|
make_codepoints(void)
|
||||||
|
{
|
||||||
int tty;
|
int tty;
|
||||||
struct unimapdesc table;
|
struct unimapdesc table;
|
||||||
int res;
|
int res;
|
||||||
@ -1741,7 +1746,9 @@ void make_codepoints() {
|
|||||||
// fprintf(stderr, "U+%04X\n", codepoints.list[i]);
|
// fprintf(stderr, "U+%04X\n", codepoints.list[i]);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void make_codepoints() {
|
void
|
||||||
|
make_codepoints(void)
|
||||||
|
{
|
||||||
codepoints.size = -1;
|
codepoints.size = -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user