Browse Source

Implement konf_tree__get_line(), fix normalize_seq() function.

git-svn-id: https://klish.googlecode.com/svn/trunk@160 0eaa4687-2ee9-07dd-09d9-bcdd2d2dd5fb
Serj Kalichev 13 years ago
parent
commit
4d2a9696ac
3 changed files with 10 additions and 0 deletions
  1. 1 0
      konf/query/query.c
  2. 1 0
      konf/tree.h
  3. 8 0
      konf/tree/tree.c

+ 1 - 0
konf/query/query.c

@@ -61,6 +61,7 @@ void konf_query_dump(konf_query_t *query)
 	printf("pattern=%s\n", query->pattern);
 	printf("priority=%u\n", query->priority);
 	printf("sequence=%u\n", query->seq);
+	printf("seq_num=%u\n", query->seq_num);
 	printf("line=%s\n", query->line);
 	printf("path=%s\n", query->path);
 	printf("pwdc=%u\n", query->pwdc);

+ 1 - 0
konf/tree.h

@@ -61,6 +61,7 @@ unsigned short konf_tree__get_seq_num(const konf_tree_t * instance);
 void konf_tree__set_seq_num(konf_tree_t * instance, unsigned short seq_num);
 unsigned short konf_tree__get_sub_num(const konf_tree_t * instance);
 void konf_tree__set_sub_num(konf_tree_t * instance, unsigned short sub_num);
+const char * konf_tree__get_line(const konf_tree_t * instance);
 
 #endif				/* _konf_tree_h */
 /** @} clish_conf */

+ 8 - 0
konf/tree/tree.c

@@ -203,6 +203,7 @@ static int normalize_seq(konf_tree_t * this, unsigned short priority)
 			continue;
 		konf_tree__set_seq_num(conf, seq_cnt++);
 		konf_tree__set_sub_num(conf, KONF_ENTRY_OK);
+		lub_bintree_iterator_init(&iter, &this->tree, conf);
 	} while ((conf = lub_bintree_iterator_next(&iter)));
 
 	return 0;
@@ -345,3 +346,10 @@ void konf_tree__set_sub_num(konf_tree_t * this, unsigned short sub_num)
 {
 	this->sub_num = sub_num;
 }
+
+/*--------------------------------------------------------- */
+const char * konf_tree__get_line(const konf_tree_t * this)
+{
+	return this->line;
+}
+