* Sebastian Hammer, Adam Dickmeiss
*
* $Log: zebraapi.c,v $
- * Revision 1.21 1999-07-14 10:59:26 adam
+ * Revision 1.25 1999-11-04 15:00:45 adam
+ * Implemented delete result set(s).
+ *
+ * Revision 1.24 1999/10/14 14:33:50 adam
+ * Added truncation 5=106.
+ *
+ * Revision 1.23 1999/09/07 11:36:32 adam
+ * Minor changes.
+ *
+ * Revision 1.22 1999/08/02 10:13:47 adam
+ * Fixed bug regarding zebra_hits.
+ *
+ * Revision 1.21 1999/07/14 10:59:26 adam
* Changed functions isc_getmethod, isams_getmethod.
* Improved fatal error handling (such as missing EXPLAIN schema).
*
zh->errCode = 0;
zh->errString = 0;
- zh->hits = 0;
zebra_chdir (zh);
zebra_chdir (zh);
zebra_server_lock_init (zh);
zh->dh = data1_create ();
+ if (!zh->dh)
+ {
+ zebra_server_lock_destroy (zh);
+ xfree (zh);
+ return 0;
+ }
zh->bfs = bfs_create (res_get (zh->res, "register"));
+ if (!zh->bfs)
+ {
+ zebra_server_lock_destroy (zh);
+ data1_destroy(zh->dh);
+ xfree (zh);
+ return 0;
+ }
bf_lockDir (zh->bfs, res_get (zh->res, "lockDir"));
data1_set_tabpath (zh->dh, res_get(zh->res, "profilePath"));
zh->sets = NULL;
zebra_chdir (zh);
if (zh->records)
{
- resultSetDestroy (zh);
+ resultSetDestroy (zh, -1, 0, 0);
zebraExplain_close (zh->zei, 0, 0);
dict_close (zh->dict);
sortIdx_close (zh->sortIdx);
passwd_db_close (zh->passwd_db);
res_close (zh->res);
xfree (zh);
- xmalloc_trav("x");
}
struct map_baseinfo {
Z_RPNQuery *query, int num_bases, char **basenames,
const char *setname)
{
+ zh->hits = 0;
if (zebra_register_lock (zh))
return;
map_basenames (zh, stream, &num_bases, &basenames);
zebra_register_unlock (zh);
}
+int zebra_deleleResultSet(ZebraHandle zh, int function,
+ int num_setnames, char **setnames,
+ int *statuses)
+{
+ int i, status;
+ if (zebra_register_lock (zh))
+ return Z_DeleteStatus_systemProblemAtTarget;
+ switch (function)
+ {
+ case Z_DeleteRequest_list:
+ resultSetDestroy (zh, num_setnames, setnames, statuses);
+ break;
+ case Z_DeleteRequest_all:
+ resultSetDestroy (zh, -1, 0, statuses);
+ break;
+ }
+ zebra_register_unlock (zh);
+ status = Z_DeleteStatus_success;
+ for (i = 0; i<num_setnames; i++)
+ if (statuses[i] == Z_DeleteStatus_resultSetDidNotExist)
+ status = statuses[i];
+ return status;
+}
+
int zebra_errCode (ZebraHandle zh)
{
return zh->errCode;