-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.h
105 lines (78 loc) · 1.98 KB
/
main.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#ifndef __MAIN_H
#define __MAIN_H
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "history.h"
#include "shellvars.h"
/*#include <string.h>*/
/* from in.c */
int shintmode(void);
/* from _printenv.c */
int _printenv(void);
/* from cmdcall.c */
int builtincall(char *av[]);
int cmdcall(char *av[], char *path);
/* from parser.c */
int parseargs(char **buf);
/* from errhandl.c */
int errhandl(int status);
/* from string.c */
size_t _strlen(char *str);
char *_strcpy(char *dest, char *src);
int _strcmp(char *, char *);
char *_strdup(char *str);
char *_strcat(char *a, char *b);
/* from _getenv.c and getenviron.c */
char ***getenviron(void);
int setallenv(char **environ, char *add);
char *_getenv(char *avzero);
int _setenv(char *name, char *val);
int _unsetenv(char *name);
char **getallenv(void);
void print_alphabet(void);
/* from utility.c */
char *itos(int digits);
char *_strchr(char *s, char c);
int fprintstrs(int fd, char *str, ...);
int printerr(char *);
int linecount(int);
/* from cd.c */
int _cd(char *av[]);
/* from alias.c */
int aliascmd(char **av);
char *getalias(char *name);
int unsetalias(char *name);
/* from shellvars.c */
int initsvars(int ac, char **av);
char *getsvar(char *name);
int setsvar(char *name, char *val);
int unsetsvar(char *name);
ShellVar **getspecial(void);
ShellVar **getvars(void);
/* from _realloc.c */
void *_realloc(void *ptr, unsigned int old_size, unsigned int new_size);
/* from _strtok.c */
char *strtok(char *str, char *delim);
/* from _getline.c */
int _getline(char **lineptr, int fd);
char *strtokqe(char *str, char *delim, int escflags);
/*from history.c*/
int sethist(char *cmd);
int print_hist(void);
int exit_hist(void);
/* from _printenv.c */
int _printenv(void);
int _putchar(char c);
/*from help.c*/
int help(char *cmd);
/* from exitcleanup.c */
void exitcleanup(char **av);
/* from _atoi*/
int _atoi(char *s);
char *_getpid(void);
#endif