Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • editwin.c

    r0509efc re19eb97  
    4545static void oe_restore_excursion(owl_editwin *e, oe_excursion *x);
    4646static void oe_restore_mark_only(owl_editwin *e, oe_excursion *x);
    47 static int oe_count_glyphs(char *s);
     47static int oe_count_glyphs(const char *s);
    4848static int oe_char_width(gunichar c, int column);
    4949static int oe_region_width(owl_editwin *e, int start, int end, int width);
     
    5252static int owl_editwin_limit_maxcols(int v, int maxv);
    5353static int owl_editwin_check_dotsend(owl_editwin *e);
    54 static int owl_editwin_is_char_in(owl_editwin *e, char *set);
     54static int owl_editwin_is_char_in(owl_editwin *e, const char *set);
    5555static gunichar owl_editwin_get_char_at_point(owl_editwin *e);
    56 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s);
    57 static char *oe_copy_buf(owl_editwin *e, char *buf, int len);
     56static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s);
     57static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len);
    5858static int oe_copy_region(owl_editwin *e);
    5959static char *oe_chunk(owl_editwin *e, int start, int end);
     
    7171}
    7272
    73 static int oe_count_glyphs(char *s)
     73static int oe_count_glyphs(const char *s)
    7474{
    7575  int count = 0;
    76   char *p;
     76  const char *p;
    7777
    7878  for(p = s; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    175175}
    176176
    177 void owl_editwin_set_command(owl_editwin *e, char *command)
     177void owl_editwin_set_command(owl_editwin *e, const char *command)
    178178{
    179179  if(e->command) owl_free(e->command);
     
    181181}
    182182
    183 char *owl_editwin_get_command(owl_editwin *e)
     183const char *owl_editwin_get_command(owl_editwin *e)
    184184{
    185185  if(e->command) return e->command;
     
    230230 * previous text (including locked text) will be overwritten
    231231 */
    232 void owl_editwin_set_locktext(owl_editwin *e, char *text)
     232void owl_editwin_set_locktext(owl_editwin *e, const char *text)
    233233{
    234234  oe_set_index(e, 0);
     
    378378}
    379379
    380 static inline char *oe_next_point(owl_editwin *e, char *p)
    381 {
    382   char *boundary = e->buff + e->bufflen + 1;
    383   char *q;
     380static 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;
    384384
    385385  q = g_utf8_find_next_char(p, boundary);
     
    392392}
    393393
    394 static inline char *oe_prev_point(owl_editwin *e, char *p)
    395 {
    396   char *boundary = e->buff + e->lock;
     394static inline const char *oe_prev_point(owl_editwin *e, const char *p)
     395{
     396  const char *boundary = e->buff + e->lock;
    397397
    398398  p = g_utf8_find_prev_char(boundary, p);
     
    422422  int width = 0, cw;
    423423  gunichar c;
    424   char *p;
     424  const char *p;
    425425
    426426  while(1) {
     
    576576}
    577577
    578 int owl_editwin_replace_region(owl_editwin *e, char *s)
     578int owl_editwin_replace_region(owl_editwin *e, const char *s)
    579579{
    580580  oe_excursion x;
     
    594594
    595595/* replace 'replace' characters at the point with s, returning the change in size */
    596 int owl_editwin_replace(owl_editwin *e, int replace, char *s)
     596int owl_editwin_replace(owl_editwin *e, int replace, const char *s)
    597597{
    598598  int start, end, i;
    599   char *p;
     599  const char *p;
    600600
    601601  if (!g_utf8_validate(s, -1, NULL)) {
     
    615615}
    616616
    617 static int owl_editwin_replace_internal(owl_editwin *e, int replace, char *s)
     617static int owl_editwin_replace_internal(owl_editwin *e, int replace, const char *s)
    618618{
    619619  int start, end, free, need, size, change;
     
    694694void owl_editwin_transpose_chars(owl_editwin *e)
    695695{
    696   char *middle, *end, *start, *tmp;
     696  const char *middle, *end, *start;
     697  char *tmp;
    697698
    698699  if (e->bufflen == 0) return;
     
    727728 * right
    728729 */
    729 void owl_editwin_insert_string(owl_editwin *e, char *s)
     730void owl_editwin_insert_string(owl_editwin *e, const char *s)
    730731{
    731732  owl_editwin_replace(e, 0, s);
     
    750751int owl_editwin_point_move(owl_editwin *e, int delta)
    751752{
    752   char *p;
     753  const char *p;
    753754  int change, d = 0;
    754755
     
    800801}
    801802
    802 static int owl_editwin_is_char_in(owl_editwin *e, char *set)
    803 {
    804   char *p;
     803static int owl_editwin_is_char_in(owl_editwin *e, const char *set)
     804{
     805  const char *p;
    805806
    806807  for (p = set; *p != 0; p = g_utf8_find_next_char(p, NULL))
     
    810811}
    811812
    812 int owl_editwin_move_if_in(owl_editwin *e, int delta, char *set)
     813int owl_editwin_move_if_in(owl_editwin *e, int delta, const char *set)
    813814{
    814815  int change, distance = 0;
     
    822823}
    823824
    824 int owl_editwin_move_if_not_in(owl_editwin *e, int delta, char *set)
     825int owl_editwin_move_if_not_in(owl_editwin *e, int delta, const char *set)
    825826{
    826827  int change, distance = 0;
     
    10291030}
    10301031
    1031 static char *oe_copy_buf(owl_editwin *e, char *buf, int len)
     1032static const char *oe_copy_buf(owl_editwin *e, const char *buf, int len)
    10321033{
    10331034  char *p;
     
    10471048static int oe_copy_region(owl_editwin *e)
    10481049{
    1049   char *p;
     1050  const char *p;
    10501051  int start, end;
    10511052
     
    12361237static int oe_region_width(owl_editwin *e, int start, int end, int offset)
    12371238{
    1238   char *p;
     1239  const char *p;
    12391240  int width = offset;
    12401241 
     
    13161317}
    13171318
    1318 char *owl_editwin_get_text(owl_editwin *e)
     1319const char *owl_editwin_get_text(owl_editwin *e)
    13191320{
    13201321  return(e->buff+e->lock);
Note: See TracChangeset for help on using the changeset viewer.