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

Function sarrayAppend

deps/leptonica/src/sarray1.c:1600–1622  ·  view source on GitHub ↗

! * \brief sarrayAppend() * * \param[in] filename * \param[in] sa * \return 0 if OK; 1 on error */

Source from the content-addressed store, hash-verified

1598 * \return 0 if OK; 1 on error
1599 */
1600l_int32
1601sarrayAppend(const char *filename,
1602 SARRAY *sa)
1603{
1604FILE *fp;
1605
1606 PROCNAME("sarrayAppend");
1607
1608 if (!filename)
1609 return ERROR_INT("filename not defined", procName, 1);
1610 if (!sa)
1611 return ERROR_INT("sa not defined", procName, 1);
1612
1613 if ((fp = fopenWriteStream(filename, "a")) == NULL)
1614 return ERROR_INT("stream not opened", procName, 1);
1615 if (sarrayWriteStream(fp, sa)) {
1616 fclose(fp);
1617 return ERROR_INT("sa not appended to stream", procName, 1);
1618 }
1619
1620 fclose(fp);
1621 return 0;
1622}
1623
1624
1625/*---------------------------------------------------------------------*

Callers

nothing calls this directly

Calls 2

fopenWriteStreamFunction · 0.85
sarrayWriteStreamFunction · 0.85

Tested by

no test coverage detected