From da85095f54f383dd6040e834aeae8aa3a1cb5ff9 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Fri, 31 Jan 2025 21:30:23 +0100 Subject: switching to unistd.h instead of playing around with the delivered header apue.h --- main.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index b0ebe5c..9609d00 100644 --- a/main.c +++ b/main.c @@ -1,28 +1,15 @@ #include #include - - #include -#include - #include - -// import files for reading the current directory -#include "apue.c" #include +#include #define true 1 #define false 0 -void err_quit(char * str) { - printf("%s", str); -} -void err_sys(char * str) { - printf("%s", str); -} - -void PROCESS_PID(char *string) { - +void PROCESS_PID() +{ printf("PID %ld\n", (long)getpid()); } @@ -39,13 +26,27 @@ void LIST_CURRENT_DIRECTORY(int argc, char *argv[]) closedir(dp); } +void ECHO_INPUT(char *string) +{ + printf("%s", string); +} + +int loop_shell() +{ + + + return 0; +} int main(int argc, char *argv[]) { - printf("succefully started the program"); - // RUNNING THE PROGRAM ON AN ENDLESS LOOP - // BREAKS WHEN USER ENTERS EXIT - // ReSharper disable once CppDFAEndlessLoop + int c; + while ((c = getc(stdin) != EOF)) + { + if put + } + LIST_CURRENT_DIRECTORY(argc, argv); + printf("successfully started the program"); return 0; } -- cgit v1.2.3-70-g09d2