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

Function sarrayCopy

deps/leptonica/src/sarray1.c:392–410  ·  view source on GitHub ↗

! * \brief sarrayCopy() * * \param[in] sa string array * \return copy of sarray, or NULL on error */

Source from the content-addressed store, hash-verified

390 * \return copy of sarray, or NULL on error
391 */
392SARRAY *
393sarrayCopy(SARRAY *sa)
394{
395l_int32 i;
396SARRAY *csa;
397
398 PROCNAME("sarrayCopy");
399
400 if (!sa)
401 return (SARRAY *)ERROR_PTR("sa not defined", procName, NULL);
402
403 if ((csa = sarrayCreate(sa->nalloc)) == NULL)
404 return (SARRAY *)ERROR_PTR("csa not made", procName, NULL);
405
406 for (i = 0; i < sa->n; i++)
407 sarrayAddString(csa, sa->array[i], L_COPY);
408
409 return csa;
410}
411
412
413/*!

Callers 5

jbWordsInTextlinesFunction · 0.85
sarraySelectBySubstringFunction · 0.85
jbAddPagesFunction · 0.85
sarraySortFunction · 0.85
sarrayUnionByAsetFunction · 0.85

Calls 2

sarrayCreateFunction · 0.85
sarrayAddStringFunction · 0.85

Tested by

no test coverage detected