This repository has been archived on 2024-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
probotic/include/error.h

23 lines
458 B
C
Raw Normal View History

2023-08-02 15:27:59 -04:00
#ifndef ERROR_H_
#include <stdio.h>
2023-08-03 02:16:39 -04:00
#define ERR(ret,msg) \
do { fputs(PROGN ": " msg "\n", stderr); return (ret); } while (0)
#define ERRFMT(ret,fmt,...) \
do { fprintf(stderr, PROGN ": " fmt "\n", __VA_ARGS__); return (ret); } while (0)
#define PERROR(ret) \
do { perror(PROGN); return (ret); } while (0)
#define ERRMSG(msg) \
fputs(msg "\n", stderr)
2023-08-02 15:27:59 -04:00
2023-08-02 14:55:21 -04:00
#define DB_ERROR 100
#define IRC_ERROR 200
2023-08-02 16:37:28 -04:00
#define CREDS_ERROR 300
2023-08-02 15:27:59 -04:00
#define ERROR_H_
#endif