File: upscli_upserror.3

package info (click to toggle)
nut 2.2.2-6.5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 6,240 kB
  • ctags: 4,918
  • sloc: ansic: 42,528; sh: 10,284; makefile: 860
file content (27 lines) | stat: -rw-r--r-- 981 bytes parent folder | download | duplicates (2)
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
.TH UPSCLI_UPSERROR 3 "Mon Jan 22 2007" "" "Network UPS Tools (NUT)"
.SH NAME
upscli_upserror \- Get current error number for connection
.SH SYNOPSIS
.nf
.B #include <upsclient.h>
.sp
.BI "int upscli_upserror(UPSCONN *ups);"
.fi
.SH DESCRIPTION
The \fBupscli_upserror()\fP function takes the pointer \fIups\fP to a
UPSCONN state structure and returns the value of the internal error
number, if any. 
.PP
This is typically used to check for certain error values like
UPSCLI_ERR_UNKCOMMAND.  That specific error can be used for detecting
older versions of \fBupsd\fR(8) which might not support a given command.
.PP
Some error messages have additional meanings, so you should use
\fBupscli_strerror\fR(3) to obtain readable error messages.
.PP
.SH "RETURN VALUE"
The \fBupscli_upserror()\fP function returns one of the UPSCLI_ERR_*
values from \fBupsclient.h\fR, or 0 if no error has occurred.
.SH "SEE ALSO"
.BR upscli_readline "(3), "upscli_sendline "(3), "
.BR upscli_strerror (3)