forked from zwickethomas/Photonics-Helfer
add terminal size
parent
d38f410148
commit
d579d34072
28
src/main.c
28
src/main.c
|
@ -1,5 +1,7 @@
|
|||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// import sub programme
|
||||
#include "test_prog.h"
|
||||
|
@ -15,8 +17,30 @@ Datum: 04.12.2024
|
|||
0.1 04.12.2024 Dokument erstellt
|
||||
*/
|
||||
|
||||
int main(){
|
||||
int x = test_gruppe_programmname();
|
||||
int terminal_size (int argc, char **argv)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue