comparison mupdf-source/thirdparty/extract/src/outf.c @ 2:b50eed0cc0ef upstream

ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4. The directory name has changed: no version number in the expanded directory now.
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:43:07 +0200
parents
children
comparison
equal deleted inserted replaced
1:1d09e1dec1d9 2:b50eed0cc0ef
1 #include "memento.h"
2 #include "outf.h"
3
4 #include <stdarg.h>
5 #include <stdio.h>
6 #include <string.h>
7
8 int extract_outf_verbose = 0;
9
10 void extract_outf_verbose_set(int verbose)
11 {
12 extract_outf_verbose = verbose;
13 }
14
15 void (extract_outf)(
16 int level,
17 const char *file,
18 int line,
19 const char *fn,
20 int ln,
21 const char *format,
22 ...
23 )
24 {
25 va_list va;
26 if (level > extract_outf_verbose) {
27 return;
28 }
29
30 if (ln) {
31 fprintf(stderr, "%s:%i:%s: ", file, line, fn);
32 }
33 va_start(va, format);
34 vfprintf(stderr, format, va);
35 va_end(va);
36 if (ln) {
37 size_t len = strlen(format);
38 if (len == 0 || format[len-1] != '\n') {
39 fprintf(stderr, "\n");
40 }
41 }
42 }