File: middlelayer.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 (91 lines) | stat: -rw-r--r-- 2,531 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
/*
 *      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_MIDDLELAYER_H
#define XFCE4_SENSORS_MIDDLELAYER_H

#include "types.h"

#include <glib/garray.h>
#include <glib/gdir.h>
#include <glib/gerror.h>
#include <glib/gmem.h>
#include <glib/gmessages.h>
#include <glib/gprintf.h>
#include <glib/gtypes.h>

#include <string.h>

#define NO_VALID_HDDTEMP -2

/*
 * Initialize all sensors detected by iterating and calling init-routines
 * @Return: Number of initialized features
 * @Param: Double-pointer to array of chips
 */
int initialize_all (GPtrArray **chips, gboolean *suppressmessage);


/*
 * Refresh all features of a chip

 * @Param chip: Pointer to chip
 */
void refresh_chip (gpointer chip, gpointer data);


/*
 * Refresh all features of a chip
 * @Param: Pointer to chip pointers
 */
void refresh_all_chips (GPtrArray *chips);


/*
 * Classifies sensor type
 * @Param: Pointer to feature
 */
void categorize_sensor_type (t_chipfeature *chipfeature);


/* Gets value of specified number in chip_name
 * @Param chip_name: takten from libsensors3, it specifies bus and stuff of
 * the sensors chip feature
 * @Param number: number of chipfeature to look for
 * @Param value: address where double value can be stored
 * @Return: 0 on success, >0 else.
 */
int sensor_get_value (t_chip *chip, int number, double *value);


/*  Free data in chipfeatures */
void free_chipfeature (gpointer chipfeature, gpointer data);


/*  Free reamining structures in chips and associated chipfeatures */
void free_chip (gpointer chip, gpointer data);


/* Clean up structures and call library routines for ending "session".
 */
void sensor_interface_cleanup ();

#endif /* XFCE4_SENSORS_MIDDLELAYER_H */