/[zanavi_public1]/navit/navit/announcement.c
ZANavi

Contents of /navit/navit/announcement.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 40 - (show annotations) (download)
Wed Mar 4 14:00:54 2015 UTC (9 years ago) by zoff99
File MIME type: text/plain
File size: 1891 byte(s)
new market version, lots of fixes
1 /**
2 * Navit, a modular navigation system.
3 * Copyright (C) 2005-2008 Navit Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20 #include <glib.h>
21 #include "debug.h"
22 #include "item.h"
23 #include "announcement.h"
24
25 struct announcement {
26 struct attr **attrs;
27 };
28
29 struct announcement *
30 announcement_new(struct attr *parent, struct attr **attrs)
31 {
32 struct announcement *this_;
33 struct attr *type_attr;
34
35 //dbg(0, "enter\n");
36
37 if (! (type_attr=attr_search(attrs, NULL, attr_name)))
38 {
39 return NULL;
40 }
41
42 this_=g_new0(struct announcement, 1);
43 this_->attrs=attr_list_dup(attrs);
44
45 return this_;
46 }
47
48 int
49 announcement_get_attr(struct announcement *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter)
50 {
51 return attr_generic_get_attr(this_->attrs, NULL, type, attr, iter);
52 }
53
54 int
55 announcement_set_attr(struct announcement *this_, struct attr *attr)
56 {
57 //dbg(0, "enter\n");
58
59 this_->attrs=attr_generic_set_attr(this_->attrs, attr);
60 return 1;
61 }
62
63 int
64 announcement_add_attr(struct announcement *this_, struct attr *attr)
65 {
66 //dbg(0, "enter\n");
67
68 this_->attrs=attr_generic_add_attr(this_->attrs, attr);
69 return 1;
70 }
71
72 int
73 announcement_remove_attr(struct announcement *this_, struct attr *attr)
74 {
75 this_->attrs=attr_generic_remove_attr(this_->attrs, attr);
76 return 1;
77 }
78

   
Visit the ZANavi Wiki