-/* $Id: zebraapi.c,v 1.66 2002-08-05 19:46:01 adam Exp $
+/* $Id: zebraapi.c,v 1.69 2002-08-29 08:47:08 adam Exp $
Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002
Index Data Aps
default_encoding = res_get_def(zs->global_res, "encoding", "ISO-8859-1");
zh->record_encoding = xstrdup (default_encoding);
-#if HAVE_ICONV_H
+
zh->iconv_to_utf8 =
- iconv_open ("UTF-8", default_encoding);
- if (zh->iconv_to_utf8 == (iconv_t)(-1))
+ yaz_iconv_open ("UTF-8", default_encoding);
+ if (zh->iconv_to_utf8 == 0)
yaz_log (LOG_WARN, "iconv: %s to UTF-8 unsupported",
default_encoding);
zh->iconv_from_utf8 =
- iconv_open (default_encoding, "UTF-8");
- if (zh->iconv_to_utf8 == (iconv_t)(-1))
+ yaz_iconv_open (default_encoding, "UTF-8");
+ if (zh->iconv_to_utf8 == 0)
yaz_log (LOG_WARN, "iconv: UTF-8 to %s unsupported",
default_encoding);
-#endif
zebra_mutex_cond_lock (&zs->session_lock);
yaz_log (LOG_LOG, "zebra_start %s", configName);
- if (!(res = res_open (configName, 0)))
- yaz_log (LOG_WARN, "Cannot read resources `%s'", configName);
- else
+ if ((res = res_open (configName, 0)))
{
ZebraService zh = xmalloc (sizeof(*zh));
zebra_close_res (zh);
xfree (zh->record_encoding);
-#if HAVE_ICONV_H
- if (zh->iconv_to_utf8 != (iconv_t) (-1))
- iconv_close (zh->iconv_to_utf8);
- if (zh->iconv_from_utf8 != (iconv_t) (-1))
- iconv_close (zh->iconv_from_utf8);
-#endif
+
+ if (zh->iconv_to_utf8 != 0)
+ yaz_iconv_close (zh->iconv_to_utf8);
+ if (zh->iconv_from_utf8 != 0)
+ yaz_iconv_close (zh->iconv_from_utf8);
xfree (zh->admin_databaseName);
zebra_mutex_cond_lock (&zs->session_lock);
zh->errCode = 109;
return -1;
}
+ if (!zh->lock_normal || !zh->lock_shadow)
+ {
+ zh->errCode = 2;
+ return -1;
+ }
return 0;
}
zh->errCode = 109;
return -1;
}
+ if (!zh->lock_normal || !zh->lock_shadow)
+ {
+ (zh->trans_no)--;
+ zh->errCode = 2;
+ return -1;
+ }
zebra_get_state (zh, &val, &seqno);
if (val == 'd')
val = 'o';