forked from vvy/wshell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wshell.h
54 lines (49 loc) · 1.22 KB
/
wshell.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* =====================================================================================
* Filename: wshell.h
* Description:
* Version: 1.0
* Created: 2013.10.16 20h15min26s
* Author: wuyue (wy), [email protected]
* Company: UESTC
* =====================================================================================
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <pwd.h>
#include <signal.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/stat.h>
#define MAX_PROMPT 1024
#define MAXLINE 4096 //the length of all args is ARG_MAX
#define MAXARG 20
struct parse_info;
struct passwd *pwd;
char *buffer;
void type_prompt(char*);
int read_command(char **,char **,char*);
int builtin_command(char *,char **);
int parsing(char **,int,struct parse_info *);
void proc(void);
void sig_handler(int sig);
#ifndef STRUCT_PARSE_INFO
#define STRUCT_PARSE_INFO
#define BACKGROUND 1
#define IN_REDIRECT 2
#define OUT_REDIRECT 4
#define OUT_REDIRECT_APPEND 8
#define IS_PIPED 16
struct parse_info
{
int flag;
char* in_file;
char* out_file;
char* command2;
char** parameters2;
};
#endif