Changeset 075ba92


Ignore:
Timestamp:
Aug 15, 2009, 7:08:18 PM (15 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
77bced3
Parents:
64735f0
git-author:
Anders Kaseorg <andersk@mit.edu> (08/03/09 23:52:03)
git-committer:
Anders Kaseorg <andersk@mit.edu> (08/15/09 19:08:18)
Message:
Add const qualifiers for owl_fmtext *.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    re19eb97 r075ba92  
    170170
    171171/* Internal function. Scan for attribute characters. */
    172 void _owl_fmtext_scan_attributes(owl_fmtext *f, int start, char *attr, short *fgcolor, short *bgcolor) /*noproto*/
     172void _owl_fmtext_scan_attributes(const owl_fmtext *f, int start, char *attr, short *fgcolor, short *bgcolor) /*noproto*/
    173173{
    174174  const char *p;
     
    184184 * bytes.
    185185 */
    186 void _owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in, int start, int stop) /*noproto*/
     186void _owl_fmtext_append_fmtext(owl_fmtext *f, const owl_fmtext *in, int start, int stop) /*noproto*/
    187187{
    188188  char attrbuff[6];
     
    230230
    231231/* append fmtext 'in' to 'f' */
    232 void owl_fmtext_append_fmtext(owl_fmtext *f, owl_fmtext *in)
     232void owl_fmtext_append_fmtext(owl_fmtext *f, const owl_fmtext *in)
    233233{
    234234  _owl_fmtext_append_fmtext(f, in, 0, in->textlen);
     
    248248 * freeing the return
    249249 */
    250 char *owl_fmtext_print_plain(owl_fmtext *f)
     250char *owl_fmtext_print_plain(const owl_fmtext *f)
    251251{
    252252  return owl_strip_format_chars(f->textbuff);
     
    278278 * must already be initiatlized with curses
    279279 */
    280 void _owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w, int do_search) /*noproto*/
     280void _owl_fmtext_curs_waddstr(const owl_fmtext *f, WINDOW *w, int do_search) /*noproto*/
    281281{
    282282  /* char *tmpbuff; */
     
    367367}
    368368
    369 void owl_fmtext_curs_waddstr(owl_fmtext *f, WINDOW *w)
     369void owl_fmtext_curs_waddstr(const owl_fmtext *f, WINDOW *w)
    370370{
    371371  _owl_fmtext_curs_waddstr(f, w, owl_global_is_search_active(&g));
    372372}
    373373
    374 void owl_fmtext_curs_waddstr_without_search(owl_fmtext *f, WINDOW *w)
     374void owl_fmtext_curs_waddstr_without_search(const owl_fmtext *f, WINDOW *w)
    375375{
    376376  _owl_fmtext_curs_waddstr(f, w, 0);
     
    380380 * 'lines' number of lines into 'out'
    381381 */
    382 int owl_fmtext_truncate_lines(owl_fmtext *in, int aline, int lines, owl_fmtext *out)
     382int owl_fmtext_truncate_lines(const owl_fmtext *in, int aline, int lines, owl_fmtext *out)
    383383{
    384384  const char *ptr1, *ptr2;
     
    424424 * character and stop there.
    425425 */
    426 void owl_fmtext_truncate_cols(owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
     426void owl_fmtext_truncate_cols(const owl_fmtext *in, int acol, int bcol, owl_fmtext *out)
    427427{
    428428  const char *ptr_s, *ptr_e, *ptr_c, *last;
     
    500500
    501501/* Return the number of lines in 'f' */
    502 int owl_fmtext_num_lines(owl_fmtext *f)
     502int owl_fmtext_num_lines(const owl_fmtext *f)
    503503{
    504504  int lines, i;
     
    517517}
    518518
    519 const char *owl_fmtext_get_text(owl_fmtext *f)
     519const char *owl_fmtext_get_text(const owl_fmtext *f)
    520520{
    521521  return(f->textbuff);
     
    534534
    535535/* Make a copy of the fmtext 'src' into 'dst' */
    536 void owl_fmtext_copy(owl_fmtext *dst, owl_fmtext *src)
     536void owl_fmtext_copy(owl_fmtext *dst, const owl_fmtext *src)
    537537{
    538538  int mallocsize;
     
    555555 *  insensitive search.
    556556 */
    557 int owl_fmtext_search(owl_fmtext *f, owl_regex *re)
     557int owl_fmtext_search(const owl_fmtext *f, owl_regex *re)
    558558{
    559559  if (owl_regex_compare(re, f->textbuff, NULL, NULL) == 0) return(1);
  • functions.c

    r1077891a r075ba92  
    13431343}
    13441344
    1345 void owl_function_popless_fmtext(owl_fmtext *fm)
     1345void owl_function_popless_fmtext(const owl_fmtext *fm)
    13461346{
    13471347  owl_popwin *pw;
  • viewwin.c

    re19eb97 r075ba92  
    3333 * window that will be used by viewwin
    3434 */
    35 void owl_viewwin_init_fmtext(owl_viewwin *v, WINDOW *win, int winlines, int wincols, owl_fmtext *fmtext)
     35void owl_viewwin_init_fmtext(owl_viewwin *v, WINDOW *win, int winlines, int wincols, const owl_fmtext *fmtext)
    3636{
    3737  owl_fmtext_copy(&(v->fmtext), fmtext);
Note: See TracChangeset for help on using the changeset viewer.