summaryrefslogtreecommitdiffstats
path: root/contrib/libucl/src/ucl_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libucl/src/ucl_internal.h')
-rw-r--r--contrib/libucl/src/ucl_internal.h74
1 files changed, 66 insertions, 8 deletions
diff --git a/contrib/libucl/src/ucl_internal.h b/contrib/libucl/src/ucl_internal.h
index 49c4aae..0e3ecd0 100644
--- a/contrib/libucl/src/ucl_internal.h
+++ b/contrib/libucl/src/ucl_internal.h
@@ -24,18 +24,69 @@
#ifndef UCL_INTERNAL_H_
#define UCL_INTERNAL_H_
-#include <sys/types.h>
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#else
+/* Help embedded builds */
+#define HAVE_SYS_TYPES_H
+#define HAVE_SYS_MMAN_H
+#define HAVE_SYS_STAT_H
+#define HAVE_SYS_PARAM_H
+#define HAVE_LIMITS_H
+#define HAVE_FCNTL_H
+#define HAVE_ERRNO_H
+#define HAVE_UNISTD_H
+#define HAVE_CTYPE_H
+#define HAVE_STDIO_H
+#define HAVE_STRING_H
+#define HAVE_FLOAT_H
+#define HAVE_LIBGEN_H
+#define HAVE_MATH_H
+#define HAVE_STDBOOL_H
+#define HAVE_STDINT_H
+#define HAVE_STDARG_H
#ifndef _WIN32
-#include <sys/mman.h>
+# define HAVE_REGEX_H
+#endif
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_MMAN_H
+# ifndef _WIN32
+# include <sys/mman.h>
+# endif
#endif
+#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
+#endif
+#ifdef HAVE_LIMITS_H
#include <limits.h>
+#endif
+#ifdef HAVE_FCNTL_H
#include <fcntl.h>
+#endif
+#ifdef HAVE_ERRNO_H
#include <errno.h>
+#endif
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+#ifdef HAVE_CTYPE_H
#include <ctype.h>
+#endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
#include "utlist.h"
#include "utstring.h"
@@ -48,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
@@ -142,6 +197,8 @@ struct ucl_parser {
struct ucl_chunk *chunks;
struct ucl_pubkey *keys;
struct ucl_variable *variables;
+ ucl_variable_handler var_handler;
+ void *var_data;
UT_string *err;
};
@@ -261,20 +318,21 @@ ucl_maybe_parse_boolean (ucl_object_t *obj, const unsigned char *start, size_t l
* @return 0 if string is numeric and error code (EINVAL or ERANGE) in case of conversion error
*/
int ucl_maybe_parse_number (ucl_object_t *obj,
- const char *start, const char *end, const char **pos, bool allow_double, bool number_bytes);
+ const char *start, const char *end, const char **pos,
+ 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 ();
@@ -289,6 +347,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