Changeset 78f771c881f9ef27ca4a35b3fc9efc407edba665
- 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:
-
Legend:
- Unmodified
- Added
- Removed
-
|
re9069c
|
r78f771
|
|
| 63 | 63 | int i = nb_partitions_seen; |
| 64 | 64 | |
| | 65 | reset_more_printf(); |
| | 66 | |
| 65 | 67 | start = partition_offset; |
| 66 | 68 | end = start + ptab->length - 1; |
| … |
… |
|
| 115 | 117 | |
| 116 | 118 | detect_disks(hardware); |
| | 119 | reset_more_printf(); |
| | 120 | |
| 117 | 121 | if (!hardware->disk_info[i].cbios) |
| 118 | 122 | return; /* Invalid geometry */ |
| … |
… |
|
| 158 | 162 | detect_disks(hardware); |
| 159 | 163 | |
| 160 | | int first_one = 0; |
| | 164 | int first_one = 0; |
| 161 | 165 | for (int drive = 0x80; drive < 0xff; drive++) { |
| 162 | 166 | 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 | } |
| 168 | 172 | char buf[5] = ""; |
| 169 | 173 | sprintf(buf, "0x%x", drive); |
-
|
r3716f4
|
r78f771
|
|
| 39 | 39 | { |
| 40 | 40 | char available_dmi_commands[1024]; |
| | 41 | reset_more_printf(); |
| 41 | 42 | memset(available_dmi_commands, 0, sizeof(available_dmi_commands)); |
| 42 | 43 | |
| 43 | | printf("Available DMI modules on your system:\n"); |
| | 44 | more_printf("Available DMI modules on your system:\n"); |
| 44 | 45 | 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); |
| 46 | 47 | if (hardware->dmi.battery.filled == true) |
| 47 | | printf("\t%s\n", CLI_DMI_BATTERY); |
| | 48 | more_printf("\t%s\n", CLI_DMI_BATTERY); |
| 48 | 49 | if (hardware->dmi.bios.filled == true) |
| 49 | | printf("\t%s\n", CLI_DMI_BIOS); |
| | 50 | more_printf("\t%s\n", CLI_DMI_BIOS); |
| 50 | 51 | if (hardware->dmi.chassis.filled == true) |
| 51 | | printf("\t%s\n", CLI_DMI_CHASSIS); |
| | 52 | more_printf("\t%s\n", CLI_DMI_CHASSIS); |
| 52 | 53 | for (int i = 0; i < hardware->dmi.memory_count; i++) { |
| 53 | 54 | if (hardware->dmi.memory[i].filled == true) { |
| 54 | | printf("\tbank <number>\n"); |
| | 55 | more_printf("\tbank <number>\n"); |
| 55 | 56 | break; |
| 56 | 57 | } |
| … |
… |
|
| 58 | 59 | for (int i = 0; i < hardware->dmi.memory_module_count; i++) { |
| 59 | 60 | if (hardware->dmi.memory_module[i].filled == true) { |
| 60 | | printf("\tmodule <number>\n"); |
| | 61 | more_printf("\tmodule <number>\n"); |
| 61 | 62 | break; |
| 62 | 63 | } |
| 63 | 64 | } |
| 64 | 65 | if (hardware->dmi.processor.filled == true) |
| 65 | | printf("\t%s\n", CLI_DMI_PROCESSOR); |
| | 66 | more_printf("\t%s\n", CLI_DMI_PROCESSOR); |
| 66 | 67 | if (hardware->dmi.system.filled == true) |
| 67 | | printf("\t%s\n", CLI_DMI_SYSTEM); |
| | 68 | more_printf("\t%s\n", CLI_DMI_SYSTEM); |
| 68 | 69 | if (hardware->dmi.ipmi.filled == true) |
| 69 | | printf("\t%s\n", CLI_DMI_IPMI); |
| | 70 | more_printf("\t%s\n", CLI_DMI_IPMI); |
| 70 | 71 | if (hardware->dmi.cache_count) |
| 71 | | printf("\t%s\n", CLI_DMI_CACHE); |
| | 72 | more_printf("\t%s\n", CLI_DMI_CACHE); |
| 72 | 73 | if (strlen(hardware->dmi.oem_strings)) |
| 73 | 74 | more_printf("\t%s\n", CLI_DMI_OEM); |
| 74 | 75 | if (hardware->dmi.hardware_security.filled) |
| 75 | | printf("\t%s\n", CLI_DMI_SECURITY); |
| | 76 | more_printf("\t%s\n", CLI_DMI_SECURITY); |
| 76 | 77 | } |
| 77 | 78 | |
| … |
… |
|
| 80 | 81 | { |
| 81 | 82 | 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 " |
| 83 | 84 | "`show list' to see which module is available.\n"); |
| 84 | 85 | return; |
| … |
… |
|
| 115 | 116 | { |
| 116 | 117 | 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 " |
| 118 | 119 | "`show list' to see which module is available.\n"); |
| 119 | 120 | return; |
| 120 | 121 | } |
| 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); |
| 130 | 132 | |
| 131 | 133 | 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); |
| 134 | 136 | } |
| 135 | 137 | |
| 136 | 138 | 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", |
| 139 | 141 | (hardware->dmi.system.system_reset.status ? "Enabled" : "Disabled")); |
| 140 | | printf(" Watchdog Timer : %s\n", |
| | 142 | more_printf(" Watchdog Timer : %s\n", |
| 141 | 143 | (hardware->dmi.system.system_reset.watchdog ? "Present" : "Not Present")); |
| 142 | 144 | 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); |
| 144 | 146 | 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); |
| 146 | 148 | 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); |
| 148 | 150 | 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); |
| 150 | 152 | 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); |
| 152 | 154 | 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); |
| 158 | 160 | } |
| 159 | 161 | |
| … |
… |
|
| 162 | 164 | { |
| 163 | 165 | 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 " |
| 165 | 167 | "`show list' to see which module is available.\n"); |
| 166 | 168 | return; |
| … |
… |
|
| 214 | 216 | return; |
| 215 | 217 | } |
| 216 | | printf("Chassis\n"); |
| 217 | | printf(" Manufacturer : %s\n", |
| | 218 | reset_more_printf(); |
| | 219 | more_printf("Chassis\n"); |
| | 220 | more_printf(" Manufacturer : %s\n", |
| 218 | 221 | 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", |
| 222 | 225 | 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", |
| 225 | 228 | del_multi_spaces(hardware->dmi.chassis.asset_tag)); |
| 226 | | printf(" Boot up state : %s\n", |
| | 229 | more_printf(" Boot up state : %s\n", |
| 227 | 230 | hardware->dmi.chassis.boot_up_state); |
| 228 | | printf(" Power supply state : %s\n", |
| | 231 | more_printf(" Power supply state : %s\n", |
| 229 | 232 | hardware->dmi.chassis.power_supply_state); |
| 230 | | printf(" Thermal state : %s\n", |
| | 233 | more_printf(" Thermal state : %s\n", |
| 231 | 234 | hardware->dmi.chassis.thermal_state); |
| 232 | | printf(" Security Status : %s\n", |
| | 235 | more_printf(" Security Status : %s\n", |
| 233 | 236 | hardware->dmi.chassis.security_status); |
| 234 | | printf(" OEM Information : %s\n", |
| | 237 | more_printf(" OEM Information : %s\n", |
| 235 | 238 | 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", |
| 238 | 241 | hardware->dmi.chassis.nb_power_cords); |
| 239 | 242 | } |
| … |
… |
|
| 246 | 249 | return; |
| 247 | 250 | } |
| 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", |
| 250 | 254 | hardware->dmi.ipmi.interface_type); |
| 251 | | printf(" Specification Ver. : %u.%u\n", |
| | 255 | more_printf(" Specification Ver. : %u.%u\n", |
| 252 | 256 | hardware->dmi.ipmi.major_specification_version, |
| 253 | 257 | hardware->dmi.ipmi.minor_specification_version); |
| 254 | | printf(" I2C Slave Address : 0x%02x\n", |
| | 258 | more_printf(" I2C Slave Address : 0x%02x\n", |
| 255 | 259 | hardware->dmi.ipmi.I2C_slave_address); |
| 256 | | printf(" Nv Storage Address : %u\n", |
| | 260 | more_printf(" Nv Storage Address : %u\n", |
| 257 | 261 | hardware->dmi.ipmi.nv_address); |
| 258 | 262 | uint32_t high = hardware->dmi.ipmi.base_address >> 32; |
| 259 | 263 | uint32_t low = hardware->dmi.ipmi.base_address & 0xFFFF; |
| 260 | | printf(" Base Address : %08X%08X\n", |
| | 264 | more_printf(" Base Address : %08X%08X\n", |
| 261 | 265 | high,(low & ~1)); |
| 262 | | printf(" IRQ : %d\n", |
| | 266 | more_printf(" IRQ : %d\n", |
| 263 | 267 | hardware->dmi.ipmi.irq); |
| 264 | 268 | } |
| … |
… |
|
| 268 | 272 | { |
| 269 | 273 | 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 " |
| 271 | 275 | "`show list' to see which module is available.\n"); |
| 272 | 276 | return; |
| 273 | 277 | } |
| 274 | | printf("Battery \n"); |
| 275 | | printf(" Vendor : %s\n", |
| | 278 | reset_more_printf(); |
| | 279 | more_printf("Battery \n"); |
| | 280 | more_printf(" Vendor : %s\n", |
| 276 | 281 | hardware->dmi.battery.manufacturer); |
| 277 | | printf(" Manufacture Date : %s\n", |
| | 282 | more_printf(" Manufacture Date : %s\n", |
| 278 | 283 | 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", |
| 282 | 287 | hardware->dmi.battery.chemistry); |
| 283 | | printf(" Design Capacity : %s\n", |
| | 288 | more_printf(" Design Capacity : %s\n", |
| 284 | 289 | hardware->dmi.battery.design_capacity); |
| 285 | | printf(" Design Voltage : %s\n", |
| | 290 | more_printf(" Design Voltage : %s\n", |
| 286 | 291 | 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", |
| 289 | 294 | hardware->dmi.battery.sbds_manufacture_date); |
| 290 | | printf(" SBDS Chemistry : %s\n", |
| | 295 | more_printf(" SBDS Chemistry : %s\n", |
| 291 | 296 | hardware->dmi.battery.sbds_chemistry); |
| 292 | | printf(" Maximum Error : %s\n", |
| | 297 | more_printf(" Maximum Error : %s\n", |
| 293 | 298 | hardware->dmi.battery.maximum_error); |
| 294 | | printf(" OEM Info : %s\n", |
| | 299 | more_printf(" OEM Info : %s\n", |
| 295 | 300 | hardware->dmi.battery.oem_info); |
| 296 | 301 | } |
| … |
… |
|
| 300 | 305 | { |
| 301 | 306 | 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 " |
| 303 | 308 | "`show list' to see which module is available.\n"); |
| 304 | 309 | return; |
| … |
… |
|
| 364 | 369 | |
| 365 | 370 | if (errno == ERANGE || bank < 0) { |
| 366 | | printf("This bank number is incorrect\n"); |
| | 371 | more_printf("This bank number is incorrect\n"); |
| 367 | 372 | return; |
| 368 | 373 | } |
| 369 | 374 | |
| 370 | 375 | 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); |
| 372 | 377 | return; |
| 373 | 378 | } |
| 374 | 379 | 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", |
| 381 | 387 | 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", |
| 384 | 390 | 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", |
| 388 | 394 | hardware->dmi.memory[bank].device_set); |
| 389 | | printf(" Device Loc. : %s\n", |
| | 395 | more_printf(" Device Loc. : %s\n", |
| 390 | 396 | hardware->dmi.memory[bank].device_locator); |
| 391 | | printf(" Bank Locator : %s\n", |
| | 397 | more_printf(" Bank Locator : %s\n", |
| 392 | 398 | hardware->dmi.memory[bank].bank_locator); |
| 393 | | printf(" Total Width : %s\n", |
| | 399 | more_printf(" Total Width : %s\n", |
| 394 | 400 | hardware->dmi.memory[bank].total_width); |
| 395 | | printf(" Data Width : %s\n", |
| | 401 | more_printf(" Data Width : %s\n", |
| 396 | 402 | 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", |
| 399 | 405 | 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", |
| 402 | 408 | hardware->dmi.memory[bank].asset_tag); |
| 403 | | printf(" Part Number : %s\n", |
| | 409 | more_printf(" Part Number : %s\n", |
| 404 | 410 | hardware->dmi.memory[bank].part_number); |
| 405 | 411 | } |
| … |
… |
|
| 409 | 415 | { |
| 410 | 416 | 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 " |
| 412 | 418 | "`show list' to see which module is available.\n"); |
| 413 | 419 | return; |
| … |
… |
|
| 417 | 423 | |
| 418 | 424 | 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); |
| 420 | 426 | return; |
| 421 | 427 | } |
| … |
… |
|
| 465 | 471 | |
| 466 | 472 | if (errno == ERANGE || module < 0) { |
| 467 | | printf("This module number is incorrect\n"); |
| | 473 | more_printf("This module number is incorrect\n"); |
| 468 | 474 | return; |
| 469 | 475 | } |
| 470 | 476 | |
| 471 | 477 | 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); |
| 473 | 479 | return; |
| 474 | 480 | } |
| 475 | 481 | |
| 476 | 482 | 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); |
| 478 | 484 | return; |
| 479 | 485 | } |
| 480 | 486 | |
| 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", |
| 483 | 490 | hardware->dmi.memory_module[module].socket_designation); |
| 484 | | printf(" Bank Connections : %s\n", |
| | 491 | more_printf(" Bank Connections : %s\n", |
| 485 | 492 | hardware->dmi.memory_module[module].bank_connections); |
| 486 | | printf(" Current Speed : %s\n", |
| | 493 | more_printf(" Current Speed : %s\n", |
| 487 | 494 | hardware->dmi.memory_module[module].speed); |
| 488 | | printf(" Type : %s\n", |
| | 495 | more_printf(" Type : %s\n", |
| 489 | 496 | hardware->dmi.memory_module[module].type); |
| 490 | | printf(" Installed Size : %s\n", |
| | 497 | more_printf(" Installed Size : %s\n", |
| 491 | 498 | hardware->dmi.memory_module[module].installed_size); |
| 492 | | printf(" Enabled Size : %s\n", |
| | 499 | more_printf(" Enabled Size : %s\n", |
| 493 | 500 | hardware->dmi.memory_module[module].enabled_size); |
| 494 | | printf(" Error Status : %s\n", |
| | 501 | more_printf(" Error Status : %s\n", |
| 495 | 502 | hardware->dmi.memory_module[module].error_status); |
| 496 | 503 | } |
| … |
… |
|
| 503 | 510 | |
| 504 | 511 | 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", |
| 509 | 517 | hardware->dmi.dmitable.major_version, |
| 510 | 518 | hardware->dmi.dmitable.minor_version); |
| … |
… |
|
| 537 | 545 | } |
| 538 | 546 | |
| | 547 | reset_more_printf(); |
| 539 | 548 | more_printf("Memory Banks\n"); |
| 540 | 549 | for (int i = 0; i < hardware->dmi.memory_count; i++) { |
-
|
r486ec6
|
r78f771
|
|
| 53 | 53 | int i = 0; |
| 54 | 54 | |
| 55 | | printf("Available modes:\n"); |
| | 55 | reset_more_printf(); |
| | 56 | more_printf("Available modes:\n"); |
| 56 | 57 | while (list_modes[i]) { |
| 57 | | printf("%s ", list_modes[i]->name); |
| | 58 | more_printf("%s ", list_modes[i]->name); |
| 58 | 59 | i++; |
| 59 | 60 | } |
| 60 | | printf("\n"); |
| | 61 | more_printf("\n"); |
| 61 | 62 | } |
| 62 | 63 | |
| … |
… |
|
| 71 | 72 | cli_mode_t new_mode; |
| 72 | 73 | |
| | 74 | reset_more_printf(); |
| 73 | 75 | if (argc <= 0) { |
| 74 | | printf("Which mode?\n"); |
| | 76 | more_printf("Which mode?\n"); |
| 75 | 77 | return; |
| 76 | 78 | } |
| … |
… |
|
| 118 | 120 | find_cli_mode_descr(hdt_cli.mode, ¤t_mode); |
| 119 | 121 | |
| 120 | | printf("Available commands are:\n"); |
| | 122 | reset_more_printf(); |
| | 123 | more_printf("Available commands are:\n"); |
| 121 | 124 | |
| 122 | 125 | /* List first default modules of the mode */ |
| … |
… |
|
| 124 | 127 | current_mode->default_modules->modules) { |
| 125 | 128 | while (current_mode->default_modules->modules[j].name) { |
| 126 | | printf("%s ", |
| | 129 | more_printf("%s ", |
| 127 | 130 | current_mode->default_modules->modules[j].name); |
| 128 | 131 | j++; |
| 129 | 132 | } |
| 130 | | printf("\n"); |
| | 133 | more_printf("\n"); |
| 131 | 134 | } |
| 132 | 135 | |
| … |
… |
|
| 134 | 137 | if (current_mode->show_modules && |
| 135 | 138 | current_mode->show_modules->modules) { |
| 136 | | printf("\nshow commands:\n"); |
| | 139 | more_printf("\nshow commands:\n"); |
| 137 | 140 | j = 0; |
| 138 | 141 | while (current_mode->show_modules->modules[j].name) { |
| 139 | | printf("%s ", |
| | 142 | more_printf("%s ", |
| 140 | 143 | current_mode->show_modules->modules[j].name); |
| 141 | 144 | j++; |
| 142 | 145 | } |
| 143 | | printf("\n"); |
| | 146 | more_printf("\n"); |
| 144 | 147 | } |
| 145 | 148 | |
| … |
… |
|
| 147 | 150 | if (current_mode->set_modules && |
| 148 | 151 | current_mode->set_modules->modules) { |
| 149 | | printf("\nset commands:\n"); |
| | 152 | more_printf("\nset commands:\n"); |
| 150 | 153 | j = 0; |
| 151 | 154 | while (current_mode->set_modules->modules[j].name) { |
| 152 | | printf("%s ", |
| | 155 | more_printf("%s ", |
| 153 | 156 | current_mode->set_modules->modules[j].name); |
| 154 | 157 | j++; |
| 155 | 158 | } |
| 156 | | printf("\n"); |
| | 159 | more_printf("\n"); |
| 157 | 160 | } |
| 158 | 161 | |
| … |
… |
|
| 174 | 177 | &associated_module); |
| 175 | 178 | if (associated_module == NULL) |
| 176 | | printf("%s ", |
| | 179 | more_printf("%s ", |
| 177 | 180 | hdt_mode.default_modules->modules[j].name); |
| 178 | 181 | j++; |
| 179 | 182 | } |
| 180 | | printf("\n"); |
| 181 | | } |
| 182 | | |
| 183 | | printf("\n"); |
| | 183 | more_printf("\n"); |
| | 184 | } |
| | 185 | |
| | 186 | more_printf("\n"); |
| 184 | 187 | main_show_modes(argc, argv, hardware); |
| 185 | 188 | } |
| … |
… |
|
| 207 | 210 | detect_dmi(hardware); |
| 208 | 211 | cpu_detect(hardware); |
| | 212 | reset_more_printf(); |
| 209 | 213 | clear_screen(); |
| 210 | 214 | main_show_cpu(argc, argv, hardware); |
| … |
… |
|
| 237 | 241 | struct s_hardware *hardware __unused) |
| 238 | 242 | { |
| 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); |
| 244 | 249 | char *contributors[NB_CONTRIBUTORS] = CONTRIBUTORS; |
| 245 | 250 | for (int c = 0; c < NB_CONTRIBUTORS; c++) { |
| 246 | | printf(" Contributor : %s\n", contributors[c]); |
| | 251 | more_printf(" Contributor : %s\n", contributors[c]); |
| 247 | 252 | } |
| 248 | 253 | } |
-
|
rdb265a9
|
r78f771
|
|
| 47 | 47 | |
| 48 | 48 | detect_pci(hardware); |
| | 49 | reset_more_printf(); |
| 49 | 50 | more_printf("Kernel modules\n"); |
| 50 | 51 | |
| … |
… |
|
| 106 | 107 | if (hardware->pci_ids_return_code == -ENOPCIIDS) { |
| 107 | 108 | 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"); |
| 109 | 110 | return; |
| 110 | 111 | } |
| … |
… |
|
| 112 | 113 | if (hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) { |
| 113 | 114 | nomodulespcimap = true; |
| 114 | | printf |
| | 115 | more_printf |
| 115 | 116 | (" Missing modules.pcimap, we can't compute the list\n"); |
| 116 | 117 | return; |
| 117 | 118 | } |
| 118 | 119 | |
| | 120 | reset_more_printf(); |
| 119 | 121 | for_each_pci_func(pci_device, hardware->pci_domain) { |
| 120 | 122 | memset(kernel_modules, 0, sizeof kernel_modules); |
| … |
… |
|
| 141 | 143 | for (int i = 0; i < MAX_PCI_CLASSES; i++) { |
| 142 | 144 | 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]); |
| 144 | 146 | } |
| 145 | 147 | } |
-
|
r5de3f4
|
r78f771
|
|
| 42 | 42 | |
| 43 | 43 | detect_memory_e820(map, E820MAX, &count); |
| 44 | | printf("BIOS-provided physical RAM e820 map:\n"); |
| 45 | 44 | reset_more_printf(); |
| | 45 | more_printf("BIOS-provided physical RAM e820 map:\n"); |
| 46 | 46 | for (int i = 0; i < count; i++) { |
| 47 | 47 | get_type(map[i].type, type, 14); |
-
|
r3716f4
|
r78f771
|
|
| 38 | 38 | { |
| 39 | 39 | cli_detect_pci(hardware); |
| 40 | | |
| | 40 | reset_more_printf(); |
| 41 | 41 | more_printf("PCI\n"); |
| 42 | 42 | more_printf(" NB Devices : %d\n", hardware->nb_pci_devices); |
| … |
… |
|
| 57 | 57 | int bus = 0, slot = 0, func = 0; |
| 58 | 58 | |
| | 59 | reset_more_printf(); |
| 59 | 60 | /* Sanitize arguments */ |
| 60 | 61 | if (argc <= 0) { |
| 61 | | printf("show device <number>\n"); |
| | 62 | more_printf("show device <number>\n"); |
| 62 | 63 | return; |
| 63 | 64 | } else |
| … |
… |
|
| 65 | 66 | |
| 66 | 67 | if (errno == ERANGE) { |
| 67 | | printf("This PCI device number is incorrect\n"); |
| | 68 | more_printf("This PCI device number is incorrect\n"); |
| 68 | 69 | return; |
| 69 | 70 | } |
| 70 | 71 | 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); |
| 72 | 73 | return; |
| 73 | 74 | } |
| … |
… |
|
| 93 | 94 | |
| 94 | 95 | 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); |
| 96 | 97 | return; |
| 97 | 98 | } |
| … |
… |
|
| 110 | 111 | strlcpy(kernel_modules, "unknown", 7); |
| 111 | 112 | |
| 112 | | printf("PCI Device %d\n", pcidev); |
| | 113 | more_printf("PCI Device %d\n", pcidev); |
| 113 | 114 | |
| 114 | 115 | if (nopciids == false) { |
| 115 | | printf("Vendor Name : %s\n", |
| | 116 | more_printf("Vendor Name : %s\n", |
| 116 | 117 | pci_device->dev_info->vendor_name); |
| 117 | | printf("Product Name : %s\n", |
| | 118 | more_printf("Product Name : %s\n", |
| 118 | 119 | pci_device->dev_info->product_name); |
| 119 | | printf("Class Name : %s\n", |
| | 120 | more_printf("Class Name : %s\n", |
| 120 | 121 | pci_device->dev_info->class_name); |
| 121 | 122 | } |
| 122 | 123 | |
| 123 | 124 | 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], |
| 132 | 133 | 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); |
| 134 | 135 | if ((pci_device->dev_info->irq > 0) |
| 135 | 136 | && (pci_device->dev_info->irq < 255)) |
| 136 | 137 | 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); |
| 141 | 142 | |
| 142 | 143 | if (hardware->is_pxe_valid == true) { |
| 143 | 144 | if ((hardware->pxe.pci_device != NULL) |
| 144 | 145 | && (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"); |
| 147 | 148 | } |
| 148 | 149 | } |
| … |
… |
|
| 306 | 307 | detect_pci(hardware); |
| 307 | 308 | if (hardware->pci_ids_return_code == -ENOPCIIDS) { |
| 308 | | printf |
| | 309 | more_printf |
| 309 | 310 | ("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"); |
| 311 | 312 | error = true; |
| 312 | 313 | } |
| 313 | 314 | if ((hardware->modules_pcimap_return_code == -ENOMODULESPCIMAP) && |
| 314 | 315 | (hardware->modules_alias_return_code == -ENOMODULESALIAS)) { |
| 315 | | printf |
| | 316 | more_printf |
| 316 | 317 | ("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"); |
| 318 | 319 | error = true; |
| 319 | 320 | } |
| 320 | 321 | if (error == true) { |
| 321 | 322 | char tempbuf[10]; |
| 322 | | printf("Press enter to continue\n"); |
| | 323 | more_printf("Press enter to continue\n"); |
| 323 | 324 | fgets(tempbuf, sizeof(tempbuf), stdin); |
| 324 | 325 | } |
-
|
ra9d9ad
|
r78f771
|
|
| 42 | 42 | char buffer[81]; |
| 43 | 43 | memset(buffer, 0, sizeof(81)); |
| | 44 | reset_more_printf(); |
| 44 | 45 | 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"); |
| 46 | 47 | return; |
| 47 | 48 | } |
| 48 | 49 | |
| 49 | 50 | detect_pxe(hardware); |
| 50 | | printf("PXE\n"); |
| | 51 | more_printf("PXE\n"); |
| 51 | 52 | if (hardware->is_pxe_valid == false) { |
| 52 | | printf(" No valid PXE ROM found\n"); |
| | 53 | more_printf(" No valid PXE ROM found\n"); |
| 53 | 54 | return; |
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | 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); |
| 58 | 59 | |
| 59 | 60 | if (hardware->pci_ids_return_code == -ENOPCIIDS || |
| … |
… |
|
| 66 | 67 | " PCI Bus pos. : %02x:%02x.%02x\n", p->pci_bus, |
| 67 | 68 | p->pci_dev, p->pci_func); |
| 68 | | printf(buffer); |
| | 69 | more_printf(buffer); |
| 69 | 70 | } else { |
| 70 | 71 | snprintf(buffer, sizeof(buffer), " Manufacturer : %s \n", |
| 71 | 72 | p->pci_device->dev_info->vendor_name); |
| 72 | | printf(buffer); |
| | 73 | more_printf(buffer); |
| 73 | 74 | snprintf(buffer, sizeof(buffer), " Product : %s \n", |
| 74 | 75 | p->pci_device->dev_info->product_name); |
| 75 | | printf(buffer); |
| | 76 | more_printf(buffer); |
| 76 | 77 | } |
| 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], |
| 78 | 79 | p->ip_addr[1], p->ip_addr[2], p->ip_addr[3], p->mac_addr); |
| 79 | 80 | } |
-
|
ra9d9ad
|
r78f771
|
|
| 40 | 40 | struct s_hardware *hardware) |
| 41 | 41 | { |
| 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); |
| 48 | 49 | } |
| 49 | 50 | |
-
|
ra9d9ad
|
r78f771
|
|
| 37 | 37 | struct s_hardware *hardware) |
| 38 | 38 | { |
| | 39 | reset_more_printf(); |
| 39 | 40 | detect_vesa(hardware); |
| 40 | 41 | if (hardware->is_vesa_valid == false) { |
| 41 | | printf("No VESA BIOS detected\n"); |
| | 42 | more_printf("No VESA BIOS detected\n"); |
| 42 | 43 | return; |
| 43 | 44 | } |
| 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, |
| 46 | 47 | 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); |
| 53 | 54 | } |
| 54 | 55 | |
| … |
… |
|
| 57 | 58 | { |
| 58 | 59 | detect_vesa(hardware); |
| | 60 | reset_more_printf(); |
| 59 | 61 | if (hardware->is_vesa_valid == false) { |
| 60 | | printf("No VESA BIOS detected\n"); |
| | 62 | more_printf("No VESA BIOS detected\n"); |
| 61 | 63 | return; |
| 62 | 64 | } |
| 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"); |
| 66 | 67 | |
| 67 | 68 | for (int i = 0; i < hardware->vesa.vmi_count; i++) { |
| … |
… |
|
| 72 | 73 | */ |
| 73 | 74 | 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", |
| 75 | 76 | mi->h_res, mi->v_res, mi->bpp, |
| 76 | 77 | hardware->vesa.vmi[i].mode + 0x200, |
-
|
r569617
|
r78f771
|
|
| 40 | 40 | |
| 41 | 41 | if (!hardware->is_vpd_valid) { |
| 42 | | printf("No VPD structure detected.\n"); |
| | 42 | more_printf("No VPD structure detected.\n"); |
| 43 | 43 | return; |
| 44 | 44 | } |
| 45 | 45 | |
| 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); |
| 47 | 47 | if (strlen(hardware->vpd.bios_build_id) > 0) |
| 48 | 48 | more_printf("Bios Build ID : %s\n", hardware->vpd.bios_build_id); |
-
|
r47ac91
|
r78f771
|
|
| 61 | 61 | |
| 62 | 62 | #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");\ |
| 66 | 66 | } while (0); |
| 67 | 67 | |
| 68 | 68 | #define more_printf(...) do {\ |
| 69 | 69 | if (display_line_nb == 20) {\ |
| 70 | | printf("\nPress any key to continue");\ |
| | 70 | printf("\n--More--");\ |
| 71 | 71 | display_line_nb=0;\ |
| 72 | 72 | get_key(stdin, 0);\ |
| | 73 | printf("\033[2K\033[1G\033[1F");\ |
| 73 | 74 | }\ |
| 74 | | printf ( __VA_ARGS__);\ |
| | 75 | printf(__VA_ARGS__);\ |
| 75 | 76 | display_line_nb++; \ |
| 76 | 77 | } while (0); |