123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- .TH LEGET 2
- le16get, le24get, le32get, le64get, le16put, le24put, le32put, le64put, be16get, be24get, be32get, be64get, be16put, be24put, be32put, be64put\- integer marshalling
- .SH SYNOPSIS
- .ta +\w'\fLuvlong 'u
- .PP
- .nf
- .B
- u16int le16get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u32int le24get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u32int le32get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u64int le64get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- uchar* le16put(uchar *t, u16int i)
- .PP
- .nf
- .B
- uchar* le24put(uchar *t, u32int i)
- .PP
- .nf
- .B
- uchar* le32put(uchar *t, u32int i)
- .PP
- .nf
- .B
- uchar* le64put(uchar *t, u64int i)
- .PP
- .nf
- .B
- u16int be16get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u32int be24get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u32int be32get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- u64int be64get(uchar *t, uchar **r)
- .PP
- .nf
- .B
- uchar* be16put(uchar *t, u16int i)
- .PP
- .nf
- .B
- uchar* be24put(uchar *t, u32int i)
- .PP
- .nf
- .B
- uchar* be32put(uchar *t, u32int i)
- .PP
- .nf
- .B
- uchar* be64put(uchar *t, u64int i)
- .PP
- .SH DESCRIPTION
- These functions marshal a 2- to 8-byte integer to
- or from little- or big-endian formats. The
- .I put
- functions return the
- pointer to the first byte after the integer. The
- .I get
- functions return the value, and if
- .B r
- is not
- .I nil
- they set
- .B *r
- to point at the first byte after the integer.
- .SH SOURCE
- .B /sys/src/libc/port/beget.c
- .br
- .B /sys/src/libc/port/leget.c
- .SH "SEE ALSO"
- .IR fcall (2),
- .IR ip (2)
- .SH BUGS
- .IR GBIT *
- and
- .IR PBIT *
- (from
- .IR fcall (2))
- provide similar functionality for little-endian integers.
- The
- .IR nhget *
- and
- .IR nhput *
- functions from
- .IR ip (2)
- provide similar functionality for big-endian integers.
|