Changeset 78f771c881f9ef27ca4a35b3fc9efc407edba665

Show
Ignore:
Timestamp:
11/01/09 05:32:26 (2 years ago)
Author:
Pierre-Alexandre Meyer <pierre@…>
Children:
6e20c10dbc1b6740f94a01f74d6eeda8bb3a7ca4
Parents:
111fe227a44f170e91f2d6f57dd6ce285b67a56a
git-committer:
Pierre-Alexandre Meyer <pierre@mouraf.org> / 2009-10-31T22:32:26Z-0700
Message:

hdt: change remaining printf to more_printf (CLI)

A lot of places still had printf() instead of more_printf().
This patch does a bulk update and add missing reset_more_printf(),
used to reset the pager counter between each command call.

This also changes the more_printf() routine to delete the "--More--"
line while scrolling.

Signed-off-by: Pierre-Alexandre Meyer <pierre@…>

Location:
com32/hdt
Files:
11 modified

Legend:

Unmodified
Added
Removed
  • com32/hdt/hdt-cli-disk.c

    re9069c r78f771  
    6363        int i = nb_partitions_seen; 
    6464 
     65    reset_more_printf(); 
     66 
    6567        start = partition_offset; 
    6668        end = start + ptab->length - 1; 
     
    115117 
    116118        detect_disks(hardware); 
     119    reset_more_printf(); 
     120 
    117121        if (!hardware->disk_info[i].cbios) 
    118122                return; /* Invalid geometry */ 
     
    158162        detect_disks(hardware); 
    159163 
    160         int first_one = 0; 
     164    int first_one = 0; 
    161165        for (int drive = 0x80; drive < 0xff; drive++) { 
    162166                if (hardware->disk_info[drive - 0x80].cbios) { 
    163                         if (!first_one) { 
    164                                 first_one = 1; 
    165                         } else { 
    166                                 pause_printf(); 
    167                         } 
     167            if (!first_one) { 
     168                    first_one = 1; 
     169            } else { 
     170                    pause_printf(); 
     171            } 
    168172                        char buf[5] = ""; 
    169173                        sprintf(buf, "0x%x", drive); 
  • com32/hdt/hdt-cli-dmi.c

    r3716f4 r78f771  
    3939{ 
    4040  char available_dmi_commands[1024]; 
     41  reset_more_printf(); 
    4142  memset(available_dmi_commands, 0, sizeof(available_dmi_commands)); 
    4243 
    43   printf("Available DMI modules on your system:\n"); 
     44  more_printf("Available DMI modules on your system:\n"); 
    4445        if (hardware->dmi.base_board.filled == true) 
    45                 printf("\t%s\n", CLI_DMI_BASE_BOARD); 
     46                more_printf("\t%s\n", CLI_DMI_BASE_BOARD); 
    4647        if (hardware->dmi.battery.filled == true) 
    47                 printf("\t%s\n", CLI_DMI_BATTERY); 
     48                more_printf("\t%s\n", CLI_DMI_BATTERY); 
    4849        if (hardware->dmi.bios.filled == true) 
    49                 printf("\t%s\n", CLI_DMI_BIOS); 
     50                more_printf("\t%s\n", CLI_DMI_BIOS); 
    5051        if (hardware->dmi.chassis.filled == true) 
    51                 printf("\t%s\n", CLI_DMI_CHASSIS); 
     52                more_printf("\t%s\n", CLI_DMI_CHASSIS); 
    5253        for (int i = 0; i < hardware->dmi.memory_count; i++) { 
    5354                if (hardware->dmi.memory[i].filled == true) { 
    54                         printf("\tbank <number>\n"); 
     55                        more_printf("\tbank <number>\n"); 
    5556                        break; 
    5657                } 
     
    5859        for (int i = 0; i < hardware->dmi.memory_module_count; i++) { 
    5960                if (hardware->dmi.memory_module[i].filled == true) { 
    60                         printf("\tmodule <number>\n"); 
     61                        more_printf("\tmodule <number>\n"); 
    6162                        break; 
    6263                } 
    6364        } 
    6465        if (hardware->dmi.processor.filled == true) 
    65                 printf("\t%s\n", CLI_DMI_PROCESSOR); 
     66                more_printf("\t%s\n", CLI_DMI_PROCESSOR); 
    6667        if (hardware->dmi.system.filled == true) 
    67                 printf("\t%s\n", CLI_DMI_SYSTEM); 
     68                more_printf("\t%s\n", CLI_DMI_SYSTEM); 
    6869        if (hardware->dmi.ipmi.filled == true) 
    69                 printf("\t%s\n", CLI_DMI_IPMI); 
     70                more_printf("\t%s\n", CLI_DMI_IPMI); 
    7071        if (hardware->dmi.cache_count) 
    71                 printf("\t%s\n", CLI_DMI_CACHE); 
     72                more_printf("\t%s\n", CLI_DMI_CACHE); 
    7273        if (strlen(hardware->dmi.oem_strings)) 
    7374                more_printf("\t%s\n", CLI_DMI_OEM); 
    7475        if (hardware->dmi.hardware_security.filled) 
    75                 printf("\t%s\n", CLI_DMI_SECURITY); 
     76                more_printf("\t%s\n", CLI_DMI_SECURITY); 
    7677} 
    7778 
     
    8081{ 
    8182  if (hardware->dmi.base_board.filled == false) { 
    82     printf("base_board information not found on your system, see " 
     83    more_printf("base_board information not found on your system, see " 
    8384           "`show list' to see which module is available.\n"); 
    8485    return; 
     
    115116{ 
    116117  if (hardware->dmi.system.filled == false) { 
    117     printf("system information not found on your system, see " 
     118    more_printf("system information not found on your system, see " 
    118119           "`show list' to see which module is available.\n"); 
    119120    return; 
    120121  } 
    121   printf("System\n"); 
    122   printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer); 
    123   printf(" Product Name : %s\n", hardware->dmi.system.product_name); 
    124   printf(" Version      : %s\n", hardware->dmi.system.version); 
    125   printf(" Serial       : %s\n", hardware->dmi.system.serial); 
    126   printf(" UUID         : %s\n", hardware->dmi.system.uuid); 
    127   printf(" Wakeup Type  : %s\n", hardware->dmi.system.wakeup_type); 
    128   printf(" SKU Number   : %s\n", hardware->dmi.system.sku_number); 
    129   printf(" Family       : %s\n", hardware->dmi.system.family); 
     122  reset_more_printf(); 
     123  more_printf("System\n"); 
     124  more_printf(" Manufacturer : %s\n", hardware->dmi.system.manufacturer); 
     125  more_printf(" Product Name : %s\n", hardware->dmi.system.product_name); 
     126  more_printf(" Version      : %s\n", hardware->dmi.system.version); 
     127  more_printf(" Serial       : %s\n", hardware->dmi.system.serial); 
     128  more_printf(" UUID         : %s\n", hardware->dmi.system.uuid); 
     129  more_printf(" Wakeup Type  : %s\n", hardware->dmi.system.wakeup_type); 
     130  more_printf(" SKU Number   : %s\n", hardware->dmi.system.sku_number); 
     131  more_printf(" Family       : %s\n", hardware->dmi.system.family); 
    130132 
    131133  if (strlen(hardware->dmi.system.configuration_options)) { 
    132     printf("System Configuration Options\n"); 
    133     printf("%s\n", hardware->dmi.system.configuration_options); 
     134    more_printf("System Configuration Options\n"); 
     135    more_printf("%s\n", hardware->dmi.system.configuration_options); 
    134136  } 
    135137 
    136138  if (hardware->dmi.system.system_reset.filled) { 
    137     printf("System Reset\n"); 
    138     printf("  Status               : %s\n", 
     139    more_printf("System Reset\n"); 
     140    more_printf("  Status               : %s\n", 
    139141           (hardware->dmi.system.system_reset.status ? "Enabled" : "Disabled")); 
    140     printf("  Watchdog Timer       : %s\n", 
     142    more_printf("  Watchdog Timer       : %s\n", 
    141143           (hardware->dmi.system.system_reset.watchdog ? "Present" : "Not Present")); 
    142144    if (strlen(hardware->dmi.system.system_reset.boot_option)) 
    143       printf("  Boot Option          : %s\n", hardware->dmi.system.system_reset.boot_option); 
     145      more_printf("  Boot Option          : %s\n", hardware->dmi.system.system_reset.boot_option); 
    144146    if (strlen(hardware->dmi.system.system_reset.boot_option_on_limit)) 
    145       printf("  Boot Option On Limit : %s\n", hardware->dmi.system.system_reset.boot_option_on_limit); 
     147      more_printf("  Boot Option On Limit : %s\n", hardware->dmi.system.system_reset.boot_option_on_limit); 
    146148    if (strlen(hardware->dmi.system.system_reset.reset_count)) 
    147       printf("  Reset Count          : %s\n", hardware->dmi.system.system_reset.reset_count); 
     149      more_printf("  Reset Count          : %s\n", hardware->dmi.system.system_reset.reset_count); 
    148150    if (strlen(hardware->dmi.system.system_reset.reset_limit)) 
    149       printf("  Reset Limit          : %s\n", hardware->dmi.system.system_reset.reset_limit); 
     151      more_printf("  Reset Limit          : %s\n", hardware->dmi.system.system_reset.reset_limit); 
    150152    if (strlen(hardware->dmi.system.system_reset.timer_interval)) 
    151       printf("  Timer Interval       : %s\n", hardware->dmi.system.system_reset.timer_interval); 
     153      more_printf("  Timer Interval       : %s\n", hardware->dmi.system.system_reset.timer_interval); 
    152154    if (strlen(hardware->dmi.system.system_reset.timeout)) 
    153       printf("  Timeout              : %s\n", hardware->dmi.system.system_reset.timeout); 
    154   } 
    155  
    156   printf("System Boot Information\n"); 
    157   printf(" Status       : %s\n", hardware->dmi.system.system_boot_status); 
     155      more_printf("  Timeout              : %s\n", hardware->dmi.system.system_reset.timeout); 
     156  } 
     157 
     158  more_printf("System Boot Information\n"); 
     159  more_printf(" Status       : %s\n", hardware->dmi.system.system_boot_status); 
    158160} 
    159161 
     
    162164{ 
    163165  if (hardware->dmi.bios.filled == false) { 
    164     printf("bios information not found on your system, see " 
     166    more_printf("bios information not found on your system, see " 
    165167           "`show list' to see which module is available.\n"); 
    166168    return; 
     
    214216    return; 
    215217  } 
    216   printf("Chassis\n"); 
    217   printf(" Manufacturer       : %s\n", 
     218  reset_more_printf(); 
     219  more_printf("Chassis\n"); 
     220  more_printf(" Manufacturer       : %s\n", 
    218221        hardware->dmi.chassis.manufacturer); 
    219   printf(" Type               : %s\n", hardware->dmi.chassis.type); 
    220   printf(" Lock               : %s\n", hardware->dmi.chassis.lock); 
    221   printf(" Version            : %s\n", 
     222  more_printf(" Type               : %s\n", hardware->dmi.chassis.type); 
     223  more_printf(" Lock               : %s\n", hardware->dmi.chassis.lock); 
     224  more_printf(" Version            : %s\n", 
    222225        hardware->dmi.chassis.version); 
    223   printf(" Serial             : %s\n", hardware->dmi.chassis.serial); 
    224   printf(" Asset Tag          : %s\n", 
     226  more_printf(" Serial             : %s\n", hardware->dmi.chassis.serial); 
     227  more_printf(" Asset Tag          : %s\n", 
    225228        del_multi_spaces(hardware->dmi.chassis.asset_tag)); 
    226   printf(" Boot up state      : %s\n", 
     229  more_printf(" Boot up state      : %s\n", 
    227230        hardware->dmi.chassis.boot_up_state); 
    228   printf(" Power supply state : %s\n", 
     231  more_printf(" Power supply state : %s\n", 
    229232        hardware->dmi.chassis.power_supply_state); 
    230   printf(" Thermal state      : %s\n", 
     233  more_printf(" Thermal state      : %s\n", 
    231234        hardware->dmi.chassis.thermal_state); 
    232   printf(" Security Status    : %s\n", 
     235  more_printf(" Security Status    : %s\n", 
    233236        hardware->dmi.chassis.security_status); 
    234   printf(" OEM Information    : %s\n", 
     237  more_printf(" OEM Information    : %s\n", 
    235238        hardware->dmi.chassis.oem_information); 
    236   printf(" Height             : %u\n", hardware->dmi.chassis.height); 
    237   printf(" NB Power Cords     : %u\n", 
     239  more_printf(" Height             : %u\n", hardware->dmi.chassis.height); 
     240  more_printf(" NB Power Cords     : %u\n", 
    238241        hardware->dmi.chassis.nb_power_cords); 
    239242} 
     
    246249    return; 
    247250  } 
    248   printf("IPMI\n"); 
    249   printf(" Interface Type     : %s\n", 
     251  reset_more_printf(); 
     252  more_printf("IPMI\n"); 
     253  more_printf(" Interface Type     : %s\n", 
    250254        hardware->dmi.ipmi.interface_type); 
    251   printf(" Specification Ver. : %u.%u\n", 
     255  more_printf(" Specification Ver. : %u.%u\n", 
    252256        hardware->dmi.ipmi.major_specification_version, 
    253257        hardware->dmi.ipmi.minor_specification_version); 
    254   printf(" I2C Slave Address  : 0x%02x\n", 
     258  more_printf(" I2C Slave Address  : 0x%02x\n", 
    255259        hardware->dmi.ipmi.I2C_slave_address); 
    256   printf(" Nv Storage Address : %u\n", 
     260  more_printf(" Nv Storage Address : %u\n", 
    257261        hardware->dmi.ipmi.nv_address); 
    258262  uint32_t high = hardware->dmi.ipmi.base_address >> 32; 
    259263  uint32_t low  = hardware->dmi.ipmi.base_address & 0xFFFF; 
    260   printf(" Base Address       : %08X%08X\n", 
     264  more_printf(" Base Address       : %08X%08X\n", 
    261265        high,(low & ~1)); 
    262   printf(" IRQ                : %d\n", 
     266  more_printf(" IRQ                : %d\n", 
    263267        hardware->dmi.ipmi.irq); 
    264268} 
     
    268272{ 
    269273  if (hardware->dmi.battery.filled == false) { 
    270     printf("battery information not found on your system, see " 
     274    more_printf("battery information not found on your system, see " 
    271275           "`show list' to see which module is available.\n"); 
    272276    return; 
    273277  } 
    274   printf("Battery \n"); 
    275   printf(" Vendor             : %s\n", 
     278  reset_more_printf(); 
     279  more_printf("Battery \n"); 
     280  more_printf(" Vendor             : %s\n", 
    276281        hardware->dmi.battery.manufacturer); 
    277   printf(" Manufacture Date   : %s\n", 
     282  more_printf(" Manufacture Date   : %s\n", 
    278283        hardware->dmi.battery.manufacture_date); 
    279   printf(" Serial             : %s\n", hardware->dmi.battery.serial); 
    280   printf(" Name               : %s\n", hardware->dmi.battery.name); 
    281   printf(" Chemistry          : %s\n", 
     284  more_printf(" Serial             : %s\n", hardware->dmi.battery.serial); 
     285  more_printf(" Name               : %s\n", hardware->dmi.battery.name); 
     286  more_printf(" Chemistry          : %s\n", 
    282287        hardware->dmi.battery.chemistry); 
    283   printf(" Design Capacity    : %s\n", 
     288  more_printf(" Design Capacity    : %s\n", 
    284289        hardware->dmi.battery.design_capacity); 
    285   printf(" Design Voltage     : %s\n", 
     290  more_printf(" Design Voltage     : %s\n", 
    286291        hardware->dmi.battery.design_voltage); 
    287   printf(" SBDS               : %s\n", hardware->dmi.battery.sbds); 
    288   printf(" SBDS Manuf. Date   : %s\n", 
     292  more_printf(" SBDS               : %s\n", hardware->dmi.battery.sbds); 
     293  more_printf(" SBDS Manuf. Date   : %s\n", 
    289294        hardware->dmi.battery.sbds_manufacture_date); 
    290   printf(" SBDS Chemistry     : %s\n", 
     295  more_printf(" SBDS Chemistry     : %s\n", 
    291296        hardware->dmi.battery.sbds_chemistry); 
    292   printf(" Maximum Error      : %s\n", 
     297  more_printf(" Maximum Error      : %s\n", 
    293298        hardware->dmi.battery.maximum_error); 
    294   printf(" OEM Info           : %s\n", 
     299  more_printf(" OEM Info           : %s\n", 
    295300        hardware->dmi.battery.oem_info); 
    296301} 
     
    300305{ 
    301306  if (hardware->dmi.processor.filled == false) { 
    302     printf("processor information not found on your system, see " 
     307    more_printf("processor information not found on your system, see " 
    303308           "`show list' to see which module is available.\n"); 
    304309    return; 
     
    364369 
    365370  if (errno == ERANGE || bank < 0) { 
    366     printf("This bank number is incorrect\n"); 
     371    more_printf("This bank number is incorrect\n"); 
    367372    return; 
    368373  } 
    369374 
    370375  if ((bank >= hardware->dmi.memory_count) || (bank < 0)) { 
    371     printf("Bank %d number doesn't exist\n", bank); 
     376    more_printf("Bank %d number doesn't exist\n", bank); 
    372377    return; 
    373378  } 
    374379  if (hardware->dmi.memory[bank].filled == false) { 
    375     printf("Bank %d doesn't contain any information\n", bank); 
    376     return; 
    377   } 
    378  
    379   printf("Memory Bank %d\n", bank); 
    380   printf(" Form Factor  : %s\n", 
     380    more_printf("Bank %d doesn't contain any information\n", bank); 
     381    return; 
     382  } 
     383 
     384  reset_more_printf(); 
     385  more_printf("Memory Bank %d\n", bank); 
     386  more_printf(" Form Factor  : %s\n", 
    381387        hardware->dmi.memory[bank].form_factor); 
    382   printf(" Type         : %s\n", hardware->dmi.memory[bank].type); 
    383   printf(" Type Detail  : %s\n", 
     388  more_printf(" Type         : %s\n", hardware->dmi.memory[bank].type); 
     389  more_printf(" Type Detail  : %s\n", 
    384390        hardware->dmi.memory[bank].type_detail); 
    385   printf(" Speed        : %s\n", hardware->dmi.memory[bank].speed); 
    386   printf(" Size         : %s\n", hardware->dmi.memory[bank].size); 
    387   printf(" Device Set   : %s\n", 
     391  more_printf(" Speed        : %s\n", hardware->dmi.memory[bank].speed); 
     392  more_printf(" Size         : %s\n", hardware->dmi.memory[bank].size); 
     393  more_printf(" Device Set   : %s\n", 
    388394        hardware->dmi.memory[bank].device_set); 
    389   printf(" Device Loc.  : %s\n", 
     395  more_printf(" Device Loc.  : %s\n", 
    390396        hardware->dmi.memory[bank].device_locator); 
    391   printf(" Bank Locator : %s\n", 
     397  more_printf(" Bank Locator : %s\n", 
    392398        hardware->dmi.memory[bank].bank_locator); 
    393   printf(" Total Width  : %s\n", 
     399  more_printf(" Total Width  : %s\n", 
    394400        hardware->dmi.memory[bank].total_width); 
    395   printf(" Data Width   : %s\n", 
     401  more_printf(" Data Width   : %s\n", 
    396402        hardware->dmi.memory[bank].data_width); 
    397   printf(" Error        : %s\n", hardware->dmi.memory[bank].error); 
    398   printf(" Vendor       : %s\n", 
     403  more_printf(" Error        : %s\n", hardware->dmi.memory[bank].error); 
     404  more_printf(" Vendor       : %s\n", 
    399405        hardware->dmi.memory[bank].manufacturer); 
    400   printf(" Serial       : %s\n", hardware->dmi.memory[bank].serial); 
    401   printf(" Asset Tag    : %s\n", 
     406  more_printf(" Serial       : %s\n", hardware->dmi.memory[bank].serial); 
     407  more_printf(" Asset Tag    : %s\n", 
    402408        hardware->dmi.memory[bank].asset_tag); 
    403   printf(" Part Number  : %s\n", 
     409  more_printf(" Part Number  : %s\n", 
    404410        hardware->dmi.memory[bank].part_number); 
    405411} 
     
    409415{ 
    410416        if (!hardware->dmi.cache_count) { 
    411                 printf("cache information not found on your system, see " 
     417                more_printf("cache information not found on your system, see " 
    412418                       "`show list' to see which module is available.\n"); 
    413419                return; 
     
    417423 
    418424        if (argc != 1 || cache > hardware->dmi.cache_count) { 
    419                 printf("show cache [0-%d]\n", hardware->dmi.cache_count-1); 
     425                more_printf("show cache [0-%d]\n", hardware->dmi.cache_count-1); 
    420426                return; 
    421427        } 
     
    465471 
    466472        if (errno == ERANGE || module < 0) { 
    467                 printf("This module number is incorrect\n"); 
     473                more_printf("This module number is incorrect\n"); 
    468474                return; 
    469475        } 
    470476 
    471477        if ((module >= hardware->dmi.memory_module_count) || (module < 0)) { 
    472                 printf("Module number %d doesn't exist\n", module); 
     478                more_printf("Module number %d doesn't exist\n", module); 
    473479                return; 
    474480        } 
    475481 
    476482        if (hardware->dmi.memory_module[module].filled == false) { 
    477                 printf("Module %d doesn't contain any information\n", module); 
     483                more_printf("Module %d doesn't contain any information\n", module); 
    478484                return; 
    479485        } 
    480486 
    481         printf("Memory Module %d\n", module); 
    482         printf(" Socket Designation : %s\n", 
     487  reset_more_printf(); 
     488        more_printf("Memory Module %d\n", module); 
     489        more_printf(" Socket Designation : %s\n", 
    483490                hardware->dmi.memory_module[module].socket_designation); 
    484         printf(" Bank Connections   : %s\n", 
     491        more_printf(" Bank Connections   : %s\n", 
    485492                hardware->dmi.memory_module[module].bank_connections); 
    486         printf(" Current Speed      : %s\n", 
     493        more_printf(" Current Speed      : %s\n", 
    487494                hardware->dmi.memory_module[module].speed); 
    488         printf(" Type               : %s\n", 
     495        more_printf(" Type               : %s\n", 
    489496                hardware->dmi.memory_module[module].type); 
    490         printf(" Installed Size     : %s\n", 
     497        more_printf(" Installed Size     : %s\n", 
    491498                hardware->dmi.memory_module[module].installed_size); 
    492         printf(" Enabled Size       : %s\n", 
     499        more_printf(" Enabled Size       : %s\n", 
    493500                hardware->dmi.memory_module[module].enabled_size); 
    494         printf(" Error Status       : %s\n", 
     501        more_printf(" Error Status       : %s\n", 
    495502                hardware->dmi.memory_module[module].error_status); 
    496503} 
     
    503510 
    504511  if (hardware->is_dmi_valid == false) { 
    505     printf("No valid DMI table found, exiting.\n"); 
    506     return; 
    507   } 
    508   printf("DMI Table version %u.%u found\n", 
     512    more_printf("No valid DMI table found, exiting.\n"); 
     513    return; 
     514  } 
     515  reset_more_printf(); 
     516  more_printf("DMI Table version %u.%u found\n", 
    509517         hardware->dmi.dmitable.major_version, 
    510518         hardware->dmi.dmitable.minor_version); 
     
    537545  } 
    538546 
     547  reset_more_printf(); 
    539548  more_printf("Memory Banks\n"); 
    540549  for (int i = 0; i < hardware->dmi.memory_count; i++) { 
  • com32/hdt/hdt-cli-hdt.c

    r486ec6 r78f771  
    5353        int i = 0; 
    5454 
    55         printf("Available modes:\n"); 
     55    reset_more_printf(); 
     56        more_printf("Available modes:\n"); 
    5657        while (list_modes[i]) { 
    57                 printf("%s ", list_modes[i]->name); 
     58                more_printf("%s ", list_modes[i]->name); 
    5859                i++; 
    5960        } 
    60         printf("\n"); 
     61        more_printf("\n"); 
    6162} 
    6263 
     
    7172        cli_mode_t new_mode; 
    7273 
     74    reset_more_printf(); 
    7375        if (argc <= 0) { 
    74                 printf("Which mode?\n"); 
     76                more_printf("Which mode?\n"); 
    7577                return; 
    7678        } 
     
    118120        find_cli_mode_descr(hdt_cli.mode, &current_mode); 
    119121 
    120         printf("Available commands are:\n"); 
     122    reset_more_printf(); 
     123        more_printf("Available commands are:\n"); 
    121124 
    122125        /* List first default modules of the mode */ 
     
    124127            current_mode->default_modules->modules) { 
    125128                while (current_mode->default_modules->modules[j].name) { 
    126                         printf("%s ", 
     129                        more_printf("%s ", 
    127130                               current_mode->default_modules->modules[j].name); 
    128131                        j++; 
    129132                } 
    130                 printf("\n"); 
     133                more_printf("\n"); 
    131134        } 
    132135 
     
    134137        if (current_mode->show_modules && 
    135138            current_mode->show_modules->modules) { 
    136                 printf("\nshow commands:\n"); 
     139                more_printf("\nshow commands:\n"); 
    137140                j = 0; 
    138141                while (current_mode->show_modules->modules[j].name) { 
    139                         printf("%s ", 
     142                        more_printf("%s ", 
    140143                               current_mode->show_modules->modules[j].name); 
    141144                        j++; 
    142145                } 
    143                 printf("\n"); 
     146                more_printf("\n"); 
    144147        } 
    145148 
     
    147150        if (current_mode->set_modules && 
    148151            current_mode->set_modules->modules) { 
    149                 printf("\nset commands:\n"); 
     152                more_printf("\nset commands:\n"); 
    150153                j = 0; 
    151154                while (current_mode->set_modules->modules[j].name) { 
    152                         printf("%s ", 
     155                        more_printf("%s ", 
    153156                               current_mode->set_modules->modules[j].name); 
    154157                        j++; 
    155158                } 
    156                 printf("\n"); 
     159                more_printf("\n"); 
    157160        } 
    158161 
     
    174177                                             &associated_module); 
    175178                        if (associated_module == NULL) 
    176                                 printf("%s ", 
     179                                more_printf("%s ", 
    177180                                       hdt_mode.default_modules->modules[j].name); 
    178181                        j++; 
    179182                } 
    180                 printf("\n"); 
    181         } 
    182  
    183         printf("\n"); 
     183                more_printf("\n"); 
     184        } 
     185 
     186        more_printf("\n"); 
    184187        main_show_modes(argc, argv, hardware); 
    185188} 
     
    207210        detect_dmi(hardware); 
    208211        cpu_detect(hardware); 
     212    reset_more_printf(); 
    209213        clear_screen(); 
    210214        main_show_cpu(argc, argv, hardware); 
     
    237241                   struct s_hardware *hardware __unused) 
    238242{ 
    239         printf("HDT\n"); 
    240         printf(" Product     : %s\n", PRODUCT_NAME); 
    241         printf(" Version     : %s\n", VERSION); 
    242         printf(" Author      : %s\n", AUTHOR); 
    243         printf(" Contact     : %s\n", CONTACT); 
     243    reset_more_printf(); 
     244        more_printf("HDT\n"); 
     245        more_printf(" Product     : %s\n", PRODUCT_NAME); 
     246        more_printf(" Version     : %s\n", VERSION); 
     247        more_printf(" Author      : %s\n", AUTHOR); 
     248        more_printf(" Contact     : %s\n", CONTACT); 
    244249        char *contributors[NB_CONTRIBUTORS] = CONTRIBUTORS; 
    245250        for (int c = 0; c < NB_CONTRIBUTORS; c++) { 
    246                 printf(" Contributor : %s\n", contributors[c]); 
     251                more_printf(" Contributor : %s\n", contributors[c]); 
    247252        } 
    248253} 
  • com32/hdt/hdt-cli-kernel.c

    rdb265a9 r78f771  
    4747 
    4848        detect_pci(hardware); 
     49    reset_more_printf(); 
    4950        more_printf("Kernel modules\n"); 
    5051 
     
    106107        if (hardware->pci_ids_return_code == -ENOPCIIDS) { 
    107108                nopciids = true; 
    108                 printf(" Missing pci.ids, we can't compute the list\n"); 
     109                more_printf(" Missing pci.ids, we can't compute the list\n"); 
    109110                return; 
    110111        } 
     
    112113        if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) { 
    113114                nomodulespcimap = true; 
    114                 printf 
     115                more_printf 
    115116                    (" Missing modules.pcimap, we can't compute the list\n"); 
    116117                return; 
    117118        } 
    118119 
     120    reset_more_printf(); 
    119121        for_each_pci_func(pci_device, hardware->pci_domain) { 
    120122                memset(kernel_modules, 0, sizeof kernel_modules); 
     
    141143        for (int i = 0; i < MAX_PCI_CLASSES; i++) { 
    142144                if (strlen(category_name[i]) > 1) { 
    143                         printf("%s : %s\n", category_name[i], modules[i]); 
     145                        more_printf("%s : %s\n", category_name[i], modules[i]); 
    144146                } 
    145147        } 
  • com32/hdt/hdt-cli-memory.c

    r5de3f4 r78f771  
    4242 
    4343        detect_memory_e820(map, E820MAX, &count); 
    44         printf("BIOS-provided physical RAM e820 map:\n"); 
    4544        reset_more_printf(); 
     45        more_printf("BIOS-provided physical RAM e820 map:\n"); 
    4646        for (int i = 0; i < count; i++) { 
    4747                get_type(map[i].type, type, 14); 
  • com32/hdt/hdt-cli-pci.c

    r3716f4 r78f771  
    3838{ 
    3939        cli_detect_pci(hardware); 
    40  
     40    reset_more_printf(); 
    4141        more_printf("PCI\n"); 
    4242        more_printf(" NB Devices   : %d\n", hardware->nb_pci_devices); 
     
    5757        int bus = 0, slot = 0, func = 0; 
    5858 
     59    reset_more_printf(); 
    5960        /* Sanitize arguments */ 
    6061        if (argc <= 0) { 
    61                 printf("show device <number>\n"); 
     62                more_printf("show device <number>\n"); 
    6263                return; 
    6364        } else 
     
    6566 
    6667        if (errno == ERANGE) { 
    67                 printf("This PCI device number is incorrect\n"); 
     68                more_printf("This PCI device number is incorrect\n"); 
    6869                return; 
    6970        } 
    7071        if ((pcidev > hardware->nb_pci_devices) || (pcidev <= 0)) { 
    71                 printf("PCI device %d doesn't exist\n", pcidev); 
     72                more_printf("PCI device %d doesn't exist\n", pcidev); 
    7273                return; 
    7374        } 
     
    9394 
    9495        if (pci_device == NULL) { 
    95                 printf("We were enabled to find PCI device %d\n", pcidev); 
     96                more_printf("We were enabled to find PCI device %d\n", pcidev); 
    9697                return; 
    9798        } 
     
    110111                strlcpy(kernel_modules, "unknown", 7); 
    111112 
    112         printf("PCI Device %d\n", pcidev); 
     113        more_printf("PCI Device %d\n", pcidev); 
    113114 
    114115        if (nopciids == false) { 
    115                 printf("Vendor Name   : %s\n", 
     116                more_printf("Vendor Name   : %s\n", 
    116117                            pci_device->dev_info->vendor_name); 
    117                 printf("Product Name  : %s\n", 
     118                more_printf("Product Name  : %s\n", 
    118119                            pci_device->dev_info->product_name); 
    119                 printf("Class Name    : %s\n", 
     120                more_printf("Class Name    : %s\n", 
    120121                            pci_device->dev_info->class_name); 
    121122        } 
    122123 
    123124        if (nomodulesfiles == false) { 
    124                 printf("Kernel module : %s\n", kernel_modules); 
    125         } 
    126  
    127         printf("Vendor ID     : %04x\n", pci_device->vendor); 
    128         printf("Product ID    : %04x\n", pci_device->product); 
    129         printf("SubVendor ID  : %04x\n", pci_device->sub_vendor); 
    130         printf("SubProduct ID : %04x\n", pci_device->sub_product); 
    131         printf("Class ID      : %02x.%02x.%02x\n", pci_device->class[2], 
     125                more_printf("Kernel module : %s\n", kernel_modules); 
     126        } 
     127 
     128        more_printf("Vendor ID     : %04x\n", pci_device->vendor); 
     129        more_printf("Product ID    : %04x\n", pci_device->product); 
     130        more_printf("SubVendor ID  : %04x\n", pci_device->sub_vendor); 
     131        more_printf("SubProduct ID : %04x\n", pci_device->sub_product); 
     132        more_printf("Class ID      : %02x.%02x.%02x\n", pci_device->class[2], 
    132133                    pci_device->class[1], pci_device->class[0]); 
    133         printf("Revision      : %02x\n", pci_device->revision); 
     134        more_printf("Revision      : %02x\n", pci_device->revision); 
    134135        if ((pci_device->dev_info->irq > 0) 
    135136            && (pci_device->dev_info->irq < 255)) 
    136137                more_printf("IRQ           : %0d\n", pci_device->dev_info->irq); 
    137         printf("Latency       : %0d\n", pci_device->dev_info->latency); 
    138         printf("PCI Bus       : %02d\n", bus); 
    139         printf("PCI Slot      : %02d\n", slot); 
    140         printf("PCI Func      : %02d\n", func); 
     138        more_printf("Latency       : %0d\n", pci_device->dev_info->latency); 
     139        more_printf("PCI Bus       : %02d\n", bus); 
     140        more_printf("PCI Slot      : %02d\n", slot); 
     141        more_printf("PCI Func      : %02d\n", func); 
    141142 
    142143        if (hardware->is_pxe_valid == true) { 
    143144                if ((hardware->pxe.pci_device != NULL) 
    144145                    && (hardware->pxe.pci_device == pci_device)) { 
    145                         printf("Mac Address   : %s\n", hardware->pxe.mac_addr); 
    146                         printf("PXE           : Current boot device\n"); 
     146                        more_printf("Mac Address   : %s\n", hardware->pxe.mac_addr); 
     147                        more_printf("PXE           : Current boot device\n"); 
    147148                } 
    148149        } 
     
    306307                detect_pci(hardware); 
    307308                if (hardware->pci_ids_return_code == -ENOPCIIDS) { 
    308                         printf 
     309                        more_printf 
    309310                            ("The pci.ids file is missing, device names can't be computed.\n"); 
    310                         printf("Please put one in same dir as hdt\n"); 
     311                        more_printf("Please put one in same dir as hdt\n"); 
    311312                        error = true; 
    312313                } 
    313314                if ((hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) && 
    314315                        (hardware->modules_alias_return_code == -ENOMODULESALIAS)) { 
    315                         printf 
     316                        more_printf 
    316317                            ("The modules.pcimap or modules.alias files are missing, device names can't be computed.\n"); 
    317                         printf("Please put one of them in same dir as hdt\n"); 
     318                        more_printf("Please put one of them in same dir as hdt\n"); 
    318319                        error = true; 
    319320                } 
    320321                if (error == true) { 
    321322                        char tempbuf[10]; 
    322                         printf("Press enter to continue\n"); 
     323                        more_printf("Press enter to continue\n"); 
    323324                        fgets(tempbuf, sizeof(tempbuf), stdin); 
    324325                } 
  • com32/hdt/hdt-cli-pxe.c

    ra9d9ad r78f771  
    4242        char buffer[81]; 
    4343        memset(buffer, 0, sizeof(81)); 
     44    reset_more_printf(); 
    4445        if (hardware->sv->filesystem != SYSLINUX_FS_PXELINUX) { 
    45                 printf("You are not currently using PXELINUX\n"); 
     46                more_printf("You are not currently using PXELINUX\n"); 
    4647                return; 
    4748        } 
    4849 
    4950        detect_pxe(hardware); 
    50         printf("PXE\n"); 
     51        more_printf("PXE\n"); 
    5152        if (hardware->is_pxe_valid == false) { 
    52                 printf(" No valid PXE ROM found\n"); 
     53                more_printf(" No valid PXE ROM found\n"); 
    5354                return; 
    5455        } 
    5556 
    5657        struct s_pxe *p = &hardware->pxe; 
    57         printf(" PCI device no: %d \n", p->pci_device_pos); 
     58        more_printf(" PCI device no: %d \n", p->pci_device_pos); 
    5859 
    5960        if (hardware->pci_ids_return_code == -ENOPCIIDS || 
     
    6667                         " PCI Bus pos. : %02x:%02x.%02x\n", p->pci_bus, 
    6768                         p->pci_dev, p->pci_func); 
    68                 printf(buffer); 
     69                more_printf(buffer); 
    6970        } else { 
    7071                snprintf(buffer, sizeof(buffer), " Manufacturer : %s \n", 
    7172                         p->pci_device->dev_info->vendor_name); 
    72                 printf(buffer); 
     73                more_printf(buffer); 
    7374                snprintf(buffer, sizeof(buffer), " Product      : %s \n", 
    7475                         p->pci_device->dev_info->product_name); 
    75                 printf(buffer); 
     76                more_printf(buffer); 
    7677        } 
    77         printf(" Addresses    : %d.%d.%d.%d @ %s\n", p->ip_addr[0], 
     78        more_printf(" Addresses    : %d.%d.%d.%d @ %s\n", p->ip_addr[0], 
    7879                    p->ip_addr[1], p->ip_addr[2], p->ip_addr[3], p->mac_addr); 
    7980} 
  • com32/hdt/hdt-cli-syslinux.c

    ra9d9ad r78f771  
    4040                        struct s_hardware *hardware) 
    4141{ 
    42   printf("SYSLINUX\n"); 
    43   printf(" Bootloader : %s\n", hardware->syslinux_fs); 
    44   printf(" Version    : %s\n", hardware->sv->version_string + 2); 
    45   printf(" Version    : %u\n", hardware->sv->version); 
    46   printf(" Max API    : %u\n", hardware->sv->max_api); 
    47   printf(" Copyright  : %s\n", hardware->sv->copyright_string + 1); 
     42  reset_more_printf(); 
     43  more_printf("SYSLINUX\n"); 
     44  more_printf(" Bootloader : %s\n", hardware->syslinux_fs); 
     45  more_printf(" Version    : %s\n", hardware->sv->version_string + 2); 
     46  more_printf(" Version    : %u\n", hardware->sv->version); 
     47  more_printf(" Max API    : %u\n", hardware->sv->max_api); 
     48  more_printf(" Copyright  : %s\n", hardware->sv->copyright_string + 1); 
    4849} 
    4950 
  • com32/hdt/hdt-cli-vesa.c

    ra9d9ad r78f771  
    3737                    struct s_hardware *hardware) 
    3838{ 
     39    reset_more_printf(); 
    3940        detect_vesa(hardware); 
    4041        if (hardware->is_vesa_valid == false) { 
    41                 printf("No VESA BIOS detected\n"); 
     42                more_printf("No VESA BIOS detected\n"); 
    4243                return; 
    4344        } 
    44         printf("VESA\n"); 
    45         printf(" Vesa version : %d.%d\n", hardware->vesa.major_version, 
     45        more_printf("VESA\n"); 
     46        more_printf(" Vesa version : %d.%d\n", hardware->vesa.major_version, 
    4647                    hardware->vesa.minor_version); 
    47         printf(" Vendor       : %s\n", hardware->vesa.vendor); 
    48         printf(" Product      : %s\n", hardware->vesa.product); 
    49         printf(" Product rev. : %s\n", hardware->vesa.product_revision); 
    50         printf(" Software rev.: %d\n", hardware->vesa.software_rev); 
    51         printf(" Memory (KB)  : %d\n", hardware->vesa.total_memory * 64); 
    52         printf(" Modes        : %d\n", hardware->vesa.vmi_count); 
     48        more_printf(" Vendor       : %s\n", hardware->vesa.vendor); 
     49        more_printf(" Product      : %s\n", hardware->vesa.product); 
     50        more_printf(" Product rev. : %s\n", hardware->vesa.product_revision); 
     51        more_printf(" Software rev.: %d\n", hardware->vesa.software_rev); 
     52        more_printf(" Memory (KB)  : %d\n", hardware->vesa.total_memory * 64); 
     53        more_printf(" Modes        : %d\n", hardware->vesa.vmi_count); 
    5354} 
    5455 
     
    5758{ 
    5859        detect_vesa(hardware); 
     60        reset_more_printf(); 
    5961        if (hardware->is_vesa_valid == false) { 
    60                 printf("No VESA BIOS detected\n"); 
     62                more_printf("No VESA BIOS detected\n"); 
    6163                return; 
    6264        } 
    63         reset_more_printf(); 
    64         printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n"); 
    65         printf("----------------------------------------\n"); 
     65        more_printf(" ResH. x ResV x Bits : vga= : Vesa Mode\n"); 
     66        more_printf("----------------------------------------\n"); 
    6667 
    6768        for (int i = 0; i < hardware->vesa.vmi_count; i++) { 
     
    7273                 */ 
    7374                if ((mi->h_res == 0) || (mi->v_res == 0)) continue; 
    74                 printf("%5u %5u    %3u     %3d     0x%04x\n", 
     75                more_printf("%5u %5u    %3u     %3d     0x%04x\n", 
    7576                            mi->h_res, mi->v_res, mi->bpp, 
    7677                            hardware->vesa.vmi[i].mode + 0x200, 
  • com32/hdt/hdt-cli-vpd.c

    r569617 r78f771  
    4040 
    4141        if (!hardware->is_vpd_valid) { 
    42                 printf("No VPD structure detected.\n"); 
     42                more_printf("No VPD structure detected.\n"); 
    4343                return; 
    4444        } 
    4545 
    46         printf("VPD present at address : 0x%s\n", hardware->vpd.base_address); 
     46        more_printf("VPD present at address : 0x%s\n", hardware->vpd.base_address); 
    4747        if (strlen(hardware->vpd.bios_build_id) > 0) 
    4848                more_printf("Bios Build ID                 : %s\n", hardware->vpd.bios_build_id); 
  • com32/hdt/hdt-common.h

    r47ac91 r78f771  
    6161 
    6262#define pause_printf() do {\ 
    63         printf("--More--");\ 
    64         get_key(stdin, 0);\ 
    65         printf("\n");\ 
     63       printf("--More--");\ 
     64       get_key(stdin, 0);\ 
     65       printf("\033[2K\033[1G\033[1F\n");\ 
    6666} while (0); 
    6767 
    6868#define more_printf(...) do {\ 
    6969 if (display_line_nb == 20) {\ 
    70    printf("\nPress any key to continue");\ 
     70   printf("\n--More--");\ 
    7171   display_line_nb=0;\ 
    7272   get_key(stdin, 0);\ 
     73   printf("\033[2K\033[1G\033[1F");\ 
    7374 }\ 
    74  printf ( __VA_ARGS__);\ 
     75 printf(__VA_ARGS__);\ 
    7576 display_line_nb++; \ 
    7677} while (0);