-/* $Id: zebraapi.c,v 1.221 2006-06-12 09:39:18 marc Exp $
+/* $Id: zebraapi.c,v 1.224 2006-08-14 10:40:15 adam Exp $
Copyright (C) 1995-2006
Index Data ApS
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
+
*/
#include <assert.h>
{
Res res;
+ zebra_flock_init();
+
if (!log_level_initialized)
{
log_level = yaz_log_module_level("zebraapi");
{
reg->zei = zebraExplain_open(reg->records, reg->dh,
res, rw, reg,
- explain_extract);
+ zebra_extract_explain);
if (!reg->zei)
{
yaz_log (YLOG_WARN, "Cannot obtain EXPLAIN information");
}
action = 1; /* make it an insert (if it's an update).. */
}
- res = buffer_extract_record (zh, rec_buf, rec_len,
- action == 3 ? 1 : 0 /* delete flag */,
- 0, /* test mode */
- 0, /* recordType */
- &sysno,
- 0, /* match */
- 0, /* fname */
- 0, /* force update */
- 1 /* allow update */
+ res = zebra_buffer_extract_record(zh, rec_buf, rec_len,
+ action == 3 ? 1 : 0 /* delete flag */,
+ 0, /* test mode */
+ 0, /* recordType */
+ &sysno,
+ 0, /* match */
+ 0, /* fname */
+ 0, /* force update */
+ 1 /* allow update */
);
if (res == ZEBRA_FAIL)
{
zebra_lock_w(zh->lock_shadow);
bf_commitClean (bfs, rval);
- zebra_unlock (zh->lock_normal);
+ zebra_unlock (zh->lock_shadow);
}
else
{
if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
return ZEBRA_FAIL;
- res = buffer_extract_record (zh, buf, buf_size,
- 0, /* delete_flag */
- 0, /* test_mode */
- recordType,
- sysno,
- match, fname,
- 0,
- 0); /* allow_update */
+ res = zebra_buffer_extract_record(zh, buf, buf_size,
+ 0, /* delete_flag */
+ 0, /* test_mode */
+ recordType,
+ sysno,
+ match, fname,
+ 0,
+ 0); /* allow_update */
if (zebra_end_trans(zh) != ZEBRA_OK)
{
yaz_log(YLOG_WARN, "zebra_end_trans failed");
if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
return ZEBRA_FAIL;
- res = buffer_extract_record (zh, buf, buf_size,
- 0, /* delete_flag */
- 0, /* test_mode */
- recordType,
- sysno,
- match, fname,
- force_update,
- 1); /* allow_update */
+ res = zebra_buffer_extract_record(zh, buf, buf_size,
+ 0, /* delete_flag */
+ 0, /* test_mode */
+ recordType,
+ sysno,
+ match, fname,
+ force_update,
+ 1); /* allow_update */
if (zebra_end_trans(zh) != ZEBRA_OK)
{
yaz_log(YLOG_WARN, "zebra_end_trans failed");
if (zebra_begin_trans(zh, 1) == ZEBRA_FAIL)
return ZEBRA_FAIL;
- res = buffer_extract_record (zh, buf, buf_size,
- 1, /* delete_flag */
- 0, /* test_mode */
- recordType,
- sysno,
- match,fname,
- force_update,
- 1); /* allow_update */
+ res = zebra_buffer_extract_record(zh, buf, buf_size,
+ 1, /* delete_flag */
+ 0, /* test_mode */
+ recordType,
+ sysno,
+ match,fname,
+ force_update,
+ 1); /* allow_update */
if (zebra_end_trans(zh) != ZEBRA_OK)
{
yaz_log(YLOG_WARN, "zebra_end_trans failed");