-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrompt.h
More file actions
57 lines (46 loc) · 1013 Bytes
/
Copy pathPrompt.h
File metadata and controls
57 lines (46 loc) · 1013 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
53
54
55
56
57
//
// Created by yaelao on 5/30/23.
//
#ifndef SHELL_PROMPT_H
#define SHELL_PROMPT_H
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <stdbool.h>
#include "Queue.h"
#include "List.h"
#include "Process.h"
#include "Memory.h"
#define READ_END 0
#define WRITE_END 1
#define MAX_SIZE 1024
static Queue *process_queue;
enum Option {
ALLOC, FREE, COMPACT, STATE,
MKPS, LSP, KILL, RR, FCFS, SJF
};
typedef struct {
char *key;
enum Option value;
} Pair;
// Tabla hash que almacena los comandos de entrada.
static Pair lookup_table[] = {
{"alloc", ALLOC},
{"free", FREE},
{"compact", COMPACT},
{"state", STATE},
{"mkps", MKPS},
{"lsp", LSP},
{"kill", KILL},
{"rr", RR},
{"fcfs", FCFS},
{"sjf", SJF},
};
void show_prompt();
char **split_args_execvp(char *args);
char **split_args(char *args);
void init_shell();
#endif //SHELL_PROMPT_H