Rename folders

This commit is contained in:
Night Kaly 2024-09-24 13:53:53 +01:00
parent 4d3bb95e78
commit ceacd1306f
Signed by: night0721
GPG key ID: 957D67B8DB7A119B
4 changed files with 9 additions and 19 deletions

View file

@ -48,7 +48,7 @@ void ncurses_init()
{
/* check if it is interactive shell */
if (!isatty(STDIN_FILENO)) {
error(1, "No tty detected. zsm requires an interactive shell to run");
error(1, "No tty detected. zen requires an interactive shell to run");
}
/* initialize screen, don't print special chars,
@ -562,13 +562,13 @@ void ncurses_deinit()
/*
* Main loop of user interface
*/
void ui(int fd)
int main(int argc, char **argv)
{
signal(SIGPIPE, signal_handler);
signal(SIGABRT, signal_handler);
signal(SIGINT, signal_handler);
signal(SIGTERM, signal_handler);
sockfd = fd;
connect_server();
ncurses_init();
windows_init();
users = arraylist_init(LINES);
@ -579,27 +579,18 @@ void ui(int fd)
refresh();
int ch;
while (1) {
/*
if (COLS < 80 || LINES < 24) {
endwin();
error(1, "Terminal size needs to be at least 80x24");
}
*/
if (current_window == CHAT_WINDOW) {
wclear(textbox);
mvwprintw(textbox, 0, 0, "> %s", content);
wrefresh(textbox);
wmove(textbox, 0, curs_pos + 2);
/* Set cursor to visible */
curs_set(2);
} else {
curs_set(0);
}
ch = getch();
switch (ch) {
case CTRLD:
ncurses_deinit();
break;
/* go up by k or up arrow */
case UP:
if (current_window == USERS_WINDOW) {
@ -645,5 +636,6 @@ void ui(int fd)
}
}
return;
ncurses_deinit();
return 0;
}

View file

@ -7,8 +7,6 @@
#include "client/db.h"
#include "server/server.h"
int sockfd;
/*
* Authenticate with server by signing a challenge
*/
@ -132,7 +130,7 @@ int main()
error(1, "Error initializing libnotify");
}
sockfd = socket(AF_INET, SOCK_STREAM, 0);
int sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0) {
error(1, "Error on opening socket");
}
@ -149,8 +147,8 @@ int main()
memcpy(&server_addr.sin_addr.s_addr, server->h_addr, server->h_length);
/* free(server); Can't be freed seems */
if (connect(sockfd, (struct sockaddr *) &server_addr, sizeof(server_addr)
) < 0) {
if (connect(sockfd, (struct sockaddr *) &server_addr, sizeof(server_addr))
< 0) {
error(1, "Error on connect");
close(sockfd);
return 0;