cleanup
[psensor.git] / src / lib / psensor.h
index fb06814..81a8b03 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -28,7 +28,7 @@
 
 #include "bool.h"
 #include "color.h"
-#include "log.h"
+#include <plog.h>
 #include "measure.h"
 
 enum psensor_type {
@@ -54,6 +54,12 @@ enum psensor_type {
        SENSOR_TYPE_GPU = 0x10000,
        SENSOR_TYPE_FAN = 0x20000,
 
+       SENSOR_TYPE_GRAPHICS = 0x40000,
+       SENSOR_TYPE_VIDEO = 0x80000,
+       SENSOR_TYPE_PCIE = 0x100000,
+       SENSOR_TYPE_MEMORY = 0x200000,
+       SENSOR_TYPE_AMBIENT = 0x400000,
+
        /* Combinations */
        SENSOR_TYPE_HDD_TEMP = (SENSOR_TYPE_HDD | SENSOR_TYPE_TEMP),
        SENSOR_TYPE_CPU_USAGE = (SENSOR_TYPE_CPU | SENSOR_TYPE_USAGE)
@@ -84,7 +90,7 @@ struct psensor {
        struct color *color;
 
        /* Whether the graph sensor is displayed. */
-       bool enabled;
+       bool graph_enabled;
 
        /* see psensor_type */
        unsigned int type;
@@ -136,6 +142,8 @@ void psensor_free(struct psensor *sensor);
 void psensor_list_free(struct psensor **sensors);
 int psensor_list_size(struct psensor **sensors);
 
+struct psensor **psensor_list_filter_graph_enabled(struct psensor **);
+
 struct psensor *psensor_list_get_by_id(struct psensor **sensors,
                                       const char *id);
 
@@ -167,11 +175,11 @@ psensor_get_max_current_value(struct psensor **sensors, unsigned int type);
 */
 char *psensor_value_to_str(unsigned int type,
                           double value,
-                          int use_celcius);
+                          int use_celsius);
 
 char *psensor_measure_to_str(const struct measure *m,
                             unsigned int type,
-                            unsigned int use_celcius);
+                            unsigned int use_celsius);
 
 struct psensor **get_all_sensors(int use_libatasmart, int values_max_length);
 
@@ -184,7 +192,7 @@ void psensor_set_current_value(struct psensor *sensor, double value);
 void psensor_set_current_measure(struct psensor *sensor, double value,
                                 struct timeval tv);
 
-double psensor_get_current_value(struct psensor *sensor);
+double psensor_get_current_value(const struct psensor *);
 
 struct measure *psensor_get_current_measure(struct psensor *sensor);
 
@@ -193,7 +201,7 @@ struct measure *psensor_get_current_measure(struct psensor *sensor);
 */
 const char *psensor_type_to_str(unsigned int type);
 
-const char *psensor_type_to_unit_str(unsigned int type, int use_celcius);
+const char *psensor_type_to_unit_str(unsigned int type, int use_celsius);
 
 void psensor_list_update_measures(struct psensor **sensors);
 
@@ -203,9 +211,7 @@ void psensor_cleanup();
 
 double get_max_value(struct psensor **sensors, int type);
 
-double celcius_to_fahrenheit(double c);
-double fahrenheit_to_celcius(double c);
-
+char *psensor_current_value_to_str(const struct psensor *, unsigned int);
 
 void psensor_log_measures(struct psensor **sensors);