* new: bswap_32.1
@ 2012-09-16 15:55 walter harms
0 siblings, 0 replies; only message in thread
From: walter harms @ 2012-09-16 15:55 UTC (permalink / raw)
To: Michael Kerrisk; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1127 bytes --]
hi,
attached you will find a new man-page describing the swap_x macros.
These are part of libc. In contrast to htonl() etc they swap bytes
unconditionaly. (handy if you need it.)
re,
wh
.\"Copyright 2012 walter harms (walter.harms-jNDFPZUTrfTUvfpBxBsQfasoZZ7OtMbqG9Ur7JDdleE@public.gmane.org)
.\" Distributed under GPL
.TH BSWAP 3 2012-09-16 "GNU" "Linux Programmer's Manual"
.SH NAME
bswap_16, bswap_32, bswap_64 \- swap bytes
.SH SYNOPSIS
.nf
.B #include <byteswap.h>
.sp
.BI bswap_16 (x);
.sp
.BI bswap_32 (x);
.sp
.BI bswap_64 (x);
.fi
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.ad l
.sp
.BR bswap_64 ()
.RS
__GNUC__ && __GNUC__ >= 2
.RE
.ad
.SH DESCRIPTION
These is a series off macros that swap all bytes unconditionaly.
.sp
.SH EXAMPLE
This example will swap 01020304 into 04030201.
.nf
#include <stdio.h>
#include <stdint.h>
#include <byteswap.h>
int main()
{
uint32_t x=0x01020304;
printf("%08x bswap:%08x\\n",x,bswap_32(x));
return 0;
}
.fi
.SH "CONFORMING TO"
This is a glibc extension.
.SH SEE ALSO
.BR swap (3),
.BR byteorder (3)
[-- Attachment #2: bswap_32.3 --]
[-- Type: text/plain, Size: 905 bytes --]
.\"Copyright 2002 walter harms (walter.harms@informatik.uni-oldenburg.de)
.\" Distributed under GPL
.TH BSWAP 3 2012-09-16 "GNU" "Linux Programmer's Manual"
.SH NAME
bswap_16, bswap_32, bswap_64 \- swap bytes
.SH SYNOPSIS
.nf
.B #include <byteswap.h>
.sp
.BI bswap_16 (x);
.sp
.BI bswap_32 (x);
.sp
.BI bswap_64 (x);
.fi
.sp
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
.ad l
.sp
.BR bswap_64 ()
.RS
__GNUC__ && __GNUC__ >= 2
.RE
.ad
.SH DESCRIPTION
These is a series off macros that swap all bytes unconditionaly.
.sp
.SH EXAMPLE
This example will swap 01020304 into 04030201.
.nf
#include <stdio.h>
#include <stdint.h>
#include <byteswap.h>
int main()
{
uint32_t x=0x01020304;
printf("%08x bswap:%08x\\n",x,bswap_32(x));
return 0;
}
.fi
.SH "CONFORMING TO"
This is a glibc extension.
.SH SEE ALSO
.BR swap (3),
.BR byteorder (3)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-09-16 15:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-16 15:55 new: bswap_32.1 walter harms
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).