and yaz_uri_val_int. Never used outside YAZ.
YAZ_EXPORT const char *yaz_srw_pack_to_str(int pack);
YAZ_EXPORT int yaz_srw_str_to_pack(const char *str);
-/** \brief deprecated */
-YAZ_EXPORT char *yaz_uri_val(const char *path, const char *name, ODR o);
-
-/** \brief deprecated */
-YAZ_EXPORT void yaz_uri_val_int(const char *path, const char *name,
- ODR o, Odr_int **intp);
-
YAZ_EXPORT int yaz_uri_to_array(const char *path, ODR o,
char ***name, char ***val);
YAZ_EXPORT void yaz_array_to_uri(char **path, ODR o,
}
}
-void yaz_uri_val_int(const char *path, const char *name, ODR o, Odr_int **intp)
-{
- const char *v = yaz_uri_val(path, name, o);
- if (v)
- *intp = odr_intdup(o, atoi(v));
-}
-
void yaz_mk_srw_diagnostic(ODR o, Z_SRW_diagnostic *d,
const char *uri, const char *message,
const char *details)
return no;
}
-char *yaz_uri_val(const char *path, const char *name, ODR o)
-{
- size_t nlen = strlen(name);
- if (*path != '?')
- return 0;
- path++;
- while (path && *path)
- {
- const char *p1 = strchr(path, '=');
- if (!p1)
- break;
- if ((size_t)(p1 - path) == nlen && !memcmp(path, name, nlen))
- {
- size_t i = 0;
- char *ret;
-
- path = p1 + 1;
- p1 = strchr(path, '&');
- if (!p1)
- p1 = strlen(path) + path;
- ret = (char *) odr_malloc(o, p1 - path + 1);
- while (*path && *path != '&')
- {
- size_t l = 3;
- ret[i++] = decode_uri_char(path, &l);
- path += l;
- }
- ret[i] = '\0';
- return ret;
- }
- path = strchr(p1, '&');
- if (path)
- path++;
- }
- return 0;
-}
/*
* Local variables: