~ubuntu-branches/debian/squeeze/upstart/squeeze

« back to all changes in this revision

Viewing changes to nih-dbus-tool/parse.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2010-06-19 21:15:12 UTC
  • mfrom: (1.3.2 upstream) (0.1.1280 upstart)
  • Revision ID: james.westby@ubuntu.com-20100619211512-cu6b20sf8qmm4oek
Tags: 0.6.6-1
* New upstream release.
  - Mount /proc and /sys on initialisation. Closes: #577710
  - Since version 0.6.5 upstart no longer includes a internal copy of libnih
    but instead depends on it being installed system wide.
  - Provide a separate function to reconnect to the D-Bus system bus which
    can be triggered by the SIGUSR1 signal as a config reload has the
    negative side effect of losing state.
* debian/control
  - Add Build-Depends on libnih-dev (>= 1.0.2), libnih-dbus-dev (>= 1.0.2)
    and nih-dbus-tool.
  - Bump Standards-Version to 3.8.4. No further changes.
  - Add ${misc:Depends}.
* debian/conf/dbus-reconnect.conf
  - Use SIGUSR1 to tell upstart to reconnect to the D-Bus system bus.
* debian/upstart.docs
  - Remove ChangeLog.nih which is no longer included in the source.
* debian/conf/tty*.conf
  - Run getty in 8-bit clean mode to better handle UTF-8 environments.
* Switch to source format 3.0 (quilt).
  - Drop Build-Depends on quilt.
  - Remove quilt.make include and patch/unpatch targets from debian/rules.
  - Add debian/source/format.
* Add SELinux support. Closes: #543420
  - Add debian/patches/01-selinux.patch to make upstart load the policy if
    SELinux is enabled. Patch by Russell Coker with some minor changes and
    build system integration.
  - Add debian/patches/99-autoreconf.patch.
  - Add Build-Depends on libselinux-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* nih-dbus-tool
2
 
 *
3
 
 * Copyright © 2009 Scott James Remnant <scott@netsplit.com>.
4
 
 * Copyright © 2009 Canonical Ltd.
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or modify
7
 
 * it under the terms of the GNU General Public License version 2, as
8
 
 * published by the Free Software Foundation.
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 along
16
 
 * with this program; if not, write to the Free Software Foundation, Inc.,
17
 
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
 
 */
19
 
 
20
 
#ifndef NIH_DBUS_TOOL_PARSE_H
21
 
#define NIH_DBUS_TOOL_PARSE_H
22
 
 
23
 
#include <nih/macros.h>
24
 
#include <nih/list.h>
25
 
 
26
 
#include "node.h"
27
 
#include "interface.h"
28
 
#include "method.h"
29
 
#include "signal.h"
30
 
#include "property.h"
31
 
#include "argument.h"
32
 
 
33
 
 
34
 
/**
35
 
 * ParseStackType:
36
 
 *
37
 
 * Type of parsed object on the stack.
38
 
 **/
39
 
typedef enum parse_stack_type {
40
 
        PARSE_IGNORED,
41
 
        PARSE_NODE,
42
 
        PARSE_INTERFACE,
43
 
        PARSE_METHOD,
44
 
        PARSE_SIGNAL,
45
 
        PARSE_PROPERTY,
46
 
        PARSE_ARGUMENT,
47
 
        PARSE_ANNOTATION,
48
 
} ParseStackType;
49
 
 
50
 
/**
51
 
 * ParseStack:
52
 
 * @entry: list header,
53
 
 * @type: type of object parsed,
54
 
 * @data: object pointer.
55
 
 *
56
 
 * This structure represents an object parsed from the XML file and is used
57
 
 * as a stack.  @type indicates which type of object is being parsed, and
58
 
 * the @data pointer is part of a union of the different types of pointer.
59
 
 **/
60
 
typedef struct parse_stack {
61
 
        NihList            entry;
62
 
        ParseStackType     type;
63
 
        union {
64
 
                void *     data;
65
 
                Node *     node;
66
 
                Interface *interface;
67
 
                Method *   method;
68
 
                Signal *   signal;
69
 
                Property * property;
70
 
                Argument * argument;
71
 
        };
72
 
} ParseStack;
73
 
 
74
 
 
75
 
/**
76
 
 * ParseContext:
77
 
 * @parent: parent for node,
78
 
 * @stack: parse stack,
79
 
 * @filename: filename being parsed,
80
 
 * @node: top-level node.
81
 
 *
82
 
 * This structure is used as the user data for the XML parser, it tracks the
83
 
 * stack of objects being parsed and returns the top-level node object which
84
 
 * has all of the interfaces, etc.
85
 
 **/
86
 
typedef struct parse_context {
87
 
        const void *parent;
88
 
        NihList     stack;
89
 
        const char *filename;
90
 
        Node *      node;
91
 
} ParseContext;
92
 
 
93
 
 
94
 
NIH_BEGIN_EXTERN
95
 
 
96
 
ParseStack *parse_stack_push (const void *parent, NihList *stack,
97
 
                              ParseStackType type, void *data)
98
 
        __attribute__ ((warn_unused_result, malloc));
99
 
ParseStack *parse_stack_top  (NihList *stack);
100
 
 
101
 
void        parse_start_tag  (XML_Parser xmlp, const char *tag,
102
 
                              char * const *attr);
103
 
void        parse_end_tag    (XML_Parser xmlp, const char *tag);
104
 
 
105
 
Node *      parse_xml        (const void *parent, int fd, const char *filename)
106
 
        __attribute__ ((warn_unused_result, malloc));
107
 
 
108
 
NIH_END_EXTERN
109
 
 
110
 
#endif /* NIH_DBUS_TOOL_PARSE_H */