pos = gzseek(file, -8L, SEEK_CUR); if (pos != 6 || gztell(file) != pos) { fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n", (long)pos, (long)gztell(file)); exit(1); }  if (gzgetc(file) != ' ') { fprintf(stderr, "gzgetc error\n"); exit(1); }  gzgets(file, (char*)uncompr, uncomprLen); uncomprLen = strlen((char*)uncompr); if (uncomprLen != 6) {  fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err)); exit(1); } if (strcmp((char*)uncompr, hello+7)) { fprintf(stderr, "bad gzgets after gzseek\n"); exit(1); } else { printf("gzgets() after gzseek: %s\n", (char *)uncompr); }  gzclose(file);
void test_gzio(out, in, uncompr, uncomprLen)    const char *out; /* compressed output file */    const char *in;  /* compressed input file */    Byte *uncompr;    int  uncomprLen;{    int err;    int len = strlen(hello)+1;    gzFile file;    z_off_t pos;    file = gzopen(out, "wb");    if (file == NULL) {        fprintf(stderr, "gzopen error\n");        exit(1);    }    gzputc(file, 'h');    if (gzputs(file, "ello") != 4) {        fprintf(stderr, "gzputs err: %s\n", gzerror(file, &err));	exit(1);    }    if (gzprintf(file, ", %s!", "hello") != 8) {        fprintf(stderr, "gzprintf err: %s\n", gzerror(file, &err));	exit(1);    }    gzseek(file, 1L, SEEK_CUR); /* add one zero byte */    gzclose(file);    file = gzopen(in, "rb");    if (file == NULL) {        fprintf(stderr, "gzopen error\n");    }    strcpy((char*)uncompr, "garbage");    uncomprLen = gzread(file, uncompr, (unsigned)uncomprLen);    if (uncomprLen != len) {        fprintf(stderr, "gzread err: %s\n", gzerror(file, &err));	exit(1);    }    if (strcmp((char*)uncompr, hello)) {        fprintf(stderr, "bad gzread: %s\n", (char*)uncompr);	exit(1);    } else {        printf("gzread(): %s\n", (char *)uncompr);    }    pos = gzseek(file, -8L, SEEK_CUR);    if (pos != 6 || gztell(file) != pos) {	fprintf(stderr, "gzseek error, pos=%ld, gztell=%ld\n",		(long)pos, (long)gztell(file));	exit(1);    }    if (gzgetc(file) != ' ') {	fprintf(stderr, "gzgetc error\n");	exit(1);    }    gzgets(file, (char*)uncompr, uncomprLen);    uncomprLen = strlen((char*)uncompr);    if (uncomprLen != 6) { /* "hello!" */        fprintf(stderr, "gzgets err after gzseek: %s\n", gzerror(file, &err));	exit(1);    }    if (strcmp((char*)uncompr, hello+7)) {        fprintf(stderr, "bad gzgets after gzseek\n");	exit(1);    } else {        printf("gzgets() after gzseek: %s\n", (char *)uncompr);    }    gzclose(file);}