|
From: <ted...@us...> - 2011-11-01 18:20:38
|
Revision: 1840
http://frontierkernel.svn.sourceforge.net/frontierkernel/?rev=1840&view=rev
Author: tedchoward
Date: 2011-11-01 18:20:30 +0000 (Tue, 01 Nov 2011)
Log Message:
-----------
Made the odb nodeType table search recursive
A common occurrance is for the nodeType table to be stored in an
external tool and it's address is stored in the searched paths. The
lookup function now will continue to call itself as long as the
valueType returned is addressvaluetype.
Signed-off-by: Ted C. Howard <te...@te...>
Modified Paths:
--------------
Frontier/trunk/Common/source/opicons.c
Modified: Frontier/trunk/Common/source/opicons.c
===================================================================
--- Frontier/trunk/Common/source/opicons.c 2011-11-01 18:20:18 UTC (rev 1839)
+++ Frontier/trunk/Common/source/opicons.c 2011-11-01 18:20:30 UTC (rev 1840)
@@ -141,11 +141,25 @@
boolean opgetnodetypetableadr(bigstring bsnodetype, bigstring bsadrnodepath) {
//user.tools.nodeTypes.[type]
//Frontier.tools.data.nodeTypes.[type]
+ boolean fllookup = false;
- bigstring bsname;
copystring(BIGSTRING("\x15" "user.tools.nodeTypes."), bsadrnodepath);
pushstring(bsnodetype, bsadrnodepath);
+ fllookup = resolveHashTable(bsnodetype, bsadrnodepath);
+
+ if (!fllookup) {
+ copystring(BIGSTRING("\x1E" "Frontier.tools.data.nodeTypes."), bsadrnodepath);
+ pushstring(bsnodetype, bsadrnodepath);
+
+ fllookup = resolveHashTable(bsnodetype, bsadrnodepath);
+ }
+
+ return fllookup;
+}
+
+boolean resolveHashTable(bigstring bsnodetype, bigstring bsadrnodepath) {
+ bigstring bsname;
hdlhashtable ht;
hdlhashnode hn;
tyvaluerecord iconvalue;
@@ -161,20 +175,10 @@
pophashtable ();
fllookup = hashtablelookup (ht, bsnodetype, &iconvalue, &hn);
-
- if (!fllookup) {
- copystring(BIGSTRING("\x1E" "Frontier.tools.data.nodeTypes."), bsadrnodepath);
- pushstring(bsnodetype, bsadrnodepath);
-
- pushhashtable (roottable);
-
- disablelangerror ();
-
- flexpanded = langexpandtodotparams (bsadrnodepath, &ht, bsname);
- enablelangerror ();
- pophashtable ();
-
- fllookup = hashtablelookup (ht, bsnodetype, &iconvalue, &hn);
+
+ if (fllookup && iconvalue.valuetype == addressvaluetype) {
+ copystring(*iconvalue.data.stringvalue, bsadrnodepath);
+ return resolveHashTable(bsnodetype, bsadrnodepath);
}
return fllookup;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|