pmparseunitsstr(3)

NAME

   pmParseUnitsStr - parse time point specification

C SYNOPSIS

   #include <pcp/pmapi.h>

   int pmParseUnitsStr(const char *string, struct pmUnits *out,
           double *outMult, char **errMsg);

   cc ... -lpcp

DESCRIPTION

   pmParseUnitsStr is designed to  encapsulate  the  interpretation  of  a
   unit/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.   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 &
   space  dimensions,  insensitive  to case.  For example, "microseconds",
   "microsecond", "microsec",  "us"  are  considered  synonymous,  as  are
   "kilobytes", "KB", "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.  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.

EXAMPLES

       
                    string                     out        outMult 
       
       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    
       mb/s                               {1,0,-1,2,0,3}  1       
       

RETURN VALUE

   A zero status indicates success.  A negative status indicates an error,
   in which case the errMsg pointer will receive a textual error  message,
   which the caller should later free().

SEE ALSO

   PMAPI(3), pmUnitsStr(3), pmConvScale(3), and pmLookupDesc(3).



Opportunity


Personal Opportunity - Free software gives you access to billions of dollars of software at no cost. Use this software for your business, personal use or to develop a profitable skill. Access to source code provides access to a level of capabilities/information that companies protect though copyrights. Open source is a core component of the Internet and it is available to you. Leverage the billions of dollars in resources and capabilities to build a career, establish a business or change the world. The potential is endless for those who understand the opportunity.

Business Opportunity - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies know about open source and how open source can give you the advantage.


Free Software


Free Software provides computer programs and capabilities at no cost but more importantly, it provides the freedom to run, edit, contribute to, and share the software. The importance of free software is a matter of access, not price. Software at no cost is a benefit but ownership rights to the software and source code is far more significant.

Free Office Software - The Libre Office suite provides top desktop productivity tools for free. This includes, a word processor, spreadsheet, presentation engine, drawing and flowcharting, database and math applications. Libre Office is available for Linux or Windows.


Free Books


The Free Books Library is a collection of thousands of the most popular public domain books in an online readable format. The collection includes great classical literature and more recent works where the U.S. copyright has expired. These books are yours to read and use without restrictions.

Source Code - Want to change a program or know how it works? Open Source provides the source code for its programs so that anyone can use, modify or learn how to write those programs themselves. Visit the GNU source code repositories to download the source.


Education


Study at Harvard, Stanford or MIT - Open edX provides free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses for almost all major subjects and course levels. Open edx also offers some paid courses and selected certifications.

Linux Manual Pages - A man or manual page is a form of software documentation found on Linux/Unix operating systems. Topics covered include computer programs (including library and system calls), formal standards and conventions, and even abstract concepts.