diff options
| author | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-01-31 21:30:23 +0100 |
|---|---|---|
| committer | Abdellah El Morabit <nsrddyn@gmail.com> | 2025-01-31 21:30:23 +0100 |
| commit | da85095f54f383dd6040e834aeae8aa3a1cb5ff9 (patch) | |
| tree | e669cb152face7ee57b46c28bd5f1b45540548f3 /main.c | |
| parent | 7edc3ede1e7c17dd26040520c65765ef4ed8e782 (diff) | |
switching to unistd.h instead of playing around with the delivered header apue.h
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 41 |
1 files changed, 21 insertions, 20 deletions
@@ -1,28 +1,15 @@ #include <stdio.h> #include <stdlib.h> - - #include <string.h> -#include <ctype.h> - #include <readline/readline.h> - -// import files for reading the current directory -#include "apue.c" #include <dirent.h> +#include <unistd.h> #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; } |
