libyang FEATURE introduce and use new ly_bool type
To indicate simple flags or true/false return values, use a standalone
ly_bool type.
We do not use stdbool's bool type to avoid need to mimic all its
features on platforms that do not provide it. ly_bool is just a simple
rename for uint8_t and the reason to use it is only a better readability
of the meaning of the variables or function's return values.
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index e084458..12a6911 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -171,9 +171,9 @@
* @return LY_ERR value.
*/
static LY_ERR
-lyb_read_string(char **str, uint8_t with_length, struct lylyb_ctx *lybctx)
+lyb_read_string(char **str, ly_bool with_length, struct lylyb_ctx *lybctx)
{
- uint8_t next_chunk = 0;
+ ly_bool next_chunk = 0;
size_t len = 0, cur_len;
*str = NULL;
@@ -345,7 +345,7 @@
lyb_parse_metadata(struct lyd_lyb_ctx *lybctx, const struct lysc_node *sparent, struct lyd_meta **meta)
{
LY_ERR ret = LY_SUCCESS;
- uint8_t dynamic;
+ ly_bool dynamic;
uint8_t i, count = 0;
char *meta_name = NULL, *meta_value;
const struct lys_module *mod;
@@ -464,7 +464,7 @@
uint8_t count, i;
struct lyd_attr *attr2;
char *prefix = NULL, *module_name = NULL, *name = NULL, *value = NULL;
- uint8_t dynamic = 0;
+ ly_bool dynamic = 0;
LYD_FORMAT format = 0;
struct ly_prefix *val_prefs = NULL;
@@ -688,7 +688,7 @@
struct ly_prefix *val_prefs = NULL;
LYD_ANYDATA_VALUETYPE value_type;
char *value = NULL, *name = NULL, *prefix = NULL, *module_key = NULL;
- uint8_t dynamic = 0;
+ ly_bool dynamic = 0;
LYD_FORMAT format = 0;
uint32_t prev_lo;
const struct ly_ctx *ctx = lybctx->lybctx->ctx;