+
+void yaz_add_sru_update_diagnostic(ODR o, Z_SRW_diagnostic **d,
+ int *num, int code, const char *addinfo)
+{
+ char uri[40];
+
+ sprintf(uri, "info:srw/diagnostic/12/%d", code);
+ yaz_add_srw_diagnostic_uri(o, d, num, uri, 0, addinfo);
+}
+
+
+static void grab_charset(ODR o, const char *content_type, char **charset)
+{
+ if (charset)
+ {
+ const char *charset_p = 0;
+ if (content_type && (charset_p = strstr(content_type, "; charset=")))
+ {
+ int i = 0;
+ charset_p += 10;
+ while (i < 20 && charset_p[i] &&
+ !strchr("; \n\r", charset_p[i]))
+ i++;
+ *charset = (char*) odr_malloc(o, i+1);
+ memcpy(*charset, charset_p, i);
+ (*charset)[i] = '\0';
+ }
+ }
+}
+