ladybird/Userland/Libraries/LibLine/VT.h
Ali Mohammad Pur 3184086679 LibLine: Avoid excessive write() syscalls when refreshing the display
Previously, we were generating the display update one character at a
time, and writing them one at a time to stderr, which is not buffered,
doing so caused one syscall per character printed which is s l o w (TM)
This commit makes LibLine write the update contents into a buffer, and
flush it after all the update is generated :^)
2021-07-20 11:55:42 +04:30

24 lines
558 B
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Types.h>
#include <LibLine/Style.h>
namespace Line {
namespace VT {
void save_cursor(OutputStream&);
void restore_cursor(OutputStream&);
void clear_to_end_of_line(OutputStream&);
void clear_lines(size_t count_above, size_t count_below, OutputStream&);
void move_relative(int x, int y, OutputStream&);
void move_absolute(u32 x, u32 y, OutputStream&);
void apply_style(const Style&, OutputStream&, bool is_starting = true);
}
}