upscli_readline \- read a single response from a UPS
.SH"SYNOPSIS"
.sp
.nf
#include <upsclient\&.h>
.fi
.sp
.nf
int upscli_readline(UPSCONN_t *ups, char *buf, size_t buflen);
.fi
.SH"DESCRIPTION"
.sp
The \fBupscli_readline()\fR function takes the pointer \fIups\fR to a UPSCONN_t state structure, receives a single line from the server, and copies up to \fIbuflen\fR bytes of the response into the buffer \fIbuf\fR\&.
.sp
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"
.sp
The \fBupscli_readline()\fR function returns 0 on success, or \-1 if an error occurs\&.