PMPARSEUNITSSTR - Online Linux Manual PageSection : 3
Updated : PCP
Source : Performance Co-Pilot
NAMEpmParseUnitsStr − parse units specification
C SYNOPSIS#include <pcp/pmapi.h> int pmParseUnitsStr(const char *string, struct pmUnits *out, double *outMult, char **errMsg); cc ... −lpcp
DESCRIPTIONpmParseUnitsStr is designed to encapsulate the interpretation of a units (dimension and scale) specification in command line switches for use by the PCP client tools. This function expects to be called with the unit/scale specification as string. This specification takes the general form produced by pmUnitsStr(3). Briefly, the format allows /-separated divisor and dividend, each listing space-separated dimensions/scales along the space, time, and count axes. There are also a few extra possibilities: First, multiple equivalent sets of keywords are accepted for the time and space dimensions, insensitive to case. For example, "microseconds", "microsecond", "microsec", "us" are considered synonymous, as are "kilobytes", "KB", "KiB", "kiloByte", and so on. Second, units may be offered in any order, e.g., ms kb count x 10^3 or count x 10^3 kb ms. They may not be repeated within the denominator or within the numerator. Each scale/unit keyword may be immediately followed by positive or negative exponents, e.g., ^-4. Third, numerical scaling factors may be supplied. These are factored together with implicit scale conversions into the final outMult result. The out and outMult values must both be allocated before calling pmParseUnitsStr(3). If the conversion is successful, pmParseUnitsStr returns 0, and fills in out and outMult with the unit/scales defined by the input parameter. If the argument strings could not be parsed, it returns a negative status code.
EXAMPLESstringoutoutMult 2 count{0,1,0,0,0,0}0.5 count / 7.5 nanosecond{0,1,-1,0,0,0}7.5 10 kilobytes / 2.5e2 count x 10^3{1,-1,0,1,3,0}25 millisecond / second^2{0,0,-1,0,0,3}1000 mib/s{1,0,-1,2,0,3}1
BUGSFor backward compatibility, this interface interprets several traditional computer science interpretations of space units incorrectly by the International System of Units (SI) standard. The accepted unit string − in either singular or plural form − and the pmParseUnitsStr interpretation for each are: megabyte(mebibyte), gigabyte(gibibyte), terabyte(tebibyte), petabyte(pebibyte), exabyte(exbibyte), zettabyte(zebibyte) and yottabyte(yobibyte).
RETURN VALUEA zero status indicates success. A negative status indicates an error, in which case the errMsg pointer will contain a textual error message, which the caller should later free(3).
SEE ALSOPMAPI(3), pmUnitsStr(3), pmConvScale(3), and pmLookupDesc(3). 0
Johanes Gumabo
Data Size : 10,910 byte
man-pmParseUnitsStr.3Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 2 / 197,795
Visitor ID : :
Visitor IP : 3.145.55.25 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.