X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=client%2Fclient.c;h=1da6fe96f39a4d58c607ac04ca87285dc4d6c1c3;hb=f78b96e6645bb3309719a234ff68699d8fccb975;hp=84120e67f8b731647359a5cd3df51051ef47c01b;hpb=9a7d52d3a1482c26ba7fb6c8aa2b74d4442c5cc3;p=yaz-moved-to-github.git diff --git a/client/client.c b/client/client.c index 84120e6..1da6fe9 100644 --- a/client/client.c +++ b/client/client.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2002, Index Data * See the file LICENSE for details. * - * $Id: client.c,v 1.155 2002-06-02 21:29:30 adam Exp $ + * $Id: client.c,v 1.157 2002-06-04 11:36:10 adam Exp $ */ #include @@ -25,13 +25,9 @@ #include #include -#if YAZ_MODULE_ill #include -#endif -#if YAZ_MODULE_ccl #include -#endif #if HAVE_READLINE_READLINE_H #include @@ -88,9 +84,7 @@ typedef enum { static QueryType queryType = QueryType_Prefix; -#if YAZ_MODULE_ccl static CCL_bibset bibset; /* CCL bibset handle */ -#endif #if HAVE_READLINE_COMPLETION_OVER @@ -370,16 +364,24 @@ int cmd_open(char *arg) session_mem = NULL; } } - t = tcpip_type; - base[0] = '\0'; - if (sscanf (arg, "%100[^/]/%100s", type_and_host, base) < 1) - return 0; - - if(yazProxy) - conn = cs_create_host(yazProxy, 1, &add); - else - conn = cs_create_host(type_and_host, 1, &add); - + if (strncmp (arg, "unix:", 5) == 0) + { + base[0] = '\0'; + conn = cs_create_host(arg, 1, &add); + } + else + { + t = tcpip_type; + base[0] = '\0'; + if (sscanf (arg, "%100[^/]/%100s", type_and_host, base) < 1) + return 0; + + if(yazProxy) + conn = cs_create_host(yazProxy, 1, &add); + else + conn = cs_create_host(type_and_host, 1, &add); + + } if (!conn) { printf ("Couldn't create comstack\n"); @@ -790,15 +792,12 @@ static int send_searchRequest(char *arg) Z_SearchRequest *req = apdu->u.searchRequest; Z_Query query; int oid[OID_SIZE]; -#if YAZ_MODULE_ccl struct ccl_rpn_node *rpn = NULL; int error, pos; -#endif char setstring[100]; Z_RPNQuery *RPNquery; Odr_oct ccl_query; -#if YAZ_MODULE_ccl if (queryType == QueryType_CCL2RPN) { rpn = ccl_find_str(bibset, arg, &error, &pos); @@ -808,7 +807,6 @@ static int send_searchRequest(char *arg) return 0; } } -#endif req->referenceId = set_refid (out); if (!strcmp(arg, "@big")) /* strictly for troublemaking */ { @@ -866,7 +864,6 @@ static int send_searchRequest(char *arg) ccl_query.buf = (unsigned char*) arg; ccl_query.len = strlen(arg); break; -#if YAZ_MODULE_ccl case QueryType_CCL2RPN: query.which = Z_Query_type_1; RPNquery = ccl_rpn_query(out, rpn); @@ -878,7 +875,6 @@ static int send_searchRequest(char *arg) query.u.type_1 = RPNquery; ccl_rpn_delete (rpn); break; -#endif default: printf ("Unsupported query type\n"); return 0; @@ -1191,8 +1187,6 @@ void process_ESResponse(Z_ExtendedServicesResponse *res) } } -#if YAZ_MODULE_ill - const char *get_ill_element (void *clientData, const char *element) { return 0; @@ -1254,9 +1248,7 @@ static Z_External *create_external_itemRequest() } return r; } -#endif -#ifdef YAZ_MODULE_ill static Z_External *create_external_ILL_APDU(int which) { struct ill_get_ctl ctl; @@ -1312,7 +1304,6 @@ static Z_External *create_external_ILL_APDU(int which) } return r; } -#endif static Z_External *create_ItemOrderExternal(const char *type, int itemno)