Commited uncommited files

This commit is contained in:
Liliesh 2026-03-18 18:58:18 +01:00
parent bea164468b
commit af1377bc7c
Signed by: liliesh
GPG key ID: 680387646C7BAE8E
9 changed files with 285 additions and 253 deletions

View file

@ -1,28 +1,28 @@
#include <stdio.h>
#if defined(_WIN32)
#include <windows.h>
#elif defined(__linux__)
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#include "clear_screen.h"
void clearScreen(){
#if defined(_WIN32)
CONSOLE_SCREEN_BUFFER_INFO csbi;
int rows;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
for(int i = 0; i < rows; i++){
printf("\n");
}
#elif defined(__linux__)
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
for(int i = 0; i < w.ws_row; i++){
printf("\n");
}
#endif
#include <stdio.h>
#if defined(_WIN32)
#include <windows.h>
#elif defined(__linux__)
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#include "clear_screen.h"
void clearScreen(){
#if defined(_WIN32)
CONSOLE_SCREEN_BUFFER_INFO csbi;
int rows;
GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
rows = csbi.srWindow.Bottom - csbi.srWindow.Top + 1;
for(int i = 0; i < rows; i++){
printf("\n");
}
#elif defined(__linux__)
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
for(int i = 0; i < w.ws_row; i++){
printf("\n");
}
#endif
}

View file

@ -1,6 +1,6 @@
#ifndef _CLEAR_SCREEN_H_
#define _CLEAR_SCREEN_H_
void clearScreen();
#ifndef _CLEAR_SCREEN_H_
#define _CLEAR_SCREEN_H_
void clearScreen();
#endif