+Z_SRW_recordVersion *yaz_srw_get_record_versions(ODR odr, int num )
+{
+ Z_SRW_recordVersion *ver
+ = (Z_SRW_recordVersion *) odr_malloc( odr, num * sizeof(*ver) );
+ int i;
+ for ( i=0; i < num; ++i ){
+ ver[i].versionType = 0;
+ ver[i].versionValue = 0;
+ }
+ return ver;
+}
+
+const char *yaz_srw_pack_to_str(int pack)
+{
+ switch(pack)
+ {
+ case Z_SRW_recordPacking_string:
+ return "string";
+ case Z_SRW_recordPacking_XML:
+ return "xml";
+ case Z_SRW_recordPacking_URL:
+ return "url";
+ }
+ return 0;
+}
+
+int yaz_srw_str_to_pack(const char *str)
+{
+ if (!yaz_matchstr(str, "string"))
+ return Z_SRW_recordPacking_string;
+ if (!yaz_matchstr(str, "xml"))
+ return Z_SRW_recordPacking_XML;
+ if (!yaz_matchstr(str, "url"))
+ return Z_SRW_recordPacking_URL;
+ return -1;
+}
+
+void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args)
+{
+ if (extra_args)
+ {
+ char **name;
+ char **val;
+ Z_SRW_extra_arg **ea = &sr->extra_args;
+ yaz_uri_to_array(extra_args, odr, &name, &val);
+
+ while (*name)
+ {
+ *ea = odr_malloc(odr, sizeof(**ea));
+ (*ea)->name = *name;
+ (*ea)->value = *val;
+ ea = &(*ea)->next;
+ val++;
+ name++;
+ }
+ *ea = 0;
+ }
+}
+
+
+