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

Function boxaaReadMem

deps/leptonica/src/boxbasic.c:1939–1957  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1937 * \return baa, or NULL on error
1938 */
1939BOXAA *
1940boxaaReadMem(const l_uint8 *data,
1941 size_t size)
1942{
1943FILE *fp;
1944BOXAA *baa;
1945
1946 PROCNAME("boxaaReadMem");
1947
1948 if (!data)
1949 return (BOXAA *)ERROR_PTR("data not defined", procName, NULL);
1950 if ((fp = fopenReadFromMemory(data, size)) == NULL)
1951 return (BOXAA *)ERROR_PTR("stream not opened", procName, NULL);
1952
1953 baa = boxaaReadStream(fp);
1954 fclose(fp);
1955 if (!baa) L_ERROR("baa not read\n", procName);
1956 return baa;
1957}
1958
1959
1960/*!

Callers

nothing calls this directly

Calls 2

fopenReadFromMemoryFunction · 0.85
boxaaReadStreamFunction · 0.85

Tested by

no test coverage detected