27 lines
924 B
Groff
27 lines
924 B
Groff
|
.TH UPSCLI_READLINE 3 "Mon Jan 22 2007" "" "Network UPS Tools (NUT)"
|
||
|
.SH NAME
|
||
|
upscli_readline \- read a single response from a UPS
|
||
|
.SH SYNOPSIS
|
||
|
.nf
|
||
|
.B #include <upsclient.h>
|
||
|
.sp
|
||
|
.BI "int upscli_readline(UPSCONN *ups, char *buf, size_t buflen);"
|
||
|
.fi
|
||
|
.SH DESCRIPTION
|
||
|
The \fBupscli_readline()\fP function takes the pointer \fIups\fP to a
|
||
|
UPSCONN state structure, receives a single line from the server, and
|
||
|
copies up to \fIbuflen\fP bytes of the response into the buffer
|
||
|
\fIbuf\fP.
|
||
|
.PP
|
||
|
Some parsing of the string occurs during reception. In particular,
|
||
|
ERR messages from \fBupsd\fR(8) are detected and will cause this
|
||
|
function to return \-1.
|
||
|
.SH "RETURN VALUE"
|
||
|
The \fBupscli_readline()\fP function returns 0 on success, or \-1 if an
|
||
|
error occurs.
|
||
|
.SH "SEE ALSO"
|
||
|
.BR upscli_fd "(3), "upscli_get "(3), "
|
||
|
.BR upscli_readline "(3), "upscli_sendline "(3), "
|
||
|
.BR upscli_ssl "(3), "
|
||
|
.BR upscli_strerror "(3), "upscli_upserror "(3) "
|