1PMPRINTF(3)                Library Functions Manual                PMPRINTF(3)
2
3
4

NAME

6       pmprintf,  pmflush  - print formatted output in a window or to standard
7       error
8

C SYNOPSIS

10       #include <pcp/pmapi.h>
11
12       int pmprintf(const char *fmt, ... /*args*/);
13       int pmflush(void);
14
15       cc ... -lpcp
16

DESCRIPTION

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

DIAGNOSTICS

32       On  successful  completion,  pmprintf  returns the number of characters
33       transmitted, while pmflush returns a value of zero on  successful  com‐
34       pletion.
35
36       For  either  routine,  a negative value is returned if an error was en‐
37       countered, and this can be passed to pmErrStr(3) to obtain the  associ‐
38       ated error message.
39

FILES

41       pmprintf uses the mkstemp(3) function to create a temporary file.  This
42       temporary file is deleted when pmflush is called.
43

ENVIRONMENT

45       The environment variable PCP_STDERR controls the output technique  used
46       by pmflush:
47
48           If  PCP_STDERR is unset, the text is written onto the stderr stream
49           of the caller.
50
51           If PCP_STDERR is set to the literal reserved word DISPLAY then  the
52           text will be displayed as a GUI dialog using xconfirm(1).
53
54           If PCP_STDERR is set to any other value then pmflush interprets the
55           value as a file name and appends the text to that file.   The  file
56           is  created  if  it  doesn't already exist, and in this case if the
57           file creation fails, then stderr is used instead).
58

SEE ALSO

60       pmdbg(1), fprintf(3), mkstemp(3), pmErrStr(3) and PMAPI(3).
61
62
63
64Performance Co-Pilot                  PCP                          PMPRINTF(3)
Impressum