- Timestamp:
- Sep 18, 2010, 3:17:27 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- b3b1b05
- Parents:
- 4cf7b1b
- git-author:
- David Benjamin <davidben@mit.edu> (07/31/10 20:30:49)
- git-committer:
- David Benjamin <davidben@mit.edu> (09/18/10 15:17:27)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
rf7456bc r7ba2ad4 597 597 } 598 598 599 /* Searches for line 'lineno' in 'f'. The returned range, [start, 600 * end), forms a half-open interval for the extent of the line. */ 601 void owl_fmtext_line_extents(const owl_fmtext *f, int lineno, int *o_start, int *o_end) 602 { 603 int start, end; 604 char *newline; 605 for (start = 0; lineno > 0 && start < f->textlen; start++) { 606 if (f->textbuff[start] == '\n') 607 lineno--; 608 } 609 newline = strchr(f->textbuff + start, '\n'); 610 /* Include the newline, if it is there. */ 611 end = newline ? newline - f->textbuff + 1 : f->textlen; 612 if (o_start) *o_start = start; 613 if (o_end) *o_end = end; 614 } 615 599 616 const char *owl_fmtext_get_text(const owl_fmtext *f) 600 617 {
Note: See TracChangeset
for help on using the changeset viewer.