1PMPRINTF(3) Library Functions Manual PMPRINTF(3)
2
3
4
6 pmprintf, pmflush - print formatted output in a window or to standard
7 error
8
10 #include <pcp/pmapi.h>
11
12 int pmprintf(const char *fmt, ... /*args*/);
13 int pmflush(void);
14
15 cc ... -lpcp
16
18 The combination of pmprintf and pmflush produces output in either an
19 xconfirm(1) window, on the standard error stream, or to a file in a
20 manner similar to fprintf(3). The fmt argument is used to control the
21 conversion, formatting, and printing of the variable length args list.
22 The output technique is controlled via an environment variable.
23
24 pmprintf appends the formatted message string to an internal buffer
25 shared by the two routines, without actually producing any output.
26
27 pmflush causes the internal buffer to be either displayed in a window,
28 printed on standard error, or flushed to a file and the internal buffer
29 to be cleared.
30
32 The environment variable PCP_STDERR controls the output technique used
33 by pmflush:
34
35 If PCP_STDERR is unset, the text is written onto the stderr stream
36 of the caller.
37
38 If PCP_STDERR is set to the literal reserved word DISPLAY then the
39 text will be displayed as a GUI dialog using xconfirm(1).
40
41 If PCP_STDERR is set to any other value then pmflush interprets the
42 value as a file name and appends the text to that file. The file
43 is created if it doesn't already exist, and in this case if the
44 file creation fails, then stderr is used instead).
45
47 pmprintf uses the mkstemp(3) function to create a temporary file. This
48 temporary file is deleted when pmflush is called.
49
51 On successful completion, pmprintf returns the number of characters
52 transmitted, while pmflush returns a value of zero on successful com‐
53 pletion.
54
55 For either routine, a negative value is returned if an error was
56 encountered, and this can be passed to pmErrStr(3) to obtain the asso‐
57 ciated error message.
58
60 pmdbg(1), fprintf(3), mkstemp(3), pmErrStr(3) and PMAPI(3).
61
62
63
64Performance Co-Pilot PCP PMPRINTF(3)