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

Function sarrayCreate

deps/leptonica/src/sarray1.c:162–182  ·  view source on GitHub ↗

--------------------------------------------------------------------------* * String array create/destroy/copy/extend * *--------------------------------------------------------------------------*/ ! * \brief sarrayCreate() * * \param[in] n size of string ptr array to be alloc'd; * use 0 for default * \return sarray, or NULL on error */

Source from the content-addressed store, hash-verified

160 * \return sarray, or NULL on error
161 */
162SARRAY *
163sarrayCreate(l_int32 n)
164{
165SARRAY *sa;
166
167 PROCNAME("sarrayCreate");
168
169 if (n <= 0)
170 n = INITIAL_PTR_ARRAYSIZE;
171
172 sa = (SARRAY *)LEPT_CALLOC(1, sizeof(SARRAY));
173 if ((sa->array = (char **)LEPT_CALLOC(n, sizeof(char *))) == NULL) {
174 sarrayDestroy(&sa);
175 return (SARRAY *)ERROR_PTR("ptr array not made", procName, NULL);
176 }
177
178 sa->nalloc = n;
179 sa->n = 0;
180 sa->refcount = 1;
181 return sa;
182}
183
184
185/*!

Callers 15

generateFixedStringsPdfFunction · 0.85
generatePageStringPdfFunction · 0.85
generateContentStringPdfFunction · 0.85
makeTrailerStringPdfFunction · 0.85
pdfdataCreateFunction · 0.85
parseForProtosFunction · 0.85
captureProtoSignatureFunction · 0.85
cleanProtoSignatureFunction · 0.85
fmorphautogen1Function · 0.85
fmorphautogen2Function · 0.85
sarrayMakeWplsCodeFunction · 0.85

Calls 1

sarrayDestroyFunction · 0.85

Tested by

no test coverage detected