Commit ff8a018a authored by Daniel Salzman's avatar Daniel Salzman

Unify use of the schem(e/a) word

parent 91f81a55
......@@ -179,8 +179,8 @@ src/knot/conf/migration.c
src/knot/conf/migration.h
src/knot/conf/module.c
src/knot/conf/module.h
src/knot/conf/scheme.c
src/knot/conf/scheme.h
src/knot/conf/schema.c
src/knot/conf/schema.h
src/knot/conf/tools.c
src/knot/conf/tools.h
src/knot/ctl/commands.c
......@@ -226,9 +226,9 @@ src/knot/events/handlers/freeze_thaw.c
src/knot/events/handlers/load.c
src/knot/events/handlers/notify.c
src/knot/events/handlers/nsec3resalt.c
src/knot/events/handlers/parent_ds_query.c
src/knot/events/handlers/refresh.c
src/knot/events/handlers/update.c
src/knot/events/handlers/parent_ds_query.c
src/knot/events/log.c
src/knot/events/log.h
src/knot/events/replan.c
......@@ -413,8 +413,8 @@ src/libknot/yparser/ypbody.c
src/libknot/yparser/ypbody.rl
src/libknot/yparser/ypformat.c
src/libknot/yparser/ypformat.h
src/libknot/yparser/ypscheme.c
src/libknot/yparser/ypscheme.h
src/libknot/yparser/ypschema.c
src/libknot/yparser/ypschema.h
src/libknot/yparser/yptrafo.c
src/libknot/yparser/yptrafo.h
src/utils/common/cert.c
......@@ -522,7 +522,7 @@ tests/libknot/test_rrset-wire.c
tests/libknot/test_rrset.c
tests/libknot/test_tsig.c
tests/libknot/test_yparser.c
tests/libknot/test_ypscheme.c
tests/libknot/test_ypschema.c
tests/libknot/test_yptrafo.c
tests/modules/test_onlinesign.c
tests/modules/test_rrl.c
......
......@@ -145,7 +145,7 @@ nobase_libknot_la_HEADERS = \
libknot/tsig.h \
libknot/yparser/yparser.h \
libknot/yparser/ypformat.h \
libknot/yparser/ypscheme.h \
libknot/yparser/ypschema.h \
libknot/yparser/yptrafo.h \
libknot/version.h
......@@ -186,7 +186,7 @@ libknot_la_SOURCES = \
libknot/yparser/yparser.c \
libknot/yparser/ypbody.c \
libknot/yparser/ypformat.c \
libknot/yparser/ypscheme.c \
libknot/yparser/ypschema.c \
libknot/yparser/yptrafo.c \
$(nobase_libknot_la_HEADERS)
......@@ -242,8 +242,8 @@ libknotd_la_SOURCES = \
knot/conf/migration.h \
knot/conf/module.h \
knot/conf/module.c \
knot/conf/scheme.c \
knot/conf/scheme.h \
knot/conf/schema.c \
knot/conf/schema.h \
knot/conf/tools.c \
knot/conf/tools.h \
knot/ctl/commands.c \
......
......@@ -143,7 +143,7 @@ static void init_cache(
int conf_new(
conf_t **conf,
const yp_item_t *scheme,
const yp_item_t *schema,
const char *db_dir,
conf_flag_t flags)
{
......@@ -160,8 +160,8 @@ int conf_new(
// Initialize query modules list.
init_list(&out->query_modules);
// Initialize config scheme.
int ret = yp_scheme_copy(&out->scheme, scheme);
// Initialize config schema.
int ret = yp_schema_copy(&out->schema, schema);
if (ret != KNOT_EOK) {
goto new_error;
}
......@@ -278,8 +278,8 @@ int conf_clone(
}
memset(out, 0, sizeof(conf_t));
// Initialize config scheme.
int ret = yp_scheme_copy(&out->scheme, s_conf->scheme);
// Initialize config schema.
int ret = yp_schema_copy(&out->schema, s_conf->schema);
if (ret != KNOT_EOK) {
free(out);
return ret;
......@@ -293,7 +293,7 @@ int conf_clone(
// Open common read-only transaction.
ret = conf_refresh_txn(out);
if (ret != KNOT_EOK) {
yp_scheme_free(out->scheme);
yp_schema_free(out->schema);
free(out);
return ret;
}
......@@ -372,7 +372,7 @@ void conf_free(
return;
}
yp_scheme_free(conf->scheme);
yp_schema_free(conf->schema);
free(conf->filename);
free(conf->hostname);
if (conf->api != NULL) {
......@@ -554,7 +554,7 @@ int conf_parse(
}
// Initialize parser check context.
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf->schema);
if (ctx == NULL) {
ret = KNOT_ENOMEM;
goto parse_error;
......@@ -571,7 +571,7 @@ int conf_parse(
}
}
check_ret = yp_scheme_check_parser(ctx, parser);
check_ret = yp_schema_check_parser(ctx, parser);
if (check_ret != KNOT_EOK) {
log_parser_err(parser, check_ret);
break;
......@@ -610,7 +610,7 @@ int conf_parse(
}
conf_mod_load_purge(conf, false);
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
parse_error:
yp_deinit(parser);
free(parser);
......@@ -858,8 +858,8 @@ int conf_export(
int ret;
// Iterate over the scheme.
for (yp_item_t *item = conf->scheme; item->name != NULL; item++) {
// Iterate over the schema.
for (yp_item_t *item = conf->schema; item->name != NULL; item++) {
// Don't export module sections again.
if (strncmp(item->name + 1, mod_prefix, mod_prefix_len) == 0) {
break;
......
......@@ -26,7 +26,7 @@
#pragma once
#include "libknot/libknot.h"
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
#include "contrib/qp-trie/trie.h"
#include "contrib/ucw/lists.h"
#include "contrib/dynarray.h"
......@@ -88,8 +88,8 @@ typedef struct {
bool is_clone;
/*! Currently used namedb api. */
const struct knot_db_api *api;
/*! Configuration scheme. */
yp_item_t *scheme;
/*! Configuration schema. */
yp_item_t *schema;
/*! Memory context. */
knot_mm_t *mm;
/*! Configuration database. */
......@@ -188,7 +188,7 @@ void conf_refresh_hostname(
* Creates new or opens old configuration database.
*
* \param[out] conf Configuration.
* \param[in] scheme Configuration scheme.
* \param[in] schema Configuration schema.
* \param[in] db_dir Database path or NULL.
* \param[in] flags Access flags.
*
......@@ -196,7 +196,7 @@ void conf_refresh_hostname(
*/
int conf_new(
conf_t **conf,
const yp_item_t *scheme,
const yp_item_t *schema,
const char *db_dir,
conf_flag_t flags
);
......
......@@ -28,7 +28,7 @@
#include <sys/socket.h>
#include "knot/conf/base.h"
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
#define CONF_XFERS 10
......
......@@ -378,9 +378,9 @@ int conf_db_set(
}
// Check for valid keys.
const yp_item_t *item = yp_scheme_find(key1 != NULL ? key1 : key0,
const yp_item_t *item = yp_schema_find(key1 != NULL ? key1 : key0,
key1 != NULL ? key0 : NULL,
conf->scheme);
conf->schema);
if (item == NULL) {
return KNOT_YP_EINVAL_ITEM;
}
......@@ -546,9 +546,9 @@ int conf_db_unset(
}
// Check for valid keys.
const yp_item_t *item = yp_scheme_find(key1 != NULL ? key1 : key0,
const yp_item_t *item = yp_schema_find(key1 != NULL ? key1 : key0,
key1 != NULL ? key0 : NULL,
conf->scheme);
conf->schema);
if (item == NULL) {
return KNOT_YP_EINVAL_ITEM;
}
......@@ -640,9 +640,9 @@ int conf_db_get(
}
// Check for valid keys.
out.item = yp_scheme_find(key1 != NULL ? key1 : key0,
out.item = yp_schema_find(key1 != NULL ? key1 : key0,
key1 != NULL ? key0 : NULL,
conf->scheme);
conf->schema);
if (out.item == NULL) {
out.code = KNOT_YP_EINVAL_ITEM;
goto get_error;
......@@ -746,8 +746,8 @@ int conf_db_iter_begin(
goto iter_begin_error;
}
// Look-up group id item in the scheme.
const yp_item_t *grp = yp_scheme_find(key0, NULL, conf->scheme);
// Look-up group id item in the schema.
const yp_item_t *grp = yp_schema_find(key0, NULL, conf->schema);
if (grp == NULL) {
out.code = KNOT_YP_EINVAL_ITEM;
goto iter_begin_error;
......
......@@ -30,7 +30,7 @@
#include "knot/conf/conf.h"
#include "libknot/libknot.h"
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
/*! Current version of the configuration database structure. */
#define CONF_DB_VERSION 2
......
......@@ -166,16 +166,16 @@ int conf_io_list(
if (key0 == NULL) {
io_reset_val(io, NULL, NULL, NULL, 0, false, NULL);
return list_section(conf()->scheme, &io->key0, io);
return list_section(conf()->schema, &io->key0, io);
}
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf()->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf()->schema);
if (ctx == NULL) {
return KNOT_ENOMEM;
}
// Check the input.
int ret = yp_scheme_check_str(ctx, key0, NULL, NULL, NULL);
int ret = yp_schema_check_str(ctx, key0, NULL, NULL, NULL);
if (ret != KNOT_EOK) {
goto list_error;
}
......@@ -192,7 +192,7 @@ int conf_io_list(
ret = list_section(node->item->sub_items, &io->key1, io);
list_error:
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
return ret;
}
......@@ -480,7 +480,7 @@ int conf_io_diff(
// Compare all sections by default.
if (key0 == NULL) {
for (yp_item_t *i = conf()->scheme; i->name != NULL; i++) {
for (yp_item_t *i = conf()->schema; i->name != NULL; i++) {
// Skip non-group item.
if (i->type != YP_TGRP) {
continue;
......@@ -499,13 +499,13 @@ int conf_io_diff(
return KNOT_EOK;
}
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf()->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf()->schema);
if (ctx == NULL) {
return KNOT_ENOMEM;
}
// Check the input.
int ret = yp_scheme_check_str(ctx, key0, key1, id, NULL);
int ret = yp_schema_check_str(ctx, key0, key1, id, NULL);
if (ret != KNOT_EOK) {
goto diff_error;
}
......@@ -560,7 +560,7 @@ int conf_io_diff(
// Compare the section with a possible identifier.
ret = diff_section(io);
diff_error:
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
return ret;
}
......@@ -680,7 +680,7 @@ int conf_io_get(
// List all sections by default.
if (key0 == NULL) {
for (yp_item_t *i = conf()->scheme; i->name != NULL; i++) {
for (yp_item_t *i = conf()->schema; i->name != NULL; i++) {
// Skip non-group item.
if (i->type != YP_TGRP) {
continue;
......@@ -698,13 +698,13 @@ int conf_io_get(
return KNOT_EOK;
}
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf()->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf()->schema);
if (ctx == NULL) {
return KNOT_ENOMEM;
}
// Check the input.
int ret = yp_scheme_check_str(ctx, key0, key1, id, NULL);
int ret = yp_schema_check_str(ctx, key0, key1, id, NULL);
if (ret != KNOT_EOK) {
goto get_error;
}
......@@ -775,7 +775,7 @@ int conf_io_get(
// List the section with a possible identifier.
ret = get_section(txn, io);
get_error:
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
return ret;
}
......@@ -925,13 +925,13 @@ int conf_io_set(
return KNOT_EINVAL;
}
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf()->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf()->schema);
if (ctx == NULL) {
return KNOT_ENOMEM;
}
// Check the input.
int ret = yp_scheme_check_str(ctx, key0, key1, id, data);
int ret = yp_schema_check_str(ctx, key0, key1, id, data);
if (ret != KNOT_EOK) {
goto set_error;
}
......@@ -1029,7 +1029,7 @@ int conf_io_set(
upd_changes(&io, upd_type, upd_flags, false);
}
set_error:
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
return ret;
}
......@@ -1113,7 +1113,7 @@ int conf_io_unset(
// Unset all sections by default.
if (key0 == NULL) {
for (yp_item_t *i = conf()->scheme; i->name != NULL; i++) {
for (yp_item_t *i = conf()->schema; i->name != NULL; i++) {
// Skip non-group item.
if (i->type != YP_TGRP) {
continue;
......@@ -1132,13 +1132,13 @@ int conf_io_unset(
return KNOT_EOK;
}
yp_check_ctx_t *ctx = yp_scheme_check_init(&conf()->scheme);
yp_check_ctx_t *ctx = yp_schema_check_init(&conf()->schema);
if (ctx == NULL) {
return KNOT_ENOMEM;
}
// Check the input.
int ret = yp_scheme_check_str(ctx, key0, key1, id, data);
int ret = yp_schema_check_str(ctx, key0, key1, id, data);
if (ret != KNOT_EOK) {
goto unset_error;
}
......@@ -1279,7 +1279,7 @@ int conf_io_unset(
upd_changes(&io, upd_type, upd_flags, false);
}
unset_error:
yp_scheme_check_deinit(ctx);
yp_schema_check_deinit(ctx);
return ret;
}
......@@ -1462,8 +1462,8 @@ int conf_io_check(
int ret;
// Iterate over the scheme.
for (yp_item_t *item = conf()->scheme; item->name != NULL; item++) {
// Iterate over the schema.
for (yp_item_t *item = conf()->schema; item->name != NULL; item++) {
// Skip non-group items (include).
if (item->type != YP_TGRP) {
continue;
......
......@@ -132,7 +132,7 @@ int conf_migrate(
return conf_refresh_txn(conf);
}
const yp_item_t scheme_mod_online_sign[] = {
const yp_item_t schema_mod_online_sign[] = {
{ C_ID, YP_TSTR },
{ C_POLICY, YP_TSTR },
{ C_COMMENT, YP_TSTR },
......@@ -147,7 +147,7 @@ int check_mod_online_sign(
return KNOT_EOK;
}
const yp_item_t scheme_mod_synth_record[] = {
const yp_item_t schema_mod_synth_record[] = {
{ C_ID, YP_TSTR },
{ "\x07""network", YP_TSTR },
{ "\x06""origin", YP_TSTR },
......
......@@ -30,9 +30,9 @@ int conf_migrate(
);
#define C_MOD_ONLINE_SIGN "\x0f""mod-online-sign"
extern const yp_item_t scheme_mod_online_sign[];
extern const yp_item_t schema_mod_online_sign[];
int check_mod_online_sign(knotd_conf_check_args_t *args);
#define C_MOD_SYNTH_RECORD "\x10""mod-synth-record"
extern const yp_item_t scheme_mod_synth_record[];
extern const yp_item_t schema_mod_synth_record[];
int check_mod_synth_record(knotd_conf_check_args_t *args);
......@@ -80,9 +80,9 @@ static int mod_load(
int ret;
if (mod->api->config != NULL) {
ret = yp_scheme_merge(&sub_items, module_common, mod->api->config);
ret = yp_schema_merge(&sub_items, module_common, mod->api->config);
} else {
ret = yp_scheme_copy(&sub_items, module_common);
ret = yp_schema_copy(&sub_items, module_common);
}
if (ret != KNOT_EOK) {
return ret;
......@@ -97,21 +97,21 @@ static int mod_load(
name[0] = name_len;
memcpy(name + 1, mod->api->name, name_len + 1);
const yp_item_t scheme[] = {
const yp_item_t schema[] = {
{ name, YP_TGRP, YP_VGRP = { sub_items },
YP_FALLOC | YP_FMULTI | CONF_IO_FRLD_MOD | CONF_IO_FRLD_ZONES },
{ NULL }
};
yp_item_t *merged = NULL;
ret = yp_scheme_merge(&merged, conf->scheme, scheme);
yp_scheme_free(sub_items);
ret = yp_schema_merge(&merged, conf->schema, schema);
yp_schema_free(sub_items);
if (ret != KNOT_EOK) {
return ret;
}
// Update configuration schema (with lazy free).
yp_item_t **current_schema = &conf->scheme;
yp_item_t **current_schema = &conf->schema;
yp_item_t *old_schema = rcu_xchg_pointer(current_schema, merged);
synchronize_rcu();
old_schema_dynarray_add(&conf->old_schemas, &old_schema);
......@@ -288,7 +288,7 @@ void conf_mod_load_purge(
// Switch the current temporary schema with the initial one.
if (temporary && conf->old_schemas.size > 0) {
yp_item_t **current_schema = &conf->scheme;
yp_item_t **current_schema = &conf->schema;
yp_item_t **initial = &(conf->old_schemas.arr)[0];
yp_item_t *old_schema = rcu_xchg_pointer(current_schema, *initial);
......@@ -297,7 +297,7 @@ void conf_mod_load_purge(
}
dynarray_foreach(old_schema, yp_item_t *, schema, conf->old_schemas) {
yp_scheme_free(*schema);
yp_schema_free(*schema);
}
old_schema_dynarray_free(&conf->old_schemas);
......
......@@ -19,7 +19,7 @@
#include <stdlib.h>
#include <stdint.h>
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
#include "knot/conf/confio.h"
#include "knot/conf/migration.h"
#include "knot/conf/tools.h"
......@@ -300,7 +300,7 @@ static const yp_item_t desc_zone[] = {
{ NULL }
};
const yp_item_t conf_scheme[] = {
const yp_item_t conf_schema[] = {
{ C_MODULE, YP_TGRP, YP_VGRP = { desc_module }, YP_FMULTI | CONF_IO_FRLD_ALL |
CONF_IO_FCHECK_ZONES, { load_module } },
{ C_SRV, YP_TGRP, YP_VGRP = { desc_server }, CONF_IO_FRLD_SRV, { check_server } },
......@@ -317,7 +317,7 @@ const yp_item_t conf_scheme[] = {
{ C_ZONE, YP_TGRP, YP_VGRP = { desc_zone }, YP_FMULTI | CONF_IO_FZONE, { check_zone } },
{ C_INCL, YP_TSTR, YP_VNONE, CONF_IO_FDIFF_ZONES | CONF_IO_FRLD_ALL, { include_file } },
/* Renamed modules. */
{ C_MOD_ONLINE_SIGN, YP_TGRP, YP_VGRP = { scheme_mod_online_sign }, YP_FMULTI, { check_mod_online_sign } },
{ C_MOD_SYNTH_RECORD, YP_TGRP, YP_VGRP = { scheme_mod_synth_record }, YP_FMULTI, { check_mod_synth_record } },
{ C_MOD_ONLINE_SIGN, YP_TGRP, YP_VGRP = { schema_mod_online_sign }, YP_FMULTI, { check_mod_online_sign } },
{ C_MOD_SYNTH_RECORD, YP_TGRP, YP_VGRP = { schema_mod_synth_record }, YP_FMULTI, { check_mod_synth_record } },
{ NULL }
};
......@@ -16,7 +16,7 @@
/*!
* \file
*
* Server configuration scheme.
* Server configuration schema.
*
* \addtogroup config
*
......@@ -26,7 +26,7 @@
#pragma once
#include "libknot/lookup.h"
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
#define C_ACL "\x03""acl"
#define C_ACTION "\x06""action"
......@@ -138,6 +138,6 @@ enum {
extern const knot_lookup_t acl_actions[];
extern const yp_item_t conf_scheme[];
extern const yp_item_t conf_schema[];
/*! @} */
......@@ -33,7 +33,7 @@
#include "knot/conf/tools.h"
#include "knot/conf/conf.h"
#include "knot/conf/module.h"
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
#include "knot/common/log.h"
#include "libknot/errcode.h"
#include "libknot/yparser/yptrafo.h"
......@@ -565,7 +565,7 @@ int load_module(
}
// Update currently iterating item.
const yp_item_t *section = yp_scheme_find(C_MODULE, NULL, args->extra->conf->scheme);
const yp_item_t *section = yp_schema_find(C_MODULE, NULL, args->extra->conf->schema);
assert(section);
args->item = section->var.g.id;
......
......@@ -16,7 +16,7 @@
/*!
* \file
*
* Configuration scheme callbacks.
* Configuration schema callbacks.
*
* \addtogroup config
*
......@@ -29,7 +29,7 @@
#include <stdint.h>
#include "knot/conf/conf.h"
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
typedef struct knotd_conf_check_extra {
conf_t *conf;
......
......@@ -17,7 +17,7 @@
#include <assert.h>
#include <stdio.h>
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
#include "knot/dnssec/kasp/keystore.h"
#include "libknot/error.h"
......
......@@ -22,7 +22,7 @@
#include <sys/socket.h>
#include <libknot/libknot.h>
#include <libknot/yparser/ypscheme.h>
#include <libknot/yparser/ypschema.h>
/*** Query module API. ***/
......
......@@ -16,11 +16,10 @@
#include "contrib/net.h"
#include "knot/include/module.h"
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
#include "knot/query/capture.h" // Forces static module!
#include "knot/query/requestor.h" // Forces static module!
/* Module configuration scheme. */
#define MOD_REMOTE "\x06""remote"
#define MOD_TIMEOUT "\x07""timeout"
#define MOD_FALLBACK "\x08""fallback"
......
......@@ -24,9 +24,8 @@
#include "contrib/sockaddr.h"
#include "contrib/wire.h"
#include "knot/include/module.h"
#include "knot/conf/scheme.h"
#include "knot/conf/schema.h"
/* Module configuration scheme. */
#define MOD_DBDIR "\x05""dbdir"
const yp_item_t rosedb_conf[] = {
......
......@@ -19,7 +19,6 @@
#include "knot/nameserver/process_query.h" // Dependency on qdata->extra!
#include "knot/modules/rrl/functions.h"
/* Module configuration scheme. */
#define MOD_RATE_LIMIT "\x0A""rate-limit"
#define MOD_SLIP "\x04""slip"
#define MOD_TBL_SIZE "\x0A""table-size"
......
......@@ -18,7 +18,6 @@
#include "contrib/sockaddr.h"
#include "knot/include/module.h"
/* Module configuration scheme. */
#define MOD_NET "\x07""network"
#define MOD_ORIGIN "\x06""origin"
#define MOD_PREFIX "\x06""prefix"
......
......@@ -21,7 +21,7 @@
#include <urcu.h>
#include "libknot/errcode.h"
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
#include "knot/common/log.h"
#include "knot/common/stats.h"
#include "knot/conf/confio.h"
......@@ -540,7 +540,7 @@ void server_wait(server_t *server)
static int reload_conf(conf_t *new_conf)
{
yp_scheme_purge_dynamic(new_conf->scheme);
yp_schema_purge_dynamic(new_conf->schema);
/* Re-load common modules. */
int ret = conf_mod_load_common(new_conf);
......
/* Copyright (C) 2015 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
/* Copyright (C) 2017 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......@@ -24,12 +24,12 @@
#pragma once
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
/*!
* Formats key0 item.
*
* \param[in] item Scheme item to format.
* \param[in] item Schema item to format.
* \param[in] data Data to format.
* \param[in] data_len Data length.
* \param[out] out Output buffer.
......@@ -54,7 +54,7 @@ int yp_format_key0(
/*!
* Formats identifier item.
*
* \param[in] item Scheme item to format.
* \param[in] item Schema item to format.
* \param[in] data Data to format.
* \param[in] data_len Data length.
* \param[out] out Output buffer.
......@@ -75,7 +75,7 @@ int yp_format_id(
/*!
* Formats key1 item.
*
* \param[in] item Scheme item to format.
* \param[in] item Schema item to format.
* \param[in] data Data to format.
* \param[in] data_len Data length.
* \param[out] out Output buffer.
......
......@@ -18,12 +18,12 @@
#include <stdlib.h>
#include <string.h>
#include "libknot/yparser/ypscheme.h"
#include "libknot/yparser/ypschema.h"
#include "libknot/yparser/yptrafo.h"
#include "libknot/attribute.h"
#include "libknot/errcode.h"
static size_t scheme_count(
static size_t schema_count(
const yp_item_t *src)
{
size_t count = 0;
......@@ -37,15 +37,15 @@ static size_t scheme_count(
/*! Initializes the referenced item. */
static int set_ref_item(
yp_item_t *dst,
const yp_item_t *scheme)
const yp_item_t *schema)
{
if (scheme == NULL) {
if (schema == NULL) {
return KNOT_EINVAL;
}
// Get reference category.
const yp_name_t *ref_name = dst->var.r.ref_name;
const yp_item_t *ref = yp_scheme_find(ref_name, NULL, scheme);
const yp_item_t *ref = yp_schema_find(ref_name, NULL, schema);
if (ref == NULL) {
return KNOT_YP_EINVAL_ITEM;
}
......@@ -59,10 +59,10 @@ static int set_ref_item(
static int set_grp_item(