Changeset 28a5ebd in mainline for uspace/app/edit
- Timestamp:
- 2020-06-18T15:39:50Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce52c333
- Parents:
- 4f663f3e
- Location:
- uspace/app/edit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/edit/edit.c
r4f663f3e r28a5ebd 147 147 static void pane_caret_display(void); 148 148 149 static void insert_char( wchar_t c);149 static void insert_char(char32_t c); 150 150 static void delete_char_before(void); 151 151 static void delete_char_after(void); … … 630 630 kbd_event_t *kev; 631 631 char *str; 632 wchar_t buffer[INFNAME_MAX_LEN + 1];632 char32_t buffer[INFNAME_MAX_LEN + 1]; 633 633 int max_len; 634 634 int nc; … … 670 670 default: 671 671 if (kev->c >= 32 && nc < max_len) { 672 put wchar(kev->c);672 putuchar(kev->c); 673 673 console_flush(con); 674 674 buffer[nc++] = kev->c; … … 696 696 { 697 697 FILE *f; 698 wchar_t c;698 char32_t c; 699 699 char buf[BUF_SIZE]; 700 700 int bcnt; … … 850 850 coord_t rbc, rec; 851 851 char row_buf[ROW_BUF_SIZE]; 852 wchar_t c;852 char32_t c; 853 853 size_t pos, size; 854 854 int s_column; … … 1055 1055 1056 1056 /** Insert a character at caret position. */ 1057 static void insert_char( wchar_t c)1057 static void insert_char(char32_t c) 1058 1058 { 1059 1059 spt_t pt; … … 1285 1285 1286 1286 /* Search operations */ 1287 static errno_t search_spt_producer(void *data, wchar_t *ret)1287 static errno_t search_spt_producer(void *data, char32_t *ret) 1288 1288 { 1289 1289 assert(data != NULL); … … 1294 1294 } 1295 1295 1296 static errno_t search_spt_reverse_producer(void *data, wchar_t *ret)1296 static errno_t search_spt_reverse_producer(void *data, char32_t *ret) 1297 1297 { 1298 1298 assert(data != NULL); … … 1513 1513 char *str; 1514 1514 size_t off; 1515 wchar_t c;1515 char32_t c; 1516 1516 errno_t rc; 1517 1517 … … 1609 1609 } 1610 1610 1611 static wchar_t get_first_wchar(const char *str)1611 static char32_t get_first_wchar(const char *str) 1612 1612 { 1613 1613 size_t offset = 0; … … 1630 1630 return false; 1631 1631 1632 wchar_t first_char = get_first_wchar(ch);1632 char32_t first_char = get_first_wchar(ch); 1633 1633 switch (first_char) { 1634 1634 case ' ': … … 1656 1656 return false; 1657 1657 1658 wchar_t first_char = get_first_wchar(ch);1658 char32_t first_char = get_first_wchar(ch); 1659 1659 switch (first_char) { 1660 1660 case ',': -
uspace/app/edit/search.c
r4f663f3e r28a5ebd 50 50 return NULL; 51 51 52 wchar_t *p = str_to_awstr(pattern);52 char32_t *p = str_to_awstr(pattern); 53 53 if (p == NULL) { 54 54 free(search); … … 63 63 half = search->pattern_length / 2; 64 64 for (pos = 0; pos < half; pos++) { 65 wchar_t tmp = p[pos];65 char32_t tmp = p[pos]; 66 66 p[pos] = p[search->pattern_length - pos - 1]; 67 67 p[search->pattern_length - pos - 1] = tmp; … … 107 107 search_equals_fn eq = s->ops.equals; 108 108 109 wchar_t cur_char;109 char32_t cur_char; 110 110 errno_t rc = EOK; 111 111 while ((rc = s->ops.producer(s->client_data, &cur_char)) == EOK && cur_char > 0) { … … 141 141 } 142 142 143 bool char_exact_equals(const wchar_t a, const wchar_t b)143 bool char_exact_equals(const char32_t a, const char32_t b) 144 144 { 145 145 return a == b; -
uspace/app/edit/search.h
r4f663f3e r28a5ebd 42 42 struct search; 43 43 typedef struct search search_t; 44 typedef bool (*search_equals_fn)(const wchar_t, const wchar_t);45 typedef errno_t (*search_producer_fn)(void *, wchar_t *);44 typedef bool (*search_equals_fn)(const char32_t, const char32_t); 45 typedef errno_t (*search_producer_fn)(void *, char32_t *); 46 46 typedef errno_t (*search_mark_fn)(void *, void **); 47 47 typedef void (*search_mark_free_fn)(void *); … … 59 59 } search_ops_t; 60 60 61 extern bool char_exact_equals(const wchar_t, const wchar_t);61 extern bool char_exact_equals(const char32_t, const char32_t); 62 62 extern search_t *search_init(const char *, void *, search_ops_t, bool); 63 63 extern errno_t search_next_match(search_t *, match_t *); -
uspace/app/edit/search_impl.h
r4f663f3e r28a5ebd 43 43 /* Note: This structure is opaque for the user. */ 44 44 45 wchar_t *pattern;45 char32_t *pattern; 46 46 size_t pattern_length; 47 47 ssize_t *back_table; -
uspace/app/edit/sheet.c
r4f663f3e r28a5ebd 195 195 size_t copy_sz; 196 196 size_t off, prev; 197 wchar_t c;197 char32_t c; 198 198 199 199 spp = sh->data + spos->b_off; … … 222 222 { 223 223 size_t cur_pos, prev_pos; 224 wchar_t c;224 char32_t c; 225 225 coord_t cc; 226 226 … … 291 291 size_t off; 292 292 coord_t cc; 293 wchar_t c;293 char32_t c; 294 294 sheet_t *sh; 295 295 … … 320 320 321 321 /** Get a character at spt and return next spt */ 322 wchar_t spt_next_char(spt_t spt, spt_t *next)323 { 324 wchar_t ch = str_decode(spt.sh->data, &spt.b_off, spt.sh->text_size);322 char32_t spt_next_char(spt_t spt, spt_t *next) 323 { 324 char32_t ch = str_decode(spt.sh->data, &spt.b_off, spt.sh->text_size); 325 325 if (next) 326 326 *next = spt; … … 328 328 } 329 329 330 wchar_t spt_prev_char(spt_t spt, spt_t *prev)331 { 332 wchar_t ch = str_decode_reverse(spt.sh->data, &spt.b_off, spt.sh->text_size);330 char32_t spt_prev_char(spt_t spt, spt_t *prev) 331 { 332 char32_t ch = str_decode_reverse(spt.sh->data, &spt.b_off, spt.sh->text_size); 333 333 if (prev) 334 334 *prev = spt; -
uspace/app/edit/sheet.h
r4f663f3e r28a5ebd 101 101 extern void spt_get_coord(spt_t const *, coord_t *); 102 102 extern bool spt_equal(spt_t const *, spt_t const *); 103 extern wchar_t spt_next_char(spt_t, spt_t *);104 extern wchar_t spt_prev_char(spt_t, spt_t *);103 extern char32_t spt_next_char(spt_t, spt_t *); 104 extern char32_t spt_prev_char(spt_t, spt_t *); 105 105 106 106 extern void sheet_place_tag(sheet_t *, spt_t const *, tag_t *);
Note:
See TracChangeset
for help on using the changeset viewer.
