userprintf.c
Go to the documentation of this file.
1 /*<html><pre> -<a href="qh-user.htm"
2  >-------------------------------</a><a name="TOP">-</a>
3 
4  userprintf.c
5  qh_fprintf()
6 
7  see README.txt see COPYING.txt for copyright information.
8 
9  If you recompile and load this file, then userprintf.o will not be loaded
10  from qhull.a or qhull.lib
11 
12  See libqhull.h for data structures, macros, and user-callable functions.
13  See user.c for qhull-related, redefinable functions
14  see user.h for user-definable constants
15  See usermem.c for qh_exit(), qh_free(), and qh_malloc()
16  see Qhull.cpp and RboxPoints.cpp for examples.
17 
18  Please report any errors that you fix to qhull@qhull.org
19 */
20 
21 #include "libqhull.h"
22 #include "mem.h"
23 
24 #include <stdarg.h>
25 #include <stdio.h>
26 #include <stdlib.h>
27 
28 /*-<a href="qh-user.htm#TOC"
29  >-------------------------------</a><a name="qh_fprintf">-</a>
30 
31  qh_fprintf(fp, msgcode, format, list of args )
32  print arguments to *fp according to format
33  Use qh_fprintf_rbox() for rboxlib.c
34 
35  notes:
36  same as fprintf()
37  fgets() is not trapped like fprintf()
38  exit qh_fprintf via qh_errexit()
39  may be called for errors in qh_initstatistics and qh_meminit
40 */
41 
42 void qh_fprintf(FILE *fp, int msgcode, const char *fmt, ... ) {
43  va_list args;
44 
45  if (!fp) {
46  /* could use qhmem.ferr, but probably better to be cautious */
47  qh_fprintf_stderr(6232, "Qhull internal error (userprintf.c): fp is 0. Wrong qh_fprintf called.\n");
48  qh_errexit(6232, NULL, NULL);
49  }
50  va_start(args, fmt);
51 #if qh_QHpointer
52  if (qh_qh && qh ANNOTATEoutput) {
53 #else
54  if (qh ANNOTATEoutput) {
55 #endif
56  fprintf(fp, "[QH%.4d]", msgcode);
57  }else if (msgcode >= MSG_ERROR && msgcode < MSG_STDERR ) {
58  fprintf(fp, "QH%.4d ", msgcode);
59  }
60  vfprintf(fp, fmt, args);
61  va_end(args);
62 
63  /* Place debugging traps here. Use with option 'Tn' */
64 
65 } /* qh_fprintf */
66 
obb.fmt
fmt
Definition: obb.py:145
qh_fprintf_stderr
void qh_fprintf_stderr(int msgcode, const char *fmt,...)
Definition: usermem.c:57
libqhull.h
qh_qh
qhT qh_qh
Definition: global.c:26
doxygen_xml_parser.args
args
Definition: doxygen_xml_parser.py:884
MSG_ERROR
#define MSG_ERROR
Definition: user.h:74
qh
#define qh
Definition: libqhull.h:457
qh_errexit
void qh_errexit(int exitcode, facetT *facet, ridgeT *ridge)
Definition: user.c:213
qh_fprintf
void qh_fprintf(FILE *fp, int msgcode, const char *fmt,...)
Definition: userprintf.c:42
MSG_STDERR
#define MSG_STDERR
Definition: user.h:76
mem.h


hpp-fcl
Author(s):
autogenerated on Fri Jan 26 2024 03:46:15