Enhance user information handling: add exportPersonInfo function, improve TUI dialogs, and refactor related code for better clarity and functionality.
This commit is contained in:
@@ -15,4 +15,6 @@ int loadListFromCSV(char* _filename, list_t * _list);
|
||||
|
||||
int saveListToCSV(char* _filename, list_t * _list);
|
||||
|
||||
int exportPersonInfo(node_t * _person);
|
||||
|
||||
#endif
|
||||
+24
-1
@@ -1,13 +1,36 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
#include <ncurses.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <termios.h>
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#ifndef __MAIN_H__
|
||||
#define __MAIN_H__
|
||||
|
||||
#define TRUE !0
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef BYTE
|
||||
#define BYTE uint8_t
|
||||
#endif
|
||||
|
||||
#define MIN_X_TERMINAL_SIZE 50
|
||||
#define MIN_Y_TERMINAL_SIZE 20
|
||||
|
||||
|
||||
+8
-3
@@ -4,15 +4,20 @@
|
||||
#include <ncurses.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include "main.h"
|
||||
#include "users.h"
|
||||
|
||||
void uartDialog(char *uart_adress, int terminal_x, int terminal_y);
|
||||
|
||||
void mainMenu(list_t * person_list, int terminal_x, int terminal_y);
|
||||
void mainMenu(list_t *person_list, int terminal_x, int terminal_y);
|
||||
|
||||
void personListing(list_t * person_list, int terminal_x, int terminal_y);
|
||||
void personListing(list_t *person_list, int terminal_x, int terminal_y);
|
||||
|
||||
void personSearch(list_t * person_list, int terminal_x, int terminal_y);
|
||||
void personSearch(list_t *person_list, int terminal_x, int terminal_y);
|
||||
|
||||
void personInfo(node_t *_person, int terminal_x, int terminal_y);
|
||||
|
||||
void exportDialog(list_t _list, int terminal_x, int terminal_y)
|
||||
|
||||
#endif
|
||||
@@ -1,10 +1,5 @@
|
||||
#include "main.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#ifndef __USERS_H__
|
||||
#define __USERS_H__
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef __UTILS_H__
|
||||
#define __UTILS_H__
|
||||
|
||||
#include "main.h"
|
||||
|
||||
void printTimeInString(time_t _input, char * _output);
|
||||
|
||||
void printDateAndTimeInString(time_t _input, char * _output);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user