X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=util%2Fattrfind.c;h=55a8a762324d7d4af4bf7a20adb8ea9e4a0c6dc1;hp=a416ba24b02def4393af5a16d414b09dd3b22cb9;hb=0dedb6a7a6a0f0ddaf56cb0673978fdd85e64be1;hpb=89d16cf15eda0e4802d18b8ad09bd3653508ebfc diff --git a/util/attrfind.c b/util/attrfind.c index a416ba2..55a8a76 100644 --- a/util/attrfind.c +++ b/util/attrfind.c @@ -1,5 +1,5 @@ /* This file is part of the Zebra server. - Copyright (C) 1994-2009 Index Data + Copyright (C) Index Data 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 @@ -17,6 +17,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if HAVE_CONFIG_H +#include +#endif #include #include @@ -52,7 +55,7 @@ int attr_find_ex(AttrType *src, const Odr_oid **attribute_set_oid, element = src->attributeList[src->major]; if (src->type == *element->attributeType) { - switch (element->which) + switch (element->which) { case Z_AttributeValue_numeric: ++(src->major); @@ -65,20 +68,20 @@ int attr_find_ex(AttrType *src, const Odr_oid **attribute_set_oid, break; if (element->attributeSet && attribute_set_oid) *attribute_set_oid = element->attributeSet; - if (element->value.complex->list[src->minor]->which == + if (element->value.complex->list[src->minor]->which == Z_StringOrNumeric_numeric) { ++(src->minor); return *element->value.complex->list[src->minor-1]->u.numeric; } - else if (element->value.complex->list[src->minor]->which == + else if (element->value.complex->list[src->minor]->which == Z_StringOrNumeric_string) { if (!string_value) break; ++(src->minor); - *string_value = + *string_value = element->value.complex->list[src->minor-1]->u.string; return -2; } @@ -102,6 +105,7 @@ int attr_find(AttrType *src, const Odr_oid **attribute_set_id) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab