-/* $Id: zserver.c,v 1.144 2005-12-09 11:33:32 adam Exp $
- Copyright (C) 1995-2005
+/* $Id: zserver.c,v 1.148 2006-06-07 10:50:09 adam Exp $
+ Copyright (C) 1995-2006
Index Data ApS
This file is part of the Zebra server.
se->subqueryExpression->u.term->termComment = 0;
se->subqueryInterpretation = 0;
se->subqueryRecommendation = 0;
- if (count > 2000000000)
- count = 2000000000;
- se->subqueryCount = odr_intdup(r->stream, (int) count);
+ if (count > 2147483646)
+ count = 2147483647;
+ se->subqueryCount = odr_intdup(r->stream, CAST_ZINT_TO_INT(count));
se->subqueryWeight = 0;
se->resultsByDB = 0;
}
}
-int bend_search (void *handle, bend_search_rr *r)
+int bend_search(void *handle, bend_search_rr *r)
{
ZebraHandle zh = (ZebraHandle) handle;
zint zhits = 0;
zebra_result(zh, &r->errcode, &r->errstring);
else
{
- if (zhits > 2147483646)
- r->hits = 2147483647;
- else
- r->hits = (int) zhits;
+ if (zhits > 2147483646)
+ zhits = 2147483647;
+ r->hits = CAST_ZINT_TO_INT(zhits);
search_terms (zh, r);
}
break;
for (i = 0; i < r->num_entries; i++)
{
r->entries[i].term = entries[i].term;
- r->entries[i].occurrences = entries[i].occurrences;
+ r->entries[i].occurrences =
+ CAST_ZINT_TO_INT(entries[i].occurrences);
}
}
else
{
ZebraHandle zh = (ZebraHandle) handle;
- zebra_sort (zh, rr->stream,
- rr->num_input_setnames, (const char **) rr->input_setnames,
- rr->output_setname, rr->sort_sequence, &rr->sort_status);
- zebra_result (zh, &rr->errcode, &rr->errstring);
+ if (zebra_sort (zh, rr->stream,
+ rr->num_input_setnames, (const char **) rr->input_setnames,
+ rr->output_setname, rr->sort_sequence, &rr->sort_status)
+ != ZEBRA_OK)
+ zebra_result (zh, &rr->errcode, &rr->errstring);
return 0;
}
case Z_ESAdminOriginPartToKeep_commit:
yaz_log(YLOG_LOG, "adm-commit");
if (r->toKeep->databaseName)
- zebra_select_database(zh, r->toKeep->databaseName);
+ {
+ if (zebra_select_database(zh, r->toKeep->databaseName) !=
+ ZEBRA_OK)
+ yaz_log(YLOG_WARN, "zebra_select_database failed in "
+ "adm-commit");
+ }
zebra_commit(zh);
break;
case Z_ESAdminOriginPartToKeep_shutdown:
}
}
}
- zebra_end_trans (zh);
+ if (zebra_end_trans (zh) != ZEBRA_OK)
+ {
+ yaz_log(YLOG_WARN, "zebra_end_trans failed for"
+ " extended service operation");
+ }
}
}
}
return statserv_main (argc, argv, bend_init, bend_close);
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+