diff options
Diffstat (limited to 'navit/attr.c')
-rw-r--r-- | navit/attr.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/navit/attr.c b/navit/attr.c index 785cdfb0f..ae5c01e6e 100644 --- a/navit/attr.c +++ b/navit/attr.c @@ -661,6 +661,27 @@ attr_list_dup(struct attr **attrs) return ret; } +struct attr ** +attr_list_append(struct attr **attrs, struct attr *attr) +{ + struct attr **ret; + int i,count=0; + + if (!attrs) + return NULL; + + while (attrs[count]) + count++; + ret=g_new0(struct attr *, count+2); + for (i = 0 ; i < count ; i++) + ret[i]=attr_dup(attrs[i]); + + ret[count]=attr_dup(attr); + g_free(attrs); + + return ret; +} + int attr_from_line(char *line, char *name, int *pos, char *val_ret, char *name_ret) |