summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/src/ucl_internal.h
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2014-04-22 22:02:06 +0000
committerbapt <bapt@FreeBSD.org>2014-04-22 22:02:06 +0000
commit8286a6069a68d13dc8ef55a25885a57aa127dde3 (patch)
tree72be8a76cd83688338f881c969e6dfc0583ec8ff /contrib/libucl/src/ucl_internal.h
parent418b7ad78192cd30c84465a025da93f4d87a8491 (diff)
downloadFreeBSD-src-8286a6069a68d13dc8ef55a25885a57aa127dde3.zip
FreeBSD-src-8286a6069a68d13dc8ef55a25885a57aa127dde3.tar.gz
Import libucl 0.4.0
Adapt pkg(7) to the new libucl API
Diffstat (limited to 'contrib/libucl/src/ucl_internal.h')
-rw-r--r--contrib/libucl/src/ucl_internal.h18
1 files changed, 12 insertions, 6 deletions
diff --git a/contrib/libucl/src/ucl_internal.h b/contrib/libucl/src/ucl_internal.h
index a55d747..9a35dce 100644
--- a/contrib/libucl/src/ucl_internal.h
+++ b/contrib/libucl/src/ucl_internal.h
@@ -45,7 +45,9 @@
#define HAVE_STDBOOL_H
#define HAVE_STDINT_H
#define HAVE_STDARG_H
-#define HAVE_REGEX_H
+#ifndef _WIN32
+# define HAVE_REGEX_H
+#endif
#endif
#ifdef HAVE_SYS_TYPES_H
@@ -97,6 +99,10 @@
#include <openssl/evp.h>
#endif
+#ifndef __DECONST
+#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
+#endif
+
/**
* @file rcl_internal.h
* Internal structures and functions of UCL library
@@ -314,17 +320,17 @@ int ucl_maybe_parse_number (ucl_object_t *obj,
bool allow_double, bool number_bytes, bool allow_time);
-static inline ucl_object_t *
+static inline const ucl_object_t *
ucl_hash_search_obj (ucl_hash_t* hashlin, ucl_object_t *obj)
{
- return (ucl_object_t *)ucl_hash_search (hashlin, obj->key, obj->keylen);
+ return (const ucl_object_t *)ucl_hash_search (hashlin, obj->key, obj->keylen);
}
static inline ucl_hash_t *
-ucl_hash_insert_object (ucl_hash_t *hashlin, ucl_object_t *obj) UCL_WARN_UNUSED_RESULT;
+ucl_hash_insert_object (ucl_hash_t *hashlin, const ucl_object_t *obj) UCL_WARN_UNUSED_RESULT;
static inline ucl_hash_t *
-ucl_hash_insert_object (ucl_hash_t *hashlin, ucl_object_t *obj)
+ucl_hash_insert_object (ucl_hash_t *hashlin, const ucl_object_t *obj)
{
if (hashlin == NULL) {
hashlin = ucl_hash_create ();
@@ -339,6 +345,6 @@ ucl_hash_insert_object (ucl_hash_t *hashlin, ucl_object_t *obj)
* @param obj
* @return
*/
-unsigned char * ucl_object_emit_single_json (ucl_object_t *obj);
+unsigned char * ucl_object_emit_single_json (const ucl_object_t *obj);
#endif /* UCL_INTERNAL_H_ */
OpenPOWER on IntegriCloud