4 fz_warn(char *fmt
, ...)
7 fprintf(stderr
, "warning: ");
9 vfprintf(stderr
, fmt
, ap
);
11 fprintf(stderr
, "\n");
15 fz_throw1(char *fmt
, ...)
20 eo
= fz_malloc(sizeof(fz_error
));
21 if (!eo
) return fz_outofmem
;
24 strlcpy(eo
->func
, "unknown", sizeof eo
->func
);
25 strlcpy(eo
->file
, "unknown", sizeof eo
->file
);
29 vsnprintf(eo
->msg
, sizeof eo
->msg
, fmt
, ap
);
30 eo
->msg
[sizeof(eo
->msg
) - 1] = '\0';
37 fz_throw0(const char *func
, const char *file
, int line
, char *fmt
, ...)
42 eo
= fz_malloc(sizeof(fz_error
));
43 if (!eo
) return fz_outofmem
;
46 strlcpy(eo
->func
, func
, sizeof eo
->func
);
47 strlcpy(eo
->file
, file
, sizeof eo
->file
);
51 vsnprintf(eo
->msg
, sizeof eo
->msg
, fmt
, ap
);
52 eo
->msg
[sizeof(eo
->msg
) - 1] = '\0';
58 fprintf(stderr
, "%s:%d: %s(): %s\n", eo
->file
, eo
->line
, eo
->func
, eo
->msg
);
67 fz_droperror(fz_error
*eo
)