blob: 56e1d85254cd88facfc04997587338ec892b06af [file] [log] [blame]
Amit Arorae9e16b02010-08-03 10:15:20 +05301#include <stdio.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <string.h>
5#include <dirent.h>
6#include <getopt.h>
7#include <errno.h>
Amit Arora47fd9182010-08-24 13:26:06 +05308#include <ncurses.h>
Amit Arorae9e16b02010-08-03 10:15:20 +05309
Amit Arorafefe8bf2010-08-05 13:31:20 +053010#define VERSION "1.0"
11
Amit Arorae9e16b02010-08-03 10:15:20 +053012#define VALUE_MAX 16
13
14struct regulator_info {
15 char name[NAME_MAX];
16 char state[VALUE_MAX];
17 char status[VALUE_MAX];
18 char type[VALUE_MAX];
19 char opmode[VALUE_MAX];
20 int microvolts;
Amit Arora83faf0e2010-08-05 12:27:42 +053021 int min_microvolts;
22 int max_microvolts;
Amit Arorae9e16b02010-08-03 10:15:20 +053023 int microamps;
Amit Arora83faf0e2010-08-05 12:27:42 +053024 int min_microamps;
25 int max_microamps;
26 int requested_microamps;
Amit Arorae9e16b02010-08-03 10:15:20 +053027 int num_users;
28} *regulators_info;
29
30extern int numregulators;
Amit Arora47fd9182010-08-24 13:26:06 +053031extern int dump;
Amit Arorae9e16b02010-08-03 10:15:20 +053032
33extern void usage(char **argv);
Amit Arorafefe8bf2010-08-05 13:31:20 +053034extern void version(void);
Amit Arorae9e16b02010-08-03 10:15:20 +053035extern void print_regulator_info(int verbose);
36extern void get_sensor_info(char *path, char *name, char *sensor, int verbose);
Amit Aroradca56d02010-08-05 14:57:22 +053037extern void print_string_val(char *name, char *val);
Amit Arora47fd9182010-08-24 13:26:06 +053038
39#define PT_COLOR_DEFAULT 1
40#define PT_COLOR_HEADER_BAR 2
41#define PT_COLOR_ERROR 3
42#define PT_COLOR_RED 4
43#define PT_COLOR_YELLOW 5
44#define PT_COLOR_GREEN 6
45#define PT_COLOR_BRIGHT 7
46#define PT_COLOR_BLUE 8
47
48
49
50extern void init_curses(void);
51extern void fini_curses(void);
52extern void killall_windows(void);
53extern void show_header(void);
54extern void create_windows(void);
55extern void show_regulator_info(int verbose);