-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.h
More file actions
16 lines (12 loc) · 866 Bytes
/
shell.h
File metadata and controls
16 lines (12 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef SHELL_H // Prevent multiple inclusion: if SHELL_H is not defined
#define SHELL_H // Define SHELL_H now
#include <stdio.h> // Standard I/O functions (e.g., printf, fgets)
#include <stdlib.h> // General utilities (e.g., exit, malloc)
#include <string.h> // String functions (e.g., strtok, strcmp)
#include <unistd.h> // POSIX functions (e.g., fork, exec)
#include <sys/wait.h> // For wait() function to wait for child processes
#define MAX_INPUT 1024 // Define a constant for max input length
#define MAX_ARGS 64 // Define a constant for max number of arguments
void execute_command(char *input); // Function to execute parsed command
void print_error(const char *msg); // Function to print error messages
#endif // End of ifndef/define block