summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorAbdellah El Morabit <nsrddyn@gmail.com>2025-01-31 21:47:05 +0100
committerAbdellah El Morabit <nsrddyn@gmail.com>2025-01-31 21:47:05 +0100
commit796e839f5f5e60be95f1c64f3784c3eef52673a7 (patch)
tree3889bfb0229650031b549f732cece6479f6436d9 /main.c
parentda85095f54f383dd6040e834aeae8aa3a1cb5ff9 (diff)
implementing basic functionality in the shell
Diffstat (limited to 'main.c')
-rw-r--r--main.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/main.c b/main.c
index 9609d00..b4f02ff 100644
--- a/main.c
+++ b/main.c
@@ -5,9 +5,34 @@
#include <dirent.h>
#include <unistd.h>
+/* BOOLEANS */
#define true 1
#define false 0
+/* SIGNALS */
+#define SIGHUP 1 /* Hang up the process */
+#define SIGINT 2 /* Interrupt the process */
+#define SIGQUIT 3 /* Quit the process */
+#define SIGILL 4 /* Illegal instruction. */
+#define SIGTRAP 5 /* Trace trap. */
+#define SIGABRT 6 /* Abort. */
+
+void PIPELING();
+void COMMAND_EXECUTION();
+void REDIRECTION();
+void SCRIPTING();
+
+void ERROR_QUIT(char *CURRENT_COMMAND, char *COMMAND_INSTRUCTIONS)
+{
+ printf("%s", );
+
+}
+
+void err_sys(char *string)
+{
+ printf("%s", string);
+}
+
void PROCESS_PID()
{
printf("PID %ld\n", (long)getpid());
@@ -20,7 +45,7 @@ void LIST_CURRENT_DIRECTORY(int argc, char *argv[])
if (argc != 2)
err_quit("usage: ls directory_name");
if ((dp = opendir(argv[1])) == NULL)
- err_sys( argv[1]);
+ err_sys(argv[1]);
while ((dirp = readdir(dp)) != NULL)
printf("%s\n", dirp->d_name);
closedir(dp);