-
Notifications
You must be signed in to change notification settings - Fork 9
/
main.c
38 lines (35 loc) · 749 Bytes
/
main.c
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
#include "holberton.h"
/**
* main - entry point for application
* @ac: argument count
* @av: argument vector
* Return: 0 on success
*/
int main(int ac, char **av)
{
config build;
(void)ac;
signal(SIGINT, sigintHandler);
configInit(&build);
build.shellName = av[0];
shell(&build);
return (0);
}
/**
* configInit - initialize member values for config struct
* @build: input build
* Return: build with initialized members
*/
config *configInit(config *build)
{
build->env = generateLinkedList(environ);
build->envList = NULL;
build->args = NULL;
build->buffer = NULL;
build->path = _getenv("PATH", environ);
build->fullPath = NULL;
build->lineCounter = 0;
build->shellName = NULL;
build->errorStatus = 0;
return (build);
}