-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshellA.h
More file actions
52 lines (36 loc) · 894 Bytes
/
shellA.h
File metadata and controls
52 lines (36 loc) · 894 Bytes
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/* shellA.h: header file for structs and so forth */
#ifndef SHELLA_H_
#define SHELLA_H_
/*** functions ***/
/* utility */
void die(const char *msg, int ret);
/* program execution */
int execute(char **argv);
int shell_cd(char *path);
/* input */
int process_cmdl_args(char **argv);
char *get_input(void);
int process(int argc, char **argv);
char **split(char *input, const char *delim, int *size);
/* misc */
char *extract_dir_name(char *full_path);
/* output */
void print_ps1(void);
void print_usage(void);
/*** structs ***/
struct command {
int iden;
const char *name;
const char *name_alt;
const char *desc;
};
/*** command line arguements ***/
struct command args[] = {
{0, "--help", "-h", "display help message"},
};
/*** internal commands ***/
struct command commands[] = {
{0, "exit", NULL, "terminate the shell"},
{1, "cd", NULL, "change directory"},
};
#endif