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
2023-08-04 09:13:47 -06:00

23 lines
458 B
C

#ifndef ERROR_H_
#include <stdio.h>
#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)
#define DB_ERROR 100
#define IRC_ERROR 200
#define CREDS_ERROR 300
#define ERROR_H_
#endif