Lines Matching defs:head
97 /* move a stream to head */
107 reg Sfio_t* head;
116 head = p->sf[0];
117 if(SFFROZEN(head) )
120 SFLOCK(head,0);
123 if(!(p->mode&SF_SHARE) || (head->mode&SF_READ) || (f->mode&SF_READ) )
124 { if(SFSYNC(head) < 0)
128 { if(SFMODE(head,1) != SF_WRITE && _sfmode(head,SF_WRITE,1) < 0)
132 v = head->next - head->data; /* pending data */
136 { if((w = SFWR(head,head->data,k,head->disc)) == k)
141 memcpy(head->data,(head->data+w),v);
143 head->next = head->data+v;
148 /* move data from head to f */
149 if((head->data+k) != f->data )
150 memcpy(f->data,(head->data+k),v);
155 head->mode |= SF_POOL;
156 head->next = head->endr = head->endw = head->data; /* clear write buffer */
158 p->sf[n] = head;
163 head->mode &= ~SF_LOCK; /* partially unlock because it's no longer head */
193 /* !_Sfpool, make sure head stream is an open stream */
203 /* head stream has SF_POOL off */
260 if(!f) /* return head of pool of pf regardless of lock states */
319 else rv = pf->pool->sf[0]; /* return head of old pool */
355 if(_sfpmove(f,0) < 0) /* make f head of pool */