1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

Userland: Replace most printf-style APIs with AK::Format APIs :^)

This commit is contained in:
Linus Groh 2021-05-31 15:43:25 +01:00
parent 4f1889c2cb
commit f5c35fccca
75 changed files with 642 additions and 644 deletions

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Format.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/ioctl.h>
@ -13,11 +14,11 @@ static int key_fd;
static void wait_for_key()
{
printf("\033[7m--[ more ]--\033[0m");
out("\033[7m--[ more ]--\033[0m");
fflush(stdout);
char dummy;
[[maybe_unused]] auto rc = read(key_fd, &dummy, 1);
printf("\n");
outln();
}
int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
@ -43,7 +44,7 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char** argv)
auto* str = fgets(buffer, sizeof(buffer), stdin);
if (!str)
break;
printf("%s", str);
out("{}", str);
++lines_printed;
if ((lines_printed % (ws.ws_row - 1)) == 0) {
wait_for_key();