diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-03-05 22:01:06 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2013-03-05 22:01:06 +0000 |
commit | f5d84ece33813148e2388ea15d766a15af48664a (patch) | |
tree | 64517ee3cf80b2bd25d16d85595665a756ee4309 /navit/profile_option.c | |
parent | 516ab7463afb934a0ec59a1a44c24812076ef643 (diff) | |
download | navit-f5d84ece33813148e2388ea15d766a15af48664a.tar.gz |
Add:Core:Beginning of work to create vehicleprofile options instead of multiple vehicle profiles
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5400 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/profile_option.c')
-rw-r--r-- | navit/profile_option.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/navit/profile_option.c b/navit/profile_option.c new file mode 100644 index 000000000..a9d5a880f --- /dev/null +++ b/navit/profile_option.c @@ -0,0 +1,61 @@ +/** + * Navit, a modular navigation system. + * Copyright (C) 2005-2012 Navit Team + * + * This program is free software; you can redistribute it and/or + * modify it under the terpo of the GNU General Public License + * version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include <glib.h> +#include "item.h" +#include "debug.h" +#include "xmlconfig.h" + +struct profile_option +{ + NAVIT_OBJECT +}; + +struct profile_option * +profile_option_new(struct attr *parent, struct attr **attrs) +{ + struct profile_option *po=g_new0(struct profile_option, 1); + po->func=&profile_option_func; + navit_object_ref((struct navit_object *)po); + po->attrs=attr_list_dup(attrs); + return po; +} + +void +profile_option_destroy(struct profile_option *po) +{ + attr_list_free(po->attrs); + g_free(po); +} + +struct object_func profile_option_func = { + attr_profile_option, + (object_func_new)profile_option_new, + (object_func_get_attr)NULL, + (object_func_iter_new)NULL, + (object_func_iter_destroy)NULL, + (object_func_set_attr)NULL, + (object_func_add_attr)NULL, + (object_func_remove_attr)NULL, + (object_func_init)NULL, + (object_func_destroy)profile_option_destroy, + (object_func_dup)NULL, + (object_func_ref)navit_object_ref, + (object_func_unref)navit_object_unref, +}; |