summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64e6b4e)
raw | patch | inline | side by side (parent: 64e6b4e)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 3 Dec 2014 21:20:45 +0000 (22:20 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 3 Dec 2014 21:20:45 +0000 (22:20 +0100) |
That'll work with C++ as well.
25 files changed:
diff --git a/src/client/sock.c b/src/client/sock.c
index 8602532da9eea9d4575d85d52fdc82cc34976c91..ef35166bab13162e84156facbd75d83fdd937b85 100644 (file)
--- a/src/client/sock.c
+++ b/src/client/sock.c
struct sdb_client {
char *address;
int fd;
- _Bool eof;
+ bool eof;
};
/*
return (ssize_t)total;
} /* sdb_client_recv */
-_Bool
+bool
sdb_client_eof(sdb_client_t *client)
{
if ((! client) || (client->fd < 0))
diff --git a/src/core/data.c b/src/core/data.c
index 9f2b1f6fe4dda241997222ec62ac4fcdabf96eb0..503db29a36c500ce34a093f465c7ca252348a8c5 100644 (file)
--- a/src/core/data.c
+++ b/src/core/data.c
#undef CMP_NULL
} /* sdb_data_strcmp */
-_Bool
+bool
sdb_data_isnull(const sdb_data_t *datum)
{
if (! datum)
return 0;
} /* sdb_data_isnull */
-_Bool
+bool
sdb_data_inarray(const sdb_data_t *value, const sdb_data_t *array)
{
const void *values;
{
char tmp[sdb_data_strlen(datum) + 1];
char *data = NULL;
- _Bool is_null = 0;
+ bool is_null = 0;
int ret = -1;
size_t i, pos;
diff --git a/src/core/plugin.c b/src/core/plugin.c
index 79df55e589ee967a4cf9e4819d4cada6c29dfae0..20fe61cd523dfe6db6229e3996e332a13cc7ca5e 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
static sdb_plugin_info_t plugin_default_info = SDB_PLUGIN_INFO_INIT;
static pthread_key_t plugin_ctx_key;
-static _Bool plugin_ctx_key_initialized = 0;
+static bool plugin_ctx_key_initialized = 0;
/* a list of the plugin contexts of all registered plugins */
static sdb_llist_t *all_plugins = NULL;
sdb_llist_iter_t *iter;
int ret = -1;
- _Bool logged = 0;
+ bool logged = 0;
if (! msg)
return 0;
diff --git a/src/core/store.c b/src/core/store.c
index ad59a2e99df3612178445edafe02eeabe3d9fa69..25691dc36839d6b38f9ea2061fcbf0f23378a4ba 100644 (file)
--- a/src/core/store.c
+++ b/src/core/store.c
*/
static sdb_host_t *
-lookup_host(const char *name, _Bool canonicalize)
+lookup_host(const char *name, bool canonicalize)
{
sdb_host_t *host;
char *cname;
return status;
} /* sdb_store_host */
-_Bool
+bool
sdb_store_has_host(const char *name)
{
sdb_host_t *host;
index e1e03961fc5e3e7760865c0d6e1e7805a7215c4f..a95f5877d38011dff4788e4655e8616bc27d420a 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
* is enabled, compare the string values in case of a type mismatch.
*/
static int
-match_cmp_value(int op, sdb_data_t *v1, sdb_data_t *v2, _Bool strcmp_fallback)
+match_cmp_value(int op, sdb_data_t *v1, sdb_data_t *v2, bool strcmp_fallback)
{
int status;
} /* match_regex_value */
static int
-match_value(int op, sdb_data_t *v1, sdb_data_t *v2, _Bool strcmp_fallback)
+match_value(int op, sdb_data_t *v1, sdb_data_t *v2, bool strcmp_fallback)
{
if ((op == MATCHER_REGEX) || (op == MATCHER_NREGEX))
return match_regex_value(op, v1, v2);
diff --git a/src/core/time.c b/src/core/time.c
index 5d34e18b4fed99a8769ed9f17d226e6d9432db5d..d0ed0b8dd9917d11596fa54da2f65071026c968f 100644 (file)
--- a/src/core/time.c
+++ b/src/core/time.c
#include <time.h>
+#include <stdbool.h>
#include <stdio.h>
#include <string.h>
size_t i;
/* special case the optional fractional part for seconds */
- _Bool have_seconds = 0;
+ bool have_seconds = 0;
struct {
sdb_time_t interval;
index 042091a997044a712c4de1d4c45fe734b1406348..1e5e9e53fee775f452ed85454ef8abea79fc1bb4 100644 (file)
/* user information */
char *username; /* NULL if the user has not been authenticated */
- _Bool ready; /* indicates that startup finished successfully */
+ bool ready; /* indicates that startup finished successfully */
};
#define CONN(obj) ((sdb_conn_t *)(obj))
index 1d8b8b34d2c9ff06eeca3f0aff9584443528540c..e384bafa98297a7cf46c9283dee7b70a9c484dab 100644 (file)
*/
static pthread_key_t conn_ctx_key;
-static _Bool conn_ctx_key_initialized = 0;
+static bool conn_ctx_key_initialized = 0;
/*
* private types
index aeed8a253b58f310c4e3e55df13e38f4bfa0232b..638f8626660807a33776267f8116dbe38c8449c0 100644 (file)
#include "core/object.h"
#include "core/data.h"
-
#include "frontend/proto.h"
-
#include "utils/strbuf.h"
#include <sys/socket.h>
+#include <stdbool.h>
#include <stddef.h>
#ifdef __cplusplus
* Returns true if end of file on the client connection was reached, that is,
* if the remote side closed the connection.
*/
-_Bool
+bool
sdb_client_eof(sdb_client_t *client);
#ifdef __cplusplus
index 997cf9f0a320c616af5074c86f749a03b1dca8b1..c179fea84b142f836a24eb4791eb12194344f12e 100644 (file)
--- a/src/include/core/data.h
+++ b/src/include/core/data.h
#include "core/time.h"
#include <inttypes.h>
+#include <stdbool.h>
#include <stddef.h>
#include <sys/types.h>
* either datum is NULL or if the type is SDB_TYPE_NULL or if the string or
* binary datum is NULL.
*/
-_Bool
+bool
sdb_data_isnull(const sdb_data_t *datum);
/*
* elements of the first array are included in the second where order does not
* matter.
*/
-_Bool
+bool
sdb_data_inarray(const sdb_data_t *value, const sdb_data_t *array);
/*
index 4e5d1046660896bb91bb5759309fda23da448758..6580e90dfcd55a8df4ea52e0ae4ee4ff3ef7d57e 100644 (file)
#include "liboconfig/oconfig.h"
#include <stdarg.h>
+#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
int sdb_module_init(sdb_plugin_info_t *info)
typedef struct {
- _Bool do_loop;
+ bool do_loop;
sdb_time_t default_interval;
} sdb_plugin_loop_t;
#define SDB_PLUGIN_LOOP_INIT { 1, 0 }
index 5507436742a79bc6d8cde34496c70dd87c61d4cf..6edbea4f173e89000f7869217b145a38ec3294be 100644 (file)
--- a/src/include/core/store.h
+++ b/src/include/core/store.h
#include "core/timeseries.h"
#include "utils/strbuf.h"
+#include <stdbool.h>
#include <stdio.h>
#ifdef __cplusplus
* sdb_store_get_host increments the ref count of the host object. The caller
* needs to deref it when no longer using it.
*/
-_Bool
+bool
sdb_store_has_host(const char *name);
sdb_store_obj_t *
index 2b93a6f724d1adaca687d81e149fa49fecb5bf68..be07329d41e42f60f0ce41fcd51e18a46391735a 100644 (file)
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <stdbool.h>
#include <unistd.h>
#ifndef SDB_FRONTEND_SOCK_H
size_t num_threads;
/* front-end listener shuts down when this is set to false */
- _Bool do_loop;
+ bool do_loop;
} sdb_fe_loop_t;
#define SDB_FE_LOOP_INIT { 5, 1 }
index 28efbdfb23d6590882f1a8f35cbba88f59ef766e..de51c7e07dfa007f020a6f6c53017ad55171588c 100644 (file)
#include "core/object.h"
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
void
sdb_avltree_iter_destroy(sdb_avltree_iter_t *iter);
-_Bool
+bool
sdb_avltree_iter_has_next(sdb_avltree_iter_t *iter);
sdb_object_t *
sdb_avltree_iter_get_next(sdb_avltree_iter_t *iter);
* - true if the tree is valid
* - false else
*/
-_Bool
+bool
sdb_avltree_valid(sdb_avltree_t *tree);
#ifdef __cplusplus
index 1dddb7e0747391a677ac267f36560b2d385d2a89..8d2b96e9ae95cf38a693d1a701397160e5936b1a 100644 (file)
#include "core/object.h"
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
void
sdb_llist_iter_destroy(sdb_llist_iter_t *iter);
-_Bool
+bool
sdb_llist_iter_has_next(sdb_llist_iter_t *iter);
sdb_object_t *
sdb_llist_iter_get_next(sdb_llist_iter_t *iter);
diff --git a/src/liboconfig/utils.c b/src/liboconfig/utils.c
index 26e3dc659c61ee82afc3f84ae0cb13cc6f02b4c8..e5a131208f18837c602616181a233c29dfe7b985 100644 (file)
--- a/src/liboconfig/utils.c
+++ b/src/liboconfig/utils.c
*/
#include "oconfig.h"
+#include "utils.h"
int
oconfig_get_string(oconfig_item_t *ci, char **value)
} /* oconfig_get_number */
int
-oconfig_get_boolean(oconfig_item_t *ci, _Bool *value)
+oconfig_get_boolean(oconfig_item_t *ci, bool *value)
{
if (! ci)
return -1;
diff --git a/src/liboconfig/utils.h b/src/liboconfig/utils.h
index 6e8c61e3cc0b7c0de61e512476f7b5fdec3a7413..f37c830bbe255c07a718ccffd65716a306e30b6f 100644 (file)
--- a/src/liboconfig/utils.h
+++ b/src/liboconfig/utils.h
#include "oconfig.h"
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
int
oconfig_get_number(oconfig_item_t *ci, double *value);
int
-oconfig_get_boolean(oconfig_item_t *ci, _Bool *value);
+oconfig_get_boolean(oconfig_item_t *ci, bool *value);
#ifdef __cplusplus
} /* extern "C" */
index 599758bb7e9042ba31a9a555b6df11fad9d0b6fb..7d9e320bc79c1f05524608c4d617e8ee786d6cd6 100644 (file)
sdb_plugin_register_config(sdb_livestatus_config);
return 0;
-} /* sdb_version_extra */
+} /* sdb_module_init */
/* vim: set tw=78 sw=4 ts=4 noexpandtab : */
index 8ea734fb643c42e8c518c7dbd51739635d5930c5..7d6c30b68ff236d6b59dc417fce56706fe63dde0 100644 (file)
/* Current versions of RRDtool do not support multiple RRDCacheD client
* connections. Use this to guard against multiple configured RRDCacheD
* instances. */
-static _Bool rrdcached_in_use = 0;
+static bool rrdcached_in_use = 0;
/*
* plugin API
index ccdce039881ca27893c53e3d5e0cb6ee6ea4cca0..0ba5c0a4dd385169fc439c1fe133b33464f609a8 100644 (file)
--- a/src/tools/sysdb/input.h
+++ b/src/tools/sysdb/input.h
size_t tokenizer_pos;
size_t query_len;
- _Bool interactive;
- _Bool eof;
+ bool interactive;
+ bool eof;
} sdb_input_t;
#define SDB_INPUT_INIT { NULL, NULL, 0, 0, 1, 0 }
index 96fe6a645459d79aff04a4d13f7f6153b094d685..bf56656d05ca3e93c961a76c32501d335ffcbfb2 100644 (file)
--- a/src/tools/sysdbd/main.c
+++ b/src/tools/sysdbd/main.c
int
main(int argc, char **argv)
{
- _Bool do_daemonize = 1;
+ bool do_daemonize = 1;
struct sigaction sa_intterm;
struct sigaction sa_hup;
diff --git a/src/utils/avltree.c b/src/utils/avltree.c
index aad2b9a6e8282d10ff0dd3764d920b681f992837..54c1895673a8dd68e6aeccf4655615db00078930 100644 (file)
--- a/src/utils/avltree.c
+++ b/src/utils/avltree.c
free(iter);
} /* sdb_avltree_iter_destroy */
-_Bool
+bool
sdb_avltree_iter_has_next(sdb_avltree_iter_t *iter)
{
if (! iter)
return tree ? tree->size : 0;
} /* sdb_avltree_size */
-_Bool
+bool
sdb_avltree_valid(sdb_avltree_t *tree)
{
node_t *n;
- _Bool status = 1;
+ bool status = 1;
size_t size = 0;
if (! tree)
diff --git a/src/utils/channel.c b/src/utils/channel.c
index 7c5c002ae545f43901e5b9dab352329936218b67..c72953e956911b9e69ffc6ab44889283c5d319b7 100644 (file)
--- a/src/utils/channel.c
+++ b/src/utils/channel.c
#include "utils/channel.h"
#include <assert.h>
-
#include <errno.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
size_t head;
size_t tail;
- _Bool full;
+ bool full;
- _Bool shutdown;
+ bool shutdown;
};
/*
diff --git a/src/utils/error.c b/src/utils/error.c
index f4ff99a8def3d847dcabb4143f50192f3e7450c2..f940be6d232b05eb5eceff1b08f6aa13d62642ac 100644 (file)
--- a/src/utils/error.c
+++ b/src/utils/error.c
#include <pthread.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
-
#include <stdlib.h>
+#include <string.h>
/*
* private data types
typedef struct {
int prio;
sdb_strbuf_t *msg;
- _Bool logged;
+ bool logged;
} sdb_error_ctx_t;
#define SDB_ERROR_INIT { -1, NULL, 1 }
static sdb_error_ctx_t default_error_ctx = SDB_ERROR_INIT;
static pthread_key_t error_ctx_key;
-static _Bool error_ctx_key_initialized = 0;
+static bool error_ctx_key_initialized = 0;
static int (*logger)(int prio, const char *msg) = NULL;
diff --git a/src/utils/llist.c b/src/utils/llist.c
index 03ffd95350f5acf992a7d9edd27acc7ed45c18b3..8a5e3f258a60d7e2863bc09585a685881a62ea49 100644 (file)
--- a/src/utils/llist.c
+++ b/src/utils/llist.c
free(iter);
} /* sdb_llist_iter_destroy */
-_Bool
+bool
sdb_llist_iter_has_next(sdb_llist_iter_t *iter)
{
if (! iter)