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

Function sarrayGetString

deps/leptonica/src/sarray1.c:681–699  ·  view source on GitHub ↗

! * \brief sarrayGetString() * * \param[in] sa string array * \param[in] index to the index-th string * \param[in] copyflag L_NOCOPY or L_COPY * \return string, or NULL on error * * * Notes: * (1) See usage comments at the top of this file. * (2) To get a pointer to the string itself, use L_NOCOPY. * To get a copy of the string, use L_COPY. * </

Source from the content-addressed store, hash-verified

679 * </pre>
680 */
681char *
682sarrayGetString(SARRAY *sa,
683 l_int32 index,
684 l_int32 copyflag)
685{
686 PROCNAME("sarrayGetString");
687
688 if (!sa)
689 return (char *)ERROR_PTR("sa not defined", procName, NULL);
690 if (index < 0 || index >= sa->n)
691 return (char *)ERROR_PTR("index not valid", procName, NULL);
692 if (copyflag != L_NOCOPY && copyflag != L_COPY)
693 return (char *)ERROR_PTR("invalid copyflag", procName, NULL);
694
695 if (copyflag == L_NOCOPY)
696 return sa->array[index];
697 else /* L_COPY */
698 return stringNew(sa->array[index]);
699}
700
701
702/*!

Callers 15

ptraConcatenatePdfToDataFunction · 0.85
generateOutputDataPdfFunction · 0.85
parseTrailerPdfFunction · 0.85
pixaReadFilesSAFunction · 0.85
pixReadIndexedFunction · 0.85
parseForProtosFunction · 0.85
getNextNonCommentLineFunction · 0.85
getNextNonBlankLineFunction · 0.85
captureProtoSignatureFunction · 0.85
cleanProtoSignatureFunction · 0.85
skipToMatchingBraceFunction · 0.85

Calls 1

stringNewFunction · 0.85

Tested by

no test coverage detected