1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- /*
- * File: command.h
- * Author: Arthur Brandao
- *
- * Created on 9 novembre 2018
- */
- #ifndef COMMAND_H
- #define COMMAND_H
- /* --- Include --- */
- #include <sys/types.h>
- #include "constante.h"
- /* --- Structure --- */
- typedef struct pid_node pid_node;
- struct pid_node{
- pid_t pid;
- pid_node* prev;
- pid_node* next;
- };
- typedef struct{
- pid_node* first;
- pid_node* last;
- }pid_list;
- /* --- Extern --- */
- extern char* cmdlist[3];
- extern boolean exitsh;
- /* --- Fonctions --- */
- void ini_pid_list(pid_list*);
- pid_node* add_pid(pid_list*, pid_t);
- pid_node* search_pid(pid_list*, pid_t);
- void remove_pid(pid_list*, pid_node*);
- void clean_pid(pid_list*);
- boolean is_internal_cmd(const char*);
- int launch_internal_command(Command*);
- /* --- Commandes --- */
- /**
- * Change le dossier de travail actuel
- * @param int argc
- * @param char** argv
- */
- int cd(int, char**);
- int exit_sh(int, char**);
- #endif /* COMMAND_H */
|