1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-20 00:15:31 +00: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:
Witold Filipczyk 2022-10-16 19:26:20 +02:00
parent 2e38104b40
commit 2129eadcbd
6 changed files with 24 additions and 7 deletions

View File

@ -31,6 +31,9 @@
/* Define if you want: Local CGI support */
#mesondefine CONFIG_CGI
/* Define if you want: codepoint lookup */
#mesondefine CONFIG_CODEPOINT
/* Define if you want: Combining characters support */
#mesondefine CONFIG_COMBINE

View File

@ -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],
[ --enable-reproducible enable reproducible build])
EL_ARG_ENABLE(CONFIG_CODEPOINT, codepoint, [Check codepoints],
[ --disable-codepoint disable codepoint lookup])
AC_ARG_ENABLE(weehoofooboomookerchoo,
[
Also check out the features.conf file for more information about features!

View File

@ -95,7 +95,7 @@ conf_data.set('CONFIG_X', get_option('x'))
conf_data.set('CONFIG_XML', get_option('xml'))
conf_data.set('CONFIG_QUICKJS', get_option('quickjs'))
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')
conf_data.set('CONFIG_ECMASCRIPT', true)

View File

@ -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('mujs', type: 'boolean', value: false, description: 'use mujs library')
option('codepoint', type: 'boolean', value: true, description: 'whether check codepoints on Linux console')

View File

@ -657,6 +657,7 @@ good_char:
#endif /* CONFIG_COMBINE */
part->spaces[x] = (data == UCS_SPACE);
#ifdef CONFIG_CODEPOINT
if (codepoint_replacement(data) != -1) {
int i;
@ -666,7 +667,9 @@ good_char:
copy_screen_chars(&POS(x++, y), schar, 1);
}
continue;
} else if (unicode_to_cell(data) == 0)
} else
#endif
if (unicode_to_cell(data) == 0)
continue;
else if (unicode_to_cell(data) == 2) {
schar->data = (unicode_val_T)data;

View File

@ -300,11 +300,12 @@ encode_utf8(unicode_val_T u)
memset(utf_buffer, 0, 7);
#ifdef CONFIG_CODEPOINT
if (!is_codepoint_supported(u)) {
BIN_SEARCH(unicode_7b, x, N_UNICODE_7B, u, s);
if (s != -1) return (char *)unicode_7b[s].s;
}
#endif
if (u < 0x80)
utf_buffer[0] = u;
else if (u < 0x800)
@ -1686,8 +1687,10 @@ get_cp_index(const char *name)
/* create the list of codepoints supported by the terminal */
#ifdef GIO_UNIMAP
int cmpint(const void *a, const void *b) {
#if defined(GIO_UNIMAP) && defined(CONFIG_CODEPOINT)
static int
cmpint(const void *a, const void *b)
{
if (* (int *) a < * (int *) b)
return -1;
else if (* (int *) a == * (int *) b)
@ -1696,7 +1699,9 @@ int cmpint(const void *a, const void *b) {
return 1;
}
void make_codepoints() {
void
make_codepoints(void)
{
int tty;
struct unimapdesc table;
int res;
@ -1741,7 +1746,9 @@ void make_codepoints() {
// fprintf(stderr, "U+%04X\n", codepoints.list[i]);
}
#else
void make_codepoints() {
void
make_codepoints(void)
{
codepoints.size = -1;
}
#endif