X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=blobdiff_plain;f=data1%2Fd1_if.c;h=399c68510437f4c81c60100d82386d0f3144be67;hp=9ac8f3f2ac6d9b1535b919b23fb1aafa0e2a225c;hb=e2e073b5c947e996304ed7d577497af5e9a879ee;hpb=02266b68e2e2c86d8a8467ee56721926b365d2d0 diff --git a/data1/d1_if.c b/data1/d1_if.c index 9ac8f3f..399c685 100644 --- a/data1/d1_if.c +++ b/data1/d1_if.c @@ -1,8 +1,5 @@ -/* $Id: d1_if.c,v 1.2 2002-10-22 13:19:50 adam Exp $ - Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 - Index Data Aps - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + 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 @@ -15,22 +12,24 @@ 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. +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include #include -#include +#include #include #include - /* * Search for a token in the supplied string up to the supplied list of stop characters or EOL * At the end, return the character causing the break and fill pTokenBuffer with the token string so far @@ -67,10 +66,10 @@ char data1_ScanNextToken(char* pBuffer, return(**pPosInBuffer); } -/* +/* * Attempt to find a string value given the specified tagpath - * - * Need to make this safe by passing in a buffer..... + * + * Need to make this safe by passing in a buffer..... * */ char *data1_getNodeValue(data1_node* node, char* pTagPath) @@ -90,17 +89,17 @@ char *data1_getNodeValue(data1_node* node, char* pTagPath) } else { - yaz_log(LOG_WARN,"Attempting to lookup data for tagpath: Child node is not a data node"); + yaz_log(YLOG_WARN,"Attempting to lookup data for tagpath: Child node is not a data node"); } } else { - yaz_log(LOG_WARN,"Found a node matching the tagpath, but it has no child data nodes"); + yaz_log(YLOG_WARN,"Found a node matching the tagpath, but it has no child data nodes"); } } else { - yaz_log(LOG_WARN,"Unable to lookup a node on the specified tag path"); + yaz_log(YLOG_WARN,"Unable to lookup a node on the specified tag path"); } return ""; @@ -110,7 +109,7 @@ char *data1_getNodeValue(data1_node* node, char* pTagPath) /* Max length of a tag */ #define MAX_TAG_SIZE 50 -/* +/* * data1_LookupNode : Try and find a node as specified by a tagpath */ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) @@ -174,7 +173,7 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } else { - yaz_log(LOG_FATAL,"Node does not end with a ]"); + yaz_log(YLOG_FATAL,"Node does not end with a ]"); /* Fatal Error */ return(NULL); } @@ -194,11 +193,11 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) /* See if we can find the . at the end of this clause */ sepchr = data1_ScanNextToken(pTagPath, &pCurrCharInPath, "."," ", Buffer); } - + } - yaz_log(LOG_DEBUG,"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences); - + yaz_log(YLOG_DEBUG,"search node for child like [%d,%d,%s,%d]",iTagType,iTagValue,StringTagVal,iOccurences); + /* OK.. We have extracted tagtype, Value and Occurence, see if we can find a node */ /* Under the current parent matching that description */ @@ -228,7 +227,7 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } else /* Attempt to match real element */ { - yaz_log(LOG_WARN,"Non string tag matching not yet implemented"); + yaz_log(YLOG_WARN,"Non string tag matching not yet implemented"); } } current_child = current_child->next; @@ -247,14 +246,9 @@ data1_node *data1_LookupNode(data1_node* node, char* pTagPath) } /** - -data1_CountOccurences - -Count the number of occurences of the last instance on a tagpath. - -@param data1_node* node : The root of the tree we wish to look for occurences in -@param const char* pTagPath : The tagpath we want to count the occurences of... - + \brief Count the number of occurences of the last instance on a tagpath. + \param node : The root of the tree we wish to look for occurences in + \param pTagPath : The tagpath we want to count the occurences of... */ int data1_CountOccurences(data1_node* node, char* pTagPath) { @@ -298,3 +292,12 @@ int data1_CountOccurences(data1_node* node, char* pTagPath) return iRetVal; } +/* + * Local variables: + * c-basic-offset: 4 + * c-file-style: "Stroustrup" + * indent-tabs-mode: nil + * End: + * vim: shiftwidth=4 tabstop=8 expandtab + */ +