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