Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*==================================================================================================
- --------------------------------------------------------------------------------------------------
- [posix_clear_screen.c]
- The POSIX (Unix, Linux, Mac OSX, etc) way of clearing the terminal screen.
- (c) Damion 'Phr0z3n.dev' Tapper, 2014.
- Email: [email protected]
- --------------------------------------------------------------------------------------------------
- ==================================================================================================*/
- #include <unistd.h>
- #include <term.h>
- void ClearScreen(void)
- int main(void)
- {
- ClearScreen();
- return 0;
- }
- void ClearScreen(void)
- {
- if(!cur_term)
- {
- int result;
- setupterm(NULL, STDOUT_FILENO, &result);
- if(result <= 0) return;
- }
- putp(tigetstr("clear"));
- }
Advertisement
Add Comment
Please, Sign In to add comment