summaryrefslogtreecommitdiff
path: root/lib/conf-parse.y
diff options
context:
space:
mode:
authorFrodo Looijaard <frodol@dds.nl>1999-12-24 22:44:41 +0000
committerFrodo Looijaard <frodol@dds.nl>1999-12-24 22:44:41 +0000
commit8199abde46ecb9cc5b0ea5e2c4456c219ecd4bef (patch)
tree23a48ce561cdd103257b2b64365c3461eeb0e616 /lib/conf-parse.y
parent01bad3825306a1f219cf13ac007246d7eda2f6ff (diff)
downloadlm-sensors-git-8199abde46ecb9cc5b0ea5e2c4456c219ecd4bef.tar.gz
New sensors.conf keyword 'ignore'
This often-asked for, long-planned and somewhat-forgotten feature makes it possible to tell libsensors-linked applications (like the sensors program) that certain features should not be displayed. This is very nice for things like unconnected temperature sensors or fans. Modifications to the library code, to the sensors program and to the documentation and example sensors.conf file. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@676 7894878c-1315-0410-8ee3-d5d059ff63e0
Diffstat (limited to 'lib/conf-parse.y')
-rw-r--r--lib/conf-parse.y17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/conf-parse.y b/lib/conf-parse.y
index 337d91a6..fd944aee 100644
--- a/lib/conf-parse.y
+++ b/lib/conf-parse.y
@@ -60,6 +60,11 @@ static sensors_chip *current_chip = NULL;
&current_chip->computes_count,\
&current_chip->computes_max,\
sizeof(sensors_compute));
+#define ignore_add_el(el) sensors_add_array_el(el,\
+ (void **) &current_chip->ignores,\
+ &current_chip->ignores_count,\
+ &current_chip->ignores_max,\
+ sizeof(sensors_ignore));
#define chip_add_el(el) sensors_add_array_el(el,\
(void **) &sensors_config_chips,\
&sensors_config_chips_count,\
@@ -105,6 +110,7 @@ static sensors_chip *current_chip = NULL;
%token <line> SET
%token <line> CHIP
%token <line> COMPUTE
+%token <line> IGNORE
%token <value> FLOAT
%token <name> NAME
%token <nothing> ERROR
@@ -131,6 +137,7 @@ line: bus_statement EOL
| set_statement EOL
| chip_statement EOL
| compute_statement EOL
+ | ignore_statement EOL
| error EOL
;
@@ -175,15 +182,25 @@ compute_statement: COMPUTE function_name expression ',' expression
}
;
+ignore_statement: IGNORE function_name
+ { sensors_ignore new_el;
+ check_current_chip();
+ new_el.lineno = $1;
+ new_el.name = $2;
+ ignore_add_el(&new_el);
+ }
+
chip_statement: CHIP chip_name_list
{ sensors_chip new_el;
new_el.lineno = $1;
new_el.labels = NULL;
new_el.sets = NULL;
new_el.computes = NULL;
+ new_el.ignores = NULL;
new_el.labels_count = new_el.labels_max = 0;
new_el.sets_count = new_el.sets_max = 0;
new_el.computes_count = new_el.computes_max = 0;
+ new_el.ignores_count = new_el.ignores_max = 0;
new_el.chips = $2;
chip_add_el(&new_el);
current_chip = sensors_config_chips +