5 * Revision 1.2 1995/06/03 09:31:11 mike
6 * handle strchr(s,0) correctly
19 if( c == 0 ) return s + strlen(s) ;
23 if (*s == c) return s ;
34 char *ret = (char *) 0 ;
36 if ( c == 0 ) return s + strlen(s) ;
40 if (*s == c) ret = s ;
45 #endif /* NO_STRCHR */
49 extern char *sys_errlist[] ;
54 return n > 0 & n < sys_nerr ? sys_errlist[n] : "" ;
86 if (*tt < *ss) return -1 ;
87 if (*tt > *ss) return 1 ;
99 char *tt = (char *) t ;
108 #endif /* NO_MEMCPY */
112 /* don't use this unless you really don't have strtod() because
113 (1) its probably slower than your real strtod()
114 (2) atof() may call the real strtod()
122 register unsigned char *p ;
128 p = (unsigned char *) s ;
131 while (*p == ' ' || *p == '\t') p++ ;
132 if (*p == '-' || *p == '+') p++ ;
133 while ( scan_code[*p] == SC_DIGIT ) { flag++ ; p++ ; }
137 while ( scan_code[*p] == SC_DIGIT ) { flag++ ; p++ ; }
139 /* done with number part */
141 { /* no number part */
142 *endptr = s ; return 0.0 ;
144 else *endptr = (char *) p ;
146 /* now look for exponent */
147 if (*p == 'e' || *p == 'E')
151 if (*p == '-' || *p == '+') p++ ;
152 while ( scan_code[*p] == SC_DIGIT ) { flag++ ; p++ ; }
153 if (flag) *endptr = (char *) p ;
158 #endif /* no strtod() */
162 #ifdef SW_FP_CHECK /* this is V7 and XNX23A specific */
175 return x - ipart * y ;
187 modf(x / y, &ipart) ;
188 return x - ipart * y ;