diff --git a/include/file_operations.h b/include/file_operations.h new file mode 100644 index 0000000..e17a4d5 --- /dev/null +++ b/include/file_operations.h @@ -0,0 +1,6 @@ +#ifndef __FILE_OPERATIONS_H__ +#define __FILE_OPERATIONS_H__ + + + +#endif \ No newline at end of file diff --git a/output/main b/output/main index cc58852..4680260 100755 Binary files a/output/main and b/output/main differ diff --git a/src/main.c b/src/main.c index d10cc0e..7295927 100644 --- a/src/main.c +++ b/src/main.c @@ -11,12 +11,13 @@ #include "users.h" #include "tui.h" #include "rfid_handler.h" +#include "file_operations.h" int main(int argc, char const **argv) { - if (argc != 1) + if (argc != 2) { - printf("Usage: %s
\n", argv[0]); + printf("filename argument required\nUsage: %s [User database]\n", argv[0]); return EXIT_FAILURE; } @@ -45,8 +46,7 @@ int main(int argc, char const **argv) erase(); refresh(); - // uartDialog(uart_address, x_max, y_max); - strcpy(uart_address, argv[1]); + uartDialog(uart_address, x_max, y_max); pthread_create(&uart_thread, NULL, uartListener, uart_address); diff --git a/src/users.c b/src/users.c index 3a384e6..68a9d0e 100644 --- a/src/users.c +++ b/src/users.c @@ -48,7 +48,7 @@ int addPersonToList( if (*_head == NULL) { *_head = new_node; - return; + return 0; } node_t *current = *_head; @@ -58,5 +58,5 @@ int addPersonToList( } current->next = new_node; - return 0; + return 1; } \ No newline at end of file