! * \brief boxaaWrite() * * \param[in] filename * \param[in] baa * \return 0 if OK, 1 on error */
| 1965 | * \return 0 if OK, 1 on error |
| 1966 | */ |
| 1967 | l_int32 |
| 1968 | boxaaWrite(const char *filename, |
| 1969 | BOXAA *baa) |
| 1970 | { |
| 1971 | l_int32 ret; |
| 1972 | FILE *fp; |
| 1973 | |
| 1974 | PROCNAME("boxaaWrite"); |
| 1975 | |
| 1976 | if (!filename) |
| 1977 | return ERROR_INT("filename not defined", procName, 1); |
| 1978 | if (!baa) |
| 1979 | return ERROR_INT("baa not defined", procName, 1); |
| 1980 | |
| 1981 | if ((fp = fopenWriteStream(filename, "w")) == NULL) |
| 1982 | return ERROR_INT("stream not opened", procName, 1); |
| 1983 | ret = boxaaWriteStream(fp, baa); |
| 1984 | fclose(fp); |
| 1985 | if (ret) |
| 1986 | return ERROR_INT("baa not written to stream", procName, 1); |
| 1987 | return 0; |
| 1988 | } |
| 1989 | |
| 1990 | |
| 1991 | /*! |
nothing calls this directly
no test coverage detected