Lines Matching refs:head
126 $head = 0;
147 while ($tail - $head > $this->chunk_size) {
148 $finger = $head + (int)(($tail - $head) / 2);
151 if ($finger == $head || $finger == $tail) {
157 $head = $finger;
165 $head = $finger;
169 if ($tail - $head < 1) {
175 $lines = $this->readChunk($fp, $head, $tail);
177 return [$fp, $lines, $head, $tail, $eof];
185 * @param int $head start point chunk
189 protected function readChunk($fp, $head, $tail) argument
192 $chunk_size = max($tail - $head, 0); // found chunk size
194 fseek($fp, $head);
230 * @param int $head position head of last chunk
238 protected function readAdjacentChunk($fp, $head, $tail, $direction) argument
240 if (!$fp) return [[], $head, $tail];
244 $head = $tail;
245 $tail = $head + (int)($this->chunk_size * (2 / 3));
249 $tail = $head;
250 $head = max($tail - $this->chunk_size, 0);
252 $nl = $this->getNewlinepointer($fp, $head);
255 $head = max($head - $this->chunk_size, 0);
257 $head = $nl;
264 $lines = $this->readChunk($fp, $head, $tail);
265 return [$lines, $head, $tail];