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

Function sarrayWriteStream

deps/leptonica/src/sarray1.c:1513–1536  ·  view source on GitHub ↗

! * \brief sarrayWriteStream() * * \param[in] fp file stream * \param[in] sa string array * \return 0 if OK; 1 on error * * * Notes: * (1) This appends a '\n' to each string, which is stripped * off by sarrayReadStream(). * */

Source from the content-addressed store, hash-verified

1511 * </pre>
1512 */
1513l_int32
1514sarrayWriteStream(FILE *fp,
1515 SARRAY *sa)
1516{
1517l_int32 i, n, len;
1518
1519 PROCNAME("sarrayWriteStream");
1520
1521 if (!fp)
1522 return ERROR_INT("stream not defined", procName, 1);
1523 if (!sa)
1524 return ERROR_INT("sa not defined", procName, 1);
1525
1526 n = sarrayGetCount(sa);
1527 fprintf(fp, "\nSarray Version %d\n", SARRAY_VERSION_NUMBER);
1528 fprintf(fp, "Number of strings = %d\n", n);
1529 for (i = 0; i < n; i++) {
1530 len = strlen(sa->array[i]);
1531 fprintf(fp, " %d[%d]: %s\n", i, len, sa->array[i]);
1532 }
1533 fprintf(fp, "\n");
1534
1535 return 0;
1536}
1537
1538
1539/*!

Callers 6

parseTrailerPdfFunction · 0.85
sarrayWriteFunction · 0.85
sarrayWriteMemFunction · 0.85
sarrayAppendFunction · 0.85
recogWriteStreamFunction · 0.85
gplotWriteFunction · 0.85

Calls 1

sarrayGetCountFunction · 0.85

Tested by

no test coverage detected