~ubuntu-branches/ubuntu/dapper/cpufreqd/dapper

« back to all changes in this revision

Viewing changes to src/config_parser.h

  • Committer: Bazaar Package Importer
  • Author(s): Mattia Dongili
  • Date: 2005-11-27 18:47:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127184742-9h26euwetr6kh1e6
Tags: 2.0.0-1

* New upstream release.
* cpufreqd.init: exit succesfully in case a stop is issued and
  cpufreqd is found running as requested by LSB thus making it
  possible to remove cpufreqd when cpufreqd itsef is stopped
  (closes: #340133)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2002-2005  Mattia Dongili <malattia@linux.it>
 
3
 *                           George Staikos <staikos@0wned.org>
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 */
 
19
 
 
20
#ifndef _CONFIG_PARSER_H
 
21
#define _CONFIG_PARSER_H 1
 
22
 
 
23
#include <stdio.h>
 
24
#include <cpufreq.h>
 
25
#include "cpufreqd.h"
 
26
#include "cpufreqd_plugin.h"
 
27
#include "list.h"
 
28
 
 
29
struct directive {
 
30
        void *obj;
 
31
        struct cpufreqd_keyword *keyword;
 
32
        struct cpufreqd_plugin *plugin;
 
33
};
 
34
 
 
35
struct profile {
 
36
        char name[MAX_STRING_LEN];
 
37
        unsigned int cpu;
 
38
        struct cpufreq_policy policy;
 
39
        struct LIST directives; /* list of struct directive */
 
40
        unsigned int directives_count;
 
41
};
 
42
 
 
43
struct rule {
 
44
        char name[MAX_STRING_LEN];
 
45
        char profile_name[MAX_STRING_LEN];
 
46
        struct LIST directives; /* list of struct directive */
 
47
        struct profile *prof;
 
48
        unsigned int score;
 
49
        unsigned int directives_count;
 
50
};
 
51
 
 
52
struct cpufreq_sys_info {
 
53
        struct cpufreq_available_governors *governors;
 
54
        struct cpufreq_available_frequencies *frequencies;
 
55
        struct cpufreq_affected_cpus *affected_cpus;
 
56
};
 
57
 
 
58
struct cpufreq_limits {
 
59
        unsigned long min;
 
60
        unsigned long max;
 
61
};
 
62
 
 
63
struct cpufreqd_conf {
 
64
 
 
65
        char config_file[MAX_PATH_LEN];
 
66
        char pidfile[MAX_PATH_LEN];
 
67
        int log_level;
 
68
        unsigned int cpu_num;
 
69
        unsigned int enable_remote;
 
70
        gid_t remote_gid;
 
71
        unsigned int double_check;
 
72
        struct timeval poll_intv;
 
73
        unsigned int has_sysfs;
 
74
        unsigned int no_daemon;
 
75
        unsigned int log_level_overridden;
 
76
        unsigned int print_help;
 
77
        unsigned int print_version;
 
78
        unsigned long cpu_min_freq;
 
79
        unsigned long cpu_max_freq;
 
80
 
 
81
        struct cpufreq_limits *limits;
 
82
        struct cpufreq_sys_info *sys_info;
 
83
 
 
84
        struct LIST rules; /* list of configured struct rule */
 
85
        struct LIST profiles; /* list of configured struct profile */
 
86
        struct LIST plugins; /* list of configured plugins struct o_plugin */
 
87
 
 
88
};
 
89
 
 
90
int     init_configuration      (struct cpufreqd_conf *config);
 
91
void    free_configuration      (struct cpufreqd_conf *config);
 
92
 
 
93
#endif /* _CONFIG_PARSER_H */