1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
3
* Copyright (C) 2009 Richard Hughes <richard@hughsie.com>
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#include <glib-object.h>
27
#include "dkp-wakeups-obj.h"
30
* dkp_wakeups_obj_clear_internal:
33
dkp_wakeups_obj_clear_internal (DkpWakeupsObj *obj)
38
obj->is_userspace = FALSE;
44
* dkp_wakeups_obj_copy:
47
dkp_wakeups_obj_copy (const DkpWakeupsObj *cobj)
50
obj = g_new0 (DkpWakeupsObj, 1);
52
obj->value = cobj->value;
53
obj->is_userspace = cobj->is_userspace;
58
* dkp_wakeups_obj_equal:
61
dkp_wakeups_obj_equal (const DkpWakeupsObj *obj1, const DkpWakeupsObj *obj2)
63
if (obj1->id == obj2->id)
69
* dkp_wakeups_obj_print:
72
dkp_wakeups_obj_print (const DkpWakeupsObj *obj)
74
g_print ("userspace:%i id:%i, interrupts:%.1f, cmdline:%s, details:%s\n", obj->is_userspace, obj->id, obj->value, obj->cmdline, obj->details);
79
* dkp_wakeups_obj_new:
82
dkp_wakeups_obj_new (void)
85
obj = g_new0 (DkpWakeupsObj, 1);
86
dkp_wakeups_obj_clear_internal (obj);
91
* dkp_wakeups_obj_free:
94
dkp_wakeups_obj_free (DkpWakeupsObj *obj)
98
g_free (obj->cmdline);
99
g_free (obj->details);