+} /* cmd_show */
+
+static int cmd_sort( char *args[], WRBUF outbuff)
+{
+ int rc=0;
+ ODR odr;
+ int sortstatus=0;
+ Z_SortKeySpecList *spec=0;
+ const char * inpsets[]={ DEFAULTRESULTSET, 0};
+ /* FIXME - allow the user to specify result sets in/out */
+
+ odr=odr_createmem(ODR_ENCODE);
+ spec=yaz_sort_spec (odr, restargs(args,1));
+ if (!spec)
+ rc=1;
+ if (!rc)
+ rc=zebra_sort(zh, odr,
+ 1, inpsets,
+ DEFAULTRESULTSET,
+ spec,
+ &sortstatus);
+ if (!rc)
+ wrbuf_printf(outbuff, "sort returned status %d\n",sortstatus);
+
+ odr_destroy(odr);
+ return rc;
+} /* cmd_sort */
+/*
+ *
+ * int bend_sort (void *handle, bend_sort_rr *rr)
+ * {
+ * 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);
+ * return 0;
+ * }
+ *
+ */
+