mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-27 11:52:03 +00:00
44 lines
414 B
C
44 lines
414 B
C
#include <u.h>
|
|
#include <libc.h>
|
|
#include <ip.h>
|
|
|
|
|
|
void
|
|
hnputl(void *p, uint v)
|
|
{
|
|
uchar *a;
|
|
|
|
a = p;
|
|
a[0] = v>>24;
|
|
a[1] = v>>16;
|
|
a[2] = v>>8;
|
|
a[3] = v;
|
|
}
|
|
|
|
void
|
|
hnputs(void *p, ushort v)
|
|
{
|
|
uchar *a;
|
|
|
|
a = p;
|
|
a[0] = v>>8;
|
|
a[1] = v;
|
|
}
|
|
|
|
uint
|
|
nhgetl(void *p)
|
|
{
|
|
uchar *a;
|
|
|
|
a = p;
|
|
return (a[0]<<24)|(a[1]<<16)|(a[2]<<8)|(a[3]<<0);
|
|
}
|
|
|
|
ushort
|
|
nhgets(void *p)
|
|
{
|
|
uchar *a;
|
|
|
|
a = p;
|
|
return (a[0]<<8)|(a[1]<<0);
|
|
}
|