fix: fix apple only code
This commit is contained in:
parent
e10a07c784
commit
443f5548e3
1 changed files with 1 additions and 8 deletions
9
main.c
9
main.c
|
@ -325,9 +325,7 @@ printCV(char face, struct json_object_element_s *r)
|
|||
void
|
||||
printAscii(struct json_value_s *json)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
fcntl(STDOUT_FILENO, F_SETFL, ~O_NONBLOCK);
|
||||
#endif
|
||||
char face = chooseMainFace();
|
||||
struct json_object_element_s *root = json_value_as_object(json)->start;
|
||||
printCV(face, root);
|
||||
|
@ -335,9 +333,7 @@ printAscii(struct json_value_s *json)
|
|||
for (int k = 0; k < SCREEN_WIDTH * SCREEN_HEIGHT; ++k)
|
||||
printf("%s", k % SCREEN_WIDTH ? chooseColor(output[k]) : "\r\n");
|
||||
printf("\r\n");
|
||||
#ifdef __APPLE__
|
||||
fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -537,9 +533,6 @@ main()
|
|||
char keyboardInput = 0;
|
||||
signal(SIGINT, intHandler);
|
||||
tcgetattr(STDIN_FILENO, &originalTerm);
|
||||
#ifndef __APPLE__
|
||||
fcntl(STDIN_FILENO, F_SETFL, O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
struct termios t = {};
|
||||
cfmakeraw(&t);
|
||||
|
@ -569,6 +562,6 @@ main()
|
|||
printf("\x1b[2J");
|
||||
printAscii(json);
|
||||
getInput(&keyboardInput);
|
||||
usleep(10000);
|
||||
usleep(30000);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue