aboutsummaryrefslogtreecommitdiff
path: root/slof/fs/node.fs
diff options
context:
space:
mode:
authorNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-08-16 13:48:24 +0530
committerNikunj A Dadhania <nikunj@linux.vnet.ibm.com>2013-08-21 10:49:58 +0530
commit85b0956ddb46c1461c32505f7ebedd44a1fed4c7 (patch)
tree7a8e3f783f0ce2f4ba7c5f4b0f5e65b2a012fe67 /slof/fs/node.fs
parent5a75cd882e352d033e582a35160198153d842347 (diff)
downloadSLOF-85b0956ddb46c1461c32505f7ebedd44a1fed4c7.zip
SLOF-85b0956ddb46c1461c32505f7ebedd44a1fed4c7.tar.gz
SLOF-85b0956ddb46c1461c32505f7ebedd44a1fed4c7.tar.bz2
Move hex64-{decode,encode}-unit to node.fs
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'slof/fs/node.fs')
-rw-r--r--slof/fs/node.fs22
1 files changed, 22 insertions, 0 deletions
diff --git a/slof/fs/node.fs b/slof/fs/node.fs
index 73aa75c..1b18dee 100644
--- a/slof/fs/node.fs
+++ b/slof/fs/node.fs
@@ -479,6 +479,28 @@ CREATE user-instance-units 4 cells allot
: hex-encode-unit ( addr.lo ... addr.hi ncells -- str len )
base @ >r hex generic-encode-unit r> base ! ;
+: hex64-decode-unit ( str len ncells -- addr.lo ... addr.hi )
+ dup 2 <> IF
+ hex-decode-unit
+ ELSE
+ drop
+ base @ >r hex
+ $number IF 0 0 ELSE xlsplit THEN
+ r> base !
+ THEN
+;
+
+: hex64-encode-unit ( addr.lo ... addr.hi ncells -- str len )
+ dup 2 <> IF
+ hex-encode-unit
+ ELSE
+ drop
+ base @ >r hex
+ lxjoin (u.)
+ r> base !
+ THEN
+;
+
: handle-leading-/ ( path len -- path' len' )
dup IF over c@ [char] / = IF 1 /string device-tree @ set-node THEN THEN ;
: match-name ( name len node -- match? )