Skip to content

Commit 79a5da3

Browse files
committed
doc REFACTOR always use module instead of model
1 parent 80f46b0 commit 79a5da3

17 files changed

+48
-48
lines changed

src/context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ ly_ctx_new(const char *search_dir, uint16_t options, struct ly_ctx **new_ctx)
336336
/* init LYB hash lock */
337337
pthread_mutex_init(&ctx->lyb_hash_lock, NULL);
338338

339-
/* models list */
339+
/* modules list */
340340
ctx->flags = options;
341341
if (search_dir) {
342342
search_dir_list = strdup(search_dir);
@@ -1383,7 +1383,7 @@ ly_ctx_destroy(struct ly_ctx *ctx)
13831383
return;
13841384
}
13851385

1386-
/* models list */
1386+
/* modules list */
13871387
for ( ; ctx->list.count; ctx->list.count--) {
13881388
fctx.mod = ctx->list.objs[ctx->list.count - 1];
13891389

src/context.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ LIBYANG_API_DECL LY_ERR ly_ctx_new(const char *search_dir, uint16_t options, str
240240
* This function loads the yang-library data from the given path. If you need to pass the data as
241241
* string, use ::::ly_ctx_new_ylmem(). Both functions extend functionality of ::ly_ctx_new() by loading
242242
* modules specified in the ietf-yang-library form into the context being created.
243-
* The preferred tree model revision is 2019-01-04. However, only the first module-set is processed and loaded
244-
* into the context. If there are no matching nodes from this tree, the legacy tree (originally from model revision 2016-04-09)
243+
* The preferred tree module revision is 2019-01-04. However, only the first module-set is processed and loaded
244+
* into the context. If there are no matching nodes from this tree, the legacy tree (originally from module revision 2016-04-09)
245245
* is processed. Note, that the modules are loaded the same way as in case of ::ly_ctx_load_module(), so the schema paths in the
246246
* yang-library data are ignored and the modules are loaded from the context's search locations. On the other hand, YANG features
247247
* of the modules are set as specified in the yang-library data.
@@ -401,7 +401,7 @@ LIBYANG_API_DECL uint32_t ly_ctx_get_modules_hash(const struct ly_ctx *ctx);
401401
typedef void (*ly_module_imp_data_free_clb)(void *module_data, void *user_data);
402402

403403
/**
404-
* @brief Callback for retrieving missing included or imported models in a custom way.
404+
* @brief Callback for retrieving missing included or imported modules in a custom way.
405405
*
406406
* When @p submod_name is provided, the submodule is requested instead of the module (in this case only
407407
* the module name without its revision is provided).
@@ -435,12 +435,12 @@ typedef LY_ERR (*ly_module_imp_clb)(const char *mod_name, const char *mod_rev, c
435435
LIBYANG_API_DECL ly_module_imp_clb ly_ctx_get_module_imp_clb(const struct ly_ctx *ctx, void **user_data);
436436

437437
/**
438-
* @brief Set missing include or import module callback. It is meant to be used when the models
438+
* @brief Set missing include or import module callback. It is meant to be used when the modules
439439
* are not locally available (such as when downloading modules from a NETCONF server), it should
440440
* not be required in other cases.
441441
*
442442
* @param[in] ctx Context that will use this callback.
443-
* @param[in] clb Callback responsible for returning the missing model.
443+
* @param[in] clb Callback responsible for returning the missing module.
444444
* @param[in] user_data Arbitrary data that will always be passed to the callback @p clb.
445445
*/
446446
LIBYANG_API_DECL void ly_ctx_set_module_imp_clb(struct ly_ctx *ctx, ly_module_imp_clb clb, void *user_data);
@@ -602,7 +602,7 @@ LIBYANG_API_DECL const struct lysp_submodule *ly_ctx_get_submodule2_latest(const
602602
LIBYANG_API_DECL uint32_t ly_ctx_internal_modules_count(const struct ly_ctx *ctx);
603603

604604
/**
605-
* @brief Try to find the model in the searchpaths of @p ctx and load it into it. If custom missing
605+
* @brief Try to find the module in the searchpaths of @p ctx and load it into it. If custom missing
606606
* module callback is set, it is used instead.
607607
*
608608
* The context itself is searched for the requested module first. If @p revision is not specified
@@ -618,7 +618,7 @@ LIBYANG_API_DECL uint32_t ly_ctx_internal_modules_count(const struct ly_ctx *ctx
618618
* The feature string '*' enables all and array of length 1 with only the terminating NULL explicitly disables all
619619
* the features. In case the parameter is NULL, the features are untouched - left disabled in newly loaded module or
620620
* with the current features settings in case the module is already present in the context.
621-
* @return Pointer to the data model structure, NULL if not found or some error occurred.
621+
* @return Found module, NULL if not found or some error occurred.
622622
*/
623623
LIBYANG_API_DECL struct lys_module *ly_ctx_load_module(struct ly_ctx *ctx, const char *name, const char *revision,
624624
const char **features);
@@ -655,7 +655,7 @@ LIBYANG_API_DECL LY_ERR ly_ctx_get_yanglib_data(const struct ly_ctx *ctx, struct
655655
* multiple contexts, the function should be called for each used context.
656656
*
657657
* All instance data are supposed to be freed before destroying the context using ::lyd_free_all(), for example.
658-
* Data models (schemas) are destroyed automatically as part of ::ly_ctx_destroy() call.
658+
* Modules (schemas) are destroyed automatically as part of ::ly_ctx_destroy() call.
659659
*
660660
* Note that the data stored by user into the ::lysc_node.priv pointer are kept
661661
* untouched and the caller is responsible for freeing this private data.

src/ly_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ struct ly_ctx {
343343
struct ly_dict dict; /**< dictionary to effectively store strings used in the context related structures */
344344
struct ly_set search_paths; /**< set of directories where to search for schema's imports/includes */
345345
struct ly_set list; /**< set of loaded YANG schemas */
346-
ly_module_imp_clb imp_clb; /**< optional callback for retrieving missing included or imported models */
346+
ly_module_imp_clb imp_clb; /**< optional callback for retrieving missing included or imported modules */
347347
void *imp_clb_data; /**< optional private data for ::ly_ctx.imp_clb */
348348
struct lys_glob_unres unres; /**< global unres, should be empty unless there are modules prepared for
349349
compilation if ::LY_CTX_EXPLICIT_COMPILE flag is set */

src/lyb.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ struct lysc_node;
5151
sb = siblings_start
5252
se = siblings_end
5353
siblings = zero-LYB_SIZE_BYTES | (sb instance+ se)
54-
instance = node_type model hash node
55-
model = 16bit_zero | (model_name_length model_name revision)
54+
instance = node_type module hash node
55+
module = 16bit_zero | (module_name_length module_name revision)
5656
node = opaq | leaflist | list | any | inner | leaf
5757
opaq = opaq_data siblings
5858
leaflist = sb leaf+ se
@@ -171,8 +171,8 @@ void lyd_lyb_ctx_free(struct lyd_ctx *lydctx);
171171
/* Just a helper macro */
172172
#define LYB_META_BYTES (LYB_INCHUNK_BYTES + LYB_SIZE_BYTES)
173173

174-
/* model revision as XXXX XXXX XXXX XXXX (2B) (year is offset from 2000)
175-
* YYYY YYYM MMMD DDDD */
174+
/* module revision as XXXX XXXX XXXX XXXX (2B) (year is offset from 2000)
175+
* YYYY YYYM MMMD DDDD */
176176
#define LYB_REV_YEAR_OFFSET 2000
177177
#define LYB_REV_YEAR_MASK 0xfe00U
178178
#define LYB_REV_YEAR_SHIFT 9

src/parser_data.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ struct ly_in;
230230
*
231231
* @param[in] ctx Context to connect with the tree being built here.
232232
* @param[in] parent Optional parent to connect the parsed nodes to. If provided, the data are expected to describe
233-
* a subtree of the YANG model instead of starting at the schema root.
233+
* a subtree of the YANG module instead of starting at the schema root.
234234
* @param[in] in The input handle to provide the dumped data in the specified @p format to parse (and validate).
235235
* @param[in] format Format of the input data to be parsed. Can be 0 to try to detect format from the input handler.
236236
* @param[in] parse_options Options for parser, see @ref dataparseroptions.

src/parser_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ LY_ERR yang_parse_module(struct lysp_yang_ctx **context, struct ly_in *in, struc
225225
/**
226226
* @brief Parse module from YIN data.
227227
*
228-
* @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed.
228+
* @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_module after it's completly parsed.
229229
* @param[in] in Input structure.
230230
* @param[in,out] mod Prepared module structure where the parsed information, including the parsed
231231
* module structure, will be filled in.
@@ -236,7 +236,7 @@ LY_ERR yin_parse_module(struct lysp_yin_ctx **yin_ctx, struct ly_in *in, struct
236236
/**
237237
* @brief Parse submodule from YIN data.
238238
*
239-
* @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_model after it's completly parsed.
239+
* @param[in,out] yin_ctx Context created during parsing, is used to finalize lysp_module after it's completly parsed.
240240
* @param[in] ctx Libyang context.
241241
* @param[in] main_ctx Parser context of main module.
242242
* @param[in] in Input structure.

src/parser_lyb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ lyb_parse_metadata(struct lyd_lyb_ctx *lybctx, const struct lysc_node *sparent,
444444

445445
/* read attributes */
446446
for (i = 0; i < count; ++i) {
447-
/* find model */
447+
/* find module */
448448
ret = lyb_parse_module(lybctx->lybctx, &mod);
449449
LY_CHECK_GOTO(ret, cleanup);
450450

src/parser_schema.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ typedef enum {
9797
/**
9898
* @brief Load a schema into the specified context.
9999
*
100-
* @param[in] ctx libyang context where to process the data model.
101-
* @param[in] in The input handle to provide the dumped data model in the specified format.
100+
* @param[in] ctx libyang context to use.
101+
* @param[in] in Input handle to provide the dumped module in the specified format.
102102
* @param[in] format Format of the schema to parse. Can be 0 to try to detect format from the input handler.
103103
* @param[in] features Array of features to enable ended with NULL. If NULL, no features are enabled.
104104
* @param[out] module Optional parsed module.
@@ -113,8 +113,8 @@ LIBYANG_API_DECL LY_ERR lys_parse(struct ly_ctx *ctx, struct ly_in *in, LYS_INFO
113113
* This function is considered for a simple use, if you have a complex use-case,
114114
* consider use of ::lys_parse() with a standalone input handler.
115115
*
116-
* @param[in] ctx libyang context where to process the data model.
117-
* @param[in] data The string containing the dumped data model in the specified format.
116+
* @param[in] ctx libyang context to use.
117+
* @param[in] data String containing the dumped module in the specified format.
118118
* @param[in] format Format of the schema to parse.
119119
* @param[out] module Optional parsed module.
120120
* @return LY_ERR value.
@@ -124,12 +124,12 @@ LIBYANG_API_DECL LY_ERR lys_parse_mem(struct ly_ctx *ctx, const char *data, LYS_
124124
/**
125125
* @brief Read a schema from file descriptor into the specified context.
126126
*
127-
* \note Current implementation supports only reading data from standard (disk) file, not from sockets, pipes, etc.
127+
* @note Current implementation supports only reading data from standard (disk) file, not from sockets, pipes, etc.
128128
*
129129
* This function is considered for a simple use, if you have a complex use-case,
130130
* consider use of ::lys_parse() with a standalone input handler.
131131
*
132-
* @param[in] ctx libyang context where to process the data model.
132+
* @param[in] ctx libyang context to use.
133133
* @param[in] fd File descriptor of a regular file (e.g. sockets are not supported) containing the schema
134134
* in the specified format.
135135
* @param[in] format Format of the schema to parse.
@@ -144,8 +144,8 @@ LIBYANG_API_DECL LY_ERR lys_parse_fd(struct ly_ctx *ctx, int fd, LYS_INFORMAT fo
144144
* This function is considered for a simple use, if you have a complex use-case,
145145
* consider use of ::lys_parse() with a standalone input handler.
146146
*
147-
* @param[in] ctx libyang context where to process the data model.
148-
* @param[in] path Path to the file with the model in the specified format.
147+
* @param[in] ctx libyang context to use.
148+
* @param[in] path Path to the file with the module in the specified format.
149149
* @param[in] format Format of the schema to parse.
150150
* @param[out] module Optional parsed module.
151151
* @return LY_ERR value.

src/plugins_types/identityref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ identityref_check_base(const struct lysc_ident *ident, struct lysc_type_identity
193193
/**
194194
* @brief Check if @p ident is not disabled.
195195
*
196-
* Identity is disabled if it is located in an unimplemented model or
196+
* Identity is disabled if it is located in an unimplemented module or
197197
* it can be disabled by if-feature. Calling this function may invoke
198198
* the implementation of another module.
199199
*

src/printer_lyb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ lyb_print_metadata(struct ly_out *out, const struct lyd_node *node, struct lyd_l
726726
continue;
727727
}
728728

729-
/* model */
729+
/* module */
730730
LY_CHECK_RET(lyb_print_module(out, iter->annotation->module, lybctx->lybctx));
731731

732732
/* annotation name with length */
@@ -1155,7 +1155,7 @@ lyb_print_node(struct ly_out *out, const struct lyd_node **printed_node, struct
11551155
/* write node type */
11561156
LY_CHECK_RET(lyb_print_lyb_type(out, node, lybctx));
11571157

1158-
/* write model info first */
1158+
/* write module info first */
11591159
if (node->schema && ((node->flags & LYD_EXT) || !lysc_data_parent(node->schema))) {
11601160
LY_CHECK_RET(lyb_print_module(out, node->schema->module, lybctx->lybctx));
11611161
}

0 commit comments

Comments
 (0)