Changes in / [dfc07c1:e435537] in mainline
- Files:
-
- 14 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
rdfc07c1 re435537 98 98 $(USPACE_PATH)/srv/bd/part/guid_part/g_part \ 99 99 $(USPACE_PATH)/srv/bd/part/mbr_part/mbr_part \ 100 $(USPACE_PATH)/srv/bd/sata_bd/sata_bd \ 100 101 $(USPACE_PATH)/srv/clipboard/clipboard \ 101 102 $(USPACE_PATH)/srv/fs/tmpfs/tmpfs \ … … 122 123 nic/ne2k \ 123 124 nic/e1k \ 124 nic/rtl8139 125 nic/rtl8139 \ 126 block/ahci 125 127 126 128 RD_DRV_CFG = -
kernel/generic/src/console/kconsole.c
rdfc07c1 re435537 202 202 * 203 203 */ 204 NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t * 204 NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev) 205 205 { 206 206 const char *name = input; 207 207 208 208 size_t found = 0; 209 /* Maximum Match Length : Length of longest matching common substring in 210 case more than one match is found */ 209 210 /* 211 * Maximum Match Length: Length of longest matching common 212 * substring in case more than one match is found. 213 */ 211 214 size_t max_match_len = size; 212 215 size_t max_match_len_tmp = size; … … 229 232 } 230 233 231 /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */ 234 /* 235 * If the number of possible completions is more than MAX_TAB_HINTS, 236 * ask the user whether to display them or not. 237 */ 232 238 if (found > MAX_TAB_HINTS) { 233 239 printf("\n"); 234 continue_showing_hints = console_prompt_display_all_hints(indev, found); 240 continue_showing_hints = 241 console_prompt_display_all_hints(indev, found); 235 242 } 236 243 … … 240 247 while (cmdtab_search_one(name, &pos)) { 241 248 cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link); 242 249 243 250 if (continue_showing_hints) { 244 251 printf("%s (%s)\n", hlp->name, hlp->description); 245 252 --hints_to_show; 246 253 ++total_hints_shown; 247 248 if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */ 249 continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show); 254 255 if ((hints_to_show == 0) && (total_hints_shown != found)) { 256 /* Ask user to continue */ 257 continue_showing_hints = 258 console_prompt_more_hints(indev, &hints_to_show); 250 259 } 251 260 } 252 261 253 262 pos = pos->next; 254 for(max_match_len_tmp = 0; output[max_match_len_tmp] == hlp->name[input_len + max_match_len_tmp] 255 && max_match_len_tmp < max_match_len; ++max_match_len_tmp); 263 264 for (max_match_len_tmp = 0; 265 (output[max_match_len_tmp] == 266 hlp->name[input_len + max_match_len_tmp]) && 267 (max_match_len_tmp < max_match_len); ++max_match_len_tmp); 268 256 269 max_match_len = max_match_len_tmp; 257 270 } 258 /* keep only the characters common in all completions */ 271 272 /* Keep only the characters common in all completions */ 259 273 output[max_match_len] = 0; 260 274 } … … 310 324 continue; 311 325 312 /* Find the beginning of the word 313 and copy it to tmp */ 326 /* 327 * Find the beginning of the word 328 * and copy it to tmp 329 */ 314 330 size_t beg; 315 331 for (beg = position - 1; (beg > 0) && (!isspace(current[beg])); … … 333 349 continue; 334 350 335 /* We have hints, may be many. In case of more than one hint, 336 tmp will contain the common prefix. */ 351 /* 352 * We have hints, possibly many. In case of more than one hint, 353 * tmp will contain the common prefix. 354 */ 337 355 size_t off = 0; 338 356 size_t i = 0; … … 340 358 if (!wstr_linsert(current, ch, position + i, MAX_CMDLINE)) 341 359 break; 360 342 361 i++; 343 362 } -
kernel/generic/src/debug/symtab.c
rdfc07c1 re435537 210 210 * 211 211 */ 212 int symtab_compl(char *input, size_t size, indev_t * 212 int symtab_compl(char *input, size_t size, indev_t *indev) 213 213 { 214 214 #ifdef CONFIG_SYMTAB … … 227 227 const char *hint; 228 228 char output[MAX_SYMBOL_NAME]; 229 /* Maximum Match Length : Length of longest matching common substring in 230 case more than one match is found */ 229 230 /* 231 * Maximum Match Length: Length of longest matching common substring in 232 * case more than one match is found. 233 */ 231 234 size_t max_match_len = size; 232 235 size_t max_match_len_tmp = size; … … 238 241 239 242 output[0] = 0; 240 241 while ((hint = symtab_search_one(name, &pos))) { 242 ++pos; 243 } 244 243 244 while ((hint = symtab_search_one(name, &pos))) 245 pos++; 246 245 247 pos = 0; 246 248 … … 253 255 } 254 256 255 /* If possible completions are more than MAX_TAB_HINTS, ask user whether to display them or not. */ 257 /* 258 * If the number of possible completions is more than MAX_TAB_HINTS, 259 * ask the user whether to display them or not. 260 */ 256 261 if (found > MAX_TAB_HINTS) { 257 262 printf("\n"); 258 continue_showing_hints = console_prompt_display_all_hints(indev, found); 263 continue_showing_hints = 264 console_prompt_display_all_hints(indev, found); 259 265 } 260 266 … … 265 271 sym_name = symbol_table[pos].symbol_name; 266 272 pos++; 267 268 if (continue_showing_hints) { /* We are still showing hints */ 273 274 if (continue_showing_hints) { 275 /* We are still showing hints */ 269 276 printf("%s\n", sym_name); 270 277 --hints_to_show; 271 278 ++total_hints_shown; 272 273 if (hints_to_show == 0 && total_hints_shown != found) { /* Time to ask user to continue */ 274 continue_showing_hints = console_prompt_more_hints(indev, &hints_to_show); 279 280 if ((hints_to_show == 0) && (total_hints_shown != found)) { 281 /* Ask the user to continue */ 282 continue_showing_hints = 283 console_prompt_more_hints(indev, &hints_to_show); 275 284 } 276 285 } 277 278 for(max_match_len_tmp = 0; output[max_match_len_tmp] == sym_name[input_len + max_match_len_tmp] 279 && max_match_len_tmp < max_match_len; ++max_match_len_tmp); 286 287 for (max_match_len_tmp = 0; 288 (output[max_match_len_tmp] == 289 sym_name[input_len + max_match_len_tmp]) && 290 (max_match_len_tmp < max_match_len); ++max_match_len_tmp); 291 280 292 max_match_len = max_match_len_tmp; 281 293 } 282 /* keep only the characters common in all completions */ 294 295 /* Keep only the characters common in all completions */ 283 296 output[max_match_len] = 0; 284 297 } -
uspace/Makefile
rdfc07c1 re435537 85 85 srv/vfs \ 86 86 srv/bd/ata_bd \ 87 srv/bd/sata_bd \ 87 88 srv/bd/file_bd \ 88 89 srv/bd/gxe_bd \ … … 105 106 drv/infrastructure/root \ 106 107 drv/infrastructure/rootvirt \ 108 drv/block/ahci \ 107 109 drv/char/i8042 \ 108 110 drv/char/ps2mouse \ -
uspace/app/bdsh/cmds/modules/cat/cat.c
rdfc07c1 re435537 176 176 177 177 bool reading_stdin = dash_represents_stdin && (str_cmp(fname, "-") == 0); 178 178 179 179 if (reading_stdin) { 180 180 fd = fileno(stdin); 181 181 /* Allow storing the whole UTF-8 character. */ 182 182 blen = STR_BOUNDS(1); 183 } else {183 } else 184 184 fd = open(fname, O_RDONLY); 185 }185 186 186 if (fd < 0) { 187 187 printf("Unable to open %s\n", fname); … … 222 222 bytes_to_read = 1; 223 223 } else { 224 if ((length != CAT_FULL_FILE) 225 &&(length - (off64_t)count <= (off64_t)(blen - copied_bytes))) {224 if ((length != CAT_FULL_FILE) && 225 (length - (off64_t)count <= (off64_t)(blen - copied_bytes))) { 226 226 bytes_to_read = (size_t) (length - count); 227 227 } else { … … 229 229 } 230 230 } 231 231 232 bytes = read(fd, buff + copied_bytes, bytes_to_read); 232 233 bytes += copied_bytes; … … 261 262 reads++; 262 263 } 263 264 if (reading_stdin) {264 265 if (reading_stdin) 265 266 fflush(stdout); 266 }267 267 } while (bytes > 0 && !should_quit && (count < length || length == CAT_FULL_FILE)); 268 268 -
uspace/lib/c/Makefile
rdfc07c1 re435537 71 71 generic/device/nic.c \ 72 72 generic/device/pci.c \ 73 generic/device/ahci.c \ 73 74 generic/elf/elf_load.c \ 74 75 generic/event.c \ -
uspace/lib/c/include/ipc/dev_iface.h
rdfc07c1 re435537 51 51 /** Interface provided by USB HID devices. */ 52 52 USBHID_DEV_IFACE, 53 /** Interface provided by AHCI devices. */ 54 AHCI_DEV_IFACE, 53 55 54 56 DEV_IFACE_MAX -
uspace/lib/drv/Makefile
rdfc07c1 re435537 44 44 generic/remote_pci.c \ 45 45 generic/remote_usbhc.c \ 46 generic/remote_usbhid.c 46 generic/remote_usbhid.c \ 47 generic/remote_ahci.c 47 48 48 49 include $(USPACE_PREFIX)/Makefile.common -
uspace/lib/drv/generic/dev_iface.c
rdfc07c1 re435537 46 46 #include "remote_usbhid.h" 47 47 #include "remote_pci.h" 48 #include "remote_ahci.h" 48 49 49 50 static iface_dipatch_table_t remote_ifaces = { … … 55 56 &remote_usb_iface, 56 57 &remote_usbhc_iface, 57 &remote_usbhid_iface 58 &remote_usbhid_iface, 59 &remote_ahci_iface 58 60 } 59 61 }; -
uspace/srv/hid/console/console.c
rdfc07c1 re435537 617 617 618 618 size_t pos = 0; 619 619 620 620 /* 621 621 * Read input from keyboard and copy it to the buffer. … … 628 628 buf[pos] = cons->char_remains[0]; 629 629 pos++; 630 630 631 /* Unshift the array. */ 631 for (size_t i = 1; i < cons->char_remains_len; i++) {632 for (size_t i = 1; i < cons->char_remains_len; i++) 632 633 cons->char_remains[i - 1] = cons->char_remains[i]; 633 }634 634 635 cons->char_remains_len--; 635 636 } 637 636 638 /* Still not enough? Then get another key from the queue. */ 637 639 if (pos < size) { 638 640 link_t *link = prodcons_consume(&cons->input_pc); 639 641 kbd_event_t *event = list_get_instance(link, kbd_event_t, link); 640 642 641 643 /* Accept key presses of printable chars only. */ 642 644 if ((event->type == KEY_PRESS) && (event->c != 0)) { … … 645 647 cons->char_remains_len = str_size(cons->char_remains); 646 648 } 647 649 648 650 free(event); 649 651 }
Note:
See TracChangeset
for help on using the changeset viewer.