add terminal size
This commit is contained in:
		
							parent
							
								
									d38f410148
								
							
						
					
					
						commit
						d579d34072
					
				
							
								
								
									
										28
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								src/main.c
									
									
									
									
									
								
							@ -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;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user