X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fyaz-z-cache.cpp;h=3ab0ba6c5dd9bd48d56cf774bacda7c8f753ecd6;hb=db245a81abf7ad888e4b3829d703b69a4c30e414;hp=ef7f3bbbd22696c7bbda8ff375aadeb97bcfd28c;hpb=1e20b137d14621dedf159d26c5d06b4318965d66;p=yazpp-moved-to-github.git diff --git a/src/yaz-z-cache.cpp b/src/yaz-z-cache.cpp index ef7f3bb..3ab0ba6 100644 --- a/src/yaz-z-cache.cpp +++ b/src/yaz-z-cache.cpp @@ -1,8 +1,11 @@ /* This file is part of the yazpp toolkit. - * Copyright (C) 1998-2010 Index Data and Mike Taylor + * Copyright (C) 1998-2012 Index Data and Mike Taylor * See the file LICENSE for details. */ +#if HAVE_CONFIG_H +#include +#endif #include #include #include @@ -69,7 +72,7 @@ void RecordCache::copy_presentRequest(Z_PresentRequest *pr) { ODR encode = odr_createmem(ODR_ENCODE); ODR decode = odr_createmem(ODR_DECODE); - + m_searchRequest = 0; m_presentRequest = 0; int v = z_PresentRequest (encode, &pr, 1, 0); @@ -130,7 +133,7 @@ int RecordCache::match (RecordCache_Entry *entry, int match = 0; ODR o1 = odr_createmem(ODR_ENCODE); ODR o2 = odr_createmem(ODR_ENCODE); - + z_RecordComposition(o1, &comp, 1, 0); z_RecordComposition(o2, &entry->m_comp, 1, 0); @@ -138,12 +141,12 @@ int RecordCache::match (RecordCache_Entry *entry, char *buf1 = odr_getbuf(o1, &len1, 0); int len2 = -1; char *buf2 = odr_getbuf(o2, &len2, 0); - + if (buf1 && buf2 && len1 && len1 == len2 && !memcmp(buf1, buf2, len1)) match = 1; else if (!buf1 && !buf2 && !len1 && !len2) match = 1; - + odr_destroy(o1); odr_destroy(o2); if (!match)