Browse Source

macros: Change macros prototypes

Serj Kalichev 2 years ago
parent
commit
bc5daa8af8

+ 2 - 2
klish/ischeme/icommand.c

@@ -61,7 +61,7 @@ bool_t icommand_parse_nested(const icommand_t *icommand, kcommand_t *kcommand,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kcommand_add_param(kcommand, kparam)) {
+			if (!kcommand_add_params(kcommand, kparam)) {
 				// Search for PARAM duplicates
 				if (kcommand_find_param(kcommand,
 					kparam_name(kparam))) {
@@ -92,7 +92,7 @@ bool_t icommand_parse_nested(const icommand_t *icommand, kcommand_t *kcommand,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kcommand_add_action(kcommand, kaction)) {
+			if (!kcommand_add_actions(kcommand, kaction)) {
 				faux_error_sprintf(error,
 					TAG": Can't add ACTION #%d",
 					kcommand_actions_len(kcommand) + 1);

+ 2 - 2
klish/ischeme/ientry.c

@@ -171,7 +171,7 @@ bool_t ientry_parse_nested(const ientry_t *ientry, kentry_t *kentry,
 				continue;
 			}
 			kentry_set_parent(nkentry, kentry); // Set parent entry
-			if (!kentry_add_entry(kentry, nkentry)) {
+			if (!kentry_add_entrys(kentry, nkentry)) {
 				faux_error_sprintf(error,
 					TAG": Can't add ENTRY \"%s\"",
 					kentry_name(nkentry));
@@ -194,7 +194,7 @@ bool_t ientry_parse_nested(const ientry_t *ientry, kentry_t *kentry,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kentry_add_action(kentry, kaction)) {
+			if (!kentry_add_actions(kentry, kaction)) {
 				faux_error_sprintf(error,
 					TAG": Can't add ACTION #%d",
 					kentry_actions_len(kentry) + 1);

+ 1 - 1
klish/ischeme/iparam.c

@@ -80,7 +80,7 @@ bool_t iparam_parse_nested(const iparam_t *iparam, kparam_t *kparam,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kparam_add_param(kparam, nkparam)) {
+			if (!kparam_add_params(kparam, nkparam)) {
 				// Search for PARAM duplicates
 				if (kparam_find_param(kparam,
 					kparam_name(nkparam))) {

+ 1 - 1
klish/ischeme/iptype.c

@@ -57,7 +57,7 @@ bool_t iptype_parse_nested(const iptype_t *iptype, kptype_t *kptype,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kptype_add_action(kptype, kaction)) {
+			if (!kptype_add_actions(kptype, kaction)) {
 				faux_error_sprintf(error,
 					TAG": Can't add ACTION #%d",
 					kptype_actions_len(kptype) + 1);

+ 4 - 4
klish/ischeme/ischeme.c

@@ -38,7 +38,7 @@ bool_t ischeme_parse_nested(const ischeme_t *ischeme, kscheme_t *kscheme,
 				retval = BOOL_FALSE; // Don't stop
 				continue;
 			}
-			if (!kscheme_add_plugin(kscheme, kplugin)) {
+			if (!kscheme_add_plugins(kscheme, kplugin)) {
 				// Search for PLUGIN duplicates
 				if (kscheme_find_plugin(kscheme,
 					kplugin_name(kplugin))) {
@@ -68,7 +68,7 @@ bool_t ischeme_parse_nested(const ischeme_t *ischeme, kscheme_t *kscheme,
 				retval = BOOL_FALSE; // Don't stop
 				continue;
 			}
-			if (!kscheme_add_ptype(kscheme, kptype)) {
+			if (!kscheme_add_ptypes(kscheme, kptype)) {
 				// Search for PTYPE duplicates
 				if (kscheme_find_ptype(kscheme,
 					kptype_name(kptype))) {
@@ -122,7 +122,7 @@ bool_t ischeme_parse_nested(const ischeme_t *ischeme, kscheme_t *kscheme,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kscheme_add_view(kscheme, kview)) {
+			if (!kscheme_add_views(kscheme, kview)) {
 				faux_error_sprintf(error,
 					TAG": Can't add VIEW \"%s\"",
 					kview_name(kview));
@@ -170,7 +170,7 @@ bool_t ischeme_parse_nested(const ischeme_t *ischeme, kscheme_t *kscheme,
 				continue;
 			}
 			kentry_set_parent(nkentry, NULL); // Set empty parent entry
-			if (!kscheme_add_entry(kscheme, nkentry)) {
+			if (!kscheme_add_entrys(kscheme, nkentry)) {
 				faux_error_sprintf(error,
 					TAG": Can't add ENTRY \"%s\"",
 					kentry_name(nkentry));

+ 2 - 2
klish/ischeme/iview.c

@@ -53,7 +53,7 @@ bool_t iview_parse_nested(const iview_t *iview, kview_t *kview,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kview_add_nspace(kview, knspace)) {
+			if (!kview_add_nspaces(kview, knspace)) {
 				faux_error_sprintf(error,
 					TAG": Can't add NSPACE \"%s\"",
 					knspace_view_ref(knspace));
@@ -75,7 +75,7 @@ bool_t iview_parse_nested(const iview_t *iview, kview_t *kview,
 				retval = BOOL_FALSE;
 				continue;
 			}
-			if (!kview_add_command(kview, kcommand)) {
+			if (!kview_add_commands(kview, kcommand)) {
 				// Search for COMMAND duplicates
 				if (kview_find_command(kview,
 					kcommand_name(kcommand))) {

+ 2 - 2
klish/kcommand.h

@@ -27,7 +27,7 @@ bool_t kcommand_set_help(kcommand_t *command, const char *help);
 
 // PARAMs
 faux_list_t *kcommand_params(const kcommand_t *command);
-bool_t kcommand_add_param(kcommand_t *command, kparam_t *param);
+bool_t kcommand_add_params(kcommand_t *command, kparam_t *param);
 kparam_t *kcommand_find_param(const kcommand_t *command, const char *name);
 ssize_t kcommand_params_len(const kcommand_t *command);
 kcommand_params_node_t *kcommand_params_iter(const kcommand_t *command);
@@ -35,7 +35,7 @@ kparam_t *kcommand_params_each(kcommand_params_node_t **iter);
 
 // ACTIONs
 faux_list_t *kcommand_actions(const kcommand_t *command);
-bool_t kcommand_add_action(kcommand_t *command, kaction_t *action);
+bool_t kcommand_add_actions(kcommand_t *command, kaction_t *action);
 ssize_t kcommand_actions_len(const kcommand_t *command);
 kcommand_actions_node_t *kcommand_actions_iter(const kcommand_t *command);
 kaction_t *kcommand_actions_each(kcommand_actions_node_t **iter);

+ 2 - 2
klish/kentry.h

@@ -76,7 +76,7 @@ bool_t kentry_set_order(kentry_t *entry, bool_t order);
 
 // Nested ENTRY list
 faux_list_t *kentry_entrys(const kentry_t *entry);
-bool_t kentry_add_entry(kentry_t *entry, kentry_t *nested_entry);
+bool_t kentry_add_entrys(kentry_t *entry, kentry_t *nested_entry);
 kentry_t *kentry_find_entry(const kentry_t *entry, const char *name);
 ssize_t kentry_entrys_len(const kentry_t *entry);
 bool_t kentry_entrys_is_empty(const kentry_t *entry);
@@ -85,7 +85,7 @@ kentry_t *kentry_entrys_each(kentry_entrys_node_t **iter);
 
 // ACTIONs
 faux_list_t *kentry_actions(const kentry_t *entry);
-bool_t kentry_add_action(kentry_t *entry, kaction_t *action);
+bool_t kentry_add_actions(kentry_t *entry, kaction_t *action);
 ssize_t kentry_actions_len(const kentry_t *entry);
 kentry_actions_node_t *kentry_actions_iter(const kentry_t *entry);
 kaction_t *kentry_actions_each(kentry_actions_node_t **iter);

+ 16 - 16
klish/khelper.h

@@ -79,17 +79,17 @@
 	KSET(obj, bool_t, name)
 
 // Function to add object to list
-#define _KADD_NESTED(obj, nested) \
-	bool_t k##obj##_add_##nested(k##obj##_t *inst, k##nested##_t *subobj)
-#define KADD_NESTED(obj, nested) \
-	_KADD_NESTED(obj, nested) { \
+#define _KADD_NESTED(obj, type, nested) \
+	bool_t k##obj##_add_##nested(k##obj##_t *inst, type subobj)
+#define KADD_NESTED(obj, type, nested) \
+	_KADD_NESTED(obj, type, nested) { \
 	assert(inst); \
 	if (!inst) \
 		return BOOL_FALSE; \
 	assert(subobj); \
 	if (!subobj) \
 		return BOOL_FALSE; \
-	if (!faux_list_add(inst->nested##s, subobj)) \
+	if (!faux_list_add(inst->nested, subobj)) \
 		return BOOL_FALSE; \
 	return BOOL_TRUE; \
 }
@@ -127,40 +127,40 @@
 }
 
 #define _KNESTED_LEN(obj, nested) \
-	ssize_t k##obj##_##nested##s_len(const k##obj##_t *inst)
+	ssize_t k##obj##_##nested##_len(const k##obj##_t *inst)
 #define KNESTED_LEN(obj, nested) \
 	_KNESTED_LEN(obj, nested) { \
 	assert(inst); \
 	if (!inst) \
 		return -1; \
-	return faux_list_len(inst->nested##s); \
+	return faux_list_len(inst->nested); \
 }
 
 #define _KNESTED_IS_EMPTY(obj, nested) \
-	bool_t k##obj##_##nested##s_is_empty(const k##obj##_t *inst)
+	bool_t k##obj##_##nested##_is_empty(const k##obj##_t *inst)
 #define KNESTED_IS_EMPTY(obj, nested) \
 	_KNESTED_IS_EMPTY(obj, nested) { \
 	assert(inst); \
 	if (!inst) \
 		return -1; \
-	return faux_list_is_empty(inst->nested##s); \
+	return faux_list_is_empty(inst->nested); \
 }
 
 #define _KNESTED_ITER(obj, nested) \
-	k##obj##_##nested##s_node_t *k##obj##_##nested##s_iter(const k##obj##_t *inst)
+	k##obj##_##nested##_node_t *k##obj##_##nested##_iter(const k##obj##_t *inst)
 #define KNESTED_ITER(obj, nested) \
 	_KNESTED_ITER(obj, nested) { \
 	assert(inst); \
 	if (!inst) \
 		return NULL; \
-	return (k##obj##_##nested##s_node_t *)faux_list_head(inst->nested##s); \
+	return (k##obj##_##nested##_node_t *)faux_list_head(inst->nested); \
 }
 
-#define _KNESTED_EACH(obj, nested) \
-	k##nested##_t *k##obj##_##nested##s_each(k##obj##_##nested##s_node_t **iter)
-#define KNESTED_EACH(obj, nested) \
-	_KNESTED_EACH(obj, nested) { \
-	return (k##nested##_t *)faux_list_each((faux_list_node_t **)iter); \
+#define _KNESTED_EACH(obj, type, nested) \
+	type k##obj##_##nested##_each(k##obj##_##nested##_node_t **iter)
+#define KNESTED_EACH(obj, type, nested) \
+	_KNESTED_EACH(obj, type, nested) { \
+	return (type)faux_list_each((faux_list_node_t **)iter); \
 }
 
 

+ 1 - 1
klish/kparam.h

@@ -39,7 +39,7 @@ bool_t kparam_set_mode(kparam_t *param, kparam_mode_e mode);
 
 // PARAMs
 faux_list_t *kparam_params(const kparam_t *param);
-bool_t kparam_add_param(kparam_t *param, kparam_t *nested_param);
+bool_t kparam_add_params(kparam_t *param, kparam_t *nested_param);
 kparam_t *kparam_find_param(const kparam_t *param, const char *name);
 ssize_t kparam_params_len(const kparam_t *param);
 kparam_params_node_t *kparam_params_iter(const kparam_t *param);

+ 11 - 1
klish/kpargv.h

@@ -25,6 +25,7 @@ typedef struct kpargv_s kpargv_t;
 typedef struct kparg_s kparg_t;
 
 typedef faux_list_node_t kpargv_pargs_node_t;
+typedef faux_list_node_t kpargv_completions_node_t;
 
 
 C_DECL_BEGIN
@@ -56,16 +57,25 @@ bool_t kpargv_set_command(kpargv_t *pargv, const kentry_t *command);
 // Continuable
 bool_t kpargv_continuable(const kpargv_t *pargv);
 bool_t kpargv_set_continuable(kpargv_t *pargv, bool_t continuable);
+
 // Pargs
 faux_list_t *kpargv_pargs(const kpargv_t *pargv);
 ssize_t kpargv_pargs_len(const kpargv_t *pargv);
 bool_t kpargv_pargs_is_empty(const kpargv_t *pargv);
-bool_t kpargv_add_parg(kpargv_t *pargv, kparg_t *parg);
+bool_t kpargv_add_pargs(kpargv_t *pargv, kparg_t *parg);
 kpargv_pargs_node_t *kpargv_pargs_iter(const kpargv_t *pargv);
 kparg_t *kpargv_pargs_each(kpargv_pargs_node_t **iter);
 kparg_t *kpargv_pargs_last(const kpargv_t *pargv);
 kparg_t *kpargv_entry_exists(const kpargv_t *pargv, const void *entry);
 
+// Completions
+faux_list_t *kpargv_completions(const kpargv_t *pargv);
+bool_t kpargv_add_completions(kpargv_t *pargv, kentry_t *completion);
+ssize_t kpargv_completions_len(const kpargv_t *pargv);
+bool_t kpargv_compleions_is_empty(const kpargv_t *pargv);
+kpargv_completions_node_t *kpargv_completions_iter(const kpargv_t *pargv);
+kentry_t *kpargv_completions_each(kpargv_completions_node_t **iter);
+
 C_DECL_END
 
 #endif // _klish_kpargv_h

+ 1 - 1
klish/kplugin.h

@@ -61,7 +61,7 @@ int kplugin_fini(kplugin_t *plugin, kcontext_t *context);
 
 // SYMs
 faux_list_t *kplugin_syms(const kplugin_t *plugin);
-bool_t kplugin_add_sym(kplugin_t *plugin, ksym_t *sym);
+bool_t kplugin_add_syms(kplugin_t *plugin, ksym_t *sym);
 ksym_t *kplugin_find_sym(const kplugin_t *plugin, const char *name);
 ssize_t kplugin_syms_len(const kplugin_t *plugin);
 kplugin_syms_node_t *kplugin_syms_iter(const kplugin_t *plugin);

+ 1 - 1
klish/kptype.h

@@ -24,7 +24,7 @@ bool_t kptype_set_help(kptype_t *ptype, const char *help);
 
 // ACTIONs
 faux_list_t *kptype_actions(const kptype_t *ptype);
-bool_t kptype_add_action(kptype_t *plugin, kaction_t *action);
+bool_t kptype_add_actions(kptype_t *plugin, kaction_t *action);
 ssize_t kptype_actions_len(const kptype_t *plugin);
 kptype_actions_node_t *kptype_actions_iter(const kptype_t *plugin);
 kaction_t *kptype_actions_each(kptype_actions_node_t **iter);

+ 4 - 4
klish/kscheme.h

@@ -32,7 +32,7 @@ bool_t kscheme_fini(kscheme_t *scheme, kcontext_t *context, faux_error_t *error)
 
 // VIEWs
 faux_list_t *kscheme_views(const kscheme_t *scheme);
-bool_t kscheme_add_view(kscheme_t *scheme, kview_t *view);
+bool_t kscheme_add_views(kscheme_t *scheme, kview_t *view);
 kview_t *kscheme_find_view(const kscheme_t *scheme, const char *name);
 ssize_t kscheme_views_len(const kscheme_t *scheme);
 kscheme_views_node_t *kscheme_views_iter(const kscheme_t *scheme);
@@ -40,7 +40,7 @@ kview_t *kscheme_views_each(kscheme_views_node_t **iter);
 
 // PTYPEs
 faux_list_t *kscheme_ptypes(const kscheme_t *scheme);
-bool_t kscheme_add_ptype(kscheme_t *scheme, kptype_t *ptype);
+bool_t kscheme_add_ptypes(kscheme_t *scheme, kptype_t *ptype);
 kptype_t *kscheme_find_ptype(const kscheme_t *scheme, const char *name);
 ssize_t kscheme_ptypes_len(const kscheme_t *scheme);
 kscheme_ptypes_node_t *kscheme_ptypes_iter(const kscheme_t *scheme);
@@ -48,7 +48,7 @@ kptype_t *kscheme_ptypes_each(kscheme_ptypes_node_t **iter);
 
 // PLUGINs
 faux_list_t *kscheme_plugins(const kscheme_t *scheme);
-bool_t kscheme_add_plugin(kscheme_t *scheme, kplugin_t *plugin);
+bool_t kscheme_add_plugins(kscheme_t *scheme, kplugin_t *plugin);
 kplugin_t *kscheme_find_plugin(const kscheme_t *scheme, const char *name);
 ssize_t kscheme_plugins_len(const kscheme_t *scheme);
 kscheme_plugins_node_t *kscheme_plugins_iter(const kscheme_t *scheme);
@@ -57,7 +57,7 @@ kplugin_t *kscheme_plugins_each(kscheme_plugins_node_t **iter);
 // ENTRYs
 kentry_t *kscheme_find_entry_by_path(const kscheme_t *scheme, const char *name);
 faux_list_t *kscheme_entrys(const kscheme_t *scheme);
-bool_t kscheme_add_entry(kscheme_t *scheme, kentry_t *entry);
+bool_t kscheme_add_entrys(kscheme_t *scheme, kentry_t *entry);
 kentry_t *kscheme_find_entry(const kscheme_t *scheme, const char *name);
 ssize_t kscheme_entrys_len(const kscheme_t *scheme);
 kscheme_entrys_node_t *kscheme_entrys_iter(const kscheme_t *scheme);

+ 8 - 8
klish/kscheme/kcommand.c

@@ -31,18 +31,18 @@ KSET_STR(command, help);
 KGET(command, faux_list_t *, params);
 static KCMP_NESTED(command, param, name);
 static KCMP_NESTED_BY_KEY(command, param, name);
-KADD_NESTED(command, param);
+KADD_NESTED(command, kparam_t *, params);
 KFIND_NESTED(command, param);
-KNESTED_LEN(command, param);
-KNESTED_ITER(command, param);
-KNESTED_EACH(command, param);
+KNESTED_LEN(command, params);
+KNESTED_ITER(command, params);
+KNESTED_EACH(command, kparam_t *, params);
 
 // ACTION list
 KGET(command, faux_list_t *, actions);
-KADD_NESTED(command, action);
-KNESTED_LEN(command, action);
-KNESTED_ITER(command, action);
-KNESTED_EACH(command, action);
+KADD_NESTED(command, kaction_t *, actions);
+KNESTED_LEN(command, actions);
+KNESTED_ITER(command, actions);
+KNESTED_EACH(command, kaction_t *, actions);
 
 
 kcommand_t *kcommand_new(const char *name)

+ 9 - 9
klish/kscheme/kentry.c

@@ -86,19 +86,19 @@ KSET_BOOL(entry, order);
 KGET(entry, faux_list_t *, entrys);
 static KCMP_NESTED(entry, entry, name);
 static KCMP_NESTED_BY_KEY(entry, entry, name);
-KADD_NESTED(entry, entry);
+KADD_NESTED(entry, kentry_t *, entrys);
 KFIND_NESTED(entry, entry);
-KNESTED_LEN(entry, entry);
-KNESTED_IS_EMPTY(entry, entry);
-KNESTED_ITER(entry, entry);
-KNESTED_EACH(entry, entry);
+KNESTED_LEN(entry, entrys);
+KNESTED_IS_EMPTY(entry, entrys);
+KNESTED_ITER(entry, entrys);
+KNESTED_EACH(entry, kentry_t *, entrys);
 
 // ACTION list
 KGET(entry, faux_list_t *, actions);
-KADD_NESTED(entry, action);
-KNESTED_LEN(entry, action);
-KNESTED_ITER(entry, action);
-KNESTED_EACH(entry, action);
+KADD_NESTED(entry, kaction_t *, actions);
+KNESTED_LEN(entry, actions);
+KNESTED_ITER(entry, actions);
+KNESTED_EACH(entry, kaction_t *, actions);
 
 
 kentry_t *kentry_new(const char *name)

+ 3 - 3
klish/kscheme/kparam.c

@@ -44,10 +44,10 @@ KSET(param, kparam_mode_e, mode);
 KGET(param, faux_list_t *, params);
 static KCMP_NESTED(param, param, name);
 static KCMP_NESTED_BY_KEY(param, param, name);
-KADD_NESTED(param, param);
+KADD_NESTED(param, kparam_t *, params);
 KFIND_NESTED(param, param);
-KNESTED_ITER(param, param);
-KNESTED_EACH(param, param);
+KNESTED_ITER(param, params);
+KNESTED_EACH(param, kparam_t *, params);
 
 
 kparam_t *kparam_new(const char *name)

+ 4 - 4
klish/kscheme/kplugin.c

@@ -63,11 +63,11 @@ KSET(plugin, void *, udata);
 KGET(plugin, faux_list_t *, syms);
 static KCMP_NESTED(plugin, sym, name);
 static KCMP_NESTED_BY_KEY(plugin, sym, name);
-KADD_NESTED(plugin, sym);
+KADD_NESTED(plugin, ksym_t *, syms);
 KFIND_NESTED(plugin, sym);
-KNESTED_LEN(plugin, sym);
-KNESTED_ITER(plugin, sym);
-KNESTED_EACH(plugin, sym);
+KNESTED_LEN(plugin, syms);
+KNESTED_ITER(plugin, syms);
+KNESTED_EACH(plugin, ksym_t *, syms);
 
 
 kplugin_t *kplugin_new(const char *name)

+ 4 - 4
klish/kscheme/kptype.c

@@ -29,10 +29,10 @@ KSET_STR(ptype, help);
 
 // ACTION list
 KGET(ptype, faux_list_t *, actions);
-KADD_NESTED(ptype, action);
-KNESTED_LEN(ptype, action);
-KNESTED_ITER(ptype, action);
-KNESTED_EACH(ptype, action);
+KADD_NESTED(ptype, kaction_t *, actions);
+KNESTED_LEN(ptype, actions);
+KNESTED_ITER(ptype, actions);
+KNESTED_EACH(ptype, kaction_t *, actions);
 
 
 kptype_t *kptype_new(const char *name)

+ 16 - 16
klish/kscheme/kscheme.c

@@ -29,41 +29,41 @@ struct kscheme_s {
 KGET(scheme, faux_list_t *, plugins);
 KCMP_NESTED(scheme, plugin, name);
 KCMP_NESTED_BY_KEY(scheme, plugin, name);
-KADD_NESTED(scheme, plugin);
+KADD_NESTED(scheme, kplugin_t *, plugins);
 KFIND_NESTED(scheme, plugin);
-KNESTED_LEN(scheme, plugin);
-KNESTED_ITER(scheme, plugin);
-KNESTED_EACH(scheme, plugin);
+KNESTED_LEN(scheme, plugins);
+KNESTED_ITER(scheme, plugins);
+KNESTED_EACH(scheme, kplugin_t *, plugins);
 
 // PTYPE list
 KGET(scheme, faux_list_t *, ptypes);
 KCMP_NESTED(scheme, ptype, name);
 KCMP_NESTED_BY_KEY(scheme, ptype, name);
-KADD_NESTED(scheme, ptype);
+KADD_NESTED(scheme, kptype_t *, ptypes);
 KFIND_NESTED(scheme, ptype);
-KNESTED_LEN(scheme, ptype);
-KNESTED_ITER(scheme, ptype);
-KNESTED_EACH(scheme, ptype);
+KNESTED_LEN(scheme, ptypes);
+KNESTED_ITER(scheme, ptypes);
+KNESTED_EACH(scheme, kptype_t *, ptypes);
 
 // VIEW list
 KGET(scheme, faux_list_t *, views);
 KCMP_NESTED(scheme, view, name);
 KCMP_NESTED_BY_KEY(scheme, view, name);
-KADD_NESTED(scheme, view);
+KADD_NESTED(scheme, kview_t *, views);
 KFIND_NESTED(scheme, view);
-KNESTED_LEN(scheme, view);
-KNESTED_ITER(scheme, view);
-KNESTED_EACH(scheme, view);
+KNESTED_LEN(scheme, views);
+KNESTED_ITER(scheme, views);
+KNESTED_EACH(scheme, kview_t *, views);
 
 // ENTRY list
 KGET(scheme, faux_list_t *, entrys);
 KCMP_NESTED(scheme, entry, name);
 KCMP_NESTED_BY_KEY(scheme, entry, name);
-KADD_NESTED(scheme, entry);
+KADD_NESTED(scheme, kentry_t *, entrys);
 KFIND_NESTED(scheme, entry);
-KNESTED_LEN(scheme, entry);
-KNESTED_ITER(scheme, entry);
-KNESTED_EACH(scheme, entry);
+KNESTED_LEN(scheme, entrys);
+KNESTED_ITER(scheme, entrys);
+KNESTED_EACH(scheme, kentry_t *, entrys);
 
 
 kscheme_t *kscheme_new(void)

+ 8 - 8
klish/kscheme/kview.c

@@ -27,18 +27,18 @@ KGET_STR(view, name);
 KGET(view, faux_list_t *, commands);
 KCMP_NESTED(view, command, name);
 KCMP_NESTED_BY_KEY(view, command, name);
-KADD_NESTED(view, command);
+KADD_NESTED(view, kcommand_t *, commands);
 KFIND_NESTED(view, command);
-KNESTED_LEN(view, command);
-KNESTED_ITER(view, command);
-KNESTED_EACH(view, command);
+KNESTED_LEN(view, commands);
+KNESTED_ITER(view, commands);
+KNESTED_EACH(view, kcommand_t *, commands);
 
 // NSPACE list
 KGET(view, faux_list_t *, nspaces);
-KADD_NESTED(view, nspace);
-KNESTED_LEN(view, nspace);
-KNESTED_ITER(view, nspace);
-KNESTED_EACH(view, nspace);
+KADD_NESTED(view, knspace_t *, nspaces);
+KNESTED_LEN(view, nspaces);
+KNESTED_ITER(view, nspaces);
+KNESTED_EACH(view, knspace_t *, nspaces);
 
 
 kview_t *kview_new(const char *name)

+ 14 - 5
klish/ksession/kpargv.c

@@ -13,6 +13,7 @@
 
 struct kpargv_s {
 	faux_list_t *pargs;
+	faux_list_t *completions;
 	kpargv_status_e status; // Parse status
 	size_t level; // Number of path's level where command was found
 	const kentry_t *command; // ENTRY that consider as command (has ACTIONs)
@@ -37,11 +38,19 @@ KSET_BOOL(pargv, continuable);
 
 // Pargs
 KGET(pargv, faux_list_t *, pargs);
-KADD_NESTED(pargv, parg);
-KNESTED_LEN(pargv, parg);
-KNESTED_IS_EMPTY(pargv, parg);
-KNESTED_ITER(pargv, parg);
-KNESTED_EACH(pargv, parg);
+KADD_NESTED(pargv, kparg_t *, pargs);
+KNESTED_LEN(pargv, pargs);
+KNESTED_IS_EMPTY(pargv, pargs);
+KNESTED_ITER(pargv, pargs);
+KNESTED_EACH(pargv, kparg_t *, pargs);
+
+// Completions
+KGET(pargv, faux_list_t *, completions);
+KADD_NESTED(pargv, kentry_t *, completions);
+KNESTED_LEN(pargv, completions);
+KNESTED_IS_EMPTY(pargv, completions);
+KNESTED_ITER(pargv, completions);
+KNESTED_EACH(pargv, kentry_t *, completions);
 
 
 int kpargv_pargs_kcompare(const void *key, const void *list_item)

+ 1 - 1
klish/ksession/ksession_parse.c

@@ -65,7 +65,7 @@ static kpargv_status_e ksession_parse_arg(kentry_t *current_entry,
 		const char *current_arg = faux_argv_current(*argv_iter);
 		if (ksession_validate_arg(entry, current_arg)) {
 			kparg_t *parg = kparg_new(entry, current_arg);
-			kpargv_add_parg(pargv, parg);
+			kpargv_add_pargs(pargv, parg);
 			// Command is an ENTRY with ACTIONs or NAVigation
 			if (kentry_actions_len(entry) > 0)
 				kpargv_set_command(pargv, entry);

+ 1 - 1
klish/ksession/kustore.c

@@ -18,7 +18,7 @@ struct kustore_s {
 // User data blobs list
 KCMP_NESTED(ustore, udata, name);
 KCMP_NESTED_BY_KEY(ustore, udata, name);
-KADD_NESTED(ustore, udata);
+KADD_NESTED(ustore, kudata_t *, udatas);
 KFIND_NESTED(ustore, udata);
 
 

+ 1 - 1
klish/kustore.h

@@ -16,7 +16,7 @@ C_DECL_BEGIN
 kustore_t *kustore_new();
 void kustore_free(kustore_t *ustore);
 
-bool_t kustore_add_udata(kustore_t *ustore, kudata_t *udata);
+bool_t kustore_add_udatas(kustore_t *ustore, kudata_t *udata);
 kudata_t *kustore_find_udata(const kustore_t *ustore, const char *name);
 
 // Helper functions for easy access to udata entries

+ 2 - 2
klish/kview.h

@@ -31,7 +31,7 @@ const char *kview_name(const kview_t *view);
 
 // COMMANDs
 faux_list_t *kview_commands(const kview_t *view);
-bool_t kview_add_command(kview_t *view, kcommand_t *command);
+bool_t kview_add_commands(kview_t *view, kcommand_t *command);
 kcommand_t *kview_find_command(const kview_t *view, const char *name);
 ssize_t kview_commands_len(const kview_t *view);
 kview_commands_node_t *kview_commands_iter(const kview_t *view);
@@ -39,7 +39,7 @@ kcommand_t *kview_commands_each(kview_commands_node_t **iter);
 
 // NAMESPACEs
 faux_list_t *kview_nspaces(const kview_t *view);
-bool_t kview_add_nspace(kview_t *view, knspace_t *nspace);
+bool_t kview_add_nspaces(kview_t *view, knspace_t *nspace);
 ssize_t kview_nspaces_len(const kview_t *view);
 kview_nspaces_node_t *kview_nspaces_iter(const kview_t *view);
 knspace_t *kview_nspaces_each(kview_nspaces_node_t **iter);

+ 12 - 12
klish/xml-helper/load.c

@@ -349,7 +349,7 @@ static bool_t process_view(const kxml_node_t *element, void *parent,
 		view = iview_load(&iview, error);
 		if (!view)
 			goto err;
-		if (!kscheme_add_view(scheme, view)) {
+		if (!kscheme_add_views(scheme, view)) {
 			faux_error_sprintf(error, TAG": Can't add VIEW \"%s\". "
 				"Probably duplication",
 				kview_name(view));
@@ -391,7 +391,7 @@ static bool_t process_ptype(const kxml_node_t *element, void *parent,
 	if (!ptype)
 		goto err;
 
-	if (!kscheme_add_ptype((kscheme_t *)parent, ptype)) {
+	if (!kscheme_add_ptypes((kscheme_t *)parent, ptype)) {
 		faux_error_sprintf(error, TAG": Can't add PTYPE \"%s\". "
 			"Probably duplication",
 			kptype_name(ptype));
@@ -435,7 +435,7 @@ static bool_t process_plugin(const kxml_node_t *element, void *parent,
 	if (!plugin)
 		goto err;
 
-	if (!kscheme_add_plugin((kscheme_t *)parent, plugin)) {
+	if (!kscheme_add_plugins((kscheme_t *)parent, plugin)) {
 		faux_error_sprintf(error, TAG": Can't add PLUGIN \"%s\". "
 			"Probably duplication",
 			kplugin_name(plugin));
@@ -496,7 +496,7 @@ static bool_t process_param(const kxml_node_t *element, void *parent,
 
 	if (KTAG_COMMAND == parent_tag) {
 		kcommand_t *command = (kcommand_t *)parent;
-		if (!kcommand_add_param(command, param)) {
+		if (!kcommand_add_params(command, param)) {
 			faux_error_sprintf(error,
 				TAG": Can't add PARAM \"%s\" to COMMAND \"%s\". "
 				"Probably duplication",
@@ -511,7 +511,7 @@ static bool_t process_param(const kxml_node_t *element, void *parent,
 		(KTAG_MULTI == parent_tag)
 		) {
 		kparam_t *parent_param = (kparam_t *)parent;
-		if (!kparam_add_param(parent_param, param)) {
+		if (!kparam_add_params(parent_param, param)) {
 			faux_error_sprintf(error,
 				TAG": Can't add PARAM \"%s\" to PARAM \"%s\". "
 				"Probably duplication",
@@ -563,7 +563,7 @@ static bool_t process_command(const kxml_node_t *element, void *parent,
 	if (!command)
 		goto err;
 
-	if (!kview_add_command((kview_t *)parent, command)) {
+	if (!kview_add_commands((kview_t *)parent, command)) {
 		faux_error_sprintf(error, TAG": Can't add COMMAND \"%s\". "
 			"Probably duplication",
 			kcommand_name(command));
@@ -605,7 +605,7 @@ static bool_t process_action(const kxml_node_t *element, void *parent,
 
 	if (KTAG_COMMAND == parent_tag) {
 		kcommand_t *command = (kcommand_t *)parent;
-		if (!kcommand_add_action(command, action)) {
+		if (!kcommand_add_actions(command, action)) {
 			faux_error_sprintf(error,
 				TAG": Can't add ACTION #%d to COMMAND \"%s\". "
 				"Probably duplication",
@@ -616,7 +616,7 @@ static bool_t process_action(const kxml_node_t *element, void *parent,
 		}
 	} else if (KTAG_PTYPE == parent_tag) {
 		kptype_t *ptype = (kptype_t *)parent;
-		if (!kptype_add_action(ptype, action)) {
+		if (!kptype_add_actions(ptype, action)) {
 			faux_error_sprintf(error,
 				TAG": Can't add ACTION #%d to PTYPE \"%s\". "
 				"Probably duplication",
@@ -627,7 +627,7 @@ static bool_t process_action(const kxml_node_t *element, void *parent,
 		}
 	} else if (KTAG_ENTRY == parent_tag) {
 		kentry_t *entry = (kentry_t *)parent;
-		if (!kentry_add_action(entry, action)) {
+		if (!kentry_add_actions(entry, action)) {
 			faux_error_sprintf(error,
 				TAG": Can't add ACTION #%d to ENTRY \"%s\". "
 				"Probably duplication",
@@ -683,7 +683,7 @@ static bool_t process_nspace(const kxml_node_t *element, void *parent,
 	if (!nspace)
 		goto err;
 
-	if (!kview_add_nspace((kview_t *)parent, nspace)) {
+	if (!kview_add_nspaces((kview_t *)parent, nspace)) {
 		faux_error_sprintf(error, TAG": Can't add NSPACE \"%s\". ",
 			knspace_view_ref(nspace));
 		knspace_free(nspace);
@@ -753,7 +753,7 @@ static bool_t process_entry(const kxml_node_t *element, void *parent,
 			entry = ientry_load(&ientry, error);
 			if (!entry)
 				goto err;
-			if (!kscheme_add_entry((kscheme_t *)parent, entry)) {
+			if (!kscheme_add_entrys((kscheme_t *)parent, entry)) {
 				faux_error_sprintf(error, TAG": Can't add entry \"%s\". "
 					"Probably duplication",
 					kentry_name(entry));
@@ -772,7 +772,7 @@ static bool_t process_entry(const kxml_node_t *element, void *parent,
 			if (!entry)
 				goto err;
 			kentry_set_parent(entry, parent_entry);
-			if (!kentry_add_entry(parent_entry, entry)) {
+			if (!kentry_add_entrys(parent_entry, entry)) {
 				faux_error_sprintf(error, TAG": Can't add entry \"%s\". "
 					"Probably duplication",
 					kentry_name(entry));

+ 1 - 1
plugins/klish/plugin_init.c

@@ -25,7 +25,7 @@ int kplugin_klish_init(kcontext_t *context)
 	plugin = kcontext_plugin(context);
 	assert(plugin);
 
-	kplugin_add_sym(plugin, ksym_new("nop", klish_nop));
+	kplugin_add_syms(plugin, ksym_new("nop", klish_nop));
 
 //	fprintf(stderr, "Plugin 'klish' init\n");
 	context = context; // Happy compiler