nut/docs/man/libnutclient_general.3

68 lines
2.4 KiB
Groff
Raw Permalink Normal View History

2013-11-24 15:00:12 +00:00
'\" t
.\" Title: libnutclient_general
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
2015-04-30 13:53:36 +00:00
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
2016-07-18 00:11:41 +00:00
.\" Date: 03/02/2016
2013-11-24 15:00:12 +00:00
.\" Manual: NUT Manual
2016-07-18 00:11:41 +00:00
.\" Source: Network UPS Tools 2.7.3.1
2013-11-24 15:00:12 +00:00
.\" Language: English
.\"
2016-07-18 00:11:41 +00:00
.TH "LIBNUTCLIENT_GENERAL" "3" "03/02/2016" "Network UPS Tools 2\&.7\&.3\&." "NUT Manual"
2013-11-24 15:00:12 +00:00
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
libnutclient_general, nutclient_destroy, strarr_alloc, strarr_free \- General and utility functions in Network UPS Tools high\-level client access library
.SH "SYNOPSIS"
.sp
.nf
#include <nutclient\&.h>
.fi
.sp
.nf
typedef void* NUTCLIENT_t;
.fi
.sp
.nf
void nutclient_destroy(NUTCLIENT_t client);
.fi
.sp
.nf
typedef char** strarr;
.fi
.sp
.nf
strarr strarr_alloc(unsigned short count);
void strarr_free(strarr arr);
.fi
.SH "DESCRIPTION"
.sp
The \fBnutclient_destroy()\fR function destroys a \fINUTCLIENT_t\fR or derived (like \fINUTCLIENT_TCP_t\fR) connection object, and frees allocated memory\&.
.sp
The \fBstrarr\fR type represents an array of C strings (array of char pointer)\&. The array must always be terminated by a NULL pointer\&. Pointed strings must be allocated by (x)calloc or (x)strdup\&.
.sp
The \fBstrarr_alloc()\fR function allocates a \fIstrarr\fR array with the specified number of (non\-initialized) string pointers\&. Another additional pointer set to 0 is added at the end of the array\&.
.sp
The \fBstrarr_free\fR function frees a \fIstrarr\fR array\&. It also frees all pointed strings\&.
.sp
\fIdev\fR is the device name\&.
.SH "SEE ALSO"
.sp
\fBlibnutclient\fR(3)