Lines Matching refs:ip
119 freeid(Dt_t* dt, Void_t* ip, Dtdisc_t* disc)
121 if (((Id_t*)ip)->sp)
122 sfclose(((Id_t*)ip)->sp);
123 free(ip);
134 register Id_t* ip;
160 for (ip = (Id_t*)dtfirst(dp->ids); ip; ip = (Id_t*)dtnext(dp->ids, ip))
161 if (n = sfstrtell(ip->sp))
164 ip->windows++;
165 if (n >= use && (!ip->row || (n / ip->row) > 16))
167 if (!ip->used++ && !ip->part && !streq(ip->name, "0") && dp->pz->disc->errorf && (dp->pz->flags & (PZ_SUMMARY|PZ_VERBOSE|PZ_DUMP)))
168 (*dp->pz->disc->errorf)(dp->pz, dp->pz->disc, 1, "%s: generate a partition to improve compression", ip->name);
169 if (ip->use = !(dp->pz->flags & PZ_NOPZIP) && ip->part)
170 ip->part->flags |= PZ_UPDATE;
173 ip->use = 0;
175 else if (ip->part)
176 ip->part->flags &= ~PZ_UPDATE;
191 for (ip = (Id_t*)dtfirst(dp->sqs); ip; ip = (Id_t*)dtnext(dp->sqs, ip))
192 if (n = sfstrtell(ip->sp))
194 sfputu(op, ip->row);
195 sfputu(op, ip->use);
197 sfputr(op, ip->name, 0);
199 (*dp->pz->disc->errorf)(dp->pz, dp->pz->disc, 0, "%8d %12s %2d %4d %4I*u %12I*u%s", ip->seq, ip->name, !!ip->part, ip->use, sizeof(ip->row), ip->row, sizeof(n), n, ip->windows == 1 ? " NEW" : "");
215 for (ip = (Id_t*)dtfirst(dp->sqs); ip; ip = (Id_t*)dtnext(dp->sqs, ip))
216 if (ip->use && (n = sfstrtell(ip->sp)))
218 error_info.file = ip->name;
220 sfstrseek(ip->sp, 0, SEEK_SET);
221 if (!pzpartset(dp->pz, ip->part))
223 sfstrbuf(state.buf, sfstrbase(ip->sp), n, 0);
227 ip->seq = 0;
234 for (ip = (Id_t*)dtfirst(dp->sqs); ip; ip = (Id_t*)dtnext(dp->sqs, ip))
235 if (n = sfstrtell(ip->sp))
237 sfstrseek(ip->sp, 0, SEEK_SET);
238 if (sfwrite(op, sfstrbase(ip->sp), n) != n || sferror(op))
240 error_info.file = ip->name;
246 ip->seq = 0;
302 Id_t* ip;
384 if (!(ip = (Id_t*)dtmatch(def.ids, &rp->id)))
390 if (!(ip = newof(0, Id_t, 1, strlen(s) + 1)))
392 if (ip->id = rp->id)
393 ip->row = rp->size;
394 ip->name = strcpy((char*)(ip + 1), s);
395 if (!(ip->sp = sfstropen()))
398 (*pz->disc->errorf)(pz, pz->disc, ERROR_SYSTEM|2, "%s: cannot create tmp stream", ip->name);
401 if ((ip->part = pzpartget(def.pz, ip->name)) && pz->disc->errorf && ip->row && ip->part->row != ip->row)
402 (*pz->disc->errorf)(pz, pz->disc, 1, "%s: partition row %I*u != data row %I*u", ip->name, sizeof(ip->part->row), ip->part->row, sizeof(ip->row), ip->row);
403 dtinsert(def.ids, ip);
405 else if (!ip->id)
406 ip->total += rp->size;
407 else if (pz->disc->errorf && ip->row != rp->size && (ip->row % rp->size))
408 (*pz->disc->errorf)(pz, pz->disc, 1, "%s: size %I*u not a multiple of %I*u", ip->name, sizeof(rp->size), rp->size, sizeof(ip->row), ip->row);
409 if (!ip->seq)
411 ip->seq = ++def.seq;
412 dtinsert(def.sqs, ip);
414 sfputu(def.xp, ip->seq);
415 if (!ip->id)
417 o = sfstrtell(ip->sp);
418 sfputu(ip->sp, rp->size);
419 o = sfstrtell(ip->sp) - o;
423 if (sfwrite(ip->sp, rp->data, rp->size) != rp->size)
426 (*pz->disc->errorf)(pz, pz->disc, ERROR_SYSTEM|2, "%s: %I*u byte write error", ip->name, sizeof(rp->size), rp->size);
429 ip->modules++;
454 for (ip = (Id_t*)dtfirst(def.ids); ip; ip = (Id_t*)dtnext(def.ids, ip))
455 (*pz->disc->errorf)(pz, pz->disc, 0, "%8I*u %12s %2u %4I*u %4I*u %12I*u %12I*u%s", sizeof(ip->windows), ip->windows, ip->name, !!ip->part, sizeof(ip->used), ip->used, sizeof(ip->row), ip->row, sizeof(ip->total), ip->total ? ip->total : ip->modules * ip->row, sizeof(ip->modules), ip->modules, ip->used && !ip->part ? " GENERATE PARTITION" : "");
485 register Id_t* ip;
558 if (!(ip = (Id_t*)dtmatch(ids, id)))
560 if (!(ip = newof(0, Id_t, 1, sfvalue(pz->io))))
562 ip->name = strcpy((char*)(ip + 1), id);
563 ip->row = row;
564 if ((ip->part = pzpartget(pz, ip->name)) && pz->disc->errorf && ip->row && ip->part->row != ip->row)
565 (*pz->disc->errorf)(pz, pz->disc, 1, "%s: partition row %I*u != data row %I*u", ip->name, sizeof(ip->part->row), ip->part->row, sizeof(ip->row), ip->row);
566 dtinsert(ids, ip);
568 ip->use = use;
569 ip->used++;
570 tab[i] = ip;
571 if (m >= pz->win || ip->row && m % ip->row)
574 (*pz->disc->errorf)(pz, pz->disc, 2, "input corrupted [%s partition table size %I*u]", ip->name, sizeof(m), m);
577 ip->size = m;
578 if (ip->use)
580 ip->bp = s;
586 (*pz->disc->errorf)(pz, pz->disc, 0, "%8d %12s %2d %4I*u %4I*u %12I*u%s", i + 1, ip->name, ip->use, sizeof(ip->used), ip->used, sizeof(ip->row), ip->row, sizeof(ip->size), ip->size, ip->used == 1 ? " NEW" : "");
633 ip = tab[m - 1];
634 p = (unsigned char*)ip->bp;
635 if (!(n = ip->row) && ((n = *p++) & SF_MORE))
653 ip->bp = (char*)p + n;
718 Id_t* ip;
755 if (!(ip = (Id_t*)dtmatch(ids, &rp->id)))
761 if (!(ip = newof(0, Id_t, 1, strlen(s) + 1)))
763 if (ip->id = rp->id)
764 ip->row = rp->size;
765 ip->name = strcpy((char*)(ip + 1), s);
766 if (!pz->split.match || strmatch(ip->name, pz->split.match))
768 if (!(ip->sp = sfopen(NiL, ip->name, (pz->flags & PZ_APPEND) ? "a" : "w")))
771 (*pz->disc->errorf)(pz, pz->disc, ERROR_SYSTEM|2, "%s: cannot create split stream", ip->name);
774 ip->count = sfsize(ip->sp);
776 dtinsert(ids, ip);
778 (*pz->disc->errorf)(pz, pz->disc, 0, "split %s size %I*u", ip->name, sizeof(ip->row), ip->row);
780 else if (!ip->id)
781 ip->total += rp->size;
782 else if (pz->disc->errorf && ip->row != rp->size && rp->size && (ip->row % rp->size))
783 (*pz->disc->errorf)(pz, pz->disc, 1, "%s: size %I*u not a multiple of %I*u", ip->name, sizeof(rp->size), rp->size, sizeof(ip->row), ip->row);
784 if (ip->sp)
786 if (ip->count < window)
788 if (sfwrite(ip->sp, rp->data, rp->size) != rp->size)
791 (*pz->disc->errorf)(pz, pz->disc, ERROR_SYSTEM|2, "%s: %I*u byte write error", ip->name, sizeof(rp->size), rp->size);
794 ip->count += rp->size;
796 ip->modules++;
803 for (ip = (Id_t*)dtfirst(ids); ip; ip = (Id_t*)dtnext(ids, ip))
804 if (ip->sp)
805 (*pz->disc->errorf)(pz, pz->disc, 0, "%8I*u %12s %2u %4I*u %4I*u %12I*u %12I*u%s", sizeof(ip->windows), ip->windows, ip->name, !!ip->part, sizeof(ip->used), ip->used, sizeof(ip->row), ip->row, sizeof(ip->total), ip->total ? ip->total : ip->modules * ip->row, sizeof(ip->modules), ip->modules, ip->used && !ip->part ? " GENERATE PARTITION" : "");
807 for (ip = (Id_t*)dtfirst(ids); ip; ip = (Id_t*)dtnext(ids, ip))
808 if (ip->sp && sfclose(ip->sp))
811 (*pz->disc->errorf)(pz, pz->disc, ERROR_SYSTEM|2, "%s: write error", ip->name);