2021-02-17 22:23:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* Header pour la bibliothèque permettant d’avoir des
|
|
|
|
|
* outils essentiels pour le shell tel que la fonction pour
|
|
|
|
|
* afficher des erreurs.
|
|
|
|
|
* @file essential_shell.h
|
|
|
|
|
* @author rick <rick@gnous.eu>
|
|
|
|
|
* @date 2021
|
|
|
|
|
*/
|
|
|
|
|
|
2021-02-22 14:48:35 +00:00
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
2021-02-17 22:23:13 +00:00
|
|
|
|
#ifndef _ESSHELL_
|
|
|
|
|
# define _ESSHELL_
|
|
|
|
|
|
|
|
|
|
#define SHELL rishtik
|
|
|
|
|
#define FATAL_ERROR 1
|
|
|
|
|
#define NON_FATAL_ERROR 0
|
|
|
|
|
|
2021-02-21 18:12:12 +00:00
|
|
|
|
#define ERR_PIPE_CREATION 200 /* erreur lors de la création des pipes */
|
|
|
|
|
#define ERR_FORK 201 /* erreur lors du fork */
|
|
|
|
|
|
2021-02-22 14:48:35 +00:00
|
|
|
|
extern pid_t pid;
|
2021-02-23 16:23:02 +00:00
|
|
|
|
extern int exit_code;
|
2021-02-23 17:23:36 +00:00
|
|
|
|
extern int need_exit; /* 0 = pas besoin de sortir, 1 = commande exit appelée */
|
2021-02-22 14:48:35 +00:00
|
|
|
|
|
2021-02-20 15:53:46 +00:00
|
|
|
|
int native_command(char *command[]);
|
2021-02-23 16:23:02 +00:00
|
|
|
|
void change_dir(char *command[]);
|
2021-02-23 17:23:36 +00:00
|
|
|
|
void thus_exit(char *command[]);
|
2021-02-24 01:23:21 +00:00
|
|
|
|
void thus_export(char *command[]);
|
2021-03-05 19:24:28 +00:00
|
|
|
|
void ctrl_c_handler(int signum);
|
2021-02-21 19:42:54 +00:00
|
|
|
|
void error(int code, int type, char *message);
|
2021-02-17 22:23:13 +00:00
|
|
|
|
|
|
|
|
|
#endif
|