comparison mupdf-source/thirdparty/extract/src/outf.c @ 3:2c135c81b16c

MERGE: upstream PyMuPDF 1.26.4 with MuPDF 1.26.7
author Franz Glasner <fzglas.hg@dom66.de>
date Mon, 15 Sep 2025 11:44:09 +0200
parents b50eed0cc0ef
children
comparison
equal deleted inserted replaced
0:6015a75abc2d 3:2c135c81b16c
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 }