File: types.h

package info (click to toggle)
xfce4-sensors-plugin 0.10.99.5~svn-r4998-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,032 kB
  • ctags: 307
  • sloc: sh: 9,815; ansic: 3,174; makefile: 100
file content (109 lines) | stat: -rw-r--r-- 2,516 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
 *      middlelayer.h
 *
 *      Copyright 2006, 2007 Fabian Nowak <timytery@arcor.de>
 *
 *      This program is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program is distributed in the hope that it will be useful,
 *      but WITHOUT ANY WARRANTY; without even the implied warranty of
 *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *      GNU General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */


#ifndef XFCE4_SENSORS_TYPES_H
#define XFCE4_SENSORS_TYPES_H

#include <glib/garray.h>
#include <glib/gtypes.h>

#ifdef HAVE_CONFIG_H
  #include "config.h"
#endif

#include <libxfce4util/libxfce4util.h>

#ifdef HAVE_LIBSENSORS
 #include <sensors/sensors.h>
#else
 typedef struct sensors_chip_name {
  char *prefix;
  int bus;
  int addr;
  char *busname;    /* if dummy */
 } sensors_chip_name;
#endif


/*
 * temperature scale to show values in
 */
typedef enum {
    CELSIUS,
    FAHRENHEIT
} t_tempscale;


/* #define NUM_SENSOR_CHIPS 10
#define FEATURES_PER_SENSOR 256 */

typedef enum {
    LMSENSOR,
    HDD,
    ACPI
} t_chiptype;

/*
 * Indicates whether chipfeature is a temperature, a voltage or a speed
 * value
 */
typedef enum {
    TEMPERATURE,
    VOLTAGE,
    SPEED,
    ENERGY,
    STATE,
    OTHER
} t_chipfeature_class;

/*
 * Information about a special feature on a chip
 */
typedef struct {
    gchar *name;
    gchar *devicename;
    /* gchar *description; */
    double raw_value; /* unformatted sensor feature values */
    gchar *formatted_value; /* formatted (%f5.2) sensor feature values */
    float min_value;
    float max_value;
    gchar *color;
    gboolean show;
    gint address; /* specifies the mapping to the internal number in chip_name */
    gboolean valid;
    t_chipfeature_class class;
} t_chipfeature;


/*
 * Information about a whole chip, like asb-1-45
 */
typedef struct {
    gchar *sensorId;
    gchar *name;
    gchar *description;
    gint num_features;
    const sensors_chip_name *chip_name;
    GPtrArray *chip_features;
    t_chiptype type;
} t_chip;

#endif /* XFCE4_SENSORS_TYPES_H */