+/* ---------------------------------------------------------------------------
+ Get BFS for Zebra system (to make alternative storage methods)
+*/
+struct BFiles_struct *zebra_get_bfs(ZebraHandle zh)
+{
+ if (zh && zh->reg)
+ return zh->reg->bfs;
+ return 0;
+}
+
+
+/* ---------------------------------------------------------------------------
+ Set limit for search/scan
+*/
+ZEBRA_RES zebra_set_limit(ZebraHandle zh, int complement_flag, zint *ids)
+{
+ ZEBRA_CHECK_HANDLE(zh);
+ zebra_limit_destroy(zh->m_limit);
+ zh->m_limit = zebra_limit_create(complement_flag, ids);
+ return ZEBRA_OK;
+}
+
+/*
+ Set Error code + addinfo
+*/
+void zebra_setError(ZebraHandle zh, int code, const char *addinfo)
+{
+ if (!zh)
+ return;
+ zh->errCode = code;
+ nmem_reset(zh->nmem_error);
+ zh->errString = addinfo ? nmem_strdup(zh->nmem_error, addinfo) : 0;
+}
+
+void zebra_setError_zint(ZebraHandle zh, int code, zint i)
+{
+ char vstr[60];
+ sprintf(vstr, ZINT_FORMAT, i);
+
+ zh->errCode = code;
+ nmem_reset(zh->nmem_error);
+ zh->errString = nmem_strdup(zh->nmem_error, vstr);
+}
+
+void zebra_lock_prefix (Res res, char *path)
+{
+ const char *lock_dir = res_get_def (res, "lockDir", "");
+
+ strcpy (path, lock_dir);
+ if (*path && path[strlen(path)-1] != '/')
+ strcat (path, "/");
+}
+