+
+/*
+ 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, "/");
+}
+
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+