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

Function sarrayWrite

deps/leptonica/src/sarray1.c:1476–1497  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1474 * \return 0 if OK; 1 on error
1475 */
1476l_int32
1477sarrayWrite(const char *filename,
1478 SARRAY *sa)
1479{
1480l_int32 ret;
1481FILE *fp;
1482
1483 PROCNAME("sarrayWrite");
1484
1485 if (!filename)
1486 return ERROR_INT("filename not defined", procName, 1);
1487 if (!sa)
1488 return ERROR_INT("sa not defined", procName, 1);
1489
1490 if ((fp = fopenWriteStream(filename, "w")) == NULL)
1491 return ERROR_INT("stream not opened", procName, 1);
1492 ret = sarrayWriteStream(fp, sa);
1493 fclose(fp);
1494 if (ret)
1495 return ERROR_INT("sa not written to stream", procName, 1);
1496 return 0;
1497}
1498
1499
1500/*!

Callers

nothing calls this directly

Calls 2

fopenWriteStreamFunction · 0.85
sarrayWriteStreamFunction · 0.85

Tested by

no test coverage detected