extensions CHANGE optimise use of padding bytes in complex extension instance
copy pointer to some of the plugin's commonly used data into the extension
instance structure to simplify accessing it while using padding space which
must be present but tha wouldn't be used otherway.
diff --git a/src/parser_yang.c b/src/parser_yang.c
index b903d68..5e73f87 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -2156,28 +2156,28 @@
}
switch (actual_type) {
case NAMESPACE_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_NAMESPACE;
+ instance->insubstmt = LYEXT_SUBSTMT_NAMESPACE;
break;
case BELONGS_TO_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_BELONGSTO;
+ instance->insubstmt = LYEXT_SUBSTMT_BELONGSTO;
break;
case PREFIX_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_PREFIX;
+ instance->insubstmt = LYEXT_SUBSTMT_PREFIX;
break;
case REVISION_DATE_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_REVISIONDATE;
+ instance->insubstmt = LYEXT_SUBSTMT_REVISIONDATE;
break;
case DESCRIPTION_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_DESCRIPTION;
+ instance->insubstmt = LYEXT_SUBSTMT_DESCRIPTION;
break;
case REFERENCE_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_REFERENCE;
+ instance->insubstmt = LYEXT_SUBSTMT_REFERENCE;
break;
case CONTACT_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_CONTACT;
+ instance->insubstmt = LYEXT_SUBSTMT_CONTACT;
break;
case ORGANIZATION_KEYWORD:
- instance->substmt = LYEXT_SUBSTMT_ORGANIZATION;
+ instance->insubstmt = LYEXT_SUBSTMT_ORGANIZATION;
break;
default:
LOGINT;
@@ -2188,7 +2188,7 @@
if (!instance) {
return NULL;
}
- instance->substmt = LYEXT_SUBSTMT_SELF;
+ instance->insubstmt = LYEXT_SUBSTMT_SELF;
}
instance->flags |= LYEXT_OPT_YANG;
instance->def = (struct lys_ext *)ext_name; /* hack for UNRES */
@@ -2985,8 +2985,8 @@
info->parent = parent;
info->mod = module;
info->parent_type = (*ext)[i]->parent_type;
- info->substmt = (*ext)[i]->substmt;
- info->substmt_index = (*ext)[i]->substmt_index;
+ info->substmt = (*ext)[i]->insubstmt;
+ info->substmt_index = (*ext)[i]->insubstmt_index;
info->ext_index = i;
if (unres_schema_add_node(module, unres, ext, UNRES_EXT, (struct lys_node *)info) == -1) {
return EXIT_FAILURE;