[CHANGE] Base implementation logger

This commit is contained in:
max 2025-01-20 04:08:30 +01:00
parent b536709fb5
commit 320ee80cb1
4 changed files with 21 additions and 0 deletions

0
src/net/collections/CMakeLists.txt Normal file → Executable file
View File

0
src/net/collections/list.c Normal file → Executable file
View File

0
src/net/include/list.h Normal file → Executable file
View File

View File

@ -1,5 +1,6 @@
#include "netex.h"
#include "server.h"
#include <signal.h>
WINDOW *info_win, *log_win, *log_win_content;
SCR_SIZE info_win_size, log_win_size;
@ -8,6 +9,7 @@ bool setup_info_window(void);
bool write_info(const char* conn, int port, const char* ipv);
bool setup_log_window(void);
void calculate_window_sizes(void);
void sig_resize(int in);
bool setup_srv_curses(void)
{
@ -23,9 +25,28 @@ bool setup_srv_curses(void)
wrefresh(info_win);
wrefresh(log_win);
wrefresh(log_win_content);
signal(SIGWINCH, sig_resize);
return true;
}
void sig_resize(int in)
{
calculate_window_sizes();
int info_resize_result = wresize(info_win, info_win_size.y, info_win_size.x);
if (info_resize_result == ERR)
{
ERROR("Failed to resize info window!");
}
clear();
box(info_win, 0, 0);
mvwprintw(info_win, 0, 1, " Info ");
write_info("0.0.0.0", 6950, "IPv4");
refresh();
wrefresh(info_win);
wrefresh(log_win);
wrefresh(log_win_content);
}
bool setup_info_window(void)
{
info_win = subwin(stdscr, info_win_size.y, info_win_size.x, 1, 0);