From c7c77845d2ba7d1fc1e44c0f663ac54c5e186705 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Tue, 3 Jul 2007 14:26:26 +0000 Subject: [PATCH] Make a few libsensors functions static. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4544 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/access.c | 16 ++++++++++------ lib/access.h | 22 ---------------------- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/lib/access.c b/lib/access.c index f7bac9cb..b6c5eb7b 100644 --- a/lib/access.c +++ b/lib/access.c @@ -27,7 +27,9 @@ #include "proc.h" #include "general.h" -static int sensors_do_this_chip_sets(sensors_chip_name name); +static int sensors_eval_expr(sensors_chip_name chipname, + const sensors_expr *expr, + double val, double *result); /* Compare two chips name descriptions, to see whether they could match. Return 0 if it does not match, return 1 if it does match. */ @@ -70,8 +72,9 @@ int sensors_match_chip(sensors_chip_name chip1, sensors_chip_name chip2) the struct the return value points to! Note that this visits the list of chips from last to first. Usually, you want the match that was latest in the config file. */ -sensors_chip *sensors_for_all_config_chips(sensors_chip_name chip_name, - const sensors_chip * last) +static sensors_chip * +sensors_for_all_config_chips(sensors_chip_name chip_name, + const sensors_chip *last) { int nr, i; sensors_chip_name_list chips; @@ -110,8 +113,8 @@ const sensors_chip_feature *sensors_lookup_feature_nr(const sensors_chip_name *c /* Look up a resource in the intern chip list, and return a pointer to it. Do not modify the struct the return value points to! Returns NULL if not found.*/ -const sensors_chip_feature *sensors_lookup_feature_name(const sensors_chip_name *chip, - const char *feature) +static const sensors_chip_feature * +sensors_lookup_feature_name(const sensors_chip_name *chip, const char *feature) { int i, j; const sensors_chip_feature *features; @@ -349,6 +352,7 @@ const sensors_feature_data *sensors_get_all_features(sensors_chip_name name, return NULL; } +/* Evaluate an expression */ int sensors_eval_expr(sensors_chip_name chipname, const sensors_expr * expr, double val, double *result) { @@ -410,7 +414,7 @@ int sensors_eval_expr(sensors_chip_name chipname, const sensors_expr * expr, /* Execute all set statements for this particular chip. The chip may not contain wildcards! This function will return 0 on success, and <0 on failure. */ -int sensors_do_this_chip_sets(sensors_chip_name name) +static int sensors_do_this_chip_sets(sensors_chip_name name) { sensors_chip *chip; double value; diff --git a/lib/access.h b/lib/access.h index 0ed55e17..32c274ec 100644 --- a/lib/access.h +++ b/lib/access.h @@ -23,28 +23,12 @@ #include "sensors.h" #include "data.h" -/* Returns, one by one, a pointer to all sensor_chip structs of the - config file which match with the given chip name. Last should be - the value returned by the last call, or NULL if this is the first - call. Returns NULL if no more matches are found. Do not modify - the struct the return value points to! - Note that this visits the list of chips from last to first. Usually, - you want the match that was latest in the config file. */ -extern sensors_chip *sensors_for_all_config_chips(sensors_chip_name chip_name, - const sensors_chip *last); - /* Look up a resource in the intern chip list, and return a pointer to it. Do not modify the struct the return value points to! Returns NULL if not found. */ extern const sensors_chip_feature *sensors_lookup_feature_nr(const sensors_chip_name *chip, int feature); -/* Look up a resource in the intern chip list, and return a pointer to it. - Do not modify the struct the return value points to! Returns NULL if - not found.*/ -extern const sensors_chip_feature *sensors_lookup_feature_name - (const sensors_chip_name *chip, const char *feature); - /* Substitute configuration bus numbers with real-world /proc bus numbers in the chips lists */ extern int sensors_substitute_busses(void); @@ -54,10 +38,4 @@ extern int sensors_substitute_busses(void); error.h on failure. */ extern int sensors_parse_i2cbus_name(const char *name, int *res); -/* Evaluate an expression */ -extern int sensors_eval_expr(sensors_chip_name chipname, - const sensors_expr *expr, - double val, double *result); - - #endif /* def LIB_SENSORS_ACCESS_H */