-
Notifications
You must be signed in to change notification settings - Fork 11
/
shell.h
35 lines (28 loc) · 805 Bytes
/
shell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#define NUM_BUILTINS 8
void shell_loop(void);
char *shell_read_line(void);
char **shell_line_parse(char* line);
int shell_launch(char** args);
int shell_execute(char** args);
void shell_handle_error(const char* message);
int shell_man(char** args);
int shell_list(char** args);
int shell_make_dir(char** args);
// Global current directory variable
extern char current_dir[1024];
// Built-in shell commands
int shell_cd(char** args);
int shell_help(char** args);
int shell_pwd(char** args);
int shell_echo(char** args);
int shell_exit_command(char** args);
// Command structure for built-in commands
typedef struct {
char *name;
int (*func)(char **args);
char *description;
} builtin_command;
extern builtin_command builtins[NUM_BUILTINS];
#endif