2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
16 // This license applies to all functions, except for the functions under the below mentioned license
22 // Copyright (c) 1998, M. Warner Losh <imp@freebsd.org>
23 // All rights reserved.
25 // Redistribution and use in source and binary forms, with or without
26 // modification, are permitted provided that the following conditions
28 // 1. Redistributions of source code must retain the above copyright
29 // notice, this list of conditions and the following disclaimer.c
30 // 2. Redistributions in binary form must reproduce the above copyright
31 // notice, this list of conditions and the following disclaimer in the
32 // documentation and/or other materials provided with the distribution.
34 // THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
35 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37 // ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
38 // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39 // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40 // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43 // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 // This license applies to all the permissions of the below mentioned function.
51 #include <FOspCompat.h>
54 atoff(const char* pcStr)
56 return strtof (pcStr, NULL);
60 ecvtf(float fval, int ndigit, int* decpt, int* sign)
62 return ecvt((double)fval, ndigit, decpt, sign);
67 ecvtbuf(double invalue, int ndigit, int* decpt, int* sign, char* ecvt_buf)
69 char* pecvt_ret = ecvt(invalue, ndigit, decpt, sign);
70 strcpy(ecvt_buf, pecvt_ret);
76 fcvtf( float fval, int ndigit, int* decpt, int* sign)
78 return fcvt((double)fval, ndigit, decpt, sign);
83 fcvtbuf(double invalue, int ndigit, int* decpt, int* sign, char* fcvt_buf)
85 char* pfcvt_ret = fcvt( invalue, ndigit, decpt, sign);
86 strcpy(fcvt_buf, pfcvt_ret);
92 gcvtf( float fval, int ndigit, char* buf)
94 return gcvt((double)fval, ndigit, buf);
99 reallocf(void* ptr, unsigned int size)
102 ptemp = realloc( ptr, size);