~xavi-garcia-mena/ubuntu/vivid/upower/percentages-power-off

« back to all changes in this revision

Viewing changes to libupower-glib/up-version.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-02-16 10:16:24 UTC
  • Revision ID: james.westby@ubuntu.com-20100216101624-2cmwqsr1ndftdd87
Tags: upstream-0.9.0+git20100216.72bb2
ImportĀ upstreamĀ versionĀ 0.9.0+git20100216.72bb2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 
2
 *
 
3
 * Copyright (C) 2009-2010 Richard Hughes <richard@hughsie.com>
 
4
 *
 
5
 * Licensed under the GNU General Public License Version 2
 
6
 *
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
20
 */
 
21
 
 
22
/**
 
23
 * SECTION:up-version
 
24
 * @short_description: Obtains the version for the installed UPower
 
25
 *
 
26
 * These compile time macros allow the user to enable parts of client code
 
27
 * depending on the version of libupower-glib installed.
 
28
 *
 
29
 * See also: #UpClient, #UpDevice
 
30
 */
 
31
 
 
32
#if !defined (__UPOWER_H_INSIDE__) && !defined (UP_COMPILATION)
 
33
#error "Only <upower.h> can be included directly."
 
34
#endif
 
35
 
 
36
#ifndef __UP_VERSION_H
 
37
#define __UP_VERSION_H
 
38
 
 
39
/**
 
40
 * UP_CHECK_VERSION:
 
41
 *
 
42
 * The compile-time major version
 
43
 */
 
44
#define UP_MAJOR_VERSION                                (0)
 
45
 
 
46
/**
 
47
 * UP_CHECK_MINOR:
 
48
 *
 
49
 * The compile-time minor version
 
50
 */
 
51
#define UP_MINOR_VERSION                                (9)
 
52
 
 
53
/**
 
54
 * UP_MICRO_VERSION:
 
55
 *
 
56
 * The compile-time micro version
 
57
 */
 
58
#define UP_MICRO_VERSION                                (1)
 
59
 
 
60
/* check whether a UPower version equal to or greater than
 
61
 * major.minor.micro.
 
62
 */
 
63
#define UP_CHECK_VERSION(major,minor,micro)    \
 
64
    (UP_MAJOR_VERSION > (major) || \
 
65
     (UP_MAJOR_VERSION == (major) && UP_MINOR_VERSION > (minor)) || \
 
66
     (UP_MAJOR_VERSION == (major) && UP_MINOR_VERSION == (minor) && \
 
67
      UP_MICRO_VERSION >= (micro)))
 
68
 
 
69
#endif /* __UP_VERSION_H */