1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[terminfo] const char *

This commit is contained in:
Witold Filipczyk 2022-02-21 18:25:11 +01:00
parent e954286db5
commit f3496ae098
3 changed files with 17 additions and 16 deletions

View File

@ -668,7 +668,8 @@ add_cursor_move_to_string(struct string *screen, int y, int x)
{
#ifdef CONFIG_TERMINFO
if (get_cmd_opt_bool("terminfo")) {
return add_to_string(screen, terminfo_cursor_address(y-1, x-1));
const char *aa = terminfo_cursor_address(y-1, x-1);
return add_to_string(screen, aa);
} else
#endif
#define CURSOR_NUM_LEN 10 /* 10 chars for @y and @x numbers should be more than enough. */
@ -1453,7 +1454,7 @@ erase_screen(struct terminal *term)
#ifdef CONFIG_TERMINFO
if (get_cmd_opt_bool("terminfo")) {
char *text = terminfo_clear_screen();
const char *text = terminfo_clear_screen();
hard_write(term->fdout, text, strlen(text));
} else
#endif

View File

@ -26,7 +26,7 @@ terminfo_setupterm(char *term, int fildes)
return setupterm(term, fildes, NULL);
}
char *
const char *
terminfo_clear_screen(void)
{
char *res = tiparm(clear_screen);
@ -35,7 +35,7 @@ terminfo_clear_screen(void)
return "";
}
char *
const char *
terminfo_set_bold(int arg)
{
char *res = tiparm(arg ? enter_bold_mode : exit_attribute_mode);
@ -44,7 +44,7 @@ terminfo_set_bold(int arg)
return "";
}
char *
const char *
terminfo_set_italics(int arg)
{
char *res = tiparm(arg ? enter_italics_mode : exit_italics_mode);
@ -53,7 +53,7 @@ terminfo_set_italics(int arg)
return "";
}
char *
const char *
terminfo_set_underline(int arg)
{
char *res = tiparm(arg ? enter_underline_mode : exit_underline_mode);
@ -62,7 +62,7 @@ terminfo_set_underline(int arg)
return "";
}
char *
const char *
terminfo_set_background(int arg)
{
char *res = tiparm(set_a_background, arg);
@ -71,7 +71,7 @@ terminfo_set_background(int arg)
return "";
}
char *
const char *
terminfo_set_foreground(int arg)
{
char *res = tiparm(set_a_foreground, arg);
@ -86,7 +86,7 @@ terminfo_max_colors(void)
return max_colors;
}
char *
const char *
terminfo_cursor_address(int y, int x)
{
char *res = tiparm(cursor_address, y, x);

View File

@ -6,14 +6,14 @@ extern "C" {
#endif
int terminfo_setupterm(char *term, int fildes);
char *terminfo_clear_screen(void);
char *terminfo_set_bold(int arg);
char *terminfo_set_italics(int arg);
char *terminfo_set_underline(int arg);
char *terminfo_set_foreground(int arg);
char *terminfo_set_background(int arg);
const char *terminfo_clear_screen(void);
const char *terminfo_set_bold(int arg);
const char *terminfo_set_italics(int arg);
const char *terminfo_set_underline(int arg);
const char *terminfo_set_foreground(int arg);
const char *terminfo_set_background(int arg);
int terminfo_max_colors(void);
char *terminfo_cursor_address(int y, int x);
const char *terminfo_cursor_address(int y, int x);
#ifdef __cplusplus
}