From 66209ac0fe8e09e2919783035e8183413a906567 Mon Sep 17 00:00:00 2001 From: rsc Date: Sun, 26 Dec 2004 23:42:38 +0000 Subject: changes from plan 9 --- src/libip/bo.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/libip/bo.c') diff --git a/src/libip/bo.c b/src/libip/bo.c index 54675d8c..95fc5f8d 100644 --- a/src/libip/bo.c +++ b/src/libip/bo.c @@ -2,6 +2,21 @@ #include #include +void +hnputv(void *p, uvlong v) +{ + uchar *a; + + a = p; + a[0] = v>>56; + a[1] = v>>48; + a[2] = v>>40; + a[3] = v>>32; + a[4] = v>>24; + a[5] = v>>16; + a[6] = v>>8; + a[7] = v; +} void hnputl(void *p, uint v) @@ -25,6 +40,24 @@ hnputs(void *p, ushort v) a[1] = v; } +uvlong +nhgetv(void *p) +{ + uchar *a; + uvlong v; + + a = p; + v = (uvlong)a[0]<<56; + v |= (uvlong)a[1]<<48; + v |= (uvlong)a[2]<<40; + v |= (uvlong)a[3]<<32; + v |= a[4]<<24; + v |= a[5]<<16; + v |= a[6]<<8; + v |= a[7]<<0; + return v; +} + uint nhgetl(void *p) { -- cgit v1.2.3