1195098Sed/****************************************************************
2195098Sed
3195098SedThe author of this software is David M. Gay.
4195098Sed
5195098SedCopyright (C) 1998 by Lucent Technologies
6195098SedAll Rights Reserved
7195098Sed
8195098SedPermission to use, copy, modify, and distribute this software and
9195098Sedits documentation for any purpose and without fee is hereby
10195098Sedgranted, provided that the above copyright notice appear in all
11249423Sdimcopies and that both that the copyright notice and this
12249423Sdimpermission notice and warranty disclaimer appear in supporting
13205218Srdivackydocumentation, and that the name of Lucent or any of its entities
14249423Sdimnot be used in advertising or publicity pertaining to
15249423Sdimdistribution of the software without specific, written prior
16226633Sdimpermission.
17226633Sdim
18249423SdimLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19249423SdimINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
20207618SrdivackyIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
21195098SedSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22218893SdimWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23234353SdimIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24249423SdimARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25249423SdimTHIS SOFTWARE.
26234353Sdim
27195098Sed****************************************************************/
28195098Sed
29207618Srdivacky/* Please send bug reports to David M. Gay (dmg at acm dot org,
30207618Srdivacky * with " at " changed at "@" and " dot " changed to ".").	*/
31208599Srdivacky
32207618Srdivacky#include "gdtoaimp.h"
33207618Srdivacky
34226633Sdim int
35249423Sdim#ifdef KR_headers
36249423SdimstrtoIx(s, sp, a, b) CONST char *s; char **sp; void *a; void *b;
37234353Sdim#else
38221345SdimstrtoIx(CONST char *s, char **sp, void *a, void *b)
39221345Sdim#endif
40249423Sdim{
41249423Sdim	static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
42249423Sdim	Long exp[2];
43249423Sdim	Bigint *B[2];
44249423Sdim	int k, rv[2];
45207618Srdivacky	UShort *L = (UShort *)a, *M = (UShort *)b;
46207618Srdivacky
47208599Srdivacky	B[0] = Balloc(1);
48210299Sed	B[0]->wds = 2;
49210299Sed	k = strtoIg(s, sp, &fpi, exp, B, rv);
50210299Sed	ULtox(L, B[0]->x, exp[0], rv[0]);
51210299Sed	Bfree(B[0]);
52212904Sdim	if (B[1]) {
53249423Sdim		ULtox(M, B[1]->x, exp[1], rv[1]);
54249423Sdim		Bfree(B[1]);
55249423Sdim		}
56249423Sdim	else {
57195098Sed		M[0] = L[0];
58195098Sed		M[1] = L[1];
59195098Sed		M[2] = L[2];
60249423Sdim		M[3] = L[3];
61249423Sdim		M[4] = L[4];
62249423Sdim		}
63249423Sdim	return k;
64207618Srdivacky	}
65198090Srdivacky