-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathheader.h
More file actions
42 lines (36 loc) · 924 Bytes
/
header.h
File metadata and controls
42 lines (36 loc) · 924 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
#ifndef __HEADER_H__
#define __HEADER_H__
// 다른 헤더파일 include
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
#include <signal.h>
// 상수 및 매크로 정의부
#define AMPERSAND 0
#define EOL 1
#define ARG 2
#define SIZE 1024
// 사용자 정의 type정의부
// 전역 변수 선언
char current_directory[SIZE];
char previous_directory[SIZE];
char input[SIZE];
char tokens[SIZE];
char *ptr;
char *tok;
// 함수 선언부
int get_token(char **arg);
void change_directory(char **arg, int index);
bool is_pipe(char **arg, int size);
bool is_redirection(char **arg, int size);
bool command_line(void);
void process_pipe(char **arg, int narg, int how);
void background(char **arg, int index);
void process_redir(char **arg, int narg);
void fork_and_call_process_redir(char **arg, int narg);
#endif