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