Lines Matching refs:cur
45 uchar* cur; /* reserved data current */
61 #define MGRESERVE(mg,rsrv,endrsrv,cur,r,action) \
63 if((cur+r) > endrsrv) \
64 { if(rsrv && sfread(mg->f,rsrv,cur-rsrv) != cur-rsrv) { MGSETEOF(mg); action;} \
65 rsrv = endrsrv = cur = NIL(uchar*); \
71 endrsrv = (cur = rsrv) + rr; \
75 #define RSRESERVE(rs,rsrv,endrsrv,cur,w,action) \
78 if((endrsrv-cur) < w) \
79 { if(rsrv && sfwrite(rs->f,rsrv,cur-rsrv) != cur-rsrv) { action;} \
80 rsrv = endrsrv = cur = NIL(uchar*); \
86 endrsrv = (cur = rsrv) + rw; \
92 { sfwrite(rs->f,rs->rsrv,rs->cur-rs->rsrv); \
93 rs->rsrv = rs->cur = rs->endrsrv = NIL(uchar*); \
136 reg uchar *t, *cur, *rsrv, *endrsrv;
159 cur = mg->cur; rsrv = mg->rsrv; endrsrv = mg->endrsrv;
165 { MGRESERVE(mg,rsrv,endrsrv,cur,datalen, return -1);
168 { MGRESERVE(mg,rsrv,endrsrv,cur,s, goto last_chunk);
169 x = endrsrv-cur;
172 { if ((datalen = reclen(rsc, cur, x)) < 0)
179 if((t = (uchar*)memchr(cur,rsc,x)) )
180 { datalen = (t-cur)+1;
202 { MGRESERVE(mg,rsrv,endrsrv,cur,sizeof(ssize_t), return -1);
203 t = (uchar*)(&mg->match); MEMCPY(t,cur,sizeof(ssize_t));
212 { MGRESERVE(mg,rsrv,endrsrv,cur,sizeof(ssize_t), return -1);
215 datalen = reclen(rsc, cur, sizeof(ssize_t));
219 MEMCPY(t,cur,sizeof(ssize_t));
228 MGRESERVE(mg,rsrv,endrsrv,cur,datalen, return -1);
240 obj->data = cur;
242 obj->key = cur+key;
244 cur += datalen;
250 obj >= endobj || (cur+datalen) > endrsrv )
257 obj->data = cur;
258 cur += datalen;
303 { if((cur+datalen) > endrsrv)
310 { if ((datalen = reclen(rsc, cur, endrsrv-cur)) < 0 || datalen > (endrsrv-cur))
315 if(!(t = (uchar*)memchr(cur,rsc,endrsrv-cur)) )
318 datalen = (t-cur)+1;
326 { if((cur+datalen) > endrsrv)
330 { if(cur+sizeof(ssize_t) > endrsrv)
334 datalen = reclen(rsc, cur, sizeof(ssize_t));
338 MEMCPY(t,cur,sizeof(ssize_t));
344 if((cur+datalen) > endrsrv)
349 cur -= sizeof(ssize_t);
359 mg->rsrv = rsrv; mg->endrsrv = endrsrv; mg->cur = cur;
377 sfread(mg->f,mg->rsrv,mg->cur-mg->rsrv);
422 mg->rsrv = mg->endrsrv = mg->cur = NIL(uchar*);
568 reg uchar *d, *cur, *mgcur;
580 rsrv = rs->rsrv; endrsrv = rs->endrsrv; cur = rs->cur;
581 mgrsrv = mg->rsrv; mgendrsrv = mg->endrsrv; mgcur = mg->cur;
588 { sfwrite(rs->f, rsrv, cur-rsrv);
613 { RSRESERVE(rs,rsrv,endrsrv,cur,sizeof(ssize_t),goto done);
614 d = (uchar*)(&n_obj); MEMCPY(cur,d,sizeof(ssize_t));
626 RSRESERVE(rs,rsrv,endrsrv,cur,len, goto done);
632 { out.data = cur;
633 out.datalen = w = endrsrv - cur;
642 RSRESERVE(rs,rsrv,endrsrv,cur,out.datalen, goto done);
644 cur += out.datalen;
658 RSRESERVE(rs,rsrv,endrsrv,cur,w, goto done);
659 MEMCPY(cur,mgcur,w);
683 { len = (t-cur)+1;
710 RSRESERVE(rs,rsrv,endrsrv,cur,len, goto done);
718 { out.data = cur;
719 out.datalen = w = endrsrv - cur;
728 RSRESERVE(rs,rsrv,endrsrv,cur,out.datalen, goto done);
730 cur += out.datalen;
734 MEMCPY(cur,mgcur,len);
746 RSRESERVE(rs,rsrv,endrsrv,cur,len, goto done);
753 { out.data = cur;
754 out.datalen = w = endrsrv - cur;
763 RSRESERVE(rs,rsrv,endrsrv,cur,out.datalen, goto done);
765 cur += out.datalen;
769 MEMCPY(cur,mgcur,len);
780 RSRESERVE(rs,rsrv,endrsrv,cur,len, goto done);
783 RSRESERVE(rs,rsrv,endrsrv,cur,w, goto done);
784 d = (uchar*)(&len); MEMCPY(cur,d,sizeof(ssize_t));
793 { out.data = cur;
794 out.datalen = w = endrsrv - cur;
803 RSRESERVE(rs,rsrv,endrsrv,cur,out.datalen, goto done);
805 cur += out.datalen;
809 MEMCPY(cur,mgcur,len);
820 rs->endrsrv = rs->cur = NIL(uchar*);
823 rs->cur = cur;
826 mg->endrsrv = mg->cur = NIL(uchar*);
829 mg->cur = mgcur;
954 rs->rsrv = rs->endrsrv = rs->cur = NIL(uchar*);