Lines Matching defs:head
113 * if success returns array(fp, array(changeloglines), $head, $tail, $eof)
126 $head = 0;
147 while ($tail - $head > $this->chunk_size) {
148 $finger = $head + (int)(($tail - $head) / 2);
151 if ($finger == $head || $finger == $tail) {
160 $head = $finger;
164 if ($tail - $head < 1) {
170 $lines = $this->readChunk($fp, $head, $tail);
172 return [$fp, $lines, $head, $tail, $eof];
177 * Has no check if $head and $tail are really at a new line
180 * @param int $head start point chunk
184 protected function readChunk($fp, $head, $tail)
187 $chunk_size = max($tail - $head, 0); // found chunk size
189 fseek($fp, $head);
222 * Returns the next lines of the changelog of the chunk before head or after tail
225 * @param int $head position head of last chunk
230 * - $head: head of chunk
233 protected function readAdjacentChunk($fp, $head, $tail, $direction)
235 if (!$fp) return [[], $head, $tail];
239 $head = $tail;
240 $tail = $head + (int)($this->chunk_size * (2 / 3));
244 $tail = $head;
245 $head = max($tail - $this->chunk_size, 0);
247 $nl = $this->getNewlinepointer($fp, $head);
250 $head = max($head - $this->chunk_size, 0);
252 $head = $nl;
259 $lines = $this->readChunk($fp, $head, $tail);
260 return [$lines, $head, $tail];