| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /*
- * File: error.h
- * Author: Arthur Brandao
- *
- * Created on 8 novembre 2018
- */
- #ifndef ERROR_H
- #define ERROR_H
- #include <stdio.h>
- #include <errno.h>
- /* --- Macro --- */
- #define serror(str) fprintf(stderr, str" : %s\n", serrlib[serrno])
- #define strserror(index) serrlib[index]
- #define adderror(str) fprintf(stderr, "Erreur dans le fichier "__FILE__" ligne %d, "str"\n", __LINE__)
- #define addperror(str) fprintf(stderr, "Erreur dans le fichier "__FILE__" ligne %d, "str" : %s\n", __LINE__, strerror(errno))
- #define addserror(str) fprintf(stderr, "Erreur dans le fichier "__FILE__" ligne %d, "str" : %s\n", __LINE__, strserror(serrno))
- /* --- Constantes Generales --- */
- #define ERR -1
- /* --- Constantes Erreurs --- */
- #define SEBADEND 1
- #define SEBADET 2
- #define SEOPENF 3
- #define SEREDIRTYPE 4
- #define SEBADREDIR 5
- #define SEBADCMD 6
- #define SEWC 7
- #define SEADDWC 8
- /* --- Extern --- */
- extern int errno;
- extern int serrno; //Shell Errno
- extern char* serrlib[];
- #endif /* ERROR_H */
|