mirror of
https://github.com/hmaxnl/netex.git
synced 2025-04-19 11:38:13 +02:00
[CHANGE] Base implementation logger
This commit is contained in:
parent
b536709fb5
commit
320ee80cb1
0
src/net/collections/CMakeLists.txt
Normal file → Executable file
0
src/net/collections/CMakeLists.txt
Normal file → Executable file
0
src/net/collections/list.c
Normal file → Executable file
0
src/net/collections/list.c
Normal file → Executable file
0
src/net/include/list.h
Normal file → Executable file
0
src/net/include/list.h
Normal file → Executable file
|
@ -1,5 +1,6 @@
|
||||||
#include "netex.h"
|
#include "netex.h"
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
|
#include <signal.h>
|
||||||
|
|
||||||
WINDOW *info_win, *log_win, *log_win_content;
|
WINDOW *info_win, *log_win, *log_win_content;
|
||||||
SCR_SIZE info_win_size, log_win_size;
|
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 write_info(const char* conn, int port, const char* ipv);
|
||||||
bool setup_log_window(void);
|
bool setup_log_window(void);
|
||||||
void calculate_window_sizes(void);
|
void calculate_window_sizes(void);
|
||||||
|
void sig_resize(int in);
|
||||||
|
|
||||||
bool setup_srv_curses(void)
|
bool setup_srv_curses(void)
|
||||||
{
|
{
|
||||||
|
@ -23,9 +25,28 @@ bool setup_srv_curses(void)
|
||||||
wrefresh(info_win);
|
wrefresh(info_win);
|
||||||
wrefresh(log_win);
|
wrefresh(log_win);
|
||||||
wrefresh(log_win_content);
|
wrefresh(log_win_content);
|
||||||
|
signal(SIGWINCH, sig_resize);
|
||||||
return true;
|
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)
|
bool setup_info_window(void)
|
||||||
{
|
{
|
||||||
info_win = subwin(stdscr, info_win_size.y, info_win_size.x, 1, 0);
|
info_win = subwin(stdscr, info_win_size.y, info_win_size.x, 1, 0);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user