X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=data1%2Fd1_map.c;h=ff1aedcae8ad95282c0a6474cd38d61aab50474a;hb=cc4289d73c2b872c09d221d5e1188d3cdd9da438;hp=8cd3bc957876af72f18d88e92d44c435d6fb7baf;hpb=519fefb91135ad52134b9fc4e82b3874f5525a2b;p=idzebra-moved-to-github.git diff --git a/data1/d1_map.c b/data1/d1_map.c index 8cd3bc9..ff1aedc 100644 --- a/data1/d1_map.c +++ b/data1/d1_map.c @@ -1,10 +1,24 @@ -/* - * Copyright (c) 1995-2002, Index Data. - * See the file LICENSE for details. - * Sebastian Hammer, Adam Dickmeiss - * - * $Id: d1_map.c,v 1.1 2002-10-22 12:53:33 adam Exp $ - */ +/* $Id: d1_map.c,v 1.3 2003-03-27 21:57:01 adam Exp $ + Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 + Index Data Aps + +This file is part of the Zebra server. + +Zebra is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Zebra 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 Zebra; see the file LICENSE.zebra. If not, write to the +Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. +*/ #include #include @@ -264,8 +278,27 @@ static int map_children(data1_handle dh, data1_node *n, data1_maptab *map, { if (!cur || mt->new_field || !tagmatch(cur, mt)) { - cur = data1_mk_node2 (dh, mem, DATA1N_tag, pn); - cur->u.tag.tag = mt->value.string; + if (mt->which == D1_MAPTAG_string) + { + cur = data1_mk_node2 (dh, mem, DATA1N_tag, pn); + cur->u.tag.tag = mt->value.string; + } + else if (mt->which == D1_MAPTAG_numeric) + { + data1_tag *tag = + data1_gettagbynum( + dh, + pn->root->u.root.absyn->tagset, + mt->type, + mt->value.numeric); + + if (tag && tag->names->name) + { + cur = data1_mk_tag ( + dh, mem, tag->names->name, 0, pn); + + } + } } if (mt->next)