Lines Matching refs:zi
130 static int putsec __P ((struct zm_fileinfo *zi, char *buf, size_t n));
176 if (!zi->fname) \
179 shortname=strrchr(zi->fname,'/'); \
181 shortname=zi->fname; \
896 struct zm_fileinfo zi; in wcreceive() local
900 zi.fname=NULL; in wcreceive()
901 zi.modtime=0; in wcreceive()
902 zi.mode=0; in wcreceive()
903 zi.bytes_total=0; in wcreceive()
904 zi.bytes_sent=0; in wcreceive()
905 zi.bytes_received=0; in wcreceive()
906 zi.bytes_skipped=0; in wcreceive()
907 zi.eof_seen=0; in wcreceive()
923 c = rzfiles(&zi); in wcreceive()
943 if (wcrxpn(&zi,secbuf)== ERROR) { in wcreceive()
951 if (procheader(secbuf, &zi) == ERROR) { in wcreceive()
956 shortname=strrchr(zi.fname,'/'); in wcreceive()
960 shortname=zi.fname; in wcreceive()
962 if (wcrx(&zi)==ERROR) { in wcreceive()
977 bps=(zi.bytes_received-zi.bytes_skipped)/d; in wcreceive()
982 (long) zi.bytes_received, (long) zi.bytes_total, bps); in wcreceive()
987 shortname,protname(),zi.bytes_received, bps); in wcreceive()
998 zi.bytes_total = DEFBYTL; in wcreceive()
1006 procheader(dummy, &zi); in wcreceive()
1037 if (wcrx(&zi)==ERROR) { in wcreceive()
1050 bps=(zi.bytes_received-zi.bytes_skipped)/d; in wcreceive()
1054 (long) zi.bytes_received, bps); in wcreceive()
1059 shortname,protname(),zi.bytes_received, bps); in wcreceive()
1094 wcrxpn(struct zm_fileinfo *zi, char *rpn) in wcrxpn() argument
1107 zi->eof_seen=FALSE; in wcrxpn()
1133 wcrx(struct zm_fileinfo *zi) in wcrx() argument
1140 zi->eof_seen=FALSE; in wcrx()
1153 if (zi->bytes_total && R_BYTESLEFT(zi) < Blklen) in wcrx()
1154 Blklen=R_BYTESLEFT(zi); in wcrx()
1155 zi->bytes_received+=Blklen; in wcrx()
1156 if (putsec(zi, secbuf, Blklen)==ERROR) { in wcrx()
1166 if (closeit(zi)) { in wcrx()
1368 procheader(char *name, struct zm_fileinfo *zi) in procheader() argument
1395 zi->fname=name_static; in procheader()
1431 zi->bytes_total = DEFBYTL; in procheader()
1432 zi->mode = 0; in procheader()
1433 zi->eof_seen = 0; in procheader()
1434 zi->modtime = 0; in procheader()
1443 zi->modtime=modtime; in procheader()
1444 zi->bytes_total=bytes_total; in procheader()
1445 zi->mode=mode; in procheader()
1446 if (zi->mode & UNIXFILE) in procheader()
1479 if (sta.st_mtime > zi->modtime) { in procheader()
1487 if (((size_t) sta.st_size) >= zi->bytes_total in procheader()
1488 && sta.st_mtime > zi->modtime) { in procheader()
1496 int r=do_crc_check(NULL,zi->bytes_total,0); in procheader()
1532 zi->fname=name_static; in procheader()
1550 long d=t-zi->modtime; in procheader()
1555 (long) t, (long) zi->modtime, d); in procheader()
1560 tv.tv_sec=zi->modtime; in procheader()
1576 zi->bytes_received=0; in procheader()
1583 && !(zi->mode&UNIXFILE)) in procheader()
1650 int r=do_crc_check(NULL,zi->bytes_total,0); in procheader()
1664 zi->bytes_skipped = 0 & ~(1023); in procheader()
1667 if (fseek(fout, (long) zi->bytes_skipped, SEEK_SET)) { in procheader()
1674 zi->bytes_skipped=0; /* resume impossible, file has changed */ in procheader()
1677 zi->bytes_skipped=0; in procheader()
1721 if (zi->bytes_total>last_length) { in procheader()
1730 if (zi->bytes_total>0) in procheader()
1731 last_length=zi->bytes_total; in procheader()
1752 zi->bytes_received=zi->bytes_skipped; in procheader()
1810 static int putsec(struct zm_fileinfo *zi, char *buf, size_t n) in putsec() argument
1818 putsec(struct zm_fileinfo *zi, char *buf, size_t n)
1829 if (zi->eof_seen)
1835 zi->eof_seen=TRUE;
2138 rzfiles(struct zm_fileinfo *zi) in rzfiles() argument
2145 c = rzfile(zi); in rzfiles()
2149 xil_printf("%s(): receive %s (%d bytes)complete\n\r", __func__, zi->fname, (u32)zi->bytes_total); in rzfiles()
2160 bps=(zi->bytes_received-zi->bytes_skipped)/d; in rzfiles()
2164 (long) zi->bytes_received, (long) zi->bytes_total, bps); in rzfiles()
2167 protname(), (long) zi->bytes_total,bps)); in rzfiles()
2215 rzfile(struct zm_fileinfo *zi) in rzfile() argument
2224 zi->eof_seen=FALSE; in rzfile()
2228 if (procheader(secbuf,zi) == ERROR) { in rzfile()
2239 stohdr(zi->bytes_received); in rzfile()
2247 if (akt->pos==zi->bytes_received) { in rzfile()
2248 putsec(zi, akt->data, akt->len); in rzfile()
2249 zi->bytes_received += akt->len; in rzfile()
2256 if (akt->pos<zi->bytes_received) { in rzfile()
2302 if (rclhdr(Rxhdr) != (long) zi->bytes_received) { in rzfile()
2310 if (closeit(zi)) { in rzfile()
2339 closeit(zi); in rzfile()
2346 if (rclhdr(Rxhdr) != (long) zi->bytes_received) { in rzfile()
2364 if (pos>zi->bytes_received) { in rzfile()
2398 || zi->bytes_received > last_bps / 2 + last_rxbytes)) { in rzfile()
2407 last_bps=zi->bytes_received/d; in rzfile()
2409 minleft = (R_BYTESLEFT(zi))/last_bps/60; in rzfile()
2410 secleft = ((R_BYTESLEFT(zi))/last_bps)%60; in rzfile()
2442 (long) zi->bytes_received, (long) zi->bytes_total, in rzfile()
2444 last_rxbytes=zi->bytes_received; in rzfile()
2501 putsec(zi, secbuf, chinseg); in rzfile()
2504 putsec(zi, secbuf, bytes_in_block); in rzfile()
2506 zi->bytes_received += bytes_in_block; in rzfile()
2507 stohdr(zi->bytes_received); in rzfile()
2516 putsec(zi, secbuf, bytes_in_block); in rzfile()
2518 zi->bytes_received += bytes_in_block; in rzfile()
2519 stohdr(zi->bytes_received); in rzfile()
2528 putsec(zi, secbuf, bytes_in_block); in rzfile()
2530 zi->bytes_received += bytes_in_block; in rzfile()
2538 putsec(zi, secbuf, bytes_in_block); in rzfile()
2540 zi->bytes_received += bytes_in_block; in rzfile()
2596 closeit(struct zm_fileinfo *zi) argument
2626 if (zi->modtime) {
2630 timep.modtime = zi->modtime;
2640 if (S_ISREG(zi->mode)) {
2651 chmod(Pathname, (00666 & zi->mode));
2653 chmod(Pathname, (07777 & zi->mode));