summaryrefslogtreecommitdiff
path: root/hardinfo/info.c
AgeCommit message (Collapse)Author
2019-08-14Benchmark: fixes, user_note, verifiable test dataBurt P
* fix zlib display order * fix cryptohash MiB/s calculation * revision and params for other benchmarks * allow attaching user note to bench result with -u * don't inlcude the new result value bits if they are empty/invalid in bench_value_to_str(). bench_value_from_str() doesn't need to be modified. * bench_results: clean old result cpu name for x86 * use problem_marker() from dmi_memory to mark old version bench results * benchmark: verifiable test data size and content - The test data benchmark.data is stored in a file that could be edited to change the size or content. /* to guarantee size */ gchar *get_test_data(gsize min_size); /* to checksum content */ char *md5_digest_str(const char *data, unsigned int len); Signed-off-by: Burt P <pburt0@gmail.com>
2019-08-10name cleanup for x86 model strings and intel pci device stringsBurt P
x86 CPU: * Remove (R), (TM), etc * AMD: remove redundant "X2 Dual Core", "X4 Quad Core", etc * Move vendor to front if not already * Remove speed, as the actual speed is usually right next to it * Remove "CPU", "APU", "Processor" to shorten * Compress space Intel GPU: * Remove (R) * Abbreviate "Generation": "Gen" * Remove "Processor", "Controller", and "Device" to shorten * Compress space Some examples: x86 CPU: 'AMD Turion(tm) 64 Mobile Technology ML-32' ---> 'AMD Turion 64 Mobile ML-32' 'Cyrix MediaGXtm MMXtm Enhanced' ---> 'Cyrix MediaGX MMX Enhanced' 'Transmeta(tm) Crusoe(tm) Processor TM5800' ---> 'Transmeta Crusoe TM5800' 'VIA Nano X2 L4350 @ 1.6+ GHz' ---> 'VIA Nano X2 L4350' 'AMD Athlon(tm) 64 X2 Dual-Core Processor TK-53' ---> 'AMD Athlon 64 X2 TK-53' 'Embedded AMD Opteron(tm) Processor 23KS EE' ---> 'AMD Embedded Opteron 23KS EE' 'Intel(R) Atom(TM) x5-Z8300 CPU @ 1.44GHz' ---> 'Intel Atom x5-Z8300' 'Intel(R) Pentium(R) III CPU - S 1400MHz' ---> 'Intel Pentium III - S' 'Dual Core AMD Opteron(tm) Processor 165' ---> 'AMD Dual Core Opteron 165' 'Genuine Intel(R) CPU T1350 @ 1.86GHz' ---> 'Intel T1350' 'AMD Phenom(tm) 9350e Quad-Core Processor' ---> 'AMD Phenom 9350e Quad-Core' Intel GPU: 'Atom/Celeron/Pentium Processor x5-E8000/J3xxx/N3xxx Integrated Graphics Controller' ---> 'Atom/Celeron/Pentium x5-E8000/J3xxx/N3xxx Integrated Graphics' '4th Generation Core Processor Family Integrated Graphics Controller' ---> '4th Gen Core Family Integrated Graphics' 'Mobile GM965/GL960 Integrated Graphics Controller (secondary)' ---> 'Mobile GM965/GL960 Integrated Graphics (secondary)' 'Mobile 915GM/GMS/910GML Express Graphics Controller' ---> 'Mobile 915GM/GMS/910GML Express Graphics' Also: Fix/replace the appf() and SEQ() that were peppered about. Signed-off-by: Burt P <pburt0@gmail.com>
2019-08-10shell/info: allow newlines in valuesBurt P
Also fixed a FIXME: use g_key_file_get_string_list(). Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-29struct Info: handle groups with the same name in flatten()Burt P
Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-29struct Info: make info_add_computed_group() use info_unflatten()Burt P
Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-29struct info unflatten [v2]Burt P
Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-11Misc. cleanups in struct Info implementationLeandro Pereira
2019-07-11info struct bug Fixes, add tagged update fieldsBurt P
* tag was always included even when it didn't need to be. Now only include it when tag specified, flagged, or includes an icon. This messed up the existing update fields system. * The update fields system has been changed to allow updating by tag instead of the translated label. By label still works, however. I think it would be best to switch to using tags in the future. * info_flatten() calls flatten_shell_param() after flatten_group() which could cause a field name or tag to be used after it was freed. Created special free functions to handle this after all is used. Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-11Do not copy InfoField while flatteningLeandro Pereira
2019-07-10computer/os: Ubuntu flavorsBurt P
See: https://github.com/lpereira/hardinfo/issues/404 Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-06Add `free_name_on_flatten` flag to struct InfoFieldLeandro Pereira
2019-07-06Cleanup group comparison functionsLeandro Pereira
Reduce code repetition by using an array of GCompareFunc function pointers.
2019-07-06struct info: add field sort option to InfoGroupBurt P
Fields are sorted on flatten. Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-06struct info: try bools instead of flagsBurt P
2019-07-06struct info: add macros as described by lpereiraBurt P
See: https://github.com/lpereira/hardinfo/pull/393#issuecomment-507893260 Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-06struct info: add morinfo() tag and flags supportBurt P
Signed-off-by: Burt P <pburt0@gmail.com>
2019-07-04Plug memory leak when flattening a struct InfoLeandro Pereira
2019-06-29Only prepend $ITEM-g-i$ while flattening if there are iconsLeandro Pereira
Otherwise, the field updater would look for a field $ITEM-g-i$FieldName, which it has no way of knowing about.
2019-06-29Support icons in InfoFieldsLeandro Pereira
2019-06-29Allow more dynamic InfoGroup creationLeandro Pereira
2018-05-18Fix compiler warnings generated with GCC 8Leandro Pereira
2017-08-21Remove duplicate group headers in computer summaryBurt P
Signed-off-by: Burt P <pburt0@gmail.com>
2017-08-15Add info_field_printf() to reduce some sturct Info field boilerplateLeandro Pereira
2017-08-14Use GString to flatten struct InfoLeandro Pereira
While info_flatten() is just a scaffold, use GString to reduce the amount of temporary heap memory allocations.
2017-08-14Begin getting rid of callbacks returning stringsLeandro Pereira
Strings were never a good choice to begin with. However, with the efforts to improve translatability, they became even worse. This is an attempt to clean up the current mess and provide a more structured way for modules to commmunicate with the shell. The Computer module has been partially converted and changes will be provided next. It's partially converted since some of its information is still stored as strings. The Shell still only understands strings; that's why the structured data is converted to a string the way it is. Once all modules are converted, the Shell can be modified to handle struct Info directly without having to parse the .ini-like strings.