File: pmparseinterval.3

package info (click to toggle)
pcp 3.3.3-squeeze3
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 14,452 kB
  • ctags: 9,608
  • sloc: ansic: 102,434; sh: 16,080; perl: 5,011; makefile: 2,275; yacc: 2,112; lex: 1,069; xml: 82; fortran: 60; java: 22; awk: 20
file content (85 lines) | stat: -rw-r--r-- 2,152 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.\" DO NOT EDIT THIS FILE ... source is constricted from
.\" pmparseinterval.x and other pieces in isms/pcp/man/common
'\"macro stdmacro
.\"
.\" Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
.\" 
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\" 
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\" 
.\"
.TH PMPARSEINTERVAL 3 "SGI" "Performance Co-Pilot"
.SH NAME
\f3pmParseInterval\f1 \- convert interval string to \fBtimeval\fR structure
.SH "C SYNOPSIS"
.ft 3
#include <pcp/pmapi.h>
.sp
int pmParseInterval(const char *string, struct timeval *rslt, char **errmsg)
.sp
cc ... \-lpcp
.ft 1
.de CW
.ie t \f(CW\\$1\f1\\$2
.el \fI\\$1\f1\\$2
..
.SH DESCRIPTION
.B pmParseInterval
parses the argument
.I string
specifying an interval of time and fills in the
.B tv_sec
and
.B tv_usec
components of the
.I rslt
structure to represent that interval.
.PP
The input
.I string
is most commonly the argument following a
.BR \-t
command line option to a PCP application, and
the syntax is fully described in
.BR PCPIntro (1).
.PP
.B pmParseInterval
returns 0 and
.I errmsg
is undefined if the parsing is successful.
.PP
If the given
.I string
does not conform to the required syntax
.B pmParseInterval
returns \-1 and a dynamically allocated
error message string in
.IR errmsg .
The error message
is terminated with a newline and
includes the text of the input
.I string
along with an indicator of the position at which the error was detected,
e.g.
.br
.in +1i
.CW "\&4minutes 30mumble"
.br
.CW "\&           ^ -- unexpected value"
.in -1i
.PP
In the case of an error, the caller is responsible for calling
.BR free (3C)
to release the space allocated for
.IR errmsg .
.SH SEE ALSO
.BR PMAPI (3)
and
.BR pmParseTimeWindow (3).