1 #include "qpms_error.h"
6 qpms_dbgmsg_flags qpms_dbgmsg_enabled
= QPMS_DBGMSG_MISC
;
8 qpms_dbgmsg_flags
qpms_dbgmsg_enable(qpms_dbgmsg_flags types
) {
9 return (qpms_dbgmsg_enabled
|= types
);
12 qpms_dbgmsg_flags
qpms_dbgmsg_disable(qpms_dbgmsg_flags types
) {
13 return (qpms_dbgmsg_enabled
&= ~types
);
16 void qpms_pr_error(const char *fmt
, ...) {
20 vfprintf(stderr
, fmt
, ap
);
28 //void qpms_error(const char *fmt, ...);
30 void qpms_pr_error_at_line(const char *filename
, unsigned int linenum
,
31 const char *fmt
, ...) {
33 fprintf(stderr
, "%s:%u: ", filename
, linenum
);
36 vfprintf(stderr
, fmt
, ap
);
43 void qpms_pr_error_at_flf(const char *filename
, unsigned int linenum
,
45 const char *fmt
, ...) {
47 fprintf(stderr
, "%s:%u, %s: ", filename
, linenum
, func
);
50 vfprintf(stderr
, fmt
, ap
);
57 void qpms_warn_at_flf(const char *filename
, unsigned int linenum
,
59 const char *fmt
, ...) {
60 fprintf(stderr
, "%s:%u, %s: ", filename
, linenum
, func
);
63 vfprintf(stderr
, fmt
, ap
);
69 void qpms_pr_debug_at_flf(const char *filename
, unsigned int linenum
,
71 const char *fmt
, ...) {
72 fprintf(stderr
, "%s:%u, %s: ", filename
, linenum
, func
);
75 vfprintf(stderr
, fmt
, ap
);
81 void qpms_debug_at_flf(const char *filename
, unsigned int linenum
,
82 const char *func
, qpms_dbgmsg_flags type
,
83 const char *fmt
, ...) {
84 if (!(type
& qpms_dbgmsg_enabled
)) return;
85 fprintf(stderr
, "%s:%u, %s: ", filename
, linenum
, func
);
88 vfprintf(stderr
, fmt
, ap
);
94 //void qpms_error_at_line(const char *filename, unsigned int linenum,
95 // const char *fmt, ...);