Lines Matching defs:tab

54 static int vdunfold(Utable_t* tab)
56 static int vdunfold(tab)
57 Utable_t* tab;
66 n_tar = tab->n_tar;
67 tar = tab->tar;
68 n_src = tab->n_src;
69 src = tab->src;
70 target = tab->target;
71 source = tab->source;
74 { if((inst = VDGETC((Vdio_t*)tab)) < 0)
84 { if((size = VDGETC((Vdio_t*)tab)) < 0)
87 (size = (long)(*_Vdgetu)((Vdio_t*)tab,size)) < 0)
98 { if((long)(n = sizeof(tab->data)) > size)
100 if((*_Vdread)((Vdio_t*)tab,tab->data,n) != n )
102 r = (*target->writef)((Void_t*)tab->data, n,
103 tab->t_org+t, target);
109 if((*_Vdread)((Vdio_t*)tab,tar+t,n) != n)
127 { if((size = VDGETC((Vdio_t*)tab)) < 0)
130 (size = (long)(*_Vdgetu)((Vdio_t*)tab,size)) < 0)
138 if((copy = VDGETC((Vdio_t*)tab)) < 0)
141 copy = tab->quick[copy + ((k_type-K_QUICK)<<VD_BITS)];
144 (copy = (long)(*_Vdgetu)((Vdio_t*)tab,copy)) < 0)
147 copy += tab->recent[k_type - K_RECENT];
152 K_UPDATE(tab->quick,tab->recent,tab->rhere,copy);
167 tab->t_org+t, target);
176 if(tab->compress)
177 { copy += tab->t_org - tab->n_src;
181 { copy += tab->s_org;
192 { n = sizeof(tab->data);
196 ((Void_t*)tab->data, n,
201 ((Void_t*)tab->data, n,
202 tab->t_org+t, target);
231 { if((long)(n = sizeof(tab->data)) > s)
234 ((Void_t*)tab->data, n,
235 a + tab->t_org, target );
239 ((Void_t*)tab->data, n,
240 t + tab->t_org, target );
273 Utable_t tab;
281 INIT(&tab.io,delta);
282 tab.source = source;
283 tab.target = target;
290 if((*_Vdread)(&tab.io,magic,n) != n)
306 if((t = (long)(*_Vdgetu)(&tab.io,0)) < 0 ||
312 if((t = (long)(*_Vdgetu)(&tab.io,0)) < 0)
323 if((window = (long)(*_Vdgetu)(&tab.io,0)) < 0)
326 tab.compress = n_src == 0 ? 1 : 0;
329 tab.tar = tab.src = NIL(uchar*);
330 tab.t_alloc = tab.s_alloc = 0;
335 if(n > 0 && (tab.tar = (uchar*)malloc(n*sizeof(uchar))) )
336 tab.t_alloc = 1;
348 if(n > 0 && (tab.src = (uchar*)malloc(n*sizeof(uchar))) )
349 tab.s_alloc = 1;
354 { tab.t_org = t; /* current location in target stream */
357 { tab.s_org = 0;
360 tab.n_src = 0;
362 { tab.n_src = HEADER(window);
363 p = t - tab.n_src;
365 tab.src = tar + p;
366 else if(tab.src)
367 { n = (int)tab.n_src;
368 if(tab.tar)
369 { data = tab.tar + tab.n_tar - n;
370 memcpy((Void_t*)tab.src,(Void_t*)data,n);
373 { r = (*target->readf)(tab.src,n,p,target);
387 if((tab.n_src = n_src-p) > window)
388 tab.n_src = window;
389 tab.s_org = p;
392 tab.src = src + p;
393 else if(tab.src)
394 { n = (int)tab.n_src;
395 r = (*source->readf)(tab.src,n,p,source);
404 tab.tar = (uchar*)tar+t;
405 tab.n_tar = window < (n_tar-t) ? window : (n_tar-t);
407 K_INIT(tab.quick,tab.recent,tab.rhere);
408 if(vdunfold(&tab) < 0)
410 if(!target->data && tab.tar)
411 { p = (*target->writef)((Void_t*)tab.tar,(int)tab.n_tar,t,target);
412 if(p != tab.n_tar)
416 t += tab.n_tar;
420 if(tab.t_alloc)
421 free((Void_t*)tab.tar);
422 if(tab.s_alloc)
423 free((Void_t*)tab.src);