1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

Expose lineptr and unlineptr outside terminal.c.

This will allow test programs to look more easily at the terminal's
data structures.
This commit is contained in:
Simon Tatham 2023-03-04 17:19:24 +00:00
parent 1b8fb1d436
commit c890449d76
2 changed files with 8 additions and 2 deletions

View File

@ -90,7 +90,6 @@ static void term_userpass_state_free(struct term_userpass_state *s);
*/
static void resizeline(Terminal *, termline *, int);
static termline *lineptr(Terminal *, int, int);
static void unlineptr(termline *);
static void check_line_size(Terminal *, termline *);
static void do_paint(Terminal *);
static void erase_lots(Terminal *, bool, bool, bool);
@ -131,7 +130,7 @@ static void freetermline(termline *line)
}
}
static void unlineptr(termline *line)
void term_release_line(termline *line)
{
if (line->temporary)
freetermline(line);
@ -1264,6 +1263,10 @@ static termline *lineptr(Terminal *term, int y, int lineno)
*/
#define lineptr(x) (lineptr)(term,x,__LINE__)
#define scrlineptr(x) (lineptr)(term,checkscr(x,__LINE__),__LINE__)
#define unlineptr(line) term_release_line(line)
/* Wrapper for external use (e.g. tests), without the __LINE__ parameter */
termline *term_get_line(Terminal *term, int y) { return lineptr(y); }
/*
* Coerce a termline to the terminal's current width. Unlike the

View File

@ -613,4 +613,7 @@ enum {
#undef DEFINE_FLAG_BIT
};
termline *term_get_line(Terminal *term, int y);
void term_release_line(termline *line);
#endif