2 * Copyright 1991 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
6 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
7 /* All Rights Reserved */
10 * Copyright (c) 1980 Regents of the University of California.
11 * All rights reserved. The Berkeley software License Agreement
12 * specifies the terms and conditions for redistribution.
15 #pragma ident "%Z%%M% %I% %E% SMI"
17 /* tm.c: split numerical fields */
23 /* make two numerical fields */
25 char *dpoint
, *p
, *q
, *ba
;
27 for (ba
= 0; c
= *str
; str
++)
28 if (c
== '\\' && *(str
+1)== '&')
33 for (dpoint
=0; *str
; str
++)
35 if (*str
=='.' && !ineqn(str
,p
) &&
36 (str
>p
&& digit(*(str
-1)) ||
43 if (digit( * (str
-1) ) && !ineqn(str
, p
))
46 if (!dpoint
&& p
==str
) /* not numerical, don't split */
48 if (dpoint
) str
=dpoint
;
53 if (exstore
==0 || exstore
>exlim
)
56 exlim
= exstore
+MAXCHS
;
59 ba
= exstore
+ MAXSTR
;
62 error(gettext("numeric field too big"));
63 } while (*exstore
++ = *str
++);
69 ineqn (char *s
, char *p
)
71 /* true if s is in a eqn within p */
78 if ((ineq
== 0) && (c
== delim1
))
81 if ((ineq
== 1) && (c
== delim2
))