Changeset ecb5f95 in rtems
- Timestamp:
- 08/09/01 21:39:34 (22 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 4f088ae
- Parents:
- ff19ae5
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/libmisc/ChangeLog
rff19ae5 recb5f95 1 2001-08-09 Keith Outwater <vac4050@cae597.rsc.raytheon.com> 2 3 * monitor/mon-command.c: Add support for partial command matching. 4 The monitor used to have this functionality before it was overhauled 5 to support addition of user commands. 6 1 7 2001-06-14 Joel Sherrill <joel@OARcorp.com> 2 8 -
c/src/libmisc/monitor/mon-command.c
rff19ae5 recb5f95 13 13 #include <stdio.h> 14 14 #include <string.h> 15 16 /* 15 #include <stdlib.h> 16 17 /* 18 * 2001-01-30 KJO (vac4050@cae597.rsc.raytheon.com): 19 * Fixed rtems_monitor_command_lookup() to accept partial 20 * commands to uniqeness. Added support for setting 21 * the monitor prompt via an environment variable: 22 * RTEMS_MONITOR_PROMPT 23 * 17 24 * CCJ: 26-3-2000, adding command history and command line 18 25 * editing. This code is donated from My Right Boot and not … … 462 469 char **argv) 463 470 { 471 char *env_prompt; 472 473 env_prompt = getenv("RTEMS_MONITOR_PROMPT"); 474 464 475 /* 465 476 * put node number in the prompt if we are multiprocessing 466 477 */ 467 468 478 if (!rtems_configuration_get_user_multiprocessing_table ()) 469 sprintf (monitor_prompt, "%s", MONITOR_PROMPT); 479 sprintf (monitor_prompt, "%s", 480 (env_prompt == NULL) ? MONITOR_PROMPT: env_prompt); 470 481 else if (rtems_monitor_default_node != rtems_monitor_node) 471 482 sprintf (monitor_prompt, "%d-%s-%d", rtems_monitor_node, 472 MONITOR_PROMPT, rtems_monitor_default_node); 483 (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt, 484 rtems_monitor_default_node); 473 485 else 474 sprintf (monitor_prompt, "%d-%s", rtems_monitor_node, MONITOR_PROMPT); 486 sprintf (monitor_prompt, "%d-%s", rtems_monitor_node, 487 (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt); 475 488 476 489 #if defined(RTEMS_UNIX) … … 499 512 ) 500 513 { 501 char *command; 502 503 command = argv[0]; 504 505 if ((table == 0) || (command == 0)) 514 int command_length; 515 rtems_monitor_command_entry_t *found_it = NULL; 516 517 command_length = strlen (argv[0]); 518 519 if ((table == 0) || (argv[0] == 0)) 506 520 return 0; 507 521 … … 510 524 if (table->command) 511 525 { 512 if (STREQ (command, table->command)) /* exact match */ 526 527 /* 528 * Check for ambiguity 529 */ 530 if (!strncmp (table->command, argv[0], command_length)) 513 531 { 514 if (table->command_function == 0) 532 if (found_it) 533 { 515 534 return 0; 516 return table; 535 } 536 537 else 538 found_it = table; 517 539 } 518 540 } 519 541 table = table->next; 542 } 543 544 /* 545 * No ambiguity (the possible partial command was unique after all) 546 */ 547 if (found_it) 548 { 549 if (table->command_function == 0) 550 return 0; 551 552 return found_it; 520 553 } 521 554 -
cpukit/libmisc/ChangeLog
rff19ae5 recb5f95 1 2001-08-09 Keith Outwater <vac4050@cae597.rsc.raytheon.com> 2 3 * monitor/mon-command.c: Add support for partial command matching. 4 The monitor used to have this functionality before it was overhauled 5 to support addition of user commands. 6 1 7 2001-06-14 Joel Sherrill <joel@OARcorp.com> 2 8 -
cpukit/libmisc/monitor/mon-command.c
rff19ae5 recb5f95 13 13 #include <stdio.h> 14 14 #include <string.h> 15 16 /* 15 #include <stdlib.h> 16 17 /* 18 * 2001-01-30 KJO (vac4050@cae597.rsc.raytheon.com): 19 * Fixed rtems_monitor_command_lookup() to accept partial 20 * commands to uniqeness. Added support for setting 21 * the monitor prompt via an environment variable: 22 * RTEMS_MONITOR_PROMPT 23 * 17 24 * CCJ: 26-3-2000, adding command history and command line 18 25 * editing. This code is donated from My Right Boot and not … … 462 469 char **argv) 463 470 { 471 char *env_prompt; 472 473 env_prompt = getenv("RTEMS_MONITOR_PROMPT"); 474 464 475 /* 465 476 * put node number in the prompt if we are multiprocessing 466 477 */ 467 468 478 if (!rtems_configuration_get_user_multiprocessing_table ()) 469 sprintf (monitor_prompt, "%s", MONITOR_PROMPT); 479 sprintf (monitor_prompt, "%s", 480 (env_prompt == NULL) ? MONITOR_PROMPT: env_prompt); 470 481 else if (rtems_monitor_default_node != rtems_monitor_node) 471 482 sprintf (monitor_prompt, "%d-%s-%d", rtems_monitor_node, 472 MONITOR_PROMPT, rtems_monitor_default_node); 483 (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt, 484 rtems_monitor_default_node); 473 485 else 474 sprintf (monitor_prompt, "%d-%s", rtems_monitor_node, MONITOR_PROMPT); 486 sprintf (monitor_prompt, "%d-%s", rtems_monitor_node, 487 (env_prompt == NULL) ? MONITOR_PROMPT : env_prompt); 475 488 476 489 #if defined(RTEMS_UNIX) … … 499 512 ) 500 513 { 501 char *command; 502 503 command = argv[0]; 504 505 if ((table == 0) || (command == 0)) 514 int command_length; 515 rtems_monitor_command_entry_t *found_it = NULL; 516 517 command_length = strlen (argv[0]); 518 519 if ((table == 0) || (argv[0] == 0)) 506 520 return 0; 507 521 … … 510 524 if (table->command) 511 525 { 512 if (STREQ (command, table->command)) /* exact match */ 526 527 /* 528 * Check for ambiguity 529 */ 530 if (!strncmp (table->command, argv[0], command_length)) 513 531 { 514 if (table->command_function == 0) 532 if (found_it) 533 { 515 534 return 0; 516 return table; 535 } 536 537 else 538 found_it = table; 517 539 } 518 540 } 519 541 table = table->next; 542 } 543 544 /* 545 * No ambiguity (the possible partial command was unique after all) 546 */ 547 if (found_it) 548 { 549 if (table->command_function == 0) 550 return 0; 551 552 return found_it; 520 553 } 521 554
Note: See TracChangeset
for help on using the changeset viewer.