- Timestamp:
- Aug 15, 2009, 7:08:18 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 1077891a
- Parents:
- fa4562c
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/04/09 02:37:51)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmtext.c
r65b2173 re19eb97 43 43 * 'color' 44 44 */ 45 void owl_fmtext_append_attr(owl_fmtext *f, c har *text, char attr, short fgcolor, short bgcolor)45 void owl_fmtext_append_attr(owl_fmtext *f, const char *text, char attr, short fgcolor, short bgcolor) 46 46 { 47 47 char attrbuff[6]; … … 83 83 84 84 /* Append normal, uncolored text 'text' to 'f' */ 85 void owl_fmtext_append_normal(owl_fmtext *f, c har *text)85 void owl_fmtext_append_normal(owl_fmtext *f, const char *text) 86 86 { 87 87 owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); … … 89 89 90 90 /* Append normal, uncolored text specified by format string to 'f' */ 91 void owl_fmtext_appendf_normal(owl_fmtext *f, c har *fmt, ...)91 void owl_fmtext_appendf_normal(owl_fmtext *f, const char *fmt, ...) 92 92 { 93 93 va_list ap; … … 103 103 104 104 /* Append normal text 'text' to 'f' with color 'color' */ 105 void owl_fmtext_append_normal_color(owl_fmtext *f, c har *text, int fgcolor, int bgcolor)105 void owl_fmtext_append_normal_color(owl_fmtext *f, const char *text, int fgcolor, int bgcolor) 106 106 { 107 107 owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_NONE, fgcolor, bgcolor); … … 109 109 110 110 /* Append bold text 'text' to 'f' */ 111 void owl_fmtext_append_bold(owl_fmtext *f, c har *text)111 void owl_fmtext_append_bold(owl_fmtext *f, const char *text) 112 112 { 113 113 owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); … … 115 115 116 116 /* Append reverse video text 'text' to 'f' */ 117 void owl_fmtext_append_reverse(owl_fmtext *f, c har *text)117 void owl_fmtext_append_reverse(owl_fmtext *f, const char *text) 118 118 { 119 119 owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); … … 121 121 122 122 /* Append reversed and bold, uncolored text 'text' to 'f' */ 123 void owl_fmtext_append_reversebold(owl_fmtext *f, c har *text)123 void owl_fmtext_append_reversebold(owl_fmtext *f, const char *text) 124 124 { 125 125 owl_fmtext_append_attr(f, text, OWL_FMTEXT_ATTR_REVERSE | OWL_FMTEXT_ATTR_BOLD, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT); … … 172 172 void _owl_fmtext_scan_attributes(owl_fmtext *f, int start, char *attr, short *fgcolor, short *bgcolor) /*noproto*/ 173 173 { 174 c har *p;174 const char *p; 175 175 p = strchr(f->textbuff, OWL_FMTEXT_UC_STARTBYTE_UTF8); 176 176 while (p && p < f->textbuff + start) { … … 382 382 int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out) 383 383 { 384 c har *ptr1, *ptr2;384 const char *ptr1, *ptr2; 385 385 int i, offset; 386 386 … … 426 426 void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out) 427 427 { 428 c har *ptr_s, *ptr_e, *ptr_c, *last;428 const char *ptr_s, *ptr_e, *ptr_c, *last; 429 429 int col, st, padding, chwidth; 430 430 … … 517 517 } 518 518 519 c har *owl_fmtext_get_text(owl_fmtext *f)519 const char *owl_fmtext_get_text(owl_fmtext *f) 520 520 { 521 521 return(f->textbuff); … … 565 565 * formatting syntax to set appropriate attributes. 566 566 */ 567 void owl_fmtext_append_ztext(owl_fmtext *f, c har *text)567 void owl_fmtext_append_ztext(owl_fmtext *f, const char *text) 568 568 { 569 569 int stacksize, curattrs, curcolor; 570 c har *ptr, *txtptr, *tmpptr;570 const char *ptr, *txtptr, *tmpptr; 571 571 char *buff; 572 572 int attrstack[32], chrstack[32], colorstack[32]; … … 770 770 * If format_fn is specified, passes it the list element value 771 771 * and it will return a string which this needs to free. */ 772 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, c har *join_with, char *(format_fn)(char *))772 void owl_fmtext_append_list(owl_fmtext *f, owl_list *l, const char *join_with, char *(format_fn)(const char *)) 773 773 { 774 774 int i, size; 775 c har *elem;775 const char *elem; 776 776 char *text; 777 777
Note: See TracChangeset
for help on using the changeset viewer.