mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Refactor is_cp_special to is_cp_utf8
This commit is contained in:
parent
681cfc4ae5
commit
44c74ac389
@ -60,7 +60,7 @@ charset_list(struct terminal *term, void *xxx, void *ses_)
|
||||
|
||||
if (!name) break;
|
||||
#ifndef CONFIG_UTF_8
|
||||
if (is_cp_special(i)) continue;
|
||||
if (is_cp_utf8(i)) continue;
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
add_to_menu(&mi, name, NULL, ACT_MAIN_NONE,
|
||||
|
@ -1016,7 +1016,7 @@ render_dom_document(struct cache_entry *cached, struct document *document,
|
||||
|
||||
document->bgcolor = document->options.default_bg;
|
||||
#ifdef CONFIG_UTF_8
|
||||
document->options.utf8 = is_cp_special(document->options.cp);
|
||||
document->options.utf8 = is_cp_utf8(document->options.cp);
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
if (document->options.plain)
|
||||
|
@ -2182,7 +2182,7 @@ render_html_document(struct cache_entry *cached, struct document *document,
|
||||
&document->cp_status,
|
||||
document->options.hard_assume);
|
||||
#ifdef CONFIG_UTF_8
|
||||
html_context->options->utf8 = is_cp_special(document->options.cp);
|
||||
html_context->options->utf8 = is_cp_utf8(document->options.cp);
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
if (title.length) {
|
||||
|
@ -648,7 +648,7 @@ render_plain_document(struct cache_entry *cached, struct document *document,
|
||||
document->bgcolor = document->options.default_bg;
|
||||
document->width = 0;
|
||||
#ifdef CONFIG_UTF_8
|
||||
document->options.utf8 = is_cp_special(document->options.cp);
|
||||
document->options.utf8 = is_cp_utf8(document->options.cp);
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
/* Setup the style */
|
||||
|
@ -1142,7 +1142,7 @@ get_cp_mime_name(int cp_index)
|
||||
}
|
||||
|
||||
int
|
||||
is_cp_special(int cp_index)
|
||||
is_cp_utf8(int cp_index)
|
||||
{
|
||||
cp_index &= ~SYSTEM_CHARSET_FLAG;
|
||||
return codepages[cp_index].table == table_utf_8;
|
||||
|
@ -51,7 +51,7 @@ unsigned char *convert_string(struct conv_table *convert_table,
|
||||
int get_cp_index(unsigned char *);
|
||||
unsigned char *get_cp_name(int);
|
||||
unsigned char *get_cp_mime_name(int);
|
||||
int is_cp_special(int);
|
||||
int is_cp_utf8(int);
|
||||
void free_conv_table(void);
|
||||
#ifdef CONFIG_UTF_8
|
||||
inline unsigned char *encode_utf_8(unicode_val_T);
|
||||
|
@ -324,7 +324,7 @@ add_document_to_string(struct string *string, struct document *document)
|
||||
if_assert_failed return NULL;
|
||||
|
||||
#ifdef CONFIG_UTF_8
|
||||
if (is_cp_special(document->options.cp))
|
||||
if (is_cp_utf8(document->options.cp))
|
||||
goto utf_8;
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
@ -427,7 +427,7 @@ dump_to_file(struct document *document, int fd)
|
||||
if (!buf) return -1;
|
||||
|
||||
#ifdef CONFIG_UTF_8
|
||||
if (is_cp_special(document->options.cp))
|
||||
if (is_cp_utf8(document->options.cp))
|
||||
goto utf_8;
|
||||
#endif /* CONFIG_UTF_8 */
|
||||
|
||||
|
@ -580,7 +580,7 @@ is_in_range(struct document *document, int y, int height,
|
||||
if_assert_failed return -1;
|
||||
|
||||
#ifdef CONFIG_UTF_8
|
||||
utf8 = is_cp_special(document->options.cp);
|
||||
utf8 = is_cp_utf8(document->options.cp);
|
||||
#endif
|
||||
*min = INT_MAX, *max = 0;
|
||||
textlen = strlen_u(text, utf8);
|
||||
@ -778,7 +778,7 @@ draw_searched(struct terminal *term, struct document_view *doc_view)
|
||||
return;
|
||||
|
||||
#ifdef CONFIG_UTF_8
|
||||
utf8 = is_cp_special(doc_view->document->options.cp);
|
||||
utf8 = is_cp_utf8(doc_view->document->options.cp);
|
||||
#endif
|
||||
get_searched(doc_view, &pt, &len, utf8);
|
||||
if (len) {
|
||||
@ -945,7 +945,7 @@ find_next_link_in_search(struct document_view *doc_view, int direction)
|
||||
int len;
|
||||
int utf8 = 0;
|
||||
#ifdef CONFIG_UTF_8
|
||||
utf8 = is_cp_special(doc_view->document->options.cp);
|
||||
utf8 = is_cp_utf8(doc_view->document->options.cp);
|
||||
#endif
|
||||
|
||||
nt:
|
||||
|
Loading…
Reference in New Issue
Block a user