154359Sroberto/* 2182007Sroberto * /src/NTP/ntp4-dev/include/ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A 354359Sroberto * 4182007Sroberto * ieee754io.h,v 4.3 2005/04/16 17:32:10 kardel RELEASE_20050508_A 5182007Sroberto * 654359Sroberto * $Created: Sun Jul 13 12:22:11 1997 $ 754359Sroberto * 8182007Sroberto * Copyright (c) 1997-2005 by Frank Kardel <kardel <AT> ntp.org> 9182007Sroberto * 10182007Sroberto * Redistribution and use in source and binary forms, with or without 11182007Sroberto * modification, are permitted provided that the following conditions 12182007Sroberto * are met: 13182007Sroberto * 1. Redistributions of source code must retain the above copyright 14182007Sroberto * notice, this list of conditions and the following disclaimer. 15182007Sroberto * 2. Redistributions in binary form must reproduce the above copyright 16182007Sroberto * notice, this list of conditions and the following disclaimer in the 17182007Sroberto * documentation and/or other materials provided with the distribution. 18182007Sroberto * 3. Neither the name of the author nor the names of its contributors 19182007Sroberto * may be used to endorse or promote products derived from this software 20182007Sroberto * without specific prior written permission. 21182007Sroberto * 22182007Sroberto * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 23182007Sroberto * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24182007Sroberto * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25182007Sroberto * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 26182007Sroberto * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27182007Sroberto * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28182007Sroberto * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29182007Sroberto * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30182007Sroberto * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31182007Sroberto * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32182007Sroberto * SUCH DAMAGE. 33182007Sroberto * 3454359Sroberto */ 3554359Sroberto#ifndef IEEE754IO_H 3654359Sroberto#define IEEE754IO_H 3754359Sroberto 3854359Sroberto#define IEEE_SINGLE 1 3954359Sroberto#define IEEE_DOUBLE 2 4054359Sroberto 4154359Sroberto#define IEEE_MSB 1 4254359Sroberto#define IEEE_LSB 2 4354359Sroberto 4454359Sroberto#define IEEE_OK 0 /* conversion ok */ 4554359Sroberto#define IEEE_BADCALL 1 /* bad call parameters */ 4654359Sroberto#define IEEE_NAN 2 /* found an NaN */ 4754359Sroberto#define IEEE_POSINFINITY 3 /* positive infinity */ 4854359Sroberto#define IEEE_NEGINFINITY 4 /* negative infinity */ 4954359Sroberto#define IEEE_POSOVERFLOW 5 /* positive overflow */ 5054359Sroberto#define IEEE_NEGOVERFLOW 6 /* negative overflow */ 5154359Sroberto 5254359Sroberto#define IEEE_OFFSETS 8 /* number of byte positions */ 5354359Srobertotypedef unsigned char offsets_t[IEEE_OFFSETS]; 5454359Sroberto 55285612Sdelphijint fetch_ieee754 (unsigned char **bufp, int size, l_fp *lfpp, offsets_t offsets); 56285612Sdelphijint put_ieee754 (unsigned char **bufpp, int size, l_fp *lfpp, offsets_t offsets); 5754359Sroberto 5854359Sroberto#endif 5954359Sroberto/* 60182007Sroberto * History: 61182007Sroberto * 6254359Sroberto * ieee754io.h,v 63182007Sroberto * Revision 4.3 2005/04/16 17:32:10 kardel 64182007Sroberto * update copyright 65182007Sroberto * 66182007Sroberto * Revision 4.2 2004/11/14 15:29:41 kardel 67182007Sroberto * support PPSAPI, upgrade Copyright to Berkeley style 68182007Sroberto * 6954359Sroberto * Revision 4.0 1998/04/10 19:50:40 kardel 7054359Sroberto * Start 4.0 release version numbering 7154359Sroberto * 7254359Sroberto * Revision 1.1 1998/04/10 19:27:33 kardel 7354359Sroberto * initial NTP VERSION 4 integration of PARSE with GPS166 binary support 7454359Sroberto * 7554359Sroberto * Revision 1.1 1997/10/06 20:55:37 kardel 7654359Sroberto * new parse structure 7754359Sroberto * 7854359Sroberto */ 79