- Timestamp:
- Aug 15, 2009, 7:08:18 PM (16 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
-
editwin.c
r65b2173 re19eb97 45 45 static void oe_restore_excursion(owl_editwin *e, oe_excursion *x); 46 46 static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x); 47 static int oe_count_glyphs(c har *s);47 static int oe_count_glyphs(const char *s); 48 48 static int oe_char_width(gunichar c, int column); 49 49 static int oe_region_width(owl_editwin *e, int start, int end, int width); … … 52 52 static int owl_editwin_limit_maxcols(int v, int maxv); 53 53 static int owl_editwin_check_dotsend(owl_editwin *e); 54 static int owl_editwin_is_char_in(owl_editwin *e, c har *set);54 static int owl_editwin_is_char_in(owl_editwin *e, const char *set); 55 55 static gunichar owl_editwin_get_char_at_point(owl_editwin *e); 56 static int owl_editwin_replace_internal(owl_editwin *e, int replace, c har *s);57 static c har *oe_copy_buf(owl_editwin *e,char *buf, int len);56 static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s); 57 static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len); 58 58 static int oe_copy_region(owl_editwin *e); 59 59 static char *oe_chunk(owl_editwin *e, int start, int end); … … 71 71 } 72 72 73 static int oe_count_glyphs(c har *s)73 static int oe_count_glyphs(const char *s) 74 74 { 75 75 int count = 0; 76 c har *p;76 const char *p; 77 77 78 78 for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL)) … … 175 175 } 176 176 177 void owl_editwin_set_command(owl_editwin *e, c har *command)177 void owl_editwin_set_command(owl_editwin *e, const char *command) 178 178 { 179 179 if(e->command) owl_free(e->command); … … 181 181 } 182 182 183 c har *owl_editwin_get_command(owl_editwin *e)183 const char *owl_editwin_get_command(owl_editwin *e) 184 184 { 185 185 if(e->command) return e->command; … … 230 230 * previous text (including locked text) will be overwritten 231 231 */ 232 void owl_editwin_set_locktext(owl_editwin *e, c har *text)232 void owl_editwin_set_locktext(owl_editwin *e, const char *text) 233 233 { 234 234 oe_set_index(e, 0); … … 378 378 } 379 379 380 static inline c har *oe_next_point(owl_editwin *e,char *p)381 { 382 c har *boundary = e->buff + e->bufflen + 1;383 c har *q;380 static inline const char *oe_next_point(owl_editwin *e, const char *p) 381 { 382 const char *boundary = e->buff + e->bufflen + 1; 383 const char *q; 384 384 385 385 q = g_utf8_find_next_char(p, boundary); … … 392 392 } 393 393 394 static inline c har *oe_prev_point(owl_editwin *e,char *p)395 { 396 c har *boundary = e->buff + e->lock;394 static inline const char *oe_prev_point(owl_editwin *e, const char *p) 395 { 396 const char *boundary = e->buff + e->lock; 397 397 398 398 p = g_utf8_find_prev_char(boundary, p); … … 422 422 int width = 0, cw; 423 423 gunichar c; 424 c har *p;424 const char *p; 425 425 426 426 while(1) { … … 576 576 } 577 577 578 int owl_editwin_replace_region(owl_editwin *e, c har *s)578 int owl_editwin_replace_region(owl_editwin *e, const char *s) 579 579 { 580 580 oe_excursion x; … … 594 594 595 595 /* replace 'replace' characters at the point with s, returning the change in size */ 596 int owl_editwin_replace(owl_editwin *e, int replace, c har *s)596 int owl_editwin_replace(owl_editwin *e, int replace, const char *s) 597 597 { 598 598 int start, end, i; 599 c har *p;599 const char *p; 600 600 601 601 if (!g_utf8_validate(s, -1, NULL)) { … … 615 615 } 616 616 617 static int owl_editwin_replace_internal(owl_editwin *e, int replace, c har *s)617 static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s) 618 618 { 619 619 int start, end, free, need, size, change; … … 694 694 void owl_editwin_transpose_chars(owl_editwin *e) 695 695 { 696 c har *middle, *end, *start;696 const char *middle, *end, *start; 697 697 char *tmp; 698 698 … … 728 728 * right 729 729 */ 730 void owl_editwin_insert_string(owl_editwin *e, c har *s)730 void owl_editwin_insert_string(owl_editwin *e, const char *s) 731 731 { 732 732 owl_editwin_replace(e, 0, s); … … 751 751 int owl_editwin_point_move(owl_editwin *e, int delta) 752 752 { 753 c har *p;753 const char *p; 754 754 int change, d = 0; 755 755 … … 801 801 } 802 802 803 static int owl_editwin_is_char_in(owl_editwin *e, c har *set)804 { 805 c har *p;803 static int owl_editwin_is_char_in(owl_editwin *e, const char *set) 804 { 805 const char *p; 806 806 807 807 for (p = set; *p != 0; p = g_utf8_find_next_char(p, NULL)) … … 811 811 } 812 812 813 int owl_editwin_move_if_in(owl_editwin *e, int delta, c har *set)813 int owl_editwin_move_if_in(owl_editwin *e, int delta, const char *set) 814 814 { 815 815 int change, distance = 0; … … 823 823 } 824 824 825 int owl_editwin_move_if_not_in(owl_editwin *e, int delta, c har *set)825 int owl_editwin_move_if_not_in(owl_editwin *e, int delta, const char *set) 826 826 { 827 827 int change, distance = 0; … … 1030 1030 } 1031 1031 1032 static c har *oe_copy_buf(owl_editwin *e,char *buf, int len)1032 static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len) 1033 1033 { 1034 1034 char *p; … … 1048 1048 static int oe_copy_region(owl_editwin *e) 1049 1049 { 1050 c har *p;1050 const char *p; 1051 1051 int start, end; 1052 1052 … … 1237 1237 static int oe_region_width(owl_editwin *e, int start, int end, int offset) 1238 1238 { 1239 c har *p;1239 const char *p; 1240 1240 int width = offset; 1241 1241 … … 1317 1317 } 1318 1318 1319 c har *owl_editwin_get_text(owl_editwin *e)1319 const char *owl_editwin_get_text(owl_editwin *e) 1320 1320 { 1321 1321 return(e->buff+e->lock);
Note: See TracChangeset
for help on using the changeset viewer.