-- see zlib.h -- */
(file, str)
| 356 | |
| 357 | /* -- see zlib.h -- */ |
| 358 | int ZEXPORT gzputs(file, str) |
| 359 | gzFile file; |
| 360 | const char *str; |
| 361 | { |
| 362 | int ret; |
| 363 | z_size_t len; |
| 364 | gz_statep state; |
| 365 | |
| 366 | /* get internal structure */ |
| 367 | if (file == NULL) |
| 368 | return -1; |
| 369 | state.file = file; |
| 370 | |
| 371 | /* check that we're writing and that there's no error */ |
| 372 | if (state.state->mode != GZ_WRITE || state.state->err != Z_OK) |
| 373 | return -1; |
| 374 | |
| 375 | /* write string */ |
| 376 | len = strlen(str); |
| 377 | ret = (int)gz_write(state, str, len); |
| 378 | return ret == 0 && len != 0 ? -1 : ret; |
| 379 | } |
| 380 | |
| 381 | #if defined(STDC) || defined(Z_HAVE_STDARG_H) |
| 382 | #include <stdarg.h> |