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

« back to all changes in this revision

Viewing changes to string_list.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,2003,2004  Mattia Dongili<dongili@supereva.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
 
#include <stdlib.h>
20
 
#include <string.h>
21
 
 
22
 
#ifndef __STRINGLIST_H
23
 
#define __STRINGLIST_H
24
 
 
25
 
/*
26
 
 * Doubly linked list
27
 
 */
28
 
struct string_list {
29
 
  struct string_node *first;
30
 
  struct string_node *last;
31
 
};
32
 
/*
33
 
 * Node
34
 
 */
35
 
struct string_node {
36
 
  char string[255];
37
 
  struct string_node *next;
38
 
  struct string_node *prev;
39
 
};
40
 
 
41
 
/*
42
 
 * Frees all the elements of the list.
43
 
 * Returns the number of freed elements.
44
 
 * 
45
 
 */
46
 
int string_list_free_sublist(struct string_list *list, struct string_node *start);
47
 
 
48
 
/*
49
 
 * Initializes a new string_list and 
50
 
 * returns a reference to it
51
 
 *
52
 
 */
53
 
struct string_list *string_list_new(void);
54
 
 
55
 
/*
56
 
 * Initializes a new string_node and 
57
 
 * returns a reference to it
58
 
 *
59
 
 */
60
 
struct string_node *string_node_new(void);
61
 
 
62
 
/*
63
 
 * Appends a node to the list
64
 
 * 
65
 
 */
66
 
void string_list_append(struct string_list *list, struct string_node *node);
67
 
 
68
 
#endif