le16get, le24get, le32get, le64get, le16put, le24put, le32put, le64put, be16get, be24get, be32get, be64get, be16put, be24put, be32put, be64put– integer marshalling

SYNOPSIS

u16int le16get(uchar *t,    uchar **r)

u32int le24get(uchar *t,    uchar **r)

u32int le32get(uchar *t,    uchar **r)

u64int le64get(uchar *t,    uchar **r)

uchar* le16put(uchar *t, u16int i)

uchar* le24put(uchar *t, u32int i)

uchar* le32put(uchar *t, u32int i)

uchar* le64put(uchar *t, u64int i)

u16int be16get(uchar *t,    uchar **r)

u32int be24get(uchar *t,    uchar **r)

u32int be32get(uchar *t,    uchar **r)

u64int be64get(uchar *t,    uchar **r)

uchar* be16put(uchar *t, u16int i)

uchar* be24put(uchar *t, u32int i)

uchar* be32put(uchar *t, u32int i)

uchar* be64put(uchar *t, u64int i)

DESCRIPTION
These functions marshal a 2– to 8–byte integer to or from little– or big–endian formats. The put functions return the pointer to the first byte after the integer. The get functions return the value, and if r is not nil they set *r to point at the first byte after the integer.

SOURCE
/sys/src/libc/port/beget.c
/sys/src/libc/port/leget.c

SEE ALSO
fcall(2), ip(2)

BUGS
GBIT* and PBIT* (from fcall(2)) provide similar functionality for little–endian integers. The nhget* and nhput* functions from ip(2) provide similar functionality for big–endian integers.
Copyright © 2024 Plan 9 Foundation. All rights reserved.