преобразование форматированной строки (formatted string conversion)
Имя (Name)
pmsprintf
- formatted string conversion
Синопсис C (C Synopsis)
#include <pcp/pmapi.h>
int pmsprintf(char *
str, size_t
size, const char *
fmt, ...
/*
args*/);
cc ... -lpcp
Описание (Description)
Safe string formatting interface that wraps the vsnprintf(3)
call.
It differs primarily in that pmsprintf
guarantees that the output
buffer str will be null-terminated even when the provided buffer
size is insufficient to contain the formatted string. In this
case a null-terminated truncated string will be returned in str.
In the case of a failure in the underlying vsnprintf interface, a
null-terminated empty string will be returned in str, and the
return value will be zero.
Диагностика (Diagnostic)
On successful completion, pmsprintf
returns the number of
characters written to the supplied buffer, not including the null
terminator.
The return code is always zero or more, never negative.
Смотри также (See also)
vsnprintf(3), pmprintf(3) and PMAPI(3).