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