summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAbdellah El Morabit <nsrddyn@gmail.com>2025-01-31 21:30:23 +0100
committerAbdellah El Morabit <nsrddyn@gmail.com>2025-01-31 21:30:23 +0100
commitda85095f54f383dd6040e834aeae8aa3a1cb5ff9 (patch)
treee669cb152face7ee57b46c28bd5f1b45540548f3 /main.c
parent7edc3ede1e7c17dd26040520c65765ef4ed8e782 (diff)
switching to unistd.h instead of playing around with the delivered header apue.h
Diffstat (limited to 'main.c')
-rw-r--r--main.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/main.c b/main.c
index b0ebe5c..9609d00 100644
--- a/main.c
+++ b/main.c
@@ -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;
}