Imported Upstream version 2.7.3

This commit is contained in:
Arnaud Quette 2015-04-30 15:53:36 +02:00
parent a356b56d11
commit fd413a3168
283 changed files with 14978 additions and 6511 deletions

View file

@ -1,13 +1,13 @@
'\" t
.\" Title: upscli_get
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\" Date: 02/15/2014
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\" Date: 04/17/2015
.\" Manual: NUT Manual
.\" Source: Network UPS Tools 2.7.1.5
.\" Source: Network UPS Tools 2.7.3
.\" Language: English
.\"
.TH "UPSCLI_GET" "3" "02/15/2014" "Network UPS Tools 2\&.7\&.1\&." "NUT Manual"
.TH "UPSCLI_GET" "3" "04/17/2015" "Network UPS Tools 2\&.7\&.3" "NUT Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@ -36,8 +36,8 @@ upscli_get \- retrieve data from a UPS
.fi
.sp
.nf
int upscli_get(UPSCONN_t *ups, int numq, const char **query,
int *numa, char ***answer)
int upscli_get(UPSCONN_t *ups, unsigned int numq, const char **query,
unsigned int *numa, char ***answer)
.fi
.SH "DESCRIPTION"
.sp
@ -121,7 +121,7 @@ To generate a request for GET NUMLOGINS su700, you would populate query and numq
.RS 4
.\}
.nf
int numq;
unsigned int numq;
const char *query[2];
.fi
.if n \{\
@ -149,6 +149,16 @@ The raw response from upsd to the above query would be NUMLOGINS su700 1\&. Sinc
.RS 4
.\}
.nf
unsigned int numa;
.fi
.if n \{\
.RE
.\}
.sp
.if n \{\
.RS 4
.\}
.nf
numa = 3;
answer[0] = "NUMLOGINS"
answer[1] = "su700"
@ -174,6 +184,21 @@ The array will be deleted after calling \fBupscli_disconnect\fR(3)\&. Any access
.SH "RETURN VALUE"
.sp
The \fBupscli_get()\fR function returns 0 on success, or \-1 if an error occurs\&.
.sp
If \fBupsd\fR disconnects, you may need to handle or ignore SIGPIPE in order to prevent your program from terminating the next time that the library writes to the disconnected socket\&. The following code in your initialization function will allow the \fBupscli_get()\fR call to return an error in that case:
.sp
.if n \{\
.RS 4
.\}
.nf
#include <signal\&.h>
\&.\&.\&.
signal (SIGPIPE, SIG_IGN);
\&.\&.\&.
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.sp
\fBupscli_list_start\fR(3), \fBupscli_list_next\fR(3), \fBupscli_strerror\fR(3), \fBupscli_upserror\fR(3)