Bugfix: memory and thread-deleting problems
[monky] / src / diskio.h
1 /* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
2  *
3  * Conky, a system monitor, based on torsmo
4  *
5  * Any original torsmo code is licensed under the BSD license
6  *
7  * All code written since the fork of torsmo is licensed under the GPL
8  *
9  * Please see COPYING for details
10  *
11  * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen
12  * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
13  * (see AUTHORS)
14  * All rights reserved.
15  *
16  * This program is free software: you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation, either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24  * GNU General Public License for more details.
25  * You should have received a copy of the GNU General Public License
26  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
27  *
28  */
29
30 #ifndef DISKIO_H_
31 #define DISKIO_H_
32
33 struct diskio_stat {
34         struct diskio_stat *next;
35         char *dev;
36         double sample[15];
37         double sample_read[15];
38         double sample_write[15];
39         double current;
40         double current_read;
41         double current_write;
42         double last;
43         double last_read;
44         double last_write;
45 };
46
47 extern struct diskio_stat stats;
48
49 struct diskio_stat *prepare_diskio_stat(const char *);
50 int update_diskio(void);
51 void clear_diskio_stats(void);
52 void update_diskio_values(struct diskio_stat *, unsigned int, unsigned int);
53
54 void parse_diskio_arg(struct text_object *, const char *);
55 void print_diskio(struct text_object *, char *, int);
56 void print_diskio_read(struct text_object *, char *, int);
57 void print_diskio_write(struct text_object *, char *, int);
58 #ifdef X11
59 void parse_diskiograph_arg(struct text_object *, const char *);
60 void print_diskiograph(struct text_object *, char *, int);
61 void print_diskiograph_read(struct text_object *, char *, int);
62 void print_diskiograph_write(struct text_object *, char *, int);
63 #endif /* X11 */
64
65 #endif /* DISKIO_H_ */