From 75c9defe1c9ffb8efe58507dc994a56e6fd0409b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Wed, 15 Oct 2008 22:20:08 +0200 Subject: [PATCH] Omit some functions not used when XML2 is not enabled (YAZ_HAVE_XML2). --- client/client.c | 2 ++ src/srwutil.c | 6 ++++++ src/statserv.c | 10 ++++++---- src/zoom-c.c | 6 ++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/client.c b/client/client.c index 106f12d..5cce8cc 100644 --- a/client/client.c +++ b/client/client.c @@ -2136,8 +2136,10 @@ static int cmd_update0(const char *arg) static int cmd_update_Z3950(int version, int action_no, const char *recid, char *rec_buf, int rec_len); +#if YAZ_HAVE_XML2 static int cmd_update_SRW(int action_no, const char *recid, char *rec_buf, int rec_len); +#endif static int cmd_update_common(const char *arg, int version) { diff --git a/src/srwutil.c b/src/srwutil.c index 5cc58e6..58d0d3b 100644 --- a/src/srwutil.c +++ b/src/srwutil.c @@ -175,6 +175,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 +221,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 +241,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 +276,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 +460,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 +484,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 diff --git a/src/statserv.c b/src/statserv.c index c58646f..00ba31c 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -208,6 +208,7 @@ static char *nmem_dup_xml_content(NMEM n, xmlNodePtr ptr) } #endif +#if YAZ_HAVE_XML2 static struct gfs_server * gfs_server_new(void) { struct gfs_server *n = (struct gfs_server *) @@ -222,12 +223,12 @@ static struct gfs_server * gfs_server_new(void) n->directory = 0; n->docpath = 0; n->stylesheet = 0; -#if YAZ_HAVE_XML2 n->retrieval = yaz_retrieval_create(); -#endif return n; } +#endif +#if YAZ_HAVE_XML2 static struct gfs_listen * gfs_listen_new(const char *id, const char *address) { @@ -241,6 +242,7 @@ static struct gfs_listen * gfs_listen_new(const char *id, n->address = nmem_strdup(gfs_nmem, address); return n; } +#endif static void gfs_server_chdir(struct gfs_server *gfs) { @@ -326,11 +328,11 @@ int control_association(association *assoc, const char *host, int force_open) return 1; } +#if YAZ_HAVE_XML2 static void xml_config_read(void) { struct gfs_server **gfsp = &gfs_server_list; struct gfs_listen **gfslp = &gfs_listen_list; -#if YAZ_HAVE_XML2 xmlNodePtr ptr = xml_config_get_root(); if (!ptr) @@ -475,9 +477,9 @@ static void xml_config_read(void) gfsp = &(*gfsp)->next; } } -#endif *gfsp = 0; } +#endif static void xml_config_open(void) { diff --git a/src/zoom-c.c b/src/zoom-c.c index 89456b2..5acecb1 100644 --- a/src/zoom-c.c +++ b/src/zoom-c.c @@ -1454,13 +1454,15 @@ static zoom_ret send_srw(ZOOM_connection c, Z_SRW_PDU *sr) } #endif - -static Z_SRW_PDU *ZOOM_srw_get_pdu(ZOOM_connection c, int type) { +#if YAZ_HAVE_XML2 +static Z_SRW_PDU *ZOOM_srw_get_pdu(ZOOM_connection c, int type) +{ Z_SRW_PDU *sr = yaz_srw_get_pdu(c->odr_out, type, c->sru_version); sr->username = c->user; sr->password = c->password; return sr; } +#endif #if YAZ_HAVE_XML2 static zoom_ret ZOOM_connection_srw_send_search(ZOOM_connection c) -- 1.7.10.4