MCPcopy Create free account
hub / github.com/numpy/numpy / fromstr_next_element

Function fromstr_next_element

numpy/core/src/multiarray/ctors.c:74–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72
73
74static int
75fromstr_next_element(char **s, void *dptr, PyArray_Descr *dtype,
76 const char *end)
77{
78 char *e = *s;
79 int r = dtype->f->fromstr(*s, dptr, &e, dtype);
80 /*
81 * fromstr always returns 0 for basic dtypes; s points to the end of the
82 * parsed string. If s is not changed an error occurred or the end was
83 * reached.
84 */
85 if (*s == e || r < 0) {
86 /* Nothing read, could be end of string or an error (or both) */
87 if (string_is_fully_read(*s, end)) {
88 return -1;
89 }
90 return -2;
91 }
92 *s = e;
93 if (end != NULL && *s > end) {
94 /* Stop the iteration if we read far enough */
95 return -1;
96 }
97 return 0;
98}
99
100static int
101fromfile_next_element(FILE **fp, void *dptr, PyArray_Descr *dtype,

Callers

nothing calls this directly

Calls 1

string_is_fully_readFunction · 0.85

Tested by

no test coverage detected