[rrd-developers] implementing portable format
sh at tokkee.org
Tue Apr 7 21:45:37 CEST 2009
On Tue, Apr 07, 2009 at 09:19:57PM +0200, Bernhard Reutner-Fischer wrote:
> On Tue, Apr 07, 2009 at 09:08:02PM +0200, Tobias Oetiker wrote:
> >Today kevin brintnall wrote:
> >> On Tue, Apr 07, 2009 at 08:12:26PM +0200, Bernhard Reutner-Fischer wrote:
> >> > On Sat, Nov 01, 2008 at 10:08:06AM +0100, Tobias Oetiker wrote:
> >> > >This sounds like quite a bit of added complexity. It would
> >> > >require us to be able to convert from all platforms to all other
> >> > >platforms ... I have the feeling that adding one new format with
> >> > >the ability to read the old one already puts quite something on our
> >> > >plate.
> >> >
> >> > Why didn't we use htonl(), ntohl() etc, btw?
> >> >
> >> > It's not that converting between "host" and "network" byte order is
> >> > something new, ISTR..
> >> >
> >> > This means that we just store the data in network byte order on disk
> >> > and read it back with ntohl(), ntohs(). This should result in
> >> > much reduced pain, i would say.
> >> Given the various machine architectures (now and future), and the various
> >> packing strategies employed by all the compilers out there, it makes sense
> >> to use 64-bit values. Is there a standard ntohl() equivalent for 64-bits?
> quoting man 3 endian:
> #define _BSD_SOURCE
> #include <endian.h>
Unfortunately, this has only recently been added to the GNU libc (in version
2.9) and those functions are not defined in any standard. Afaik, they are
currently available in some BSDs and glibc 2.9 only. Anyway, as Tobi pointed
out as well, integers are the easy part ... ;-)
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 197 bytes
Desc: Digital signature
Url : http://lists.oetiker.ch/pipermail/rrd-developers/attachments/20090407/9ab59f0e/attachment.bin
More information about the rrd-developers