Skip to content

Commit f5b9361

Browse files
author
roman
committed
plguins REFACTOR various smaller docs refactoring
1 parent 701f955 commit f5b9361

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/context.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ struct ly_ctx;
212212
#define LY_CTX_STATIC_PLUGINS_ONLY 0x2000 /**< By default, external plugins from directories the path to which is obtained
213213
from the `LIBYANG_TYPES_PLUGINS_DIR` and `LIBYANG_EXTENSIONS_PLUGINS_DIR` environmental variables
214214
are loaded. This option prevents loading of all external plugins and only
215-
the static (built-in) plugins are loaded. */
215+
the static (libyang built-in) plugins are loaded. */
216216

217217
/* 0x80000000 reserved for internal use */
218218

src/plugins.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ lysc_get_ext_plugin(uintptr_t plugin_id)
176176
/**
177177
* @brief Iterate over list of loaded plugins of the given @p type.
178178
*
179-
* @param[in] ctx The context for which the plugin is searched for.
179+
* @param[in] ctx Context for which the plugin is searched for.
180180
* @param[in] type Type of the plugins to iterate.
181-
* @param[in,out] index The iterator - set to 0 for the first call.
181+
* @param[in,out] index Iterator - set to 0 for the first call.
182182
* @return The plugin records, NULL if no more record is available.
183183
*/
184184
static struct lyplg_record *
@@ -222,6 +222,10 @@ lyplg_record_find(const struct ly_ctx *ctx, enum LYPLG type, const char *module,
222222
assert(module);
223223
assert(name);
224224

225+
if (record_idx) {
226+
*record_idx = 0;
227+
}
228+
225229
while ((item = plugins_iter(ctx, type, &i)) != NULL) {
226230
if (!strcmp(item->module, module) && !strcmp(item->name, name)) {
227231
if (item->revision && revision && strcmp(item->revision, revision)) {

src/plugins_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* Covers both the types and extensions plugins.
5050
*
5151
* @param[in] builtin_type_plugins_only Whether to load only built-in YANG type plugins and no included extension plugins.
52-
* @param[in] static_plugins_only Whether to load only static plugins, meaning no external directories with plugins.
52+
* @param[in] static_plugins_only Whether to load only static (libyang built-in) plugins, meaning no external directories with plugins.
5353
* @return LY_SUCCESS in case of success
5454
* @return LY_EINT in case of internal error
5555
* @return LY_EMEM in case of memory allocation failure.

src/printer_context.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1749,12 +1749,13 @@ ly_ctx_compiled_print_context(const struct ly_ctx *orig_ctx, struct ly_ctx *ctx,
17491749
/* modules, referenced, 2 loops because of augments (forward reference), build the ht first */
17501750
ctxp_set(&orig_ctx->modules, &ctx->modules, mem);
17511751
for (i = 0; i < ctx->modules.count; ++i) {
1752+
/* build the address ht */
17521753
ctx->modules.objs[i] = *mem;
17531754
*mem = (char *)*mem + sizeof(struct lys_module);
1754-
17551755
ly_ctx_compiled_addr_ht_add(addr_ht, orig_ctx->modules.objs[i], ctx->modules.objs[i]);
17561756
}
17571757
for (i = 0; i < ctx->modules.count; ++i) {
1758+
/* parse the modules */
17581759
ctxp_module(orig_ctx->modules.objs[i], ctx->modules.objs[i], addr_ht, ptr_set, mem);
17591760
}
17601761

0 commit comments

Comments
 (0)