MCPcopy Create free account
hub / github.com/creatale/node-dv / sarrayReadMem

Function sarrayReadMem

deps/leptonica/src/sarray1.c:1448–1466  ·  view source on GitHub ↗

! * \brief sarrayReadMem() * * \param[in] data serialization in ascii * \param[in] size of data; can use strlen to get it * \return sarray, or NULL on error */

Source from the content-addressed store, hash-verified

1446 * \return sarray, or NULL on error
1447 */
1448SARRAY *
1449sarrayReadMem(const l_uint8 *data,
1450 size_t size)
1451{
1452FILE *fp;
1453SARRAY *sa;
1454
1455 PROCNAME("sarrayReadMem");
1456
1457 if (!data)
1458 return (SARRAY *)ERROR_PTR("data not defined", procName, NULL);
1459 if ((fp = fopenReadFromMemory(data, size)) == NULL)
1460 return (SARRAY *)ERROR_PTR("stream not opened", procName, NULL);
1461
1462 sa = sarrayReadStream(fp);
1463 fclose(fp);
1464 if (!sa) L_ERROR("sarray not read\n", procName);
1465 return sa;
1466}
1467
1468
1469/*!

Callers

nothing calls this directly

Calls 2

fopenReadFromMemoryFunction · 0.85
sarrayReadStreamFunction · 0.85

Tested by

no test coverage detected