Lines Matching defs:line

12  * Code to handle displaying line numbers.
14 * Finding the line number of a given file position is rather tricky.
20 * So we use the function add_lnum to cache line numbers.
22 * line numbers when we run out of space in our table. A line
24 * other line numbers. For example, we'd rather keep lines
29 * The function currline() returns the line number of a given
31 * to cache the line number. Therefore currline is occasionally
32 * called to make sure we cache line numbers often enough.
38 * Structure to keep track of a line number and the associated file position.
39 * A doubly-linked circular list of line numbers is kept ordered by line number.
47 LINENUM line; /* Line number */
50 * "gap" needs some explanation: the gap of any particular line number
53 * gap of a line number is the gap which would be introduced if this
54 * line number were deleted. It is used to decide which one to replace
58 #define NPOOL 200 /* Size of line number pool */
73 * Initialize the line number structures.
97 anchor.line = 1;
119 * Add a new line number to the cache.
121 * FIRST character in the specified line.
139 if (p->line == linenum)
170 new->line = linenum;
209 * line number, print a message to tell the user what we're doing.
214 ierror("Calculating line numbers", NULL_PARG);
245 * Turn off line numbers because the user has interrupted
246 * a lengthy line number calculation.
253 * We were displaying line numbers, so need to repaint.
261 * Find the line number associated with a given position.
274 * We're not using line numbers.
284 * Beginning of file is always line number 1.
295 return (p->line);
299 * We start at the line we just found and start
320 for (linenum = p->line, cpos = p->pos; cpos < pos; linenum++)
339 * If the given position is not at the start of a line,
340 * make sure we return the correct line number.
352 for (linenum = p->line, cpos = p->pos; cpos > pos; linenum--)
376 * Find the position of a given line number.
394 * Find the entry nearest to the line number we want.
396 for (p = anchor.next; p != &anchor && p->line < linenum; p = p->next)
398 if (p->line == linenum)
402 if (p == &anchor || linenum - p->prev->line < p->line - linenum)
410 for (clinenum = p->line, cpos = p->pos; clinenum < linenum; clinenum++)
428 for (clinenum = p->line, cpos = p->pos; clinenum > linenum; clinenum--)
448 * Return the line number of the "current" line.
449 * The argument "where" tells which line is to be considered
450 * the "current" line (e.g. TOP, BOTTOM, MIDDLE, etc).