add terminal size

main
MuedeHydra 2024-12-09 10:11:07 +01:00
parent d38f410148
commit d579d34072
1 changed files with 26 additions and 2 deletions

View File

@ -1,5 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdio.h> #include <stdio.h>
#include <sys/ioctl.h>
#include <unistd.h>
// import sub programme // import sub programme
#include "test_prog.h" #include "test_prog.h"
@ -15,8 +17,30 @@ Datum: 04.12.2024
0.1 04.12.2024 Dokument erstellt 0.1 04.12.2024 Dokument erstellt
*/ */
int main(){ int terminal_size (int argc, char **argv)
int x = test_gruppe_programmname(); {
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
printf ("lines %d\n", w.ws_row);
printf ("columns %d\n", w.ws_col);
return 0; // make sure your main returns int
}
int main(int argc, char **argv){
// int x = test_gruppe_programmname();
// int terminal_size();
struct winsize w;
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
printf ("lines %d\n", w.ws_row);
printf ("columns %d\n", w.ws_col);
return 0; return 0;
} }