--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: libbsd-dev: please provide {le,be}{16,32,64}{enc,dec} inline functions
- From: Robert Millan <rmh@debian.org>
- Date: Mon, 25 Jul 2011 18:14:56 +0200
- Message-id: <20110725161456.53057.76408.reportbug@dimoni>
Package: libbsd-dev
Version: 0.3.0-1
Severity: wishlist
These functions are provided by <sys/endian.h> on FreeBSD, but not on GNU systems.
Please could you include them in libbsd version of <sys/endian.h>?
Thanks!
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: kfreebsd-amd64 (x86_64)
Kernel: kFreeBSD 8.2-1-amd64
Locale: LANG=ca_AD.UTF-8, LC_CTYPE=ca_AD.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages libbsd-dev depends on:
ii libbsd0 0.3.0-1 utility functions from BSD systems
libbsd-dev recommends no packages.
libbsd-dev suggests no packages.
-- no debconf information
/*-
* Copyright (c) 2002 Thomas Moestl <tmm@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <stdint.h>
#include <cdefs.h>
/* Alignment-agnostic encode/decode bytestream to/from little/big endian. */
static __inline uint16_t
be16dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return ((p[0] << 8) | p[1]);
}
static __inline uint32_t
be32dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return (((unsigned)p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
}
static __inline uint64_t
be64dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return (((uint64_t)be32dec(p) << 32) | be32dec(p + 4));
}
static __inline uint16_t
le16dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return ((p[1] << 8) | p[0]);
}
static __inline uint32_t
le32dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return (((unsigned)p[3] << 24) | (p[2] << 16) | (p[1] << 8) | p[0]);
}
static __inline uint64_t
le64dec(const void *pp)
{
uint8_t const *p = (uint8_t const *)pp;
return (((uint64_t)le32dec(p + 4) << 32) | le32dec(p));
}
static __inline void
be16enc(void *pp, uint16_t u)
{
uint8_t *p = (uint8_t *)pp;
p[0] = (u >> 8) & 0xff;
p[1] = u & 0xff;
}
static __inline void
be32enc(void *pp, uint32_t u)
{
uint8_t *p = (uint8_t *)pp;
p[0] = (u >> 24) & 0xff;
p[1] = (u >> 16) & 0xff;
p[2] = (u >> 8) & 0xff;
p[3] = u & 0xff;
}
static __inline void
be64enc(void *pp, uint64_t u)
{
uint8_t *p = (uint8_t *)pp;
be32enc(p, (uint32_t)(u >> 32));
be32enc(p + 4, (uint32_t)(u & 0xffffffffU));
}
static __inline void
le16enc(void *pp, uint16_t u)
{
uint8_t *p = (uint8_t *)pp;
p[0] = u & 0xff;
p[1] = (u >> 8) & 0xff;
}
static __inline void
le32enc(void *pp, uint32_t u)
{
uint8_t *p = (uint8_t *)pp;
p[0] = u & 0xff;
p[1] = (u >> 8) & 0xff;
p[2] = (u >> 16) & 0xff;
p[3] = (u >> 24) & 0xff;
}
static __inline void
le64enc(void *pp, uint64_t u)
{
uint8_t *p = (uint8_t *)pp;
le32enc(p, (uint32_t)(u & 0xffffffffU));
le32enc(p + 4, (uint32_t)(u >> 32));
}
--- End Message ---
--- Begin Message ---
Source: libbsd
Source-Version: 0.4.0-1
We believe that the bug you reported is fixed in the latest version of
libbsd, which is due to be installed in the Debian FTP archive:
libbsd-dev_0.4.0-1_amd64.deb
to main/libb/libbsd/libbsd-dev_0.4.0-1_amd64.deb
libbsd0-dbg_0.4.0-1_amd64.deb
to main/libb/libbsd/libbsd0-dbg_0.4.0-1_amd64.deb
libbsd0-udeb_0.4.0-1_amd64.udeb
to main/libb/libbsd/libbsd0-udeb_0.4.0-1_amd64.udeb
libbsd0_0.4.0-1_amd64.deb
to main/libb/libbsd/libbsd0_0.4.0-1_amd64.deb
libbsd_0.4.0-1.debian.tar.gz
to main/libb/libbsd/libbsd_0.4.0-1.debian.tar.gz
libbsd_0.4.0-1.dsc
to main/libb/libbsd/libbsd_0.4.0-1.dsc
libbsd_0.4.0.orig.tar.gz
to main/libb/libbsd/libbsd_0.4.0.orig.tar.gz
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 635377@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Guillem Jover <guillem@debian.org> (supplier of updated libbsd package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Tue, 29 May 2012 08:11:13 +0200
Source: libbsd
Binary: libbsd-dev libbsd0 libbsd0-udeb libbsd0-dbg
Architecture: source amd64
Version: 0.4.0-1
Distribution: unstable
Urgency: low
Maintainer: Debian GNU/kFreeBSD <debian-bsd@lists.debian.org>
Changed-By: Guillem Jover <guillem@debian.org>
Description:
libbsd-dev - utility functions from BSD systems - development files
libbsd0 - utility functions from BSD systems - shared library
libbsd0-dbg - utility functions from BSD systems - debugging symbols
libbsd0-udeb - utility functions from BSD systems - shared library (udeb)
Closes: 580372 630907 634955 635377 635379 640895 657772 665997 668705
Changes:
libbsd (0.4.0-1) unstable; urgency=low
.
* New upstream release. (Closes: #668705)
- Autoconfiscated, supports cross-building natively. (Closes: #665997)
- Provide endian encoding/decoding inline functions. (Closes: #635377)
- Provide expand_number(). (Closes: #635379)
- Ship <nlist.h> under /usr/include/bsd/. (Closes: #634955, #657772)
- Ship <libutil.h> under /usr/include/bsd/. (Closes: #640895)
- Fix header protections when using the overlay. (Closes: #630907)
- Fix .so symlinks to be relative even when the .so.N shared library
is on a different directory. (Closes: #580372)
- Remove all deprecated headers and inclusions.
* Avoid leaving the system w/o an <nlist.h> previously owned by either
libelfg0-dev or libelf-dev when upgrading from old libsd-dev versions
which used to Replace them, by restoring <nlist.h> from <bsd/nlist.h>.
Checksums-Sha1:
335e03cdd8471cefedcd5b8551447564e1ce7728 1469 libbsd_0.4.0-1.dsc
87290f6ba92f773a3bfd7221f6ab561cbf88eba6 441567 libbsd_0.4.0.orig.tar.gz
08a54bb6ee11cf9f281747372c702d4277b4766f 8974 libbsd_0.4.0-1.debian.tar.gz
8a18008a755a0d61e79f44b61c1e6a7c4e45dc68 134520 libbsd-dev_0.4.0-1_amd64.deb
0717d525cd186afcc2563bb812e66fbe144fbc9d 54678 libbsd0_0.4.0-1_amd64.deb
42185c514e7e4814d8b2beae3b7859e51cd5b5a6 18826 libbsd0-udeb_0.4.0-1_amd64.udeb
6616be60e5bb90c31eb60bd8b6fbc4fe4a64ec96 36102 libbsd0-dbg_0.4.0-1_amd64.deb
Checksums-Sha256:
3060d7bd2c1b2c28a515872b2a63c6959b068a3657a15cb87d35a6459f5bb8ea 1469 libbsd_0.4.0-1.dsc
a285d7108462b913ac49142e46bab2d7e16902cabfacf77ef1101233f472fcb7 441567 libbsd_0.4.0.orig.tar.gz
4b9f389afa224f4c6634a1e6feb9716b957ca3818e217ecbfca6781d03f77acc 8974 libbsd_0.4.0-1.debian.tar.gz
66d637feba28c744bf8aded7138b2ea473d9ea385ef31471a5ed796cda1146c1 134520 libbsd-dev_0.4.0-1_amd64.deb
1e445894035a2de5c3650ef93fcd1eba18f486045117f137ac871cda037f1e72 54678 libbsd0_0.4.0-1_amd64.deb
91232c55f2ca3921b898803606141e977baaa500c563fa3210bbe8a17bd50c0a 18826 libbsd0-udeb_0.4.0-1_amd64.udeb
d8420751912307f5361e0be3f13da79f8abca365a3ed86c9a87f93467f343520 36102 libbsd0-dbg_0.4.0-1_amd64.deb
Files:
bfff6f2dcb6a6ec722a046df5b90b278 1469 libs optional libbsd_0.4.0-1.dsc
e61dee73c9e5bd5e6e6f281ac8fae325 441567 libs optional libbsd_0.4.0.orig.tar.gz
523b6bb337c40ce791c2cef9ac8b79af 8974 libs optional libbsd_0.4.0-1.debian.tar.gz
2b5991b6ee51a59cde43f7b69d0734d1 134520 libdevel optional libbsd-dev_0.4.0-1_amd64.deb
67fd550c835a8c468d6d721608a6eea4 54678 libs optional libbsd0_0.4.0-1_amd64.deb
7249bf90659fac25035a34a2fa3de8dc 18826 debian-installer optional libbsd0-udeb_0.4.0-1_amd64.udeb
dc694b858361789ddcf256e8122ddedf 36102 debug extra libbsd0-dbg_0.4.0-1_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iEYEARECAAYFAk/EcQ8ACgkQuW9ciZ2SjJttUACg3FmtdIhPyxqYtKIEWZZSsoyO
/WEAn2Rt10PLX//4vh/usVpmqCTaTqqx
=bwUO
-----END PGP SIGNATURE-----
--- End Message ---