summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorslioch <slioch@eng-140.vyatta.com>2009-10-22 15:36:22 -0700
committerslioch <slioch@eng-140.vyatta.com>2009-10-22 15:36:22 -0700
commitee4800de96b1fb561a1e3f612814784891b4c468 (patch)
tree7b67c566eca648d7284112a35247d065a2a09803 /src
parenta5e5ddbbc35fca7a33e2c14d7e4b2e068e01da51 (diff)
downloadvyatta-cfg-ee4800de96b1fb561a1e3f612814784891b4c468.tar.gz
vyatta-cfg-ee4800de96b1fb561a1e3f612814784891b4c468.zip
activate priority values from node.def. priority file is now no longer used and should be considered depricated.
Diffstat (limited to 'src')
-rw-r--r--src/commit2.c14
-rw-r--r--src/common/defs.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/commit2.c b/src/commit2.c
index 90c2846..5f52aa2 100644
--- a/src/commit2.c
+++ b/src/commit2.c
@@ -618,7 +618,7 @@ sort_func(GNode *node, gpointer data, boolean priority_mode)
}
if (priority_mode) {
- if (((struct VyattaNode*)gp)->_priority < LOWEST_PRIORITY) { //only if priority is specified.
+ if (((struct VyattaNode*)gp)->_config._priority < LOWEST_PRIORITY) { //only if priority is specified.
//unlink from original tree
g_node_unlink(node);
@@ -626,9 +626,9 @@ sort_func(GNode *node, gpointer data, boolean priority_mode)
GNode *sibling = root_node->children;
//now iterate through siblings of root_node and compare priority
- while (sibling != NULL && ((struct VyattaNode*)gp)->_priority > ((struct VyattaNode*)(sibling->data))->_priority) {
+ while (sibling != NULL && ((struct VyattaNode*)gp)->_config._priority > ((struct VyattaNode*)(sibling->data))->_config._priority) {
sibling = sibling->next;
- if (sibling == NULL || ((struct VyattaNode*)gp)->_priority < ((struct VyattaNode*)(sibling->data))->_priority) {
+ if (sibling == NULL || ((struct VyattaNode*)gp)->_config._priority < ((struct VyattaNode*)(sibling->data))->_config._priority) {
break;
}
}
@@ -636,10 +636,10 @@ sort_func(GNode *node, gpointer data, boolean priority_mode)
if (g_debug) {
int pri = LOWEST_PRIORITY;
if (sibling != NULL) {
- pri = ((struct VyattaNode*)(sibling->data))->_priority;
+ pri = ((struct VyattaNode*)(sibling->data))->_config._priority;
}
- printf("commit2::sort_func(): inserting %s into transaction, priority: %d BEFORE %d\n", ((struct VyattaNode*)gp)->_data._name, ((struct VyattaNode*)gp)->_priority, pri);
- syslog(LOG_DEBUG,"commit2::sort_func(): inserting %s into transaction, priority: %d BEFORE %d\n", ((struct VyattaNode*)gp)->_data._name, ((struct VyattaNode*)gp)->_priority, pri);
+ printf("commit2::sort_func(): inserting %s into transaction, priority: %d BEFORE %d\n", ((struct VyattaNode*)gp)->_data._name, ((struct VyattaNode*)gp)->_config._priority, pri);
+ syslog(LOG_DEBUG,"commit2::sort_func(): inserting %s into transaction, priority: %d BEFORE %d\n", ((struct VyattaNode*)gp)->_data._name, ((struct VyattaNode*)gp)->_config._priority, pri);
}
g_node_insert_before(root_node,sibling,new_node);
}
@@ -793,7 +793,7 @@ dump_func(GNode *node, gpointer data)
for (i = 0; i < depth; ++i) {
fprintf(out," ");
}
- fprintf(out,"%s (t: %d, p: %d,%d)", ((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_config._def.def_type,((struct VyattaNode*)gp)->_priority,((struct VyattaNode*)gp)->_config._priority);
+ fprintf(out,"%s (t: %d, p: %d,%d)", ((struct VyattaNode*)gp)->_data._name,((struct VyattaNode*)gp)->_config._def.def_type,((struct VyattaNode*)gp)->_config._priority,((struct VyattaNode*)gp)->_config._priority);
if (((struct VyattaNode*)gp)->_data._value == TRUE) {
fprintf(out," [VALUE]");
}
diff --git a/src/common/defs.h b/src/common/defs.h
index 5fee3ca..dbe664f 100644
--- a/src/common/defs.h
+++ b/src/common/defs.h
@@ -54,7 +54,7 @@ remove _actions and rely on def in the future.
struct Config
{
boolean _multi;
- unsigned long _priority;
+ int _priority;
vtw_def _def; //keep this here
char* _help;
char* _default;