2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-09-01 23:05:25 +00:00

Remove "generic" from all printing function names. This is the default

mode now so no need to mention it explicitly.
Rename print_vid_info to print_chip_vid and move it around for
consistency.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4728 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2007-08-26 21:26:20 +00:00
parent eaeaffb89b
commit 2ee12591df
3 changed files with 30 additions and 30 deletions

View File

@@ -67,20 +67,6 @@ static void print_label(const char *label, int space)
printf("%s:%*s", label, space - len, ""); printf("%s:%*s", label, space - len, "");
} }
static void print_vid_info(const sensors_chip_name *name, int f_vid,
int label_size)
{
char *label;
double vid;
if ((label = sensors_get_label(name, f_vid))
&& !sensors_get_value(name, f_vid, &vid)) {
print_label(label, label_size);
printf("%+6.3f V\n", vid);
}
free(label);
}
static void sensors_get_available_features(const sensors_chip_name *name, static void sensors_get_available_features(const sensors_chip_name *name,
const sensors_feature_data *feature, const sensors_feature_data *feature,
int i, short *has_features, int i, short *has_features,
@@ -150,9 +136,9 @@ static void print_temp_limits(double limit1, double limit2,
#define TEMP_FEATURE(x) has_features[x - SENSORS_FEATURE_TEMP - 1] #define TEMP_FEATURE(x) has_features[x - SENSORS_FEATURE_TEMP - 1]
#define TEMP_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_TEMP - 1] #define TEMP_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_TEMP - 1]
static void print_generic_chip_temp(const sensors_chip_name *name, static void print_chip_temp(const sensors_chip_name *name,
const sensors_feature_data *feature, const sensors_feature_data *feature, int i,
int i, int label_size) int label_size)
{ {
double val, limit1, limit2; double val, limit1, limit2;
const char *s1, *s2; const char *s1, *s2;
@@ -272,9 +258,9 @@ static void print_generic_chip_temp(const sensors_chip_name *name,
#define IN_FEATURE(x) has_features[x - SENSORS_FEATURE_IN - 1] #define IN_FEATURE(x) has_features[x - SENSORS_FEATURE_IN - 1]
#define IN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_IN - 1] #define IN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_IN - 1]
static void print_generic_chip_in(const sensors_chip_name *name, static void print_chip_in(const sensors_chip_name *name,
const sensors_feature_data *feature, const sensors_feature_data *feature, int i,
int i, int label_size) int label_size)
{ {
const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN; const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN;
short has_features[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = { 0, }; short has_features[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = { 0, };
@@ -337,9 +323,9 @@ static void print_generic_chip_in(const sensors_chip_name *name,
#define FAN_FEATURE(x) has_features[x - SENSORS_FEATURE_FAN - 1] #define FAN_FEATURE(x) has_features[x - SENSORS_FEATURE_FAN - 1]
#define FAN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_FAN - 1] #define FAN_FEATURE_VAL(x) feature_vals[x - SENSORS_FEATURE_FAN - 1]
static void print_generic_chip_fan(const sensors_chip_name *name, static void print_chip_fan(const sensors_chip_name *name,
const sensors_feature_data *feature, const sensors_feature_data *feature, int i,
int i, int label_size) int label_size)
{ {
char *label; char *label;
const int size = SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN; const int size = SENSORS_FEATURE_FAN_DIV - SENSORS_FEATURE_FAN;
@@ -390,7 +376,21 @@ static void print_generic_chip_fan(const sensors_chip_name *name,
printf("\n"); printf("\n");
} }
void print_generic_chip(const sensors_chip_name *name) static void print_chip_vid(const sensors_chip_name *name, int f_vid,
int label_size)
{
char *label;
double vid;
if ((label = sensors_get_label(name, f_vid))
&& !sensors_get_value(name, f_vid, &vid)) {
print_label(label, label_size);
printf("%+6.3f V\n", vid);
}
free(label);
}
void print_chip(const sensors_chip_name *name)
{ {
const sensors_feature_data *feature; const sensors_feature_data *feature;
int i, label_size; int i, label_size;
@@ -404,16 +404,16 @@ void print_generic_chip(const sensors_chip_name *name)
switch (feature->type) { switch (feature->type) {
case SENSORS_FEATURE_TEMP: case SENSORS_FEATURE_TEMP:
print_generic_chip_temp(name, feature, i, label_size); print_chip_temp(name, feature, i, label_size);
break; break;
case SENSORS_FEATURE_IN: case SENSORS_FEATURE_IN:
print_generic_chip_in(name, feature, i, label_size); print_chip_in(name, feature, i, label_size);
break; break;
case SENSORS_FEATURE_FAN: case SENSORS_FEATURE_FAN:
print_generic_chip_fan(name, feature, i, label_size); print_chip_fan(name, feature, i, label_size);
break; break;
case SENSORS_FEATURE_VID: case SENSORS_FEATURE_VID:
print_vid_info(name, feature->number, label_size); print_chip_vid(name, feature->number, label_size);
break; break;
default: default:
continue; continue;

View File

@@ -23,6 +23,6 @@
#include "lib/sensors.h" #include "lib/sensors.h"
void print_chip_raw(const sensors_chip_name *name); void print_chip_raw(const sensors_chip_name *name);
void print_generic_chip(const sensors_chip_name *name); void print_chip(const sensors_chip_name *name);
#endif /* def PROG_SENSORS_CHIPS_H */ #endif /* def PROG_SENSORS_CHIPS_H */

View File

@@ -160,7 +160,7 @@ static void do_a_print(const sensors_chip_name *name)
if (do_raw) if (do_raw)
print_chip_raw(name); print_chip_raw(name);
else else
print_generic_chip(name); print_chip(name);
printf("\n"); printf("\n");
} }