tags.c (161475) | tags.c (170256) |
---|---|
1/* | 1/* |
2 * Copyright (C) 1984-2004 Mark Nudelman | 2 * Copyright (C) 1984-2007 Mark Nudelman |
3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. 9 */ 10 --- 40 unchanged lines hidden (view full) --- 51static POSITION gtagsearch(); 52static int getentry(); 53 54/* 55 * The list of tags generated by the last findgtag() call. 56 * 57 * Use either pattern or line number. 58 * findgtag() always uses line number, so pattern is always NULL. | 3 * 4 * You may distribute under the terms of either the GNU General Public 5 * License or the Less License, as specified in the README file. 6 * 7 * For more information about less, or for information on how to 8 * contact the author, see the README file. 9 */ 10 --- 40 unchanged lines hidden (view full) --- 51static POSITION gtagsearch(); 52static int getentry(); 53 54/* 55 * The list of tags generated by the last findgtag() call. 56 * 57 * Use either pattern or line number. 58 * findgtag() always uses line number, so pattern is always NULL. |
59 * findctag() usually either pattern (in which case line number is 0), | 59 * findctag() uses either pattern (in which case line number is 0), |
60 * or line number (in which case pattern is NULL). 61 */ 62struct taglist { 63 struct tag *tl_first; 64 struct tag *tl_last; 65}; 66#define TAG_END ((struct tag *) &taglist) 67static struct taglist taglist = { TAG_END, TAG_END }; 68struct tag { 69 struct tag *next, *prev; /* List links */ 70 char *tag_file; /* Source file containing the tag */ 71 LINENUM tag_linenum; /* Appropriate line number in source file */ 72 char *tag_pattern; /* Pattern used to find the tag */ 73 char tag_endline; /* True if the pattern includes '$' */ 74}; 75static struct tag *curtag; 76 77#define TAG_INS(tp) \ | 60 * or line number (in which case pattern is NULL). 61 */ 62struct taglist { 63 struct tag *tl_first; 64 struct tag *tl_last; 65}; 66#define TAG_END ((struct tag *) &taglist) 67static struct taglist taglist = { TAG_END, TAG_END }; 68struct tag { 69 struct tag *next, *prev; /* List links */ 70 char *tag_file; /* Source file containing the tag */ 71 LINENUM tag_linenum; /* Appropriate line number in source file */ 72 char *tag_pattern; /* Pattern used to find the tag */ 73 char tag_endline; /* True if the pattern includes '$' */ 74}; 75static struct tag *curtag; 76 77#define TAG_INS(tp) \ |
78 (tp)->next = taglist.tl_first; \ 79 (tp)->prev = TAG_END; \ 80 taglist.tl_first->prev = (tp); \ 81 taglist.tl_first = (tp); | 78 (tp)->next = TAG_END; \ 79 (tp)->prev = taglist.tl_last; \ 80 taglist.tl_last->next = (tp); \ 81 taglist.tl_last = (tp); |
82 83#define TAG_RM(tp) \ 84 (tp)->next->prev = (tp)->prev; \ 85 (tp)->prev->next = (tp)->next; 86 87/* 88 * Delete tag structures. 89 */ --- 323 unchanged lines hidden (view full) --- 413 if (ABORT_SIGS()) 414 return (NULL_POSITION); 415 416 /* 417 * Read the next line, and save the 418 * starting position of that line in linepos. 419 */ 420 linepos = pos; | 82 83#define TAG_RM(tp) \ 84 (tp)->next->prev = (tp)->prev; \ 85 (tp)->prev->next = (tp)->next; 86 87/* 88 * Delete tag structures. 89 */ --- 323 unchanged lines hidden (view full) --- 413 if (ABORT_SIGS()) 414 return (NULL_POSITION); 415 416 /* 417 * Read the next line, and save the 418 * starting position of that line in linepos. 419 */ 420 linepos = pos; |
421 pos = forw_raw_line(pos, &line); | 421 pos = forw_raw_line(pos, &line, (int *)NULL); |
422 if (linenum != 0) 423 linenum++; 424 425 if (pos == NULL_POSITION) 426 { 427 /* 428 * We hit EOF without a match. 429 */ --- 328 unchanged lines hidden --- | 422 if (linenum != 0) 423 linenum++; 424 425 if (pos == NULL_POSITION) 426 { 427 /* 428 * We hit EOF without a match. 429 */ --- 328 unchanged lines hidden --- |