2 * libcollectdclient - src/libcollectdclient/collectd/client.h
3 * Copyright (C) 2008-2012 Florian octo Forster
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
24 * Florian octo Forster <octo at collectd.org>
27 #ifndef LIBCOLLECTD_COLLECTDCLIENT_H
28 #define LIBCOLLECTD_COLLECTDCLIENT_H 1
30 #include "collectd/lcc_features.h"
31 #include "collectd/types.h"
33 /* COLLECTD_TRACE is the environment variable used to control trace output. When
34 * set to something non-zero, all lines sent to / received from the daemon are
35 * printed to STDOUT. */
37 #define LCC_TRACE_ENV "COLLECTD_TRACE"
41 * Includes (for data types)
49 struct lcc_connection_s;
50 typedef struct lcc_connection_s lcc_connection_t;
55 int lcc_connect(const char *address, lcc_connection_t **ret_con);
56 int lcc_disconnect(lcc_connection_t *c);
57 #define LCC_DESTROY(c) \
63 int lcc_getval(lcc_connection_t *c, lcc_identifier_t *ident,
64 size_t *ret_values_num, gauge_t **ret_values,
65 char ***ret_values_names);
67 int lcc_putval(lcc_connection_t *c, const lcc_value_list_t *vl);
69 int lcc_flush(lcc_connection_t *c, const char *plugin, lcc_identifier_t *ident,
72 int lcc_listval(lcc_connection_t *c, lcc_identifier_t **ret_ident,
73 size_t *ret_ident_num);
77 const char *lcc_strerror(lcc_connection_t *c);
79 int lcc_identifier_to_string(lcc_connection_t *c, char *string,
80 size_t string_size, const lcc_identifier_t *ident);
81 int lcc_string_to_identifier(lcc_connection_t *c, lcc_identifier_t *ident,
84 /* Compares the identifiers "i0" and "i1" and returns less than zero or greater
85 * than zero if "i0" is smaller than or greater than "i1", respectively. If
86 * "i0" and "i1" are identical, zero is returned. */
87 int lcc_identifier_compare(const void *i0, const void *i1);
88 int lcc_sort_identifiers(lcc_connection_t *c, lcc_identifier_t *idents,
93 #endif /* LIBCOLLECTD_COLLECTDCLIENT_H */