Changeset 28a5ebd in mainline for uspace/app/bdsh
- Timestamp:
- 2020-06-18T15:39:50Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce52c333
- Parents:
- 4f663f3e
- Location:
- uspace/app/bdsh
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
r4f663f3e r28a5ebd 154 154 } 155 155 156 static void paged_char( wchar_t c)156 static void paged_char(char32_t c) 157 157 { 158 158 if (last_char_was_newline && number) { … … 160 160 printf("%6u ", lineno); 161 161 } 162 put wchar(c);162 putuchar(c); 163 163 last_char_was_newline = c == '\n'; 164 164 if (paging_enabled) { … … 269 269 paged_char(((count + i + 1) & 0xf) == 0 ? '\n' : ' '); 270 270 } else { 271 wchar_t c = str_decode(buff, &offset, bytes);271 char32_t c = str_decode(buff, &offset, bytes); 272 272 if (c == 0) { 273 273 /* Reached end of string */ -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r4f663f3e r28a5ebd 108 108 while (true) { 109 109 size_t prev_off = off; 110 wchar_t cur_char = str_decode(path, &off, STR_NO_LIMIT);110 char32_t cur_char = str_decode(path, &off, STR_NO_LIMIT); 111 111 if ((cur_char == 0) || (cur_char == U_SPECIAL)) { 112 112 break; -
uspace/app/bdsh/cmds/modules/printf/printf.c
r4f663f3e r28a5ebd 68 68 * @param arg string with data to print. 69 69 */ 70 static int print_arg( wchar_t ch, const char *arg)70 static int print_arg(char32_t ch, const char *arg) 71 71 { 72 72 switch (ch) { … … 93 93 * @param ch Control character. 94 94 */ 95 static int process_ctl( wchar_t ch)95 static int process_ctl(char32_t ch) 96 96 { 97 97 switch (ch) { … … 120 120 char *fmt; 121 121 size_t pos, fmt_sz; 122 wchar_t ch;122 char32_t ch; 123 123 bool esc_flag = false; 124 124 unsigned int carg; // Current argument … … 170 170 break; 171 171 } 172 put wchar(ch);172 putuchar(ch); 173 173 break; 174 174 175 175 emit: 176 put wchar(ch);176 putuchar(ch); 177 177 esc_flag = false; 178 178 } -
uspace/app/bdsh/compl.c
r4f663f3e r28a5ebd 44 44 #include "util.h" 45 45 46 static errno_t compl_init( wchar_t *text, size_t pos, size_t *cstart, void **state);46 static errno_t compl_init(char32_t *text, size_t pos, size_t *cstart, void **state); 47 47 static errno_t compl_get_next(void *state, char **compl); 48 48 static void compl_fini(void *state); … … 94 94 * Set up iterators in completion object, based on current token. 95 95 */ 96 static errno_t compl_init( wchar_t *text, size_t pos, size_t *cstart, void **state)96 static errno_t compl_init(char32_t *text, size_t pos, size_t *cstart, void **state) 97 97 { 98 98 compl_t *cs = NULL; -
uspace/app/bdsh/tok.c
r4f663f3e r28a5ebd 36 36 37 37 /* Forward declarations of static functions */ 38 static wchar_t tok_get_char(tokenizer_t *);39 static wchar_t tok_look_char(tokenizer_t *);40 static errno_t tok_push_char(tokenizer_t *, wchar_t);38 static char32_t tok_get_char(tokenizer_t *); 39 static char32_t tok_look_char(tokenizer_t *); 40 static errno_t tok_push_char(tokenizer_t *, char32_t); 41 41 static errno_t tok_push_token(tokenizer_t *); 42 42 static bool tok_pending_chars(tokenizer_t *); … … 92 92 { 93 93 errno_t rc; 94 wchar_t next_char;94 char32_t next_char; 95 95 96 96 /* Read the input line char by char and append tokens */ … … 182 182 { 183 183 errno_t rc; 184 wchar_t next_char;184 char32_t next_char; 185 185 186 186 while ((next_char = tok_look_char(tok)) != 0) { … … 214 214 215 215 /** Get a char from input, advancing the input position */ 216 wchar_t tok_get_char(tokenizer_t *tok)216 char32_t tok_get_char(tokenizer_t *tok) 217 217 { 218 218 tok->in_char_offset++; … … 221 221 222 222 /** Get a char from input, while staying on the same input position */ 223 wchar_t tok_look_char(tokenizer_t *tok)223 char32_t tok_look_char(tokenizer_t *tok) 224 224 { 225 225 size_t old_offset = tok->in_offset; 226 226 size_t old_char_offset = tok->in_char_offset; 227 wchar_t ret = tok_get_char(tok);227 char32_t ret = tok_get_char(tok); 228 228 tok->in_offset = old_offset; 229 229 tok->in_char_offset = old_char_offset; … … 232 232 233 233 /** Append a char to the end of the current token */ 234 errno_t tok_push_char(tokenizer_t *tok, wchar_t ch)234 errno_t tok_push_char(tokenizer_t *tok, char32_t ch) 235 235 { 236 236 return chr_encode(ch, tok->outbuf, &tok->outbuf_offset, tok->outbuf_size);
Note:
See TracChangeset
for help on using the changeset viewer.