* NumPyOS_ascii_ftolf: * * fp: FILE pointer * * value: Place to store the value read * * Similar to PyOS_ascii_strtod, except that it reads input from a file. * * Similarly to fscanf, this function always consumes leading whitespace, * and any text that could be the leading part in valid input. * * Return value: similar to fscanf. * * 0 if no number read, * * 1 if a
| 739 | * * EOF if end-of-file met before reading anything. |
| 740 | */ |
| 741 | NPY_NO_EXPORT int |
| 742 | NumPyOS_ascii_ftolf(FILE *fp, double *value) |
| 743 | { |
| 744 | char buffer[FLOAT_FORMATBUFLEN + 1]; |
| 745 | char *p; |
| 746 | int r; |
| 747 | |
| 748 | r = read_numberlike_string(fp, buffer, FLOAT_FORMATBUFLEN+1); |
| 749 | |
| 750 | if (r != EOF && r != 0) { |
| 751 | *value = NumPyOS_ascii_strtod(buffer, &p); |
| 752 | r = (p == buffer) ? 0 : 1; |
| 753 | } |
| 754 | return r; |
| 755 | } |
| 756 | |
| 757 | NPY_NO_EXPORT int |
| 758 | NumPyOS_ascii_ftoLf(FILE *fp, long double *value) |
nothing calls this directly
no test coverage detected