summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eabf525)
raw | patch | inline | side by side (parent: eabf525)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 30 Sep 2015 09:14:46 +0000 (11:14 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 30 Sep 2015 09:14:46 +0000 (11:14 +0200) |
This makes it truely read-only.
src/core/plugin.c | patch | blob | history | |
src/core/store.c | patch | blob | history | |
src/include/core/store.h | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 83ef6ead9cb150aa447515ba60036691eedfd451..897769926584b201fab1657ecd0885719486cce4 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
} /* plugin_add_callback */
static void
-get_backend(const char **backends, size_t *backends_num)
+get_backend(char **backends, size_t *backends_num)
{
const sdb_plugin_info_t *info;
sdb_plugin_store_host(const char *name, sdb_time_t last_update)
{
sdb_store_host_t host = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
host.name = cname;
host.last_update = last_update;
- host.backends = backends;
- get_backend(host.backends, &host.backends_num);
+ host.backends = (const char * const *)backends;
+ get_backend(backends, &host.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
sdb_time_t last_update)
{
sdb_store_service_t service = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
service.hostname = cname;
service.name = name;
service.last_update = last_update;
- service.backends = backends;
- get_backend(service.backends, &service.backends_num);
+ service.backends = (const char * const *)backends;
+ get_backend(backends, &service.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
sdb_metric_store_t *store, sdb_time_t last_update)
{
sdb_store_metric_t metric = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
metric.store.id = store->id;
}
metric.last_update = last_update;
- metric.backends = backends;
- get_backend(metric.backends, &metric.backends_num);
+ metric.backends = (const char * const *)backends;
+ get_backend(backends, &metric.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
const sdb_data_t *value, sdb_time_t last_update)
{
sdb_store_attribute_t attr = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
attr.key = key;
attr.value = *value;
attr.last_update = last_update;
- attr.backends = backends;
- get_backend(attr.backends, &attr.backends_num);
+ attr.backends = (const char * const *)backends;
+ get_backend(backends, &attr.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
const char *key, const sdb_data_t *value, sdb_time_t last_update)
{
sdb_store_attribute_t attr = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
attr.key = key;
attr.value = *value;
attr.last_update = last_update;
- attr.backends = backends;
- get_backend(attr.backends, &attr.backends_num);
+ attr.backends = (const char * const *)backends;
+ get_backend(backends, &attr.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
const char *key, const sdb_data_t *value, sdb_time_t last_update)
{
sdb_store_attribute_t attr = { 0 };
- const char *backends[1];
+ char *backends[1];
char *cname;
sdb_llist_iter_t *iter;
attr.key = key;
attr.value = *value;
attr.last_update = last_update;
- attr.backends = backends;
- get_backend(attr.backends, &attr.backends_num);
+ attr.backends = (const char * const *)backends;
+ get_backend(backends, &attr.backends_num);
iter = sdb_llist_get_iter(writer_list);
while (sdb_llist_iter_has_next(iter)) {
diff --git a/src/core/store.c b/src/core/store.c
index c6e22df69f55591e433c2d52fee5341dea6c2d90..0a23513f4b87ea31a68cbbe6ed103b2c4e9fa2b6 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
int type;
const char *name;
sdb_time_t last_update;
- const char **backends;
+ const char * const *backends;
size_t backends_num;
} store_obj_t;
#define STORE_OBJ_INIT { NULL, NULL, 0, NULL, 0, NULL, 0 }
static int
record_backends(sdb_store_obj_t *obj,
- const char **backends, size_t backends_num)
+ const char * const *backends, size_t backends_num)
{
char **tmp;
size_t i;
index bccb792202955f00c14924a99ed30db2d788ddda..ea0cd97e06ff4c5e198e93e3290ea1918e3b4456 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
sdb_time_t last_update;
sdb_time_t interval;
- const char **backends;
+ const char * const *backends;
size_t backends_num;
} sdb_store_host_t;
sdb_time_t last_update;
sdb_time_t interval;
- const char **backends;
+ const char * const *backends;
size_t backends_num;
} sdb_store_service_t;
sdb_time_t last_update;
sdb_time_t interval;
- const char **backends;
+ const char * const *backends;
size_t backends_num;
} sdb_store_metric_t;
sdb_time_t last_update;
sdb_time_t interval;
- const char **backends;
+ const char * const *backends;
size_t backends_num;
} sdb_store_attribute_t;