X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fsrwutil.c;h=7b62217d9b2d7e89cdda0a88ef255312166f2eca;hb=9748d1f21b8a1c8c6f14ef9384c0e4fdb2d41585;hp=5cc58e65aa9c031f8ea17b13ea3afef78e41c2e4;hpb=1aef63af06fa380247c91d12cd7288981985a406;p=yaz-moved-to-github.git diff --git a/src/srwutil.c b/src/srwutil.c index 5cc58e6..7b62217 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2008 Index Data + * Copyright (C) 1995-2009 Index Data * See the file LICENSE for details. */ /** @@ -9,6 +9,7 @@ #include #include +#include #include static int hex_digit (int ch) @@ -175,6 +176,7 @@ char *yaz_uri_val(const char *path, const char *name, ODR o) return 0; } +#if YAZ_HAVE_XML2 static int yaz_base64decode(const char *in, char *out) { const char *map = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -220,6 +222,7 @@ static int yaz_base64decode(const char *in, char *out) *out = '\0'; return olen; } +#endif int yaz_srw_check_content_type(Z_HTTP_Response *hres) { @@ -239,6 +242,7 @@ int yaz_srw_check_content_type(Z_HTTP_Response *hres) * Look for authentication tokens in HTTP Basic parameters or in x-username/x-password * parameters. Added by SH. */ +#if YAZ_HAVE_XML2 static void yaz_srw_decodeauth(Z_SRW_PDU *sr, Z_HTTP_Request *hreq, char *username, char *password, ODR decode) { @@ -273,6 +277,7 @@ static void yaz_srw_decodeauth(Z_SRW_PDU *sr, Z_HTTP_Request *hreq, sr->password = odr_strdup(decode, pbuf); } } +#endif void yaz_uri_val_int(const char *path, const char *name, ODR o, int **intp) { @@ -456,6 +461,7 @@ int yaz_srw_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, return 2; } +#if YAZ_HAVE_XML2 static int yaz_sru_decode_integer(ODR odr, const char *pname, const char *valstr, int **valp, Z_SRW_diagnostic **diag, int *num_diag, @@ -479,6 +485,7 @@ static int yaz_sru_decode_integer(ODR odr, const char *pname, *valp = odr_intdup(odr, ival); return 1; } +#endif /** http://www.loc.gov/z3950/agency/zing/srw/service.html @@ -600,7 +607,7 @@ int yaz_sru_decode(Z_HTTP_Request *hreq, Z_SRW_PDU **srw_pdu, Z_SRW_extra_arg **l = &extra_args; while (*l) l = &(*l)->next; - *l = odr_malloc(decode, sizeof(**l)); + *l = (Z_SRW_extra_arg *) odr_malloc(decode, sizeof(**l)); (*l)->name = odr_strdup(decode, n); (*l)->value = odr_strdup(decode, v); (*l)->next = 0; @@ -1448,7 +1455,7 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args) while (*name) { - *ea = odr_malloc(odr, sizeof(**ea)); + *ea = (Z_SRW_extra_arg *) odr_malloc(odr, sizeof(**ea)); (*ea)->name = *name; (*ea)->value = *val; ea = &(*ea)->next; @@ -1464,6 +1471,7 @@ void yaz_encode_sru_extra(Z_SRW_PDU *sr, ODR odr, const char *extra_args) /* * Local variables: * c-basic-offset: 4 + * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab