1112158Sdas/****************************************************************
2112158Sdas
3112158SdasThe author of this software is David M. Gay.
4112158Sdas
5112158SdasCopyright (C) 1998 by Lucent Technologies
6112158SdasAll Rights Reserved
7112158Sdas
8112158SdasPermission to use, copy, modify, and distribute this software and
9112158Sdasits documentation for any purpose and without fee is hereby
10112158Sdasgranted, provided that the above copyright notice appear in all
11112158Sdascopies and that both that the copyright notice and this
12112158Sdaspermission notice and warranty disclaimer appear in supporting
13112158Sdasdocumentation, and that the name of Lucent or any of its entities
14112158Sdasnot be used in advertising or publicity pertaining to
15112158Sdasdistribution of the software without specific, written prior
16112158Sdaspermission.
17112158Sdas
18112158SdasLUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19112158SdasINCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
20112158SdasIN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
21112158SdasSPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22112158SdasWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
23112158SdasIN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
24112158SdasARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
25112158SdasTHIS SOFTWARE.
26112158Sdas
27112158Sdas****************************************************************/
28112158Sdas
29165743Sdas/* Please send bug reports to David M. Gay (dmg at acm dot org,
30165743Sdas * with " at " changed at "@" and " dot " changed to ".").	*/
31112158Sdas
32112158Sdas#include "gdtoaimp.h"
33112158Sdas
34112158Sdas int
35112158Sdas#ifdef KR_headers
36112158SdasstrtoIxL(s, sp, a, b) CONST char *s; char **sp; void *a; void *b;
37112158Sdas#else
38112158SdasstrtoIxL(CONST char *s, char **sp, void *a, void *b)
39112158Sdas#endif
40112158Sdas{
41112158Sdas	static FPI fpi = { 64, 1-16383-64+1, 32766 - 16383 - 64 + 1, 1, SI };
42112158Sdas	Long exp[2];
43112158Sdas	Bigint *B[2];
44112158Sdas	int k, rv[2];
45112158Sdas	ULong *L = (ULong *)a, *M = (ULong *)b;
46112158Sdas
47112158Sdas	B[0] = Balloc(1);
48112158Sdas	B[0]->wds = 2;
49112158Sdas	k = strtoIg(s, sp, &fpi, exp, B, rv);
50112158Sdas	ULtoxL(L, B[0]->x, exp[0], rv[0]);
51112158Sdas	Bfree(B[0]);
52112158Sdas	if (B[1]) {
53112158Sdas		ULtoxL(M, B[1]->x, exp[1], rv[1]);
54112158Sdas		Bfree(B[1]);
55112158Sdas		}
56112158Sdas	else {
57112158Sdas		M[0] = L[0];
58112158Sdas		M[1] = L[1];
59112158Sdas		M[2] = L[2];
60112158Sdas		}
61112158Sdas	return k;
62112158Sdas	}
63