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

Function l_binaryCopy

deps/leptonica/src/utils2.c:1468–1483  ·  view source on GitHub ↗

--------------------------------------------------------------------* * Copy in memory * *--------------------------------------------------------------------*/ ! * \brief l_binaryCopy() * * \param[in] datas * \param[in] size of data array * \return datad on heap, or NULL on error * * * Notes: * (1) We add 4 bytes t

Source from the content-addressed store, hash-verified

1466 * </pre>
1467 */
1468l_uint8 *
1469l_binaryCopy(l_uint8 *datas,
1470 size_t size)
1471{
1472l_uint8 *datad;
1473
1474 PROCNAME("l_binaryCopy");
1475
1476 if (!datas)
1477 return (l_uint8 *)ERROR_PTR("datas not defined", procName, NULL);
1478
1479 if ((datad = (l_uint8 *)LEPT_CALLOC(size + 4, sizeof(l_uint8))) == NULL)
1480 return (l_uint8 *)ERROR_PTR("datad not made", procName, NULL);
1481 memcpy(datad, datas, size);
1482 return datad;
1483}
1484
1485
1486/*--------------------------------------------------------------------*

Callers 3

l_byteaCopyDataFunction · 0.85
pixcompCreateFromStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected