diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-09-26 17:06:51 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2003-09-26 17:06:51 +0000 |
commit | 67ce320dce77dce7fd440c5b372c9af25b9e491c (patch) | |
tree | f505b5e8aa51fe872019f86114e8392be04f06cf | |
parent | 237f35a919f78508b7fbbc53a554500a22728fff (diff) |
put 64bit macros/functions documentation back.
-rw-r--r-- | lib/libc/net/byteorder.3 | 23 | ||||
-rw-r--r-- | sys/sys/endian.h | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/lib/libc/net/byteorder.3 b/lib/libc/net/byteorder.3 index 19be4d22285..54123455c6d 100644 --- a/lib/libc/net/byteorder.3 +++ b/lib/libc/net/byteorder.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: byteorder.3,v 1.12 2003/09/26 16:50:14 millert Exp $ +.\" $OpenBSD: byteorder.3,v 1.13 2003/09/26 17:06:50 fgsch Exp $ .\" .\" Copyright (c) 1983, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -35,14 +35,19 @@ .Nm htons , .Nm ntohl , .Nm ntohs , +.Nm htobe64 , .Nm htobe32 , .Nm htobe16 , +.Nm betoh64 , .Nm betoh32 , .Nm betoh16 , +.Nm htole64 , .Nm htole32 , .Nm htole16 , +.Nm letoh64 , .Nm letoh32 , .Nm letoh16 , +.Nm swap64 , .Nm swap32 , .Nm swap16 .Nd convert values between different byte orderings @@ -56,28 +61,38 @@ .Fn ntohl "u_int32_t net32" .Ft u_int16_t .Fn ntohs "u_int16_t net16" +.Ft u_int64_t +.Fn htobe64 "u_int64_t host64" .Ft u_int32_t .Fn htobe32 "u_int32_t host32" .Ft u_int16_t .Fn htobe16 "u_int16_t host16" +.Ft u_int64_t +.Fn betoh64 "u_int64_t big64" .Ft u_int32_t .Fn betoh32 "u_int32_t big32" .Ft u_int16_t .Fn betoh16 "u_int16_t big16" +.Ft u_int64_t +.Fn htole64 "u_int64_t host64" .Ft u_int32_t .Fn htole32 "u_int32_t host32" .Ft u_int16_t .Fn htole16 "u_int16_t host16" +.Ft u_int64_t +.Fn letoh64 "u_int64_t little64" .Ft u_int32_t .Fn letoh32 "u_int32_t little32" .Ft u_int16_t .Fn letoh16 "u_int16_t little16" +.Ft u_int64_t +.Fn swap64 "u_int32_t val64" .Ft u_int32_t .Fn swap32 "u_int32_t val32" .Ft u_int16_t .Fn swap16 "u_int16_t val16" .Sh DESCRIPTION -These routines convert 16- and 32-bit quantities between different +These routines convert 16, 32 and 64-bit quantities between different byte orderings. The .Dq swap @@ -116,6 +131,8 @@ Short (16-bit, used in conjunction with forms involving 16-bit. .It 32 32-bit. +.It 64 +64-bit. .El .Pp The swap functions are of the form: swap{size}. @@ -148,7 +165,7 @@ The functions involving either or .Dq swap use the numbers -16 and 32 for specifying the bitwidth of the quantities they operate on. +16, 32 and 64 for specifying the bitwidth of the quantities they operate on. Currently all supported architectures are either big- or little-endian so either the .Dq be diff --git a/sys/sys/endian.h b/sys/sys/endian.h index 78d2d5d6906..b617ea287db 100644 --- a/sys/sys/endian.h +++ b/sys/sys/endian.h @@ -1,4 +1,4 @@ -/* $OpenBSD: endian.h,v 1.12 2003/09/21 18:11:26 fgsch Exp $ */ +/* $OpenBSD: endian.h,v 1.13 2003/09/26 17:06:50 fgsch Exp $ */ /*- * Copyright (c) 1997 Niklas Hallqvist. All rights reserved. @@ -150,13 +150,17 @@ } while (0) __BEGIN_DECLS +u_int64_t htobe64(u_int64_t); u_int32_t htobe32(u_int32_t); u_int16_t htobe16(u_int16_t); +u_int64_t betoh64(u_int64_t); u_int32_t betoh32(u_int32_t); u_int16_t betoh16(u_int16_t); +u_int64_t htole64(u_int64_t); u_int32_t htole32(u_int32_t); u_int16_t htole16(u_int16_t); +u_int64_t letoh64(u_int64_t); u_int32_t letoh32(u_int32_t); u_int16_t letoh16(u_int16_t); __END_DECLS |