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

Function fb_nextbuf

numpy/core/src/multiarray/textreading/stream_pyobject.c:88–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86
87
88static int
89fb_nextbuf(python_chunks_from_file *fb, char **start, char **end, int *kind)
90{
91 Py_XDECREF(fb->chunk);
92 fb->chunk = NULL;
93
94 PyObject *chunk = PyObject_CallFunctionObjArgs(fb->read, fb->chunksize, NULL);
95 if (chunk == NULL) {
96 return -1;
97 }
98 fb->chunk = process_stringlike(chunk, fb->encoding);
99 if (fb->chunk == NULL) {
100 return -1;
101 }
102 buffer_info_from_unicode(fb->chunk, start, end, kind);
103 if (*start == *end) {
104 return BUFFER_IS_FILEEND;
105 }
106 return BUFFER_MAY_CONTAIN_NEWLINE;
107}
108
109
110static int

Callers

nothing calls this directly

Calls 2

process_stringlikeFunction · 0.85
buffer_info_from_unicodeFunction · 0.85

Tested by

no test coverage detected