~ubuntu-branches/ubuntu/trusty/systemd-shim/trusty

« back to all changes in this revision

Viewing changes to src/unit.h

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-02 09:56:31 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130502095631-k1ddo16t58qczq4d
Tags: 3-0ubuntu1
* New upstream release:
* Add a watch file.
* Suggest pm-utils.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef _unit_h_
21
21
#define _unit_h_
22
22
 
23
 
#include <glib.h>
24
 
 
25
 
typedef struct _Unit Unit;
26
 
 
 
23
#include <gio/gio.h>
 
24
 
 
25
#define UNIT_TYPE (unit_get_type ())
 
26
#define UNIT_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), UNIT_TYPE, UnitClass))
 
27
 
 
28
typedef GObject Unit;
 
29
 
 
30
typedef struct
 
31
{
 
32
  GObjectClass parent_class;
 
33
 
 
34
  const gchar * (* get_state) (Unit *unit);
 
35
  void (* start) (Unit *unit);
 
36
  void (* stop) (Unit *unit);
 
37
} UnitClass;
 
38
 
 
39
GType unit_get_type (void);
27
40
Unit *lookup_unit (GVariant *parameters, GError **error);
28
41
const gchar *unit_get_state (Unit *unit);
29
42
void unit_start (Unit *unit);
30
43
void unit_stop (Unit *unit);
31
44
 
 
45
Unit *ntp_unit_get (void);
 
46
 
 
47
typedef enum
 
48
{
 
49
  POWER_OFF,
 
50
  POWER_REBOOT,
 
51
  POWER_SUSPEND,
 
52
  POWER_HIBERNATE,
 
53
  N_POWER_ACTIONS
 
54
} PowerAction;
 
55
 
 
56
Unit *power_unit_new (PowerAction action);
 
57
 
32
58
#endif /* _unit_h_ */