Select Git revision
Forked from
sce213ta / mysh-1
1 commit ahead of the upstream repository.
김정환 authored
main.c 717 B
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "commands.h"
#include "built_in.h"
#include "utils.h"
#include "signal_handlers.h"
#include <signal.h>
#include <sys/types.h>
#include <signal_handlers.h>
int main()
{
char buf[8096];
while (1) {
signal(SIGINT, (void*)catch_sigint);
signal(SIGTSTP, (void*)catch_sigtstp);
memset(buf, NULL,8096);
fgets(buf, 8096, stdin);
struct single_command commands[512];
int n_commands = 0;
mysh_parse_command(buf, &n_commands, &commands);
int ret = evaluate_command(n_commands, &commands);
free_commands(n_commands, &commands);
n_commands = 0;
if (ret == 1) {
break;
}
}
return 0;
}