yaz-5.34.4/0000775000175000017500000000000014754707607006176 5yaz-5.34.4/util/0000775000175000017500000000000014754707604007150 5yaz-5.34.4/util/yaz-record-conv.c0000664000175000017500000000664514753417062012264 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #if YAZ_HAVE_XML2 #include #endif const char *prog = "yaz-record-conv"; static void usage(void) { fprintf(stderr, "%s: usage\nyaz-record-conv config file ..\n", prog); exit(1); } int main (int argc, char **argv) { int r; char *arg; yaz_record_conv_t p = 0; int no_errors = 0; yaz_enable_panic_backtrace(*argv); while ((r = options("v:V", argv, argc, &arg)) != -2) { switch (r) { case 'v': yaz_log_init(yaz_log_mask_str(arg), "", 0); break; case 'V': break; case 0: #if YAZ_HAVE_XML2 if (!p) { xmlDocPtr doc = xmlParseFile(arg); int r = -1; p = yaz_record_conv_create(); if (doc) { xmlNodePtr ptr = xmlDocGetRootElement(doc); if (ptr) { r = yaz_record_conv_configure(p, ptr); if (r) { fprintf(stderr, "record conf error: %s\n", yaz_record_conv_get_error(p)); } } } xmlFreeDoc(doc); if (r) { yaz_record_conv_destroy(p); exit(2); } } else { WRBUF input_record = wrbuf_alloc(); WRBUF output_record = wrbuf_alloc(); FILE *f = fopen(arg, "rb"); int c, r; if (!f) { fprintf(stderr, "%s: open failed: %s\n", prog, arg); exit(3); } while ((c = getc(f)) != EOF) wrbuf_putc(input_record, c); r = yaz_record_conv_record(p, wrbuf_buf(input_record), wrbuf_len(input_record), output_record); if (r) { fprintf(stderr, "%s: %s: Error %s\n", prog, arg, yaz_record_conv_get_error(p)); no_errors++; } else { fwrite(wrbuf_buf(output_record), 1, wrbuf_len(output_record), stdout); } wrbuf_destroy(input_record); wrbuf_destroy(output_record); fclose(f); } break; #else fprintf(stderr, "%s: YAZ not compiled with Libxml2 support\n", prog); usage(); break; #endif default: usage(); } } #if YAZ_HAVE_XML2 yaz_record_conv_destroy(p); #endif if (no_errors) exit(1); exit(0); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/yaz-illclient.c0000664000175000017500000005416414631643521012015 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ /* WARNING - This is work in progress - not at all ready */ /** \file yaz-illclient.c * \brief client for ILL requests (ISO 10161-1) * * This is a test client for handling ISO 10161-1 ILL requests. * Those are not directly Z39.50, but the protocol is quite similar * and yaz already provides the APDUs for it. * * This is not an interactive client like yaz-client, but driven by command- * line arguments. Its output is a return code, and possibly some text on * stdout. * * Exit codes (note, the program exits as soon as it finds a good reason) * 0 ok * 1 errors in arguments * 2 Internal errors in creating objects (comstack, odr...) * mostly programming errors. * 3 could not connect * 4 could not send request * 5 No reponse received * 6 Error decoding response packet * 7 Server returned an error (see log or stdout) * * * * */ #if HAVE_CONFIG_H #include #endif #include #include #if HAVE_UNISTD_H #include #endif #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TIME_H #include #endif #include #include #include #include #include #include #include #include #include /* A structure for holding name-value pairs in a linked list */ struct nameval { char *name; char *val; struct nameval *next; }; /* A structure for storing all the arguments */ struct prog_args { char *host; char *auth_userid; char *auth_passwd; char *oclc_recno; /* record number in oclc-mode */ int oclc_auth; /* 1=use oclc-type auth */ struct nameval* namevals; /* circular list, points to last */ } ; /* Call-back to be called for every field in the ill-request */ /* It can set values to any field, perhaps from the prog_args */ const char *get_ill_element(void *clientData, const char *element) { struct prog_args *args = (struct prog_args *) clientData; struct nameval *nv=args->namevals; char *ret=0; if (!nv) return ""; do { nv=nv->next; /* printf("comparing '%s' with '%s' \n",element, nv->name ); */ if ( strcmp(element, nv->name) == 0 ) ret = nv->val; } while ( ( !ret) && ( nv != args->namevals) ); yaz_log(YLOG_DEBUG,"get_ill_element:'%s'->'%s'", element, ret ); return ret; } /* * * * * * * * * * * * * * * * * */ /** \brief parse a parameter string */ /* string is like 'name=value' */ struct nameval *parse_nameval( char *arg ) { struct nameval *nv = (struct nameval *) xmalloc(sizeof(*nv)); char *p=arg; int len; if (!p || !*p) return 0; /* yeah, leaks a bit of memory. so what */ while ( *p && ( *p != '=' ) ) p++; len = p - arg; if (!len) return 0; nv->name = (char *) xmalloc(len+1); strncpy(nv->name, arg, len); nv->name[len]='\0'; if (*p == '=' ) p++; /* skip the '=' */ else return 0; /* oops, no '=' */ if (!*p) return 0; /* no value */ nv->val=xstrdup(p); nv->next=0; yaz_log(YLOG_DEBUG,"parse_nameval: n='%s' v='%s'", nv->name, nv->val ); return nv; } /** \brief append nv to the list of namevals */ void append_nameval (struct prog_args *args, struct nameval *nv) { if (!nv) return; if (args->namevals) { nv->next=args->namevals->next; /* first */ args->namevals->next=nv; args->namevals=nv; } else { nv->next=nv; args->namevals=nv; } } /* append_nameval */ /** \brief parse a parameter file */ void parse_paramfile(char *arg, struct prog_args *args) { FILE *f=fopen(arg,"r"); #define BUFSIZE 4096 char buf[BUFSIZE]; int len; struct nameval *nv; if (!f) { yaz_log(YLOG_FATAL,"Could not open param file '%s' ", arg); printf("Could not open file '%s' \n",arg); exit(1); } yaz_log(YLOG_DEBUG,"Opened input file '%s' ",arg ); while (fgets(buf,BUFSIZE,f)) { if (buf[0] != '#' ) { len=strlen(buf)-1; if (buf[len] == '\n') buf[len] = '\0' ; nv=parse_nameval(buf); append_nameval(args, nv); } /* not a comment */ } (void) fclose(f); if (0) { nv=args->namevals; printf("nv chain: ================ \n"); printf("(last:) %p: '%s' = '%s' (%p) \n",nv, nv->name, nv->val, nv->next ); do { nv=nv->next; printf("%p: '%s' = '%s' (%p)\n",nv, nv->name, nv->val, nv->next ); } while (nv != args->namevals ); exit(1); } } /* parse_paramfile */ /** \brief Parse program arguments */ void parseargs( int argc, char * argv[], struct prog_args *args) { int ret; char *arg; char *prog=*argv; char version[60]; struct nameval *nv; /* default values */ args->host = 0; /* not known (yet) */ args->namevals=0; /* none set up */ args->oclc_auth=0; args->oclc_recno=0; args->auth_userid = 0; args->auth_passwd = 0; #if 0 /* Example 3 - directly from OCLC, supposed to work on their test server*/ args->auth_userid = "100-310-658" ; /* FIXME - get from cmd line */ args->auth_passwd = "apii2test" ; /* FIXME - get from cmd line */ #endif while ((ret = options("Vov:p:u:D:f:r:l:", argv, argc, &arg)) != -2) { yaz_log(YLOG_DEBUG,"parsing option '%c' '%s'",ret, arg); switch (ret) { case 0: if (!args->host) { args->host = xstrdup (arg); } else { fprintf(stderr, "%s: Specify at most one server address\n", prog); exit(1); } break; case 'v': yaz_log_init(yaz_log_mask_str(arg), "", 0); break; case 'l': yaz_log_init_file(arg); break; case 'V': yaz_version(version, 0); printf("%s %s\n",prog, version); break; case 'D': nv=parse_nameval(arg); append_nameval(args,nv); break; case 'f': parse_paramfile(arg,args); break; case 'o': args->oclc_auth=1; break; case 'u': args->auth_userid=xstrdup(arg); break; case 'p': args->auth_passwd=xstrdup(arg); break; case 'r': args->oclc_recno=xstrdup(arg); break; default: fprintf (stderr, "Usage: %s " " [-f filename]" " [-v loglevel...]" " [-D name=value ]" " [-o -u user -p passwd]" " [-V]" " \n", prog); exit (1); } } } /* parseargs */ /* * * * * * * * * * * */ /** \brief Validate the arguments make sense */ void validateargs( struct prog_args *args) { if (!args->host) { fprintf(stderr, "Specify a connection address, " "as in 'z3950.indexdata.com:210' \n"); exit(1); } if (args->oclc_auth && ((!args->auth_userid) || (!args->auth_passwd))){ fprintf(stderr, "-o option requires -u and -p \n"); exit(1); } } /* validateargs */ /* * * * * * * * * * * * * * * */ /** \brief Connect to the target */ COMSTACK connect_to( char *hostaddr ){ COMSTACK stack; void *server_address_ip; int status; yaz_log(YLOG_DEBUG,"Connecting to '%s'", hostaddr); stack = cs_create_host(hostaddr, 1, &server_address_ip ); if (!stack) { yaz_log(YLOG_FATAL,"Error in creating the comstack '%s' ", hostaddr ); exit(2); } yaz_log(YLOG_DEBUG,"Created stack ok "); status = cs_connect(stack, server_address_ip); if (status != 0) { yaz_log(YLOG_FATAL|YLOG_ERRNO,"Can not connect '%s' ", hostaddr ); exit(3); } yaz_log(YLOG_DEBUG,"Connected OK to '%s'", hostaddr); return stack; } /* * * * * * * * * * * * * * * */ /* Makes a Z39.50-like prompt package with username and password */ Z_PromptObject1 *makeprompt(struct prog_args *args, ODR odr) { Z_PromptObject1 *p = (Z_PromptObject1 *) odr_malloc(odr, sizeof(*p) ); Z_ResponseUnit1 *ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) ); p->which=Z_PromptObject1_response; p->u.response = (Z_Response1*) odr_malloc(odr, sizeof(*(p->u.response)) ); p->u.response->num=2; p->u.response->elements= (Z_ResponseUnit1 **) odr_malloc(odr, p->u.response->num*sizeof(*(p->u.response->elements)) ); /* user id, aka "oclc authorization number" */ p->u.response->elements[0] = ru; ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) )); ru->promptId->which = Z_PromptId_enumeratedPrompt; ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *) odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) )); ru->promptId->u.enumeratedPrompt->type = odr_intdup(odr,Z_PromptIdEnumeratedPrompt_userId); ru->promptId->u.enumeratedPrompt->suggestedString = 0 ; ru->which = Z_ResponseUnit1_string ; ru->u.string = odr_strdup(odr, args->auth_userid); /* password */ ru = (Z_ResponseUnit1 *) odr_malloc(odr, sizeof(*ru) ); p->u.response->elements[1] = ru; ru->promptId = (Z_PromptId *) odr_malloc(odr, sizeof(*(ru->promptId) )); ru->promptId->which = Z_PromptId_enumeratedPrompt; ru->promptId->u.enumeratedPrompt = (Z_PromptIdEnumeratedPrompt *) odr_malloc(odr, sizeof(*(ru->promptId->u.enumeratedPrompt) )); ru->promptId->u.enumeratedPrompt->type = odr_intdup(odr,Z_PromptIdEnumeratedPrompt_password); ru->promptId->u.enumeratedPrompt->suggestedString = 0 ; ru->which = Z_ResponseUnit1_string ; ru->u.string = odr_strdup(odr, args->auth_passwd); return p; } /* makeprompt */ ILL_Extension *makepromptextension(struct prog_args *args, ODR odr) { ODR odr_ext = odr_createmem(ODR_ENCODE); ODR odr_prt = odr_createmem(ODR_PRINT); ILL_Extension *e = (ILL_Extension *) odr_malloc(odr, sizeof(*e)); Z_PromptObject1 *p = makeprompt(args,odr_ext); char * buf; int siz; Z_External *ext = (Z_External *) odr_malloc(odr, sizeof(*ext)); ext->direct_reference = odr_getoidbystr(odr,"1.2.840.10003.8.1"); ext->indirect_reference=0; ext->descriptor=0; ext->which=Z_External_single; if ( ! z_PromptObject1(odr_ext, &p, 0,0 ) ) { yaz_log(YLOG_FATAL,"Encoding of z_PromptObject1 failed "); exit (6); } printf ("Prompt: \n"); /*!*/ z_PromptObject1(odr_prt, &p, 0,0 ); /*!*/ buf= odr_getbuf(odr_ext,&siz,0); ext->u.single_ASN1_type=(Odr_any *) odr_malloc(odr,sizeof(*ext->u.single_ASN1_type)); ext->u.single_ASN1_type->buf= (char *) odr_malloc(odr, siz); memcpy(ext->u.single_ASN1_type->buf,buf, siz ); ext->u.single_ASN1_type->len = siz; odr_reset(odr_ext); odr_reset(odr_prt); /*!*/ e->identifier = odr_intdup(odr,1); e->critical = odr_booldup(odr,0); e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item)); if ( ! z_External(odr_ext, &ext,0,0) ) { yaz_log(YLOG_FATAL,"Encoding of z_External failed "); exit (6); } printf("External: \n"); z_External(odr_prt, &ext,0,0); /*!*/ buf= odr_getbuf(odr_ext,&siz,0); e->item->buf= (char *) odr_malloc(odr, siz); memcpy(e->item->buf,buf, siz ); e->item->len = siz; odr_destroy(odr_prt); odr_destroy(odr_ext); return e; } /* makepromptextension */ ILL_Extension *makeoclcextension(struct prog_args *args, ODR odr) { /* The oclc extension is required, but only contains optional */ /* fields. Here we just null them all out */ ODR odr_ext = odr_createmem(ODR_ENCODE); ODR odr_prt = odr_createmem(ODR_PRINT); ILL_Extension *e = (ILL_Extension *) odr_malloc(odr, sizeof(*e)); ILL_OCLCILLRequestExtension *oc = (ILL_OCLCILLRequestExtension *) odr_malloc(odr_ext, sizeof(*oc)); char * buf; int siz; Z_External *ext = (Z_External *) odr_malloc(odr, sizeof(*ext)); oc->clientDepartment = 0; oc->paymentMethod = 0; oc->uniformTitle = 0; oc->dissertation = 0; oc->issueNumber = 0; oc->volume = 0; oc->affiliations = 0; oc->source = 0; ext->direct_reference = odr_getoidbystr(odr,"1.0.10161.13.2"); ext->indirect_reference=0; ext->descriptor=0; ext->which=Z_External_single; if ( ! ill_OCLCILLRequestExtension(odr_ext, &oc, 0,0 ) ) { yaz_log(YLOG_FATAL,"Encoding of ill_OCLCILLRequestExtension failed "); exit (6); } printf ("OCLC: \n"); /*!*/ ill_OCLCILLRequestExtension(odr_prt, &oc, 0,0 ); /*!*/ buf= odr_getbuf(odr_ext,&siz,0); ext->u.single_ASN1_type = (Odr_any*) odr_malloc(odr,sizeof(*ext->u.single_ASN1_type)); ext->u.single_ASN1_type->buf = (char *) odr_malloc(odr, siz); memcpy(ext->u.single_ASN1_type->buf,buf, siz ); ext->u.single_ASN1_type->len = siz; odr_reset(odr_ext); odr_reset(odr_prt); /*!*/ e->identifier = odr_intdup(odr,1); e->critical = odr_booldup(odr,0); e->item = (Odr_any *) odr_malloc(odr,sizeof(*e->item)); if ( ! z_External(odr_ext, &ext,0,0) ) { yaz_log(YLOG_FATAL,"Encoding of z_External failed "); exit (6); } printf("External: \n"); z_External(odr_prt, &ext,0,0); /*!*/ buf= odr_getbuf(odr_ext,&siz,0); e->item->buf= (char *) odr_malloc(odr, siz); memcpy(e->item->buf, buf, siz); e->item->len = siz; odr_destroy(odr_prt); odr_destroy(odr_ext); return e; } /* makeoclcextension */ ILL_APDU *createrequest( struct prog_args *args, ODR odr) { struct ill_get_ctl ctl; ILL_APDU *apdu; ILL_Request *req; ctl.odr = odr; ctl.clientData = args; ctl.f = get_ill_element; apdu = (ILL_APDU *) odr_malloc( odr, sizeof(*apdu) ); apdu->which=ILL_APDU_ILL_Request; req = ill_get_ILLRequest(&ctl, "ill", 0); apdu->u.illRequest=req; if (args->oclc_auth) { req->num_iLL_request_extensions=2; req->iLL_request_extensions= (ILL_Extension **) odr_malloc(odr, req->num_iLL_request_extensions* sizeof(*req->iLL_request_extensions)); req->iLL_request_extensions[0]=makepromptextension(args,odr); req->iLL_request_extensions[1]=makeoclcextension(args,odr); } if (!req) { yaz_log(YLOG_FATAL,"Could not create ill request"); exit(2); } return apdu; } /* createrequest */ /* * * * * * * * * * * * * * * */ /** \brief Send the request */ void sendrequest(ILL_APDU *apdu, ODR odr, COMSTACK stack ) { char *buf_out; int len_out; int res; if (!ill_APDU (odr, &apdu, 0, 0)) { yaz_log(YLOG_FATAL,"ill_Apdu failed"); exit(2); } buf_out = odr_getbuf(odr, &len_out, 0); if (0) { yaz_log(YLOG_DEBUG,"Request PDU Dump"); odr_dumpBER(yaz_log_file(), buf_out, len_out); } if (!buf_out) { yaz_log(YLOG_FATAL,"Encoding failed. Len=%d", len_out); odr_perror(odr, "encoding failed"); exit(2); } yaz_log(YLOG_DEBUG,"About to send the request. Len=%d", len_out); res = cs_put(stack, buf_out, len_out); if ( res<0 ) { yaz_log(YLOG_FATAL,"Could not send packet. code %d",res ); exit (4); } if (1) { FILE *F = fopen("req.apdu","w"); if (!F) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "open req.apdu failed"); } else { if (fwrite ( buf_out, 1, len_out, F) != len_out) yaz_log(YLOG_FATAL|YLOG_ERRNO, "write req.apdu failed"); if (fclose(F)) yaz_log(YLOG_FATAL|YLOG_ERRNO, "write req.apdu failed"); } } } /* sendrequest */ /* * * * * * * * * * * * * * * */ /** \brief Get a response */ ILL_APDU *getresponse( COMSTACK stack, ODR in_odr ){ ILL_APDU *resp; int res; char *buf_in=0; int len_in=0; yaz_log(YLOG_DEBUG,"About to wait for a response"); res = cs_get(stack, &buf_in, &len_in); yaz_log(YLOG_DEBUG,"Got a response of %d bytes at %p. res=%d", len_in,buf_in, res); if (res<0) { yaz_log(YLOG_FATAL,"Could not receive packet. code %d",res ); yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...", buf_in[0], buf_in[1], buf_in[2], buf_in[3], buf_in[4], buf_in[5], buf_in[6], buf_in[7] ); yaz_log(YLOG_DEBUG,"PDU Dump:"); odr_dumpBER(yaz_log_file(), buf_in, len_in); exit (5); } odr_setbuf(in_odr, buf_in, res, 0); if (!ill_APDU (in_odr, &resp, 0, 0)) { int x; int err = odr_geterrorx(in_odr, &x); char msg[60]; const char *element = odr_getelement(in_odr); sprintf(msg, "ODR code %d:%d element=%-20s", err, x, element ? element : ""); yaz_log(YLOG_FATAL,"Error decoding incoming packet: %s",msg); yaz_log(YLOG_DEBUG,"%02x %02x %02x %02x %02x %02x %02x %02x ...", buf_in[0], buf_in[1], buf_in[2], buf_in[3], buf_in[4], buf_in[5], buf_in[6], buf_in[7] ); yaz_log(YLOG_DEBUG,"PDU Dump:"); odr_dumpBER(yaz_log_file(), buf_in, len_in); yaz_log(YLOG_FATAL,"Error decoding incoming packet: %s",msg); exit(6); } return resp; } /* getresponse */ /** \brief Dump a apdu */ void dumpapdu( ILL_APDU *apdu) { ODR print_odr = odr_createmem(ODR_PRINT); ill_APDU (print_odr, &apdu, 0, 0); odr_destroy(print_odr); } /* dumpapdu */ /** \brief Check apdu type and extract the status_or_error */ ILL_Status_Or_Error_Report *getstaterr( ILL_APDU *resp, ODR in_odr ) { if (resp->which != ILL_APDU_Status_Or_Error_Report ) { const char *element = odr_getelement(in_odr); if (!element) element="unknown"; printf("Server returned wrong packet type: %d\n", resp->which); yaz_log(YLOG_FATAL,"Server returned a (%d) and " "not a 'Status_Or_Error_Report' (%d) ", resp->which, ILL_APDU_Status_Or_Error_Report); exit(6); } return resp->u.Status_Or_Error_Report; } /* getstaterr */ /** \brief Return a printable string from an ILL_String */ char *getillstring( ILL_String *s) { if (s->which == ILL_String_GeneralString ) return s->u.GeneralString; else if (s->which == ILL_String_EDIFACTString ) return s->u.EDIFACTString; else { yaz_log(YLOG_FATAL,"Invalid ILL_String "); exit (6); } } /* getillstring */ /** \brief Check if the status was an error packet */ /* The presence of an error_report indicates it was an error */ /* Then the problem is to find the right message. We dig around */ /* until we find the first message, print that, and exit the program */ void checkerr( ILL_Status_Or_Error_Report *staterr ) { yaz_log(YLOG_DEBUG, "err= %p ",staterr->error_report ); if (staterr->error_report) { ILL_Error_Report *err= staterr->error_report; if ( err->user_error_report) { ILL_User_Error_Report *uerr= err->user_error_report; switch( uerr->which ) { case ILL_User_Error_Report_already_forwarded: printf("Already forwarded: \n"); break; case ILL_User_Error_Report_intermediary_problem: printf("Intermediary problem: " ODR_INT_PRINTF "\n", *uerr->u.intermediary_problem); break; case ILL_User_Error_Report_security_problem: printf("Security problem: %s\n", getillstring(uerr->u.security_problem)); break; case ILL_User_Error_Report_unable_to_perform: printf("Unable to perform: " ODR_INT_PRINTF "\n", *uerr->u.unable_to_perform); break; default: printf("Unknown problem"); } exit(7); } if ( err->provider_error_report) { ILL_Provider_Error_Report *perr= err->provider_error_report; switch( perr->which ) { case ILL_Provider_Error_Report_general_problem: printf("General Problem: " ODR_INT_PRINTF ":", *perr->u.general_problem); break; case ILL_Provider_Error_Report_transaction_id_problem: printf("Transaction Id Problem: " ODR_INT_PRINTF ":", *perr->u.general_problem); break; case ILL_Provider_Error_Report_state_transition_prohibited: printf("State Transition prohibited:"); break; } /*exit(7);*/ } /* fallbacks */ if ( staterr->note ) printf("%s", getillstring(staterr->note)); else printf("Unknown error type"); printf("\n"); exit(7); } } /* checkerr */ /* * * * * * * * * * * * * * * */ /** \brief Main program * * Parse arguments * Validate arguments * Establish connection * Build a request * Send a request * Get a reply * Parse reply * Produce output */ int main (int argc, char * argv[]) { struct prog_args args; COMSTACK stack; ODR out_odr = odr_createmem(ODR_ENCODE); ODR in_odr = odr_createmem(ODR_DECODE); ILL_APDU *apdu; ILL_APDU *resp; ILL_Status_Or_Error_Report *staterr; parseargs( argc, argv, &args); validateargs(&args); stack = connect_to(args.host); apdu = createrequest(&args, out_odr); if (1) dumpapdu(apdu); sendrequest(apdu, out_odr, stack ); resp = getresponse(stack, in_odr ); if (1) dumpapdu(resp); staterr=getstaterr(resp, in_odr); checkerr(staterr); printf ("Ok\n"); /* while debugging */ exit (0); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/Makefile.am0000664000175000017500000000247414753416137011130 ## This file is part of the YAZ toolkit. ## Copyright (C) Index Data EXTRA_DIST = yaz-icu-example.xml AM_CPPFLAGS=-I$(top_srcdir)/src $(XML2_CFLAGS) $(ICU_CPPFLAGS) bin_PROGRAMS = yaz-marcdump yaz-iconv yaz-illclient yaz-icu yaz-json-parse \ yaz-url yaz-record-conv noinst_PROGRAMS = cclsh cql2pqf cql2xcql srwtst yaz-benchmark \ yaz-xmlquery # MARC dumper utility yaz_marcdump_SOURCES = marcdump.c yaz_marcdump_LDADD = ../src/libyaz.la # YAZ Iconv utility yaz_iconv_SOURCES = yaziconv.c yaz_iconv_LDADD = ../src/libyaz.la srwtst_SOURCES=srwtst.c srwtst_LDADD = ../src/libyaz.la cclsh_SOURCES=cclsh.c cclsh_LDADD = ../src/libyaz.la $(READLINE_LIBS) cql2pqf_SOURCES = cql2pqf.c cql2pqf_LDADD = ../src/libyaz.la cql2xcql_SOURCES = cql2xcql.c cql2xcql_LDADD = ../src/libyaz.la yaz_benchmark_SOURCES = benchmark.c yaz_benchmark_LDADD = ../src/libyaz.la yaz_xmlquery_SOURCES = yaz-xmlquery.c yaz_xmlquery_LDADD = ../src/libyaz.la yaz_illclient_SOURCES = yaz-illclient.c yaz_illclient_LDADD = ../src/libyaz.la yaz_icu_SOURCES = yaz-icu.c yaz_icu_LDADD =../src/libyaz_icu.la ../src/libyaz.la $(ICU_LIBS) yaz_json_parse_SOURCES = json-parse.c yaz_json_parse_LDADD = ../src/libyaz.la yaz_record_conv_SOURCES = yaz-record-conv.c yaz_record_conv_LDADD = ../src/libyaz.la yaz_url_SOURCES = yaz-url.c yaz_url_LDADD =../src/libyaz.la yaz-5.34.4/util/yaz-xmlquery.c0000664000175000017500000000775014631643521011723 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #if YAZ_HAVE_XML2 #include #endif static char *prog = "yaz-xmlquery"; #if YAZ_HAVE_XML2 void pqftoxmlquery(const char *pqf) { YAZ_PQF_Parser parser = yaz_pqf_create(); ODR odr = odr_createmem(ODR_ENCODE); Z_RPNQuery *rpn; if (!parser) { fprintf(stderr, "%s: cannot create parser\n", prog); exit(1); } if (!odr) { fprintf(stderr, "%s: cannot create parser\n", prog); exit(1); } rpn = yaz_pqf_parse(parser, odr, pqf); yaz_pqf_destroy(parser); if (!rpn) { fprintf(stderr, "%s: pqf parse error for query %s\n", prog, pqf); exit(2); } else { xmlDocPtr doc = 0; yaz_rpnquery2xml(rpn, &doc); if (!doc) { fprintf(stderr, "%s: yaz_rpnquery2xml failed for query %s\n", prog, pqf); exit(3); } else { xmlChar *buf_out = 0; int len_out = 0; xmlDocDumpMemory(doc, &buf_out, &len_out); if (!len_out || !buf_out) { fprintf(stderr, "%s: xmlDocDumpMemory failed for query %s\n", prog, pqf); exit(4); } else { if (fwrite(buf_out, len_out, 1, stdout) != 1) { fprintf(stderr, "%s: write failed\n", prog); exit(5); } } xmlFreeDoc(doc); } } odr_destroy(odr); } void xmlquerytopqf(const char *xmlstr) { xmlDocPtr doc; doc = xmlParseMemory(xmlstr, strlen(xmlstr)); if (!doc) { fprintf(stderr, "%s: xml parse error for XML:\n%s\n", prog, xmlstr); exit(1); } else { int error_code = 0; const char *addinfo = 0; Z_Query *query = 0; ODR odr = odr_createmem(ODR_ENCODE); const xmlNode *root_element = xmlDocGetRootElement(doc); yaz_xml2query(root_element, &query, odr, &error_code, &addinfo); if (error_code) { fprintf(stderr, "%s: yaz_xml2query failed code=%d addinfo=%s\n", prog, error_code, addinfo); exit(1); } else if (!query) { fprintf(stderr, "%s: yaz_xml2query no query result\n", prog); exit(1); } else { WRBUF w = wrbuf_alloc(); yaz_query_to_wrbuf(w, query); printf("%s\n", wrbuf_cstr(w)); wrbuf_destroy(w); } odr_destroy(odr); xmlFreeDoc(doc); } } void xmlfiletopqf(const char *xmlfile) { long sz; char *xmlstr; FILE *f = fopen(xmlfile, "rb"); if (!f) { fprintf(stderr, "%s: cannot open %s\n", prog, xmlfile); exit(1); } fseek(f, 0, SEEK_END); sz = ftell(f); if (sz <= 0 || sz >= 1<<18) { fprintf(stderr, "%s: bad size for file %s\n", prog, xmlfile); exit(1); } rewind(f); xmlstr = (char *) xmalloc(sz+1); xmlstr[sz] = '\0'; if (fread(xmlstr, sz, 1, f) != 1) { fprintf(stderr, "%s: read failed for file %s\n", prog, xmlfile); exit(1); } if (fclose(f)) { fprintf(stderr, "%s: close failed for file %s\n", prog, xmlfile); exit(1); } xmlquerytopqf(xmlstr); xfree(xmlstr); } #endif void usage(void) { fprintf(stderr, "%s [-p pqf] [-x xmlfile]\n", prog); fprintf(stderr, " -p pqf reads pqf. write xml to stdout\n"); fprintf(stderr, " -x xmlfile reads XML from file. write pqf to stdout\n"); exit(1); } int main (int argc, char **argv) { #if YAZ_HAVE_XML2 char *arg; int r; int active = 0; yaz_enable_panic_backtrace(*argv); while ((r = options("-p:x:", argv, argc, &arg)) != -2) { switch(r) { case 'p': pqftoxmlquery(arg); active = 1; break; case 'x': xmlfiletopqf(arg); active = 1; break; case 0: break; } } if (!active) { fprintf(stderr, "%s: nothing to do\n", prog); usage(); } #else fprintf(stderr, "%s: XML support not enabled.\n", prog); exit(1); #endif return 0; } yaz-5.34.4/util/cql2pqf.c0000664000175000017500000001057714631643521010605 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include static void usage(void) { fprintf(stderr, "usage\n cql2pqf [-n ] [-r] [-s] [-S] " "[]\n"); fprintf(stderr, " -r reverse conversion (RPN to Solr/CQL)\n"); fprintf(stderr, " -s Solr instead of CQL\n"); fprintf(stderr, " -S strict CQL 2.0\n"); exit(1); } int main(int argc, char **argv) { cql_transform_t ct; int i, iterations = 1; char *query = 0; char *fname = 0; int reverse = 0; int solr = 0; int verbose = 0; int do_strict = 0; int ret; char *arg; while ((ret = options("n:rsSv", argv, argc, &arg)) != -2) { switch (ret) { case 0: if (!fname) fname = arg; else query = arg; break; case 'n': iterations = atoi(arg); break; case 'r': reverse = 1; break; case 'S': do_strict = 1; break; case 's': solr = 1; break; case 'v': verbose = 1; break; default: usage(); } } if (fname) { ct = cql_transform_open_fname(fname); if (!ct) { fprintf(stderr, "failed to read properties %s\n", fname); exit(1); } } else ct = cql_transform_create(); if (reverse) { char buf[1024]; if (!query) { if (fgets(buf, sizeof buf, stdin)) { if (*buf && buf[strlen(buf)-1] == '\n') buf[strlen(buf)-1] = '\0'; query = buf; } } if (query) { ODR odr = odr_createmem(ODR_ENCODE); YAZ_PQF_Parser pp = yaz_pqf_create(); Z_RPNQuery *rpn = yaz_pqf_parse(pp, odr, query); if (!rpn) { fprintf(stderr, "PQF syntax error\n"); } else { int ret = 0; if (solr) ret = solr_transform_rpn2solr_stream(ct, cql_fputs, stdout, rpn); else ret = cql_transform_rpn2cql_stream(ct, cql_fputs, stdout, rpn); if (ret) { const char *addinfo; int r = cql_transform_error(ct, &addinfo); printf("Transform error %d %s\n", r, addinfo ? addinfo : ""); } else printf("\n"); } yaz_pqf_destroy(pp); odr_destroy(odr); } } else { CQL_parser cp = cql_parser_create(); int r = 0; cql_parser_strict(cp, do_strict); if (query) { if (verbose) printf("Parsing CQL %s\n", query); for (i = 0; i #endif #include #include #include #include #include #include struct boptions { int nconnect; /* number of connections to make */ int nsearch; /* number of searches on each connection */ int npresent; /* number of presents for each search */ int full; /* 1 = fetch full records, 0 = brief */ int delay; /* number of ms to delay between ops */ int random; /* if true, delay is random 0-specified */ int verbosity; /* 0 = quiet, higher => more verbose */ } boptions = { 3, 3, 3, 0, 1000, 1, 0, }; static int test(char *host, int port); static void db_printf(int level, char *fmt, ...); static void usage(const char *prog); int main(int argc, char **argv) { char *host = 0; int port = 0; int c; int i; int ok; int nok = 0; char *arg; while ((c = options("c:s:p:fbd:rv:", argv, argc, &arg)) != -2) { switch (c) { case 0: if (!host) host = arg; else if (!port) port = atoi(arg); else usage(*argv); break; case 'c': boptions.nconnect = atoi(arg); break; case 's': boptions.nsearch = atoi(arg); break; case 'p': boptions.npresent = atoi(arg); break; case 'f': boptions.full = 1; break; case 'b': boptions.full = 0; break; case 'd': boptions.delay = atoi(arg); break; case 'r': boptions.random = 1; break; case 'v': boptions.verbosity = atoi(arg); break; default: usage(*argv); } } if (!host || !port) usage(*argv); for (i = 0; i < boptions.nconnect; i++) { db_printf(2, "iteration %d of %d", i+1, boptions.nconnect); ok = test(host, port); if (ok) nok++; } db_printf(1, "passed %d of %d tests", nok, boptions.nconnect); if (nok < boptions.nconnect) printf("Failed %d of %d tests\n", boptions.nconnect-nok, boptions.nconnect); return 0; } static void usage(const char *prog) { fprintf(stderr, "Usage: %s [options] \n" " -c Make connection to the server [default: 3]\n" " -s Perform searches on each connection [3]\n" " -p Make present requests after each search [3]\n" " -f Fetch full records [default: brief]\n" " -b Fetch brief records\n" " -d Delay ms after each operation\n" " -r Delays are random between 0 and the specified number of ms\n" " -v Set verbosity level to [0, silent on success]\n" , prog); exit(1); } static int test(char *host, int port) { ZOOM_connection conn; int error; const char *errmsg, *addinfo; conn = ZOOM_connection_new(host, port); if ((error = ZOOM_connection_error(conn, &errmsg, &addinfo))) { fprintf(stderr, "ZOOM error: %s (%d): %s\n", errmsg, error, addinfo); return 0; } ZOOM_connection_destroy(conn); return 1; } static void db_printf(int level, char *fmt, ...) { va_list ap; if (level > boptions.verbosity) return; fprintf(stderr, "DEBUG(%d): ", level); va_start(ap, fmt); vfprintf(stderr, fmt, ap); fputc('\n', stderr); va_end(ap); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/yaz-url.c0000664000175000017500000001175314631643521010635 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include static void usage(void) { printf("yaz-icu [options] url ..\n"); printf(" -H name:value Sets HTTP header (repeat if necessary)\n"); printf(" -m method Sets HTTP method\n"); printf(" -O fname Writes HTTP content to file\n"); printf(" -p fname POSTs file at following url\n"); printf(" -R num Set maximum number of HTTP redirects\n"); printf(" -u user/password Sets Basic HTTP auth\n"); printf(" -v Verbose\n"); printf(" -x proxy Sets HTTP proxy\n"); exit(1); } static char *get_file(const char *fname, size_t *len) { char *buf = 0; FILE *inf = fopen(fname, "rb"); if (!inf) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "Could not open %s", fname); exit(1); } if (fseek(inf, 0L, SEEK_END)) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "fseek of %s failed", fname); exit(1); } *len = ftell(inf); if (*len) /* zero length not considered an error */ { size_t r; buf = xmalloc(*len); fseek(inf, 0L, SEEK_SET); r = fread(buf, 1, *len, inf); if (r != *len) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "short fread of %s", fname); exit(1); } } fclose(inf); return buf; } int main(int argc, char **argv) { int ret; char *arg; yaz_url_t p = yaz_url_create(); char *post_buf = 0; size_t post_len = 0; const char *method = "GET"; Z_HTTP_Response *http_response; Z_HTTP_Header *http_headers = 0; ODR odr = odr_createmem(ODR_ENCODE); int exit_code = 0; int no_urls = 0; const char *outfname = 0; yaz_enable_panic_backtrace(*argv); while ((ret = options("h{help}H:m:O:p:R{max-redirs}:u:vx:", argv, argc, &arg)) != YAZ_OPTIONS_EOF) { switch (ret) { case 'h': usage(); break; case 'H': if (!strchr(arg, ':')) { yaz_log(YLOG_FATAL, "bad header option (missing :) %s\n", arg); exit_code = 1; } else { char *cp = strchr(arg, ':'); char *name = odr_malloc(odr, 1 + cp - arg); char *value = cp + 1; memcpy(name, arg, cp - arg); name[cp - arg] = '\0'; while (*value == ' ') /* skip space after = */ value++; z_HTTP_header_add(odr, &http_headers, name, value); } break; case 'm': method = arg; break; case 'O': outfname = arg; break; case 'p': xfree(post_buf); post_buf = get_file(arg, &post_len); method = "POST"; break; case 'R': yaz_url_set_max_redirects(p, atoi(arg)); break; case 'u': if (strchr(arg, '/')) { char *cp = strchr(arg, '/'); char *user = odr_malloc(odr, 1 + cp - arg); char *password = cp + 1; memcpy(user, arg, cp - arg); user[cp - arg] = '\0'; z_HTTP_header_add_basic_auth(odr, &http_headers, user, password); } else z_HTTP_header_add_basic_auth(odr, &http_headers, arg, 0); break; case 'v': yaz_url_set_verbose(p, 1); break; case 'x': yaz_url_set_proxy(p, arg); break; case 0: http_response = yaz_url_exec(p, arg, method, http_headers, post_buf, post_len); if (!http_response) exit_code = 1; else { FILE *outf = stdout; if (outfname) { outf = fopen(outfname, "w"); if (!outf) { yaz_log(YLOG_FATAL|YLOG_ERRNO, "open %s", outfname); exit(1); } } fwrite(http_response->content_buf, 1, http_response->content_len, outf); if (outfname) fclose(outf); } no_urls++; break; default: usage(); } } xfree(post_buf); yaz_url_destroy(p); odr_destroy(odr); if (no_urls == 0) usage(); exit(exit_code); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/marcdump.c0000664000175000017500000004111514753615630011042 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #define _FILE_OFFSET_BITS 64 #if HAVE_CONFIG_H #include #endif #if YAZ_HAVE_XML2 #include #include #include #include #include #endif #include #include #include #include #include #include #if HAVE_LOCALE_H #include #endif #if HAVE_LANGINFO_H #include #endif #include #include #include #include #include #include #ifndef SEEK_SET #define SEEK_SET 0 #endif #ifndef SEEK_END #define SEEK_END 2 #endif static char *prog; static int no_errors = 0; static void usage(const char *prog) { fprintf(stderr, "Usage: %s [-i format] [-o format] [-f from] [-t to] " "[-l pos=value] [-c cfile] [-s prefix] [-C size] [-n] " "[-p] [-v] [-V] [-O offset] [-L limit] file...\n", prog); } static void show_version(void) { char vstr[20], sha1_str[41]; yaz_version(vstr, sha1_str); printf("YAZ version: %s %s\n", YAZ_VERSION, YAZ_VERSION_SHA1); if (strcmp(sha1_str, YAZ_VERSION_SHA1)) printf("YAZ DLL/SO: %s %s\n", vstr, sha1_str); exit(0); } static int getbyte_stream(void *client_data) { FILE *f = (FILE*) client_data; int c = fgetc(f); if (c == EOF) return 0; return c; } static void ungetbyte_stream(int c, void *client_data) { FILE *f = (FILE*) client_data; if (c == 0) c = EOF; ungetc(c, f); } static long marcdump_read_line(yaz_marc_t mt, const char *fname) { long no = 0; FILE *inf = fopen(fname, "rb"); if (!inf) { fprintf(stderr, "%s: cannot open %s:%s\n", prog, fname, strerror(errno)); exit(1); } while (yaz_marc_read_line(mt, getbyte_stream, ungetbyte_stream, inf) == 0) { WRBUF wrbuf = wrbuf_alloc(); yaz_marc_write_mode(mt, wrbuf); fputs(wrbuf_cstr(wrbuf), stdout); wrbuf_destroy(wrbuf); no++; } fclose(inf); return no; } static long marcdump_read_json(yaz_marc_t mt, const char *fname) { const char *errmsg; size_t errpos; WRBUF w = wrbuf_alloc(); struct json_node *n; int c; FILE *inf = fopen(fname, "rb"); if (!inf) { fprintf(stderr, "%s: cannot open %s:%s\n", prog, fname, strerror(errno)); exit(1); } while ((c = getc(inf)) != EOF) wrbuf_putc(w, c); n = json_parse2(wrbuf_cstr(w), &errmsg, &errpos); if (n) { int r = yaz_marc_read_json_node(mt, n); if (r == 0) { wrbuf_rewind(w); yaz_marc_write_mode(mt, w); fputs(wrbuf_cstr(w), stdout); wrbuf_rewind(w); } else { fprintf(stderr, "%s: JSON MARC parsing failed ret=%d\n", fname, r); } } else { fprintf(stderr, "%s: JSON parse error: %s . pos=%ld\n", fname, errmsg, (long) errpos); } wrbuf_destroy(w); fclose(inf); return 1L; } #if YAZ_HAVE_XML2 static long marcdump_read_xml(yaz_marc_t mt, const char *fname, long offset, long limit) { WRBUF wrbuf = wrbuf_alloc(); xmlTextReaderPtr reader = xmlReaderForFile(fname, 0 /* encoding */, 0 /* options */); int ret; long no = 0; if (reader == 0) { fprintf(stderr, "%s: cannot open %s:%s\n", prog, fname, strerror(errno)); exit(1); } while ((ret = xmlTextReaderRead(reader)) == 1) { int type = xmlTextReaderNodeType(reader); if (type == XML_READER_TYPE_ELEMENT) { char *name = (char *) xmlTextReaderLocalName(reader); if (!strcmp(name, "record") || !strcmp(name, "r")) { xmlNodePtr ptr = xmlTextReaderExpand(reader); int r = yaz_marc_read_xml(mt, ptr); if (r) { no_errors++; fprintf(stderr, "yaz_marc_read_xml failed\n"); } else if (no >= offset) { int write_rc = yaz_marc_write_mode(mt, wrbuf); if (write_rc) { yaz_log(YLOG_WARN, "yaz_marc_write_mode: " "write error: %d", write_rc); no_errors++; } fputs(wrbuf_cstr(wrbuf), stdout); wrbuf_rewind(wrbuf); } no++; } xmlFree(name); } if (no - offset >= limit) break; } xmlFreeTextReader(reader); fputs(wrbuf_cstr(wrbuf), stdout); wrbuf_destroy(wrbuf); return no; } #endif static long marcdump_read_iso2709(yaz_marc_t mt, const char *from, const char *to, int print_offset, int verbose, FILE *cfile, const char *split_fname, int split_chunk, const char *fname, long offset, long limit) { FILE *inf = fopen(fname, "rb"); long marc_no; int split_file_no = -1; yaz_iconv_t cd = yaz_marc_get_iconv(mt); if (!inf) { fprintf(stderr, "%s: cannot open %s:%s\n", prog, fname, strerror(errno)); exit(1); } if (cfile) fprintf(cfile, "char *marc_records[] = {\n"); for (marc_no = 0L; marc_no - offset < limit; marc_no++) { const char *result = 0; size_t len; size_t rlen; size_t len_result; size_t r; char buf[100001]; yaz_iconv_t cd1 = 0; r = fread(buf, 1, 5, inf); if (r < 5) { if (r == 0) /* normal EOF, all good */ break; if (print_offset && verbose) { printf("\n", (long)r); } break; } while (*buf < '0' || *buf > '9') { int i; long off = ftell(inf) - 5; printf("\n", *buf & 0xff, *buf & 0xff, off, off); for (i = 0; i < 4; i++) buf[i] = buf[i + 1]; r = fread(buf + 4, 1, 1, inf); no_errors++; if (r < 1) break; } if (r < 1) { if (verbose || print_offset) printf("\n"); break; } if (print_offset) { long off = ftell(inf) - 5; printf("\n", marc_no + 1, off, off); } len = atoi_n(buf, 5); if (len < 25 || len > 100000) { long off = ftell(inf) - 5; printf("\n", (long)len, (long)off, (long)off); no_errors++; break; } rlen = len - 5; r = fread(buf + 5, 1, rlen, inf); if (r < rlen) { long off = ftell(inf); printf("\n", (long)off, (long)off); no_errors++; break; } while (buf[len - 1] != ISO2709_RS) { if (len > sizeof(buf) - 2) { r = 0; break; } r = fread(buf + len, 1, 1, inf); if (r != 1) break; len++; } if (r < 1) { printf("\n"); no_errors++; break; } if (split_fname) { char fname[256]; const char *mode = 0; FILE *sf; if ((marc_no % split_chunk) == 0) { mode = "wb"; split_file_no++; } else mode = "ab"; sprintf(fname, "%.200s%07d", split_fname, split_file_no); sf = fopen(fname, mode); if (!sf) { fprintf(stderr, "Could not open %s\n", fname); split_fname = 0; } else { if (fwrite(buf, 1, len, sf) != len) { fprintf(stderr, "Could not write content to %s\n", fname); split_fname = 0; no_errors++; } fclose(sf); } } len_result = rlen; if (yaz_marc_check_marc21_coding(from, buf, 26)) { cd1 = yaz_iconv_open(to, "utf-8"); if (cd1) yaz_marc_iconv(mt, cd1); } r = yaz_marc_decode_buf(mt, buf, -1, &result, &len_result); if (cd1) { yaz_iconv_close(cd1); yaz_marc_iconv(mt, cd); cd1 = 0; } if (r == (size_t)-1) no_errors++; if (r > 0 && result && len_result && marc_no >= offset) { if (fwrite(result, len_result, 1, stdout) != 1) { fprintf(stderr, "Write to stdout failed\n"); no_errors++; break; } } if (r > 0 && cfile) { char *p = buf; size_t i; if (marc_no) fprintf(cfile, ","); fprintf(cfile, "\n"); for (i = 0; i < r; i++) { if ((i & 15) == 0) fprintf(cfile, " \""); if (p[i] < 32 || p[i] > 126) fprintf(cfile, "\" \"\\x%02X\" \"", p[i] & 255); else fputc(p[i], cfile); if (i < r - 1 && (i & 15) == 15) fprintf(cfile, "\"\n"); } fprintf(cfile, "\"\n"); } if (verbose) printf("\n"); } if (cfile) fprintf(cfile, "};\n"); fclose(inf); return marc_no; } static long dump(const char *fname, const char *from, const char *to, int input_format, int output_format, int write_using_libxml2, int print_offset, const char *split_fname, int split_chunk, int verbose, FILE *cfile, const char *leader_spec, long offset, long limit) { yaz_marc_t mt = yaz_marc_create(); yaz_iconv_t cd = 0; long total = 0L; if (yaz_marc_leader_spec(mt, leader_spec)) { fprintf(stderr, "bad leader spec: %s\n", leader_spec); yaz_marc_destroy(mt); exit(2); } if (from && to) { cd = yaz_iconv_open(to, from); if (!cd) { fprintf(stderr, "conversion from %s to %s " "unsupported\n", from, to); yaz_marc_destroy(mt); exit(2); } yaz_marc_iconv(mt, cd); } yaz_marc_enable_collection(mt); yaz_marc_xml(mt, output_format); yaz_marc_write_using_libxml2(mt, write_using_libxml2); yaz_marc_debug(mt, verbose); if (input_format == YAZ_MARC_TURBOMARC || input_format == YAZ_MARC_XCHANGE || input_format == YAZ_MARC_MARCXML) { #if YAZ_HAVE_XML2 total = marcdump_read_xml(mt, fname, offset, limit); #endif } else if (input_format == YAZ_MARC_LINE) { total = marcdump_read_line(mt, fname); } else if (input_format == YAZ_MARC_JSON) { total = marcdump_read_json(mt, fname); } else if (input_format == YAZ_MARC_ISO2709) { total = marcdump_read_iso2709(mt, from, to, print_offset, verbose, cfile, split_fname, split_chunk, fname, offset, limit); } { WRBUF wrbuf = wrbuf_alloc(); yaz_marc_write_trailer(mt, wrbuf); fputs(wrbuf_cstr(wrbuf), stdout); wrbuf_destroy(wrbuf); } if (cd) yaz_iconv_close(cd); yaz_marc_destroy(mt); return total; } int main (int argc, char **argv) { int report = 0; int r; int print_offset = 0; char *arg; int verbose = 0; int no = 0; int output_format = YAZ_MARC_LINE; FILE *cfile = 0; char *from = 0, *to = 0; int input_format = YAZ_MARC_ISO2709; int split_chunk = 1; const char *split_fname = 0; const char *leader_spec = 0; int write_using_libxml2 = 0; long offset = 0L; long limit = LONG_MAX; long total = 0L; #if HAVE_LOCALE_H setlocale(LC_CTYPE, ""); #endif #if HAVE_LANGINFO_H #ifdef CODESET to = nl_langinfo(CODESET); #endif #endif prog = *argv; yaz_enable_panic_backtrace(prog); while ((r = options("i:o:C:npc:xL:O:eXIf:t:s:l:Vrv", argv, argc, &arg)) != -2) { no++; switch (r) { case 'i': input_format = yaz_marc_decode_formatstr(arg); if (input_format == -1) { fprintf(stderr, "%s: bad input format: %s\n", prog, arg); exit(1); } #if YAZ_HAVE_XML2 #else if (input_format == YAZ_MARC_MARCXML || input_format == YAZ_MARC_XCHANGE) { fprintf(stderr, "%s: Libxml2 support not enabled\n", prog); exit(3); } #endif break; case 'o': /* dirty hack so we can make Libxml2 do the writing .. rather than WRBUF */ if (strlen(arg) > 4 && strncmp(arg, "xml,", 4) == 0) { /* Only supported for Libxml2 2.6.0 or later */ #if LIBXML_VERSION >= 20600 arg = arg + 4; write_using_libxml2 = 1; #else fprintf(stderr, "%s: output using Libxml2 unsupported\n", prog); exit(4); #endif } output_format = yaz_marc_decode_formatstr(arg); if (output_format == -1) { fprintf(stderr, "%s: bad output format: %s\n", prog, arg); exit(1); } break; case 'l': leader_spec = arg; break; case 'f': from = arg; break; case 't': to = arg; break; case 'c': if (cfile) fclose(cfile); cfile = fopen(arg, "w"); break; case 'x': fprintf(stderr, "%s: -x no longer supported. " "Use -i marcxml instead\n", prog); exit(1); break; case 'L': limit = atol(arg); break; case 'O': offset = atol(arg); break; case 'e': fprintf(stderr, "%s: -e no longer supported. " "Use -o marcxchange instead\n", prog); exit(1); break; case 'X': fprintf(stderr, "%s: -X no longer supported. " "Use -o marcxml instead\n", prog); exit(1); break; case 'I': fprintf(stderr, "%s: -I no longer supported. " "Use -o marc instead\n", prog); exit(1); break; case 'n': output_format = YAZ_MARC_CHECK; break; case 'p': print_offset = 1; break; case 's': split_fname = arg; break; case 'C': split_chunk = atoi(arg); break; case 0: total += dump(arg, from, to, input_format, output_format, write_using_libxml2, print_offset, split_fname, split_chunk, verbose, cfile, leader_spec, offset, limit); break; case 'v': verbose++; break; case 'r': report = 1; break; case 'V': show_version(); break; default: usage(prog); exit(1); } } if (cfile) fclose(cfile); if (!no) { usage(prog); exit(1); } /* for now only a single report line. Might be added in the future */ if (report) fprintf(stderr, "records read: %ld\n", total); if (no_errors) exit(5); exit(0); } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/srwtst.c0000664000175000017500000000545314631643521010600 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #if YAZ_HAVE_XML2 Z_SOAP_Handler h[2] = { {"http://www.loc.gov/zing/srw/v1.0/", 0, (Z_SOAP_fun) yaz_srw_codec}, {0, 0, 0} }; int main(int argc, char **argv) { char buf[163840]; char *content_buf = buf; int content_len; size_t no; Z_SOAP *soap_package = 0; ODR decode, encode; int debug = 0; if (argc == 2 && !strcmp(argv[1], "debug")) debug = 1; no = fread(buf, 1, sizeof(buf), stdin); if (no < 1 || no == sizeof(buf)) { fprintf(stderr, "Bad file or too big\n"); exit (1); } decode = odr_createmem(ODR_DECODE); encode = odr_createmem(ODR_ENCODE); content_len = no; z_soap_codec(decode, &soap_package, &content_buf, &content_len, h); if (!soap_package) { fprintf(stderr, "Decoding seriously failed\n"); exit(1); } if (debug) { fprintf(stderr, "got NS = %s\n", soap_package->ns); if (soap_package->which == Z_SOAP_generic && soap_package->u.generic->no == 0) { Z_SRW_PDU *sr = (Z_SRW_PDU *) soap_package->u.generic->p; if (sr->which == Z_SRW_searchRetrieve_request) { Z_SRW_searchRetrieveRequest *req = sr->u.request; fprintf(stderr, "%s: %s\n", req->queryType, req->query); } else if (sr->which == Z_SRW_searchRetrieve_response) { Z_SRW_searchRetrieveResponse *res = sr->u.response; if (res->records && res->num_records) { int i; for (i = 0; inum_records; i++) { fprintf (stderr, "%d\n", i); if (res->records[i].recordData_buf) { fprintf(stderr, "%.*s", res->records[i].recordData_len, res->records[i].recordData_buf); } } } } } } z_soap_codec(encode, &soap_package, &content_buf, &content_len, h); if (content_buf && content_len) { printf("%.*s", content_len, content_buf); } else { fprintf(stderr, "No output!\n"); exit(1); } odr_destroy(decode); odr_destroy(encode); exit(0); } #else int main(int argc, char **argv) { fprintf(stderr, "SOAP disabled\n"); exit(1); } #endif /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/json-parse.c0000664000175000017500000000346214631643521011311 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include void usage(const char *prog) { fprintf(stderr, "%s: [-p]\n", prog); exit(1); } static struct json_node *do_parse_from_stdin(void) { FILE *f = stdin; WRBUF w = wrbuf_alloc(); struct json_node *n; size_t pos; const char *json_str; const char *err_msg; int c; while ((c = getc(f)) != EOF) wrbuf_putc(w, c); json_str = wrbuf_cstr(w); n = json_parse2(json_str, &err_msg, &pos); if (!n) { fprintf(stderr, "JSON parse error: %s\nLeading text was:\n", err_msg); fwrite(json_str, 1, pos, stderr); fprintf(stderr, "^\n"); } wrbuf_destroy(w); return n; } int main(int argc, char **argv) { struct json_node *n; int print = 0; int ret; char *arg; yaz_enable_panic_backtrace(*argv); while ((ret = options("p", argv, argc, &arg)) != YAZ_OPTIONS_EOF) { switch (ret) { case 'p': print++; break; default: usage(argv[0]); } } n = do_parse_from_stdin(); if (!n) exit(1); if (print) { WRBUF result = wrbuf_alloc(); if (print > 1) json_write_wrbuf_pretty(n, result); else json_write_wrbuf(n, result); puts(wrbuf_cstr(result)); wrbuf_destroy(result); } json_remove_node(n); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/cql2xcql.c0000664000175000017500000000434014631643521010755 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include static void usage(const char *prog) { fprintf(stderr, "%s: [-c] [-n iterations] [-s] [-S] [infile]\n", prog); exit(1); } int main(int argc, char **argv) { CQL_parser cp; int r = 0; const char *fname = 0; int iterations = 1; int ret; int convert_to_ccl = 0; char *arg; char *prog = argv[0]; int do_sortkeys = 0; int do_strict = 0; while ((ret = options("cn:sS", argv, argc, &arg)) != YAZ_OPTIONS_EOF) { switch (ret) { case 0: fname = arg; break; case 'c': convert_to_ccl = 1; break; case 'n': iterations = atoi(arg); break; case 's': do_sortkeys = 1; break; case 'S': do_strict = 1; break; default: usage(prog); } } cp = cql_parser_create(); cql_parser_strict(cp, do_strict); if (fname) { int i; for (i = 0; i #endif #include #include #include #include #include #if HAVE_READLINE_READLINE_H #include #endif #if HAVE_READLINE_HISTORY_H #include #endif #if YAZ_HAVE_XML2 #include #endif static int debug = 0; static char *prog; void usage(const char *prog) { fprintf(stderr, "%s: [-d] [-b configfile] [-x xmlconfig]\n", prog); exit(1); } int main(int argc, char **argv) { CCL_bibset bibset; FILE *bib_inf; char *bib_fname; int ret; char *arg; #if YAZ_HAVE_XML2 xmlDocPtr doc; const char *addinfo; #endif WRBUF q_wrbuf = 0; prog = *argv; bibset = ccl_qual_mk(); while ((ret = options("db:x:", argv, argc, &arg)) != -2) { switch(ret) { case 'd': debug = 1; break; case 'b': bib_fname = arg; bib_inf = fopen(bib_fname, "r"); if (!bib_inf) { fprintf(stderr, "%s: cannot open %s\n", prog, bib_fname); exit(1); } ccl_qual_file(bibset, bib_inf); fclose(bib_inf); break; #if YAZ_HAVE_XML2 case 'x': doc = xmlParseFile(arg); if (!doc) { fprintf(stderr, "%s: could not read %s\n", prog, arg); exit(1); } if (ccl_xml_config(bibset, xmlDocGetRootElement(doc), &addinfo)) { fprintf(stderr, "%s: error in %s: %s\n", prog, arg, addinfo); exit(1); } xmlFreeDoc(doc); break; #endif case 0: if (q_wrbuf) wrbuf_puts(q_wrbuf, " "); else q_wrbuf = wrbuf_alloc(); wrbuf_puts(q_wrbuf, arg); break; default: usage(prog); } } if (q_wrbuf) { CCL_parser cclp = ccl_parser_create(bibset); int error; struct ccl_rpn_node *rpn; rpn = ccl_parser_find_str(cclp, wrbuf_cstr(q_wrbuf)); error = ccl_parser_get_error(cclp, 0); if (error) { printf("%s\n", ccl_err_msg(error)); } else { if (rpn) { ccl_pr_tree(rpn, stdout); printf("\n"); } } ccl_parser_destroy(cclp); if (rpn) ccl_rpn_delete(rpn); wrbuf_destroy(q_wrbuf); exit(0); } while (1) { char buf[1000]; int i, error; struct ccl_rpn_node *rpn; #if HAVE_READLINE_READLINE_H char* line_in; line_in=readline("CCLSH>"); if (!line_in) break; #if HAVE_READLINE_HISTORY_H if (*line_in) add_history(line_in); #endif if (strlen(line_in) > 999) { fprintf(stderr,"Input line to long\n"); break; } strcpy(buf,line_in); free(line_in); #else printf("CCLSH>"); fflush(stdout); if (!fgets(buf, 999, stdin)) break; #endif for (i = 0; i<1; i++) { CCL_parser cclp = ccl_parser_create(bibset); int pos; rpn = ccl_parser_find_str(cclp, buf); error = ccl_parser_get_error(cclp, &pos); if (error) { printf("%*s^ - ", 6+pos, " "); printf("%s\n", ccl_err_msg(error)); } else { if (rpn && i == 0) { ccl_stop_words_t csw = ccl_stop_words_create(); int idx = 0; printf("First:\n"); ccl_pr_tree(rpn, stdout); if (ccl_stop_words_tree(csw, bibset, &rpn)) { printf("Second:\n"); ccl_pr_tree(rpn, stdout); printf("\n"); for (idx = 0; ; idx++) { const char *qname; const char *term; if (!ccl_stop_words_info(csw, idx, &qname, &term)) break; printf("Removed from %s: %s\n", qname ? qname : "none", term); } } ccl_stop_words_destroy(csw); } } ccl_parser_destroy(cclp); if (rpn) ccl_rpn_delete(rpn); } } printf("\n"); ccl_qual_rm(&bibset); return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/yaz-icu-example.xml0000664000175000017500000000031114631643521012606 yaz-5.34.4/util/yaz-icu.c0000664000175000017500000004454514753417062010624 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #if YAZ_HAVE_ICU #include #include #include #include #include #include #include #include #include #include /* commando line and config parameters */ struct config_t { char conffile[1024]; char print[1024]; int xmloutput; int sortoutput; int org_output; yaz_icu_chain_t chain; FILE * infile; FILE * outfile; }; void print_option_error(const struct config_t *p_config) { fprintf(stderr, "yaz-icu [options] [infile]\n" "Options:\n" " -c file XML configuration\n" " -p a|c|l|t Print ICU info \n" " -s Show sort normalization key\n" " -o Show org positions\n" " -x XML output instread of text\n" "\n" "Examples:\n" "cat hugetextfile.txt | ./yaz-icu -c config.xml \n" "./yaz-icu -p c\n" "./yaz-icu -p l -x\n" "./yaz-icu -p t -x\n" "\n" "Example ICU chain XML configuration file:\n" "\n" " \n" " \n" " \n" " \n" "\n" ); exit(1); } void read_params(int argc, char **argv, struct config_t *p_config) { char *arg; int ret; /* set default parameters */ p_config->conffile[0] = 0; p_config->print[0] = 0; p_config->xmloutput = 0; p_config->sortoutput = 0; p_config->chain = 0; p_config->infile = 0; p_config->outfile = stdout; p_config->org_output = 0; /* set up command line parameters */ while ((ret = options("c:op:sx", argv, argc, &arg)) != -2) { switch (ret) { case 'c': strcpy(p_config->conffile, arg); break; case 'p': strcpy(p_config->print, arg); break; case 's': p_config->sortoutput = 1; break; case 'x': p_config->xmloutput = 1; break; case 'o': p_config->org_output = 1; break; case 0: if (p_config->infile) { fprintf(stderr, "yaz-icu: only one input file may be given\n"); print_option_error(p_config); } p_config->infile = fopen(arg, "r"); if (!p_config->infile) { fprintf(stderr, "yaz-icu: cannot open %s : %s\n", arg, strerror(errno)); exit(1); } break; default: fprintf(stderr, "yaz_icu: invalid option: %s\n", arg); print_option_error(p_config); } } if (p_config->infile == 0) p_config->infile = stdin; if (!strlen(p_config->conffile) && !strlen(p_config->print)) print_option_error(p_config); } static void print_icu_converters(const struct config_t *p_config) { int32_t count; int32_t i; count = ucnv_countAvailable(); if (p_config->xmloutput) fprintf(p_config->outfile, "\n", count, ucnv_getDefaultName()); else { fprintf(p_config->outfile, "Available ICU converters: %d\n", count); fprintf(p_config->outfile, "Default ICU Converter is: '%s'\n", ucnv_getDefaultName()); } for (i = 0; i < count; i++) { if (p_config->xmloutput) fprintf(p_config->outfile, "\n", ucnv_getAvailableName(i)); else fprintf(p_config->outfile, "%s\n", ucnv_getAvailableName(i)); } if (p_config->xmloutput) fprintf(p_config->outfile, "\n"); else fprintf(p_config->outfile, "\n"); } static void print_icu_transliterators(const struct config_t *p_config) { UErrorCode status; UEnumeration *en = utrans_openIDs(&status); int32_t count = uenum_count(en, &status); const char *name; int32_t length; if (p_config->xmloutput) fprintf(p_config->outfile, "\n", count); else fprintf(p_config->outfile, "Available ICU transliterators: %d\n", count); while ((name = uenum_next(en, &length, &status))) { if (p_config->xmloutput) fprintf(p_config->outfile, "\n", name); else fprintf(p_config->outfile, "%s\n", name); } uenum_close(en); if (p_config->xmloutput) fprintf(p_config->outfile, "\n"); else { fprintf(p_config->outfile, "\n\nUnicode Set Patterns:\n" " Pattern Description\n" " Ranges [a-z] The lower case letters a through z\n" " Named Chars [abc123] The six characters a,b,c,1,2 and 3\n" " String [abc{def}] chars a, b and c, and string 'def'\n" " Categories [\\p{Letter}] Perl General Category 'Letter'.\n" " Categories [:Letter:] Posix General Category 'Letter'.\n" "\n" " Combination Example\n" " Union [[:Greek:] [:letter:]]\n" " Intersection [[:Greek:] & [:letter:]]\n" " Set Complement [[:Greek:] - [:letter:]]\n" " Complement [^[:Greek:] [:letter:]]\n" "\n" "see: http://userguide.icu-project.org/strings/unicodeset\n" "\n" "Examples:\n" " [:Punctuation:] Any-Remove\n" " [:Cased-Letter:] Any-Upper\n" " [:Control:] Any-Remove\n" " [:Decimal_Number:] Any-Remove\n" " [:Final_Punctuation:] Any-Remove\n" " [:Georgian:] Any-Upper\n" " [:Katakana:] Any-Remove\n" " [:Arabic:] Any-Remove\n" " [:Punctuation:] Remove\n" " [[:Punctuation:]-[.,]] Remove\n" " [:Line_Separator:] Any-Remove\n" " [:Math_Symbol:] Any-Remove\n" " Lower; [:^Letter:] Remove (word tokenization)\n" " [:^Number:] Remove (numeric tokenization)\n" " [:^Katagana:] Remove (remove everything except Katagana)\n" " Lower;[[:WhiteSpace:][:Punctuation:]] Remove (word tokenization)\n" " NFD; [:Nonspacing Mark:] Remove; NFC (removes accents from characters)\n" " [A-Za-z]; Lower(); Latin-Katakana; Katakana-Hiragana (transforms latin and katagana to hiragana)\n" " [[:separator:][:start punctuation:][:initial punctuation:]] Remove \n" "\n" "see http://userguide.icu-project.org/transforms/general\n" " http://www.unicode.org/reports/tr44/\n" ); fprintf(p_config->outfile, "\n\n"); } } static void print_icu_xml_locales(const struct config_t *p_config) { int32_t count; int32_t i; UErrorCode status = U_ZERO_ERROR; UChar keyword[64]; int32_t keyword_len = 0; char keyword_str[128]; int32_t keyword_str_len = 0; UChar language[64]; int32_t language_len = 0; char lang_str[128]; int32_t lang_str_len = 0; UChar script[64]; int32_t script_len = 0; char script_str[128]; int32_t script_str_len = 0; UChar location[64]; int32_t location_len = 0; char location_str[128]; int32_t location_str_len = 0; UChar variant[64]; int32_t variant_len = 0; char variant_str[128]; int32_t variant_str_len = 0; UChar name[64]; int32_t name_len = 0; char name_str[128]; int32_t name_str_len = 0; UChar localname[64]; int32_t localname_len = 0; char localname_str[128]; int32_t localname_str_len = 0; count = uloc_countAvailable() ; if (p_config->xmloutput) { fprintf(p_config->outfile, "\n", count, uloc_getDefault(), ucol_countAvailable()); } else { fprintf(p_config->outfile, "Available ICU locales: %d\n", count); fprintf(p_config->outfile, "Default locale is: %s\n", uloc_getDefault()); } for (i = 0; i < count; i++) { keyword_len = uloc_getDisplayKeyword(uloc_getAvailable(i), "en", keyword, 64, &status); u_strToUTF8(keyword_str, 128, &keyword_str_len, keyword, keyword_len, &status); language_len = uloc_getDisplayLanguage(uloc_getAvailable(i), "en", language, 64, &status); u_strToUTF8(lang_str, 128, &lang_str_len, language, language_len, &status); script_len = uloc_getDisplayScript(uloc_getAvailable(i), "en", script, 64, &status); u_strToUTF8(script_str, 128, &script_str_len, script, script_len, &status); location_len = uloc_getDisplayCountry(uloc_getAvailable(i), "en", location, 64, &status); u_strToUTF8(location_str, 128, &location_str_len, location, location_len, &status); variant_len = uloc_getDisplayVariant(uloc_getAvailable(i), "en", variant, 64, &status); u_strToUTF8(variant_str, 128, &variant_str_len, variant, variant_len, &status); name_len = uloc_getDisplayName(uloc_getAvailable(i), "en", name, 64, &status); u_strToUTF8(name_str, 128, &name_str_len, name, name_len, &status); localname_len = uloc_getDisplayName(uloc_getAvailable(i), uloc_getAvailable(i), localname, 64, &status); u_strToUTF8(localname_str, 128, &localname_str_len, localname, localname_len, &status); if (p_config->xmloutput) { fprintf(p_config->outfile, "outfile, " language=\"%s\"", lang_str); if (strlen(script_str)) fprintf(p_config->outfile, " script=\"%s\"", script_str); if (strlen(location_str)) fprintf(p_config->outfile, " location=\"%s\"", location_str); if (strlen(variant_str)) fprintf(p_config->outfile, " variant=\"%s\"", variant_str); if (strlen(name_str)) fprintf(p_config->outfile, " name=\"%s\"", name_str); if (strlen(localname_str)) fprintf(p_config->outfile, " localname=\"%s\"", localname_str); fprintf(p_config->outfile, ">"); if (strlen(localname_str)) fprintf(p_config->outfile, "%s", localname_str); fprintf(p_config->outfile, "\n"); } else if (1 == p_config->xmloutput) { fprintf(p_config->outfile, "%s", uloc_getAvailable(i)); fprintf(p_config->outfile, " | "); if (strlen(name_str)) fprintf(p_config->outfile, "%s", name_str); fprintf(p_config->outfile, " | "); if (strlen(localname_str)) fprintf(p_config->outfile, "%s", localname_str); fprintf(p_config->outfile, "\n"); } else fprintf(p_config->outfile, "%s\n", uloc_getAvailable(i)); } if (p_config->xmloutput) fprintf(p_config->outfile, "\n"); else fprintf(p_config->outfile, "\n"); if (U_FAILURE(status)) { fprintf(stderr, "ICU Error: %d %s\n", status, u_errorName(status)); exit(2); } } static void print_info(const struct config_t *p_config) { if (p_config->xmloutput) fprintf(p_config->outfile, "\n" "\n"); if ('c' == p_config->print[0]) print_icu_converters(p_config); else if ('l' == p_config->print[0]) print_icu_xml_locales(p_config); else if ('t' == p_config->print[0]) print_icu_transliterators(p_config); else { print_icu_converters(p_config); print_icu_xml_locales(p_config); print_icu_transliterators(p_config); } if (p_config->xmloutput) fprintf(p_config->outfile, "\n"); exit(0); } static void process_text_file(struct config_t *p_config) { char *line = 0; char linebuf[1024]; xmlDoc *doc = xmlParseFile(p_config->conffile); xmlNode *xml_node = xmlDocGetRootElement(doc); long unsigned int token_count = 0; long unsigned int line_count = 0; UErrorCode status = U_ZERO_ERROR; if (!xml_node) { printf("Could not parse XML config file '%s' \n", p_config->conffile); exit(1); } p_config->chain = icu_chain_xml_config(xml_node, 1, &status); if (!p_config->chain || !U_SUCCESS(status)) { printf("Could not set up ICU chain from config file '%s' \n", p_config->conffile); exit(1); } if (p_config->xmloutput) fprintf(p_config->outfile, "\n" "\n" "\n"); /* read input lines for processing */ while ((line=fgets(linebuf, sizeof(linebuf)-1, p_config->infile))) { WRBUF sw = wrbuf_alloc(); WRBUF cdata = wrbuf_alloc(); int success = icu_chain_assign_cstr(p_config->chain, line, &status); line_count++; while (success && icu_chain_next_token(p_config->chain, &status)) { if (U_FAILURE(status)) success = 0; else { size_t start, len; const char *org_string = 0; const char *sortkey = icu_chain_token_sortkey(p_config->chain); icu_chain_get_org_info2(p_config->chain, &start, &len, &org_string); wrbuf_rewind(sw); wrbuf_puts_escaped(sw, sortkey); token_count++; if (p_config->xmloutput) { fprintf(p_config->outfile, "chain)); fprintf(p_config->outfile, " norm=\"%s\"", wrbuf_cstr(cdata)); wrbuf_rewind(cdata); wrbuf_xmlputs(cdata, icu_chain_token_display(p_config->chain)); fprintf(p_config->outfile, " display=\"%s\"", wrbuf_cstr(cdata)); if (p_config->sortoutput) { wrbuf_rewind(cdata); wrbuf_xmlputs(cdata, wrbuf_cstr(sw)); fprintf(p_config->outfile, " sortkey=\"%s\"", wrbuf_cstr(cdata)); } fprintf(p_config->outfile, "/>\n"); } else { fprintf(p_config->outfile, "%lu %lu '%s' '%s'", token_count, line_count, icu_chain_token_norm(p_config->chain), icu_chain_token_display(p_config->chain)); if (p_config->sortoutput) { fprintf(p_config->outfile, " '%s'", wrbuf_cstr(sw)); } if (p_config->org_output) { fprintf(p_config->outfile, " %ld+%ld", (long) start, (long) len); fputc(' ', p_config->outfile); fwrite(org_string, 1, start, p_config->outfile); fputc('*', p_config->outfile); fwrite(org_string + start, 1, len, p_config->outfile); fputc('*', p_config->outfile); fputs(org_string + start + len, p_config->outfile); } fprintf(p_config->outfile, "\n"); } } } wrbuf_destroy(sw); wrbuf_destroy(cdata); } if (p_config->xmloutput) fprintf(p_config->outfile, "\n" "\n"); icu_chain_destroy(p_config->chain); xmlFreeDoc(doc); if (line) free(line); } #endif /* YAZ_HAVE_ICU */ int main(int argc, char **argv) { #if YAZ_HAVE_ICU struct config_t config; yaz_enable_panic_backtrace(*argv); read_params(argc, argv, &config); if (strlen(config.conffile)) process_text_file(&config); if (strlen(config.print)) print_info(&config); u_cleanup(); #else /* YAZ_HAVE_ICU */ printf("ICU not available on your system.\n" "Please install libicu-dev and icu-doc or similar, " "re-configure and re-compile\n"); exit(3); #endif /* YAZ_HAVE_ICU */ return 0; } /* * Local variables: * c-basic-offset: 4 * c-file-style: "Stroustrup" * indent-tabs-mode: nil * End: * vim: shiftwidth=4 tabstop=8 expandtab */ yaz-5.34.4/util/yaziconv.c0000664000175000017500000001173314631643521011072 /* This file is part of the YAZ toolkit. * Copyright (C) Index Data * See the file LICENSE for details. */ #if HAVE_CONFIG_H #include #endif #include #include #include #include #include #define CHUNK_IN 64 #define CHUNK_OUT 64 void write_out(const char *b0, const char *b1) { size_t sz = b1 - b0; if (sz) { if (fwrite(b0, 1, sz, stdout) != sz) { fprintf(stderr, "yaz-iconv: write failed\n"); exit(8); } } } void convert(FILE *inf, yaz_iconv_t cd, int verbose) { char inbuf0[CHUNK_IN], *inbuf = inbuf0; char outbuf0[CHUNK_OUT], *outbuf = outbuf0; size_t inbytesleft = CHUNK_IN; size_t outbytesleft = CHUNK_OUT; int mustread = 1; while (1) { size_t r; if (mustread) { r = fread(inbuf, 1, inbytesleft, inf); if (inbytesleft != r) { if (ferror(inf)) { fprintf(stderr, "yaz-iconv: error reading file\n"); exit(6); } if (r == 0) { write_out(outbuf0, outbuf); outbuf = outbuf0; outbytesleft = CHUNK_OUT; r = yaz_iconv(cd, 0, 0, &outbuf, &outbytesleft); write_out(outbuf0, outbuf); break; } inbytesleft = r; } } if (verbose > 1) { fprintf(stderr, "yaz_iconv: inbytesleft=%ld outbytesleft=%ld\n", (long) inbytesleft, (long) outbytesleft); } r = yaz_iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); if (r == (size_t)(-1)) { int e = yaz_iconv_error(cd); if (e == YAZ_ICONV_EILSEQ) { fprintf(stderr, "invalid sequence\n"); return ; } else if (e == YAZ_ICONV_EINVAL) /* incomplete input */ { size_t i; for (i = 0; i&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = yaz-marcdump$(EXEEXT) yaz-iconv$(EXEEXT) \ yaz-illclient$(EXEEXT) yaz-icu$(EXEEXT) \ yaz-json-parse$(EXEEXT) yaz-url$(EXEEXT) \ yaz-record-conv$(EXEEXT) noinst_PROGRAMS = cclsh$(EXEEXT) cql2pqf$(EXEEXT) cql2xcql$(EXEEXT) \ srwtst$(EXEEXT) yaz-benchmark$(EXEEXT) yaz-xmlquery$(EXEEXT) subdir = util ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_icu.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/yaz.m4 $(top_srcdir)/m4/yaz_libxml2.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS) am_cclsh_OBJECTS = cclsh.$(OBJEXT) cclsh_OBJECTS = $(am_cclsh_OBJECTS) am__DEPENDENCIES_1 = cclsh_DEPENDENCIES = ../src/libyaz.la $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_cql2pqf_OBJECTS = cql2pqf.$(OBJEXT) cql2pqf_OBJECTS = $(am_cql2pqf_OBJECTS) cql2pqf_DEPENDENCIES = ../src/libyaz.la am_cql2xcql_OBJECTS = cql2xcql.$(OBJEXT) cql2xcql_OBJECTS = $(am_cql2xcql_OBJECTS) cql2xcql_DEPENDENCIES = ../src/libyaz.la am_srwtst_OBJECTS = srwtst.$(OBJEXT) srwtst_OBJECTS = $(am_srwtst_OBJECTS) srwtst_DEPENDENCIES = ../src/libyaz.la am_yaz_benchmark_OBJECTS = benchmark.$(OBJEXT) yaz_benchmark_OBJECTS = $(am_yaz_benchmark_OBJECTS) yaz_benchmark_DEPENDENCIES = ../src/libyaz.la am_yaz_iconv_OBJECTS = yaziconv.$(OBJEXT) yaz_iconv_OBJECTS = $(am_yaz_iconv_OBJECTS) yaz_iconv_DEPENDENCIES = ../src/libyaz.la am_yaz_icu_OBJECTS = yaz-icu.$(OBJEXT) yaz_icu_OBJECTS = $(am_yaz_icu_OBJECTS) yaz_icu_DEPENDENCIES = ../src/libyaz_icu.la ../src/libyaz.la \ $(am__DEPENDENCIES_1) am_yaz_illclient_OBJECTS = yaz-illclient.$(OBJEXT) yaz_illclient_OBJECTS = $(am_yaz_illclient_OBJECTS) yaz_illclient_DEPENDENCIES = ../src/libyaz.la am_yaz_json_parse_OBJECTS = json-parse.$(OBJEXT) yaz_json_parse_OBJECTS = $(am_yaz_json_parse_OBJECTS) yaz_json_parse_DEPENDENCIES = ../src/libyaz.la am_yaz_marcdump_OBJECTS = marcdump.$(OBJEXT) yaz_marcdump_OBJECTS = $(am_yaz_marcdump_OBJECTS) yaz_marcdump_DEPENDENCIES = ../src/libyaz.la am_yaz_record_conv_OBJECTS = yaz-record-conv.$(OBJEXT) yaz_record_conv_OBJECTS = $(am_yaz_record_conv_OBJECTS) yaz_record_conv_DEPENDENCIES = ../src/libyaz.la am_yaz_url_OBJECTS = yaz-url.$(OBJEXT) yaz_url_OBJECTS = $(am_yaz_url_OBJECTS) yaz_url_DEPENDENCIES = ../src/libyaz.la am_yaz_xmlquery_OBJECTS = yaz-xmlquery.$(OBJEXT) yaz_xmlquery_OBJECTS = $(am_yaz_xmlquery_OBJECTS) yaz_xmlquery_DEPENDENCIES = ../src/libyaz.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/benchmark.Po ./$(DEPDIR)/cclsh.Po \ ./$(DEPDIR)/cql2pqf.Po ./$(DEPDIR)/cql2xcql.Po \ ./$(DEPDIR)/json-parse.Po ./$(DEPDIR)/marcdump.Po \ ./$(DEPDIR)/srwtst.Po ./$(DEPDIR)/yaz-icu.Po \ ./$(DEPDIR)/yaz-illclient.Po ./$(DEPDIR)/yaz-record-conv.Po \ ./$(DEPDIR)/yaz-url.Po ./$(DEPDIR)/yaz-xmlquery.Po \ ./$(DEPDIR)/yaziconv.Po am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(cclsh_SOURCES) $(cql2pqf_SOURCES) $(cql2xcql_SOURCES) \ $(srwtst_SOURCES) $(yaz_benchmark_SOURCES) \ $(yaz_iconv_SOURCES) $(yaz_icu_SOURCES) \ $(yaz_illclient_SOURCES) $(yaz_json_parse_SOURCES) \ $(yaz_marcdump_SOURCES) $(yaz_record_conv_SOURCES) \ $(yaz_url_SOURCES) $(yaz_xmlquery_SOURCES) DIST_SOURCES = $(cclsh_SOURCES) $(cql2pqf_SOURCES) $(cql2xcql_SOURCES) \ $(srwtst_SOURCES) $(yaz_benchmark_SOURCES) \ $(yaz_iconv_SOURCES) $(yaz_icu_SOURCES) \ $(yaz_illclient_SOURCES) $(yaz_json_parse_SOURCES) \ $(yaz_marcdump_SOURCES) $(yaz_record_conv_SOURCES) \ $(yaz_url_SOURCES) $(yaz_xmlquery_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HIREDIS_LIBS = @HIREDIS_LIBS@ HTML_COMPILE = @HTML_COMPILE@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_CONFIG = @ICU_CONFIG@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ MEMCACHED_LIBS = @MEMCACHED_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ TCLSH = @TCLSH@ TCPD_LIBS = @TCPD_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YACC = @YACC@ YAZ_CONFIG_CFLAGS = @YAZ_CONFIG_CFLAGS@ YAZ_CONF_CFLAGS = @YAZ_CONF_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigpath = @pkgconfigpath@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = yaz-icu-example.xml AM_CPPFLAGS = -I$(top_srcdir)/src $(XML2_CFLAGS) $(ICU_CPPFLAGS) # MARC dumper utility yaz_marcdump_SOURCES = marcdump.c yaz_marcdump_LDADD = ../src/libyaz.la # YAZ Iconv utility yaz_iconv_SOURCES = yaziconv.c yaz_iconv_LDADD = ../src/libyaz.la srwtst_SOURCES = srwtst.c srwtst_LDADD = ../src/libyaz.la cclsh_SOURCES = cclsh.c cclsh_LDADD = ../src/libyaz.la $(READLINE_LIBS) cql2pqf_SOURCES = cql2pqf.c cql2pqf_LDADD = ../src/libyaz.la cql2xcql_SOURCES = cql2xcql.c cql2xcql_LDADD = ../src/libyaz.la yaz_benchmark_SOURCES = benchmark.c yaz_benchmark_LDADD = ../src/libyaz.la yaz_xmlquery_SOURCES = yaz-xmlquery.c yaz_xmlquery_LDADD = ../src/libyaz.la yaz_illclient_SOURCES = yaz-illclient.c yaz_illclient_LDADD = ../src/libyaz.la yaz_icu_SOURCES = yaz-icu.c yaz_icu_LDADD = ../src/libyaz_icu.la ../src/libyaz.la $(ICU_LIBS) yaz_json_parse_SOURCES = json-parse.c yaz_json_parse_LDADD = ../src/libyaz.la yaz_record_conv_SOURCES = yaz-record-conv.c yaz_record_conv_LDADD = ../src/libyaz.la yaz_url_SOURCES = yaz-url.c yaz_url_LDADD = ../src/libyaz.la all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu util/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ || test -f $$p1 \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list cclsh$(EXEEXT): $(cclsh_OBJECTS) $(cclsh_DEPENDENCIES) $(EXTRA_cclsh_DEPENDENCIES) @rm -f cclsh$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cclsh_OBJECTS) $(cclsh_LDADD) $(LIBS) cql2pqf$(EXEEXT): $(cql2pqf_OBJECTS) $(cql2pqf_DEPENDENCIES) $(EXTRA_cql2pqf_DEPENDENCIES) @rm -f cql2pqf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cql2pqf_OBJECTS) $(cql2pqf_LDADD) $(LIBS) cql2xcql$(EXEEXT): $(cql2xcql_OBJECTS) $(cql2xcql_DEPENDENCIES) $(EXTRA_cql2xcql_DEPENDENCIES) @rm -f cql2xcql$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cql2xcql_OBJECTS) $(cql2xcql_LDADD) $(LIBS) srwtst$(EXEEXT): $(srwtst_OBJECTS) $(srwtst_DEPENDENCIES) $(EXTRA_srwtst_DEPENDENCIES) @rm -f srwtst$(EXEEXT) $(AM_V_CCLD)$(LINK) $(srwtst_OBJECTS) $(srwtst_LDADD) $(LIBS) yaz-benchmark$(EXEEXT): $(yaz_benchmark_OBJECTS) $(yaz_benchmark_DEPENDENCIES) $(EXTRA_yaz_benchmark_DEPENDENCIES) @rm -f yaz-benchmark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_benchmark_OBJECTS) $(yaz_benchmark_LDADD) $(LIBS) yaz-iconv$(EXEEXT): $(yaz_iconv_OBJECTS) $(yaz_iconv_DEPENDENCIES) $(EXTRA_yaz_iconv_DEPENDENCIES) @rm -f yaz-iconv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_iconv_OBJECTS) $(yaz_iconv_LDADD) $(LIBS) yaz-icu$(EXEEXT): $(yaz_icu_OBJECTS) $(yaz_icu_DEPENDENCIES) $(EXTRA_yaz_icu_DEPENDENCIES) @rm -f yaz-icu$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_icu_OBJECTS) $(yaz_icu_LDADD) $(LIBS) yaz-illclient$(EXEEXT): $(yaz_illclient_OBJECTS) $(yaz_illclient_DEPENDENCIES) $(EXTRA_yaz_illclient_DEPENDENCIES) @rm -f yaz-illclient$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_illclient_OBJECTS) $(yaz_illclient_LDADD) $(LIBS) yaz-json-parse$(EXEEXT): $(yaz_json_parse_OBJECTS) $(yaz_json_parse_DEPENDENCIES) $(EXTRA_yaz_json_parse_DEPENDENCIES) @rm -f yaz-json-parse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_json_parse_OBJECTS) $(yaz_json_parse_LDADD) $(LIBS) yaz-marcdump$(EXEEXT): $(yaz_marcdump_OBJECTS) $(yaz_marcdump_DEPENDENCIES) $(EXTRA_yaz_marcdump_DEPENDENCIES) @rm -f yaz-marcdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_marcdump_OBJECTS) $(yaz_marcdump_LDADD) $(LIBS) yaz-record-conv$(EXEEXT): $(yaz_record_conv_OBJECTS) $(yaz_record_conv_DEPENDENCIES) $(EXTRA_yaz_record_conv_DEPENDENCIES) @rm -f yaz-record-conv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_record_conv_OBJECTS) $(yaz_record_conv_LDADD) $(LIBS) yaz-url$(EXEEXT): $(yaz_url_OBJECTS) $(yaz_url_DEPENDENCIES) $(EXTRA_yaz_url_DEPENDENCIES) @rm -f yaz-url$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_url_OBJECTS) $(yaz_url_LDADD) $(LIBS) yaz-xmlquery$(EXEEXT): $(yaz_xmlquery_OBJECTS) $(yaz_xmlquery_DEPENDENCIES) $(EXTRA_yaz_xmlquery_DEPENDENCIES) @rm -f yaz-xmlquery$(EXEEXT) $(AM_V_CCLD)$(LINK) $(yaz_xmlquery_OBJECTS) $(yaz_xmlquery_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/benchmark.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cclsh.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cql2pqf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cql2xcql.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/json-parse.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/marcdump.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/srwtst.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaz-icu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaz-illclient.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaz-record-conv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaz-url.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaz-xmlquery.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yaziconv.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/benchmark.Po -rm -f ./$(DEPDIR)/cclsh.Po -rm -f ./$(DEPDIR)/cql2pqf.Po -rm -f ./$(DEPDIR)/cql2xcql.Po -rm -f ./$(DEPDIR)/json-parse.Po -rm -f ./$(DEPDIR)/marcdump.Po -rm -f ./$(DEPDIR)/srwtst.Po -rm -f ./$(DEPDIR)/yaz-icu.Po -rm -f ./$(DEPDIR)/yaz-illclient.Po -rm -f ./$(DEPDIR)/yaz-record-conv.Po -rm -f ./$(DEPDIR)/yaz-url.Po -rm -f ./$(DEPDIR)/yaz-xmlquery.Po -rm -f ./$(DEPDIR)/yaziconv.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f ./$(DEPDIR)/benchmark.Po -rm -f ./$(DEPDIR)/cclsh.Po -rm -f ./$(DEPDIR)/cql2pqf.Po -rm -f ./$(DEPDIR)/cql2xcql.Po -rm -f ./$(DEPDIR)/json-parse.Po -rm -f ./$(DEPDIR)/marcdump.Po -rm -f ./$(DEPDIR)/srwtst.Po -rm -f ./$(DEPDIR)/yaz-icu.Po -rm -f ./$(DEPDIR)/yaz-illclient.Po -rm -f ./$(DEPDIR)/yaz-record-conv.Po -rm -f ./$(DEPDIR)/yaz-url.Po -rm -f ./$(DEPDIR)/yaz-xmlquery.Po -rm -f ./$(DEPDIR)/yaziconv.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: yaz-5.34.4/config/0000775000175000017500000000000014754707604007440 5yaz-5.34.4/config/test-driver0000755000175000017500000001141714556763366011567 #! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2018-03-07.03; # UTC # Copyright (C) 2011-2021 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <"$log_file" "$@" >>"$log_file" 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then tweaked_estatus=1 else tweaked_estatus=$estatus fi case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report the test outcome and exit status in the logs, so that one can # know whether the test passed or failed simply by looking at the '.log' # file, without the need of also peaking into the corresponding '.trs' # file (automake bug#11814). echo "$res $test_name (exit status: $estatus)" >>"$log_file" # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/ylwrap0000755000175000017500000001531414556763366010635 #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/ltmain.sh0000755000175000017500000121237514605013133011172 #! /usr/bin/env sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2019-02-19.15 # libtool (GNU libtool) 2.4.7 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2019, 2021-2022 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.7 Debian-2.4.7-7build1" package_revision=2.4.7 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2019-02-19.15; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2004-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # These NLS vars are set unconditionally (bootstrap issue #24). Unset those # in case the environment reset is needed later and the $save_* variant is not # defined (see the code above). LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # func_unset VAR # -------------- # Portably unset VAR. # In some shells, an 'unset VAR' statement leaves a non-zero return # status if VAR is already unset, which might be problematic if the # statement is used at the end of a function (thus poisoning its return # value) or when 'set -e' is active (causing even a spurious abort of # the script in this case). func_unset () { { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; } } # Make sure CDPATH doesn't cause `cd` commands to output the target dir. func_unset CDPATH # Make sure ${,E,F}GREP behave sanely. func_unset GREP_OPTIONS ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin" rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin" GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" # require_check_ifs_backslash # --------------------------- # Check if we can use backslash as IFS='\' separator, and set # $check_ifs_backshlash_broken to ':' or 'false'. require_check_ifs_backslash=func_require_check_ifs_backslash func_require_check_ifs_backslash () { _G_save_IFS=$IFS IFS='\' _G_check_ifs_backshlash='a\\b' for _G_i in $_G_check_ifs_backshlash do case $_G_i in a) check_ifs_backshlash_broken=false ;; '') break ;; *) check_ifs_backshlash_broken=: break ;; esac done IFS=$_G_save_IFS require_check_ifs_backslash=: } ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. if test -z "$_G_HAVE_PLUSEQ_OP" && \ __PLUSEQ_TEST="a" && \ __PLUSEQ_TEST+=" b" 2>/dev/null && \ test "a b" = "$__PLUSEQ_TEST"; then _G_HAVE_PLUSEQ_OP=yes fi if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1+=\\ \$func_quote_arg_result" }' else func_append_quoted () { $debug_cmd func_quote_arg pretty "$2" eval "$1=\$$1\\ \$func_quote_arg_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_portable EVAL ARG # ---------------------------- # Internal function to portably implement func_quote_arg. Note that we still # keep attention to performance here so we as much as possible try to avoid # calling sed binary (so far O(N) complexity as long as func_append is O(1)). func_quote_portable () { $debug_cmd $require_check_ifs_backslash func_quote_portable_result=$2 # one-time-loop (easy break) while true do if $1; then func_quote_portable_result=`$ECHO "$2" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` break fi # Quote for eval. case $func_quote_portable_result in *[\\\`\"\$]*) # Fallback to sed for $func_check_bs_ifs_broken=:, or when the string # contains the shell wildcard characters. case $check_ifs_backshlash_broken$func_quote_portable_result in :*|*[\[\*\?]*) func_quote_portable_result=`$ECHO "$func_quote_portable_result" \ | $SED "$sed_quote_subst"` break ;; esac func_quote_portable_old_IFS=$IFS for _G_char in '\' '`' '"' '$' do # STATE($1) PREV($2) SEPARATOR($3) set start "" "" func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy IFS=$_G_char for _G_part in $func_quote_portable_result do case $1 in quote) func_append func_quote_portable_result "$3$2" set quote "$_G_part" "\\$_G_char" ;; start) set first "" "" func_quote_portable_result= ;; first) set quote "$_G_part" "" ;; esac done done IFS=$func_quote_portable_old_IFS ;; *) ;; esac break done func_quote_portable_unquoted_result=$func_quote_portable_result case $func_quote_portable_result in # double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # many bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_portable_result=\"$func_quote_portable_result\" ;; esac } # func_quotefast_eval ARG # ----------------------- # Quote one ARG (internal). This is equivalent to 'func_quote_arg eval ARG', # but optimized for speed. Result is stored in $func_quotefast_eval. if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then printf -v _GL_test_printf_tilde %q '~' if test '\~' = "$_GL_test_printf_tilde"; then func_quotefast_eval () { printf -v func_quotefast_eval_result %q "$1" } else # Broken older Bash implementations. Make those faster too if possible. func_quotefast_eval () { case $1 in '~'*) func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result ;; *) printf -v func_quotefast_eval_result %q "$1" ;; esac } fi else func_quotefast_eval () { func_quote_portable false "$1" func_quotefast_eval_result=$func_quote_portable_result } fi # func_quote_arg MODEs ARG # ------------------------ # Quote one ARG to be evaled later. MODEs argument may contain zero or more # specifiers listed below separated by ',' character. This function returns two # values: # i) func_quote_arg_result # double-quoted (when needed), suitable for a subsequent eval # ii) func_quote_arg_unquoted_result # has all characters that are still active within double # quotes backslashified. Available only if 'unquoted' is specified. # # Available modes: # ---------------- # 'eval' (default) # - escape shell special characters # 'expand' # - the same as 'eval'; but do not quote variable references # 'pretty' # - request aesthetic output, i.e. '"a b"' instead of 'a\ b'. This might # be used later in func_quote to get output like: 'echo "a b"' instead # of 'echo a\ b'. This is slower than default on some shells. # 'unquoted' # - produce also $func_quote_arg_unquoted_result which does not contain # wrapping double-quotes. # # Examples for 'func_quote_arg pretty,unquoted string': # # string | *_result | *_unquoted_result # ------------+-----------------------+------------------- # " | \" | \" # a b | "a b" | a b # "a b" | "\"a b\"" | \"a b\" # * | "*" | * # z="${x-$y}" | "z=\"\${x-\$y}\"" | z=\"\${x-\$y}\" # # Examples for 'func_quote_arg pretty,unquoted,expand string': # # string | *_result | *_unquoted_result # --------------+---------------------+-------------------- # z="${x-$y}" | "z=\"${x-$y}\"" | z=\"${x-$y}\" func_quote_arg () { _G_quote_expand=false case ,$1, in *,expand,*) _G_quote_expand=: ;; esac case ,$1, in *,pretty,*|*,expand,*|*,unquoted,*) func_quote_portable $_G_quote_expand "$2" func_quote_arg_result=$func_quote_portable_result func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result ;; *) # Faster quote-for-eval for some shells. func_quotefast_eval "$2" func_quote_arg_result=$func_quotefast_eval_result ;; esac } # func_quote MODEs ARGs... # ------------------------ # Quote all ARGs to be evaled later and join them into single command. See # func_quote_arg's description for more info. func_quote () { $debug_cmd _G_func_quote_mode=$1 ; shift func_quote_result= while test 0 -lt $#; do func_quote_arg "$_G_func_quote_mode" "$1" if test -n "$func_quote_result"; then func_append func_quote_result " $func_quote_arg_result" else func_append func_quote_result "$func_quote_arg_result" fi shift done } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_arg pretty,expand "$_G_cmd" eval "func_notquiet $func_quote_arg_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_arg expand,pretty "$_G_cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # This is free software. There is NO warranty; not even for # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Copyright (C) 2010-2019, 2021 Bootstrap Authors # # This file is dual licensed under the terms of the MIT license # , and GPL version 2 or later # . You must apply one of # these licenses when using or redistributing this software or any of # the files within it. See the URLs above, or the file `LICENSE` # included in the Bootstrap distribution for the full license texts. # Please report bugs or propose patches to: # # Set a version string for this script. scriptversion=2019-02-19.15; # UTC ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# Copyright'. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug in processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # in the main code. A hook is just a list of function names that can be # run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of hook functions to be called by # FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_propagate_result FUNC_NAME_A FUNC_NAME_B # --------------------------------------------- # If the *_result variable of FUNC_NAME_A _is set_, assign its value to # *_result variable of FUNC_NAME_B. func_propagate_result () { $debug_cmd func_propagate_result_result=: if eval "test \"\${${1}_result+set}\" = set" then eval "${2}_result=\$${1}_result" else func_propagate_result_result=false fi } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It's assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook functions." ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do func_unset "${_G_hook}_result" eval $_G_hook '${1+"$@"}' func_propagate_result $_G_hook func_run_hooks if $func_propagate_result_result; then eval set dummy "$func_run_hooks_result"; shift fi done } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list from your hook function. You may remove # or edit any options that you action, and then pass back the remaining # unprocessed options in '_result', escaped # suitably for 'eval'. # # The '_result' variable is automatically unset # before your hook gets called; for best performance, only set the # *_result variable when necessary (i.e. don't call the 'func_quote' # function unnecessarily because it can be an expensive operation on some # machines). # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). Leave # # my_options_prep_result variable intact. # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that, for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@" in case we need it later, # # if $args_changed was set to 'true'. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # # Only call 'func_quote' here if we processed at least one argument. # if $args_changed; then # func_quote eval ${1+"$@"} # my_silent_option_result=$func_quote_result # fi # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd func_run_hooks func_options ${1+"$@"} func_propagate_result func_run_hooks func_options_finish } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_options_quoted=false for my_func in options_prep parse_options validate_options options_finish do func_unset func_${my_func}_result func_unset func_run_hooks_result eval func_$my_func '${1+"$@"}' func_propagate_result func_$my_func func_options if $func_propagate_result_result; then eval set dummy "$func_options_result"; shift _G_options_quoted=: fi done $_G_options_quoted || { # As we (func_options) are top-level options-parser function and # nobody quoted "$@" for us yet, we need to do it explicitly for # caller. func_quote eval ${1+"$@"} func_options_result=$func_quote_result } } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} func_propagate_result func_run_hooks func_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd _G_parse_options_requote=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} func_propagate_result func_run_hooks func_parse_options if $func_propagate_result_result; then eval set dummy "$func_parse_options_result"; shift # Even though we may have changed "$@", we passed the "$@" array # down into the hook and it quoted it for us (because we are in # this if-branch). No need to quote it again. _G_parse_options_requote=false fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break # We expect that one of the options parsed in this function matches # and thus we remove _G_opt from "$@" and need to re-quote. _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" >&2 $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_parse_options_requote=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_parse_options_requote=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac if $_G_match_parse_options; then _G_parse_options_requote=: fi done if $_G_parse_options_requote; then # save modified positional parameters for caller func_quote eval ${1+"$@"} func_parse_options_result=$func_quote_result fi } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} func_propagate_result func_run_hooks func_validate_options # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables # after splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} if test "x$func_split_equals_lhs" = "x$1"; then func_split_equals_rhs= fi }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs=" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x\(-.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. # The version message is extracted from the calling file's header # comments, with leading '# ' stripped: # 1. First display the progname and version # 2. Followed by the header comment line matching /^# Written by / # 3. Then a blank line followed by the first following line matching # /^# Copyright / # 4. Immediately followed by any lines between the previous matches, # except lines preceding the intervening completely blank line. # For example, see the header comments of this file. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /^# Written by /!b s|^# ||; p; n :fwd2blnk /./ { n b fwd2blnk } p; n :holdwrnt s|^# || s|^# *$|| /^Copyright /!{ /./H n b holdwrnt } s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| G s|\(\n\)\n*|\1|g p; q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.7' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.7-7build1 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote eval ${1+"$@"} libtool_options_prep_result=$func_quote_result fi } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote eval ${1+"$@"} libtool_parse_options_result=$func_quote_result fi } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote eval ${1+"$@"} libtool_validate_options_result=$func_quote_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_arg pretty "$libobj" test "X$libobj" != "X$func_quote_arg_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_arg pretty "$srcfile" qsrcfile=$func_quote_arg_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG -Xcompiler FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wa,FLAG -Xassembler FLAG pass linker-specific FLAG directly to the assembler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_arg pretty "$nonopt" install_prog="$func_quote_arg_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_arg pretty "$arg" func_append install_prog "$func_quote_arg_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_arg pretty "$arg" func_append install_prog " $func_quote_arg_result" if test -n "$arg2"; then func_quote_arg pretty "$arg2" fi func_append install_shared_prog " $func_quote_arg_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_arg pretty "$install_override_mode" func_append install_shared_prog " -m $func_quote_arg_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_arg expand,pretty "$relink_command" eval "func_echo $func_quote_arg_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" func_quote_arg pretty "$ECHO" qECHO=$func_quote_arg_result $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=$qECHO fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_arg pretty,unquoted "$arg" qarg=$func_quote_arg_unquoted_result func_append libtool_args " $func_quote_arg_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xassembler) func_append compiler_flags " -Xassembler $qarg" prev= func_append compile_command " -Xassembler $qarg" func_append finalize_command " -Xassembler $qarg" continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig* | *-*-midnightbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; # Solaris ld rejects as of 11.4. Refer to Oracle bug 22985199. -pthread) case $host in *solaris2*) ;; *) case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac ;; esac continue ;; -mt|-mthreads|-kthread|-Kthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $func_quote_arg_result" func_append compiler_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_arg pretty "$flag" func_append arg " $wl$func_quote_arg_result" func_append compiler_flags " $wl$func_quote_arg_result" func_append linker_flags " $func_quote_arg_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xassembler) prev=xassembler continue ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -static-* direct GCC to link specific libraries statically # -fcilkplus Cilk Plus language extension features for C/C++ # -Wa,* Pass flags directly to the assembler -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus|-Wa,*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_arg pretty "$arg" arg=$func_quote_arg_result fi ;; # Some other compiler flag. -* | +*) func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_arg pretty "$arg" arg=$func_quote_arg_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | $SED 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|midnightbsd-elf|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf | midnightbsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-midnightbsd*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_arg expand,pretty "$cmd" eval "func_echo $func_quote_arg_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty "$var_value" relink_command="$var=$func_quote_arg_result; export $var; $relink_command" fi done func_quote eval cd "`pwd`" func_quote_arg pretty,unquoted "($func_quote_result; $relink_command)" relink_command=$func_quote_arg_unquoted_result fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_arg pretty,unquoted "$var_value" relink_command="$var=$func_quote_arg_unquoted_result; export $var; $relink_command" fi done # Quote the link command for shipping. func_quote eval cd "`pwd`" relink_command="($func_quote_result; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" func_quote_arg pretty,unquoted "$relink_command" relink_command=$func_quote_arg_unquoted_result if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: yaz-5.34.4/config/depcomp0000755000175000017500000005602014556763366010745 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/compile0000755000175000017500000001635014556763366010750 #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2021 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN* | MSYS*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/config.guess0000755000175000017500000014051214175772605011701 #! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c89 c99 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_X32 >/dev/null then LIBCABI=${LIBC}x32 fi fi GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; x86_64:Haiku:*:*) GUESS=x86_64-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: yaz-5.34.4/config/install-sh0000755000175000017500000003577614556763366011413 #!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/missing0000755000175000017500000001533614556763366010774 #! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2021 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: yaz-5.34.4/config/config.sub0000755000175000017500000010511614175772605011345 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x$basic_os != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 exit 1 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS is always fine. ;; *-*) echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: yaz-5.34.4/win/0000775000175000017500000000000014754707607006773 5yaz-5.34.4/win/version.nsi0000664000175000017500000000003214754707607011106 !define VERSION "5.34.4" yaz-5.34.4/win/makefile0000664000175000017500000006455114754707607010426 # This file is part of the YAZ toolkit. # Copyright (C) Index Data # Parameters DEBUG=0 # 0 for release, 1 for debug BARCH = 32 # 32=win32/x86 or 64=x64 # TCL TCL=tclsh #TCL="C:\Tcl\bin\tclsh85.exe" HAVE_TCL=1 # iconv charcter conversion utility HAVE_ICONV=0 ICONV_DIR = c:\iconv-1.9.2.win$(BARCH) # icu charcter conversion utility # get icu libraries from http://www.icu-project.org HAVE_ICU=1 ICU_VER=68 ICU_BASE = c:\icu4c-$(ICU_VER)_2-Win$(BARCH)-MSVC2019 !if $(BARCH) == 32 ICU_LIB = $(ICU_BASE)\lib ICU_BIN = $(ICU_BASE)\bin !elseif $(BARCH) == 64 ICU_LIB = $(ICU_BASE)\lib64 ICU_BIN = $(ICU_BASE)\bin64 !else !error BARCH must be 32 or 64 !endif ICU_INCLUDE = $(ICU_BASE)\include # libxslt HAVE_LIBXSLT=1 LIBXSLT_DIR=c:\libxslt-1.1.28.win$(BARCH) # libxml2 HAVE_LIBXML2=1 LIBXML2_DIR=c:\libxml2-2.9.2.win$(BARCH) # get WIN32 binaries libxml2 & iconv & zlib from here: # http://www.zlatkovic.com/libxml.en.html # bison HAVE_BISON=1 BISON=bison default: all all: dirs generate dll client ztest yazicu zoomsh utilprog \ testprog iconv icu libxml2 libxslt yaz_url NSIS="c:\program files (x86)\nsis\makensis.exe" HHC="c:\program files (x86)\html help workshop\hhc.exe" YAZ4J_DIR="..\..\yaz4j" YAZPATH=$(MAKEDIR)\.. dist: yaz.nsi version.nsi distclean nmake DEBUG=0 all nmake nsis dist64: yaz.nsi version.nsi distclean nmake make64 yaz4j nmake nsis64 make64: nmake DEBUG=0 BARCH=64 all distclean: nmake DEBUG=1 clean nmake DEBUG=0 clean nsis: version.nsi $(NSIS) /DVSARCH=x86 yaz.nsi nsis64: version.nsi $(NSIS) /DVSARCH=x64 yaz.nsi nsishelp: $(NSIS) # Directories # The current directory is supposed to be something like # ..../yaz/win, everything is relative to that ROOTDIR=.. # The home of yaz LIBDIR=$(ROOTDIR)\lib # We produce .lib, .exp etc there BINDIR=$(ROOTDIR)\bin # We produce exes and dlls there WINDIR=$(ROOTDIR)\win # all these Win make things SRCDIR=$(ROOTDIR)\src # for the case we move them under src INCLDIR=$(SRCDIR) # our includes DOCDIR=$(ROOTDIR)\doc # where the doc is JAVADIR=$(ROOTDIR)\java M4DIR=$(ROOTDIR)\m4 # where we store intermediate files !if $(DEBUG) OBJDIR=$(WINDIR)\dobj !else OBJDIR=$(WINDIR)\obj !endif CLIENTDIR=$(ROOTDIR)\CLIENT ZTESTDIR=$(ROOTDIR)\ZTEST ZOOMDIR=$(ROOTDIR)\ZOOM UTILDIR=$(ROOTDIR)\UTIL TESTDIR=$(ROOTDIR)\TEST # TMPDIR=$(ROOTDIR)\win\tmp # TMP=$(TMPDIR) # Targets - what to make !if $(DEBUG) YAZ_DLL=$(BINDIR)\yaz5d.dll YAZ_IMPLIB=$(LIBDIR)\yaz5d.lib YAZ_ICU_DLL=$(BINDIR)\yaz_icu5d.dll YAZ_ICU_IMPLIB=$(LIBDIR)\yaz_icu5d.lib YAZ_COND_DLL=$(BINDIR)\yaz_cond5d.dll YAZ_COND_IMPLIB=$(LIBDIR)\yaz_cond5d.lib !else YAZ_DLL=$(BINDIR)\yaz5.dll YAZ_IMPLIB=$(LIBDIR)\yaz5.lib YAZ_ICU_DLL=$(BINDIR)\yaz_icu5.dll YAZ_ICU_IMPLIB=$(LIBDIR)\yaz_icu5.lib YAZ_COND_DLL=$(BINDIR)\yaz_cond5.dll YAZ_COND_IMPLIB=$(LIBDIR)\yaz_cond5.lib !endif CLIENT=$(BINDIR)\yaz-client.exe YAZ_ICU=$(BINDIR)\yaz-icu.exe YAZ_URL=$(BINDIR)\yaz-url.exe ZOOMSH=$(BINDIR)\zoomsh.exe ZTEST=$(BINDIR)\yaz-ztest.exe ZOOMTST1=$(BINDIR)\zoomtst1.exe ZOOMTST2=$(BINDIR)\zoomtst2.exe ZOOMTST3=$(BINDIR)\zoomtst3.exe ZOOMTST4=$(BINDIR)\zoomtst4.exe ZOOMTST5=$(BINDIR)\zoomtst5.exe ZOOMTST6=$(BINDIR)\zoomtst6.exe ZOOMTST7=$(BINDIR)\zoomtst7.exe ZOOMTST8=$(BINDIR)\zoomtst8.exe ZOOMTST9=$(BINDIR)\zoomtst9.exe ZOOMTST10=$(BINDIR)\zoomtst10.exe CQL2PQF=$(BINDIR)\cql2pqf.exe CQL2XCQL=$(BINDIR)\cql2xcql.exe YAZ_MARCDUMP=$(BINDIR)\yaz-marcdump.exe YAZ_ICONV=$(BINDIR)\yaz-iconv.exe YAZ_RECORD_CONV=$(BINDIR)\yaz-record-conv.exe YAZ_JSON_PARSE=$(BINDIR)\yaz-json-parse.exe TSTLOG=$(BINDIR)\test_log.exe TST_TIMING=$(BINDIR)\test_timing.exe TEST_MUTEX=$(BINDIR)\test_mutex.exe # shortcut names defined here dll: dirs generate $(YAZ_DLL) $(YAZ_COND_DLL) client: dirs generate $(CLIENT) ztest: dirs generate $(ZTEST) zoomsh: $(ZOOMSH) $(ZOOMTST1) $(ZOOMTST2) $(ZOOMTST3) \ $(ZOOMTST4) $(ZOOMTST5) $(ZOOMTST6) $(ZOOMTST7) $(ZOOMTST8) $(ZOOMTST9) \ $(ZOOMTST10) yaz_url: $(YAZ_URL) utilprog: $(CQL2PQF) $(CQL2XCQL) $(YAZ_MARCDUMP) $(YAZ_ICONV) $(YAZ_RECORD_CONV) $(YAZ_JSON_PARSE) testprog: $(TSTLOG) $(TST_TIMING) $(TEST_MUTEX) htmlhelp: $(DOCDIR)\htmlhelp.chm # Modules and conditional flags, etc !if $(HAVE_ICONV) ICONV_DEF= \ /D HAVE_ICONV_H=1 \ /I"$(ICONV_DIR)\include" ICONV_LIB= \ "$(ICONV_DIR)\lib\iconv.lib" iconv: $(BINDIR)\iconv.dll $(BINDIR)\iconv.dll: copy "$(ICONV_DIR)\bin\iconv.dll" $(BINDIR) !else ICONV_DEF= \ /D HAVE_ICONV_H=0 ICONV_LIB= iconv: !endif !if $(HAVE_ICU) ICU_DEF= \ /D YAZ_HAVE_ICU=1 /D HAVE_ICU_H=1 /I"$(ICU_INCLUDE)" ICU_LIBS= \ $(ICU_LIB)\icudt.lib $(ICU_LIB)\icuin.lib $(ICU_LIB)\icuuc.lib icu: $(BINDIR)\icudt$(ICU_VER).dll $(BINDIR)\icuin$(ICU_VER).dll $(BINDIR)\icuuc$(ICU_VER).dll yazicu: dirs generate $(YAZ_ICU) $(BINDIR)\icudt$(ICU_VER).dll: copy "$(ICU_BIN)\icudt$(ICU_VER).dll" $(BINDIR) $(BINDIR)\icuin$(ICU_VER).dll: copy "$(ICU_BIN)\icuin$(ICU_VER).dll" $(BINDIR) $(BINDIR)\icuuc$(ICU_VER).dll: copy "$(ICU_BIN)\icuuc$(ICU_VER).dll" $(BINDIR) !else ICU_DEF= /D YAZ_HAVE_ICU=0 ICU_LIBS= icu: yazicu: !endif ### !if $(HAVE_LIBXML2) LIBXML2_LIB="$(LIBXML2_DIR)\lib\libxml2.lib" LIBXML2_DEF=/D YAZ_HAVE_XML2=1 /I"$(LIBXML2_DIR)\include\libxml2" libxml2: $(BINDIR)\libxml2.dll $(BINDIR)\libxml2.dll: copy "$(LIBXML2_DIR)\bin\libxml2.dll" $(BINDIR) !else LIBXML2_LIB= LIBXML2_DEF=/D YAZ_HAVE_XML2=0 libxml2: !endif !if $(HAVE_LIBXSLT) LIBXSLT_LIB="$(LIBXSLT_DIR)\lib\libxslt.lib" LIBXSLT_DEF= \ /D HAVE_XSLTSAVERESULTTOSTRING=1 \ /D YAZ_HAVE_XSLT=1 \ /I"$(LIBXSLT_DIR)\include" libxslt: $(BINDIR)\libxslt.dll $(BINDIR)\libxslt.dll: copy "$(LIBXSLT_DIR)\lib\libxslt.dll" $(BINDIR) !else LIBXSLT_LIB= LIBXSLT_DEF=/D YAZ_HAVE_XSLT=0 libxslt: !endif ### C and CPP compiler (the same thing) # Note: $(CPP) has already been defined in the environment # (if you set things up right!) COMMON_C_OPTIONS= \ /nologo /W3 /EHsc /FD /c \ $(ICONV_DEF) \ $(ICU_DEF) \ $(LIBXML2_DEF) \ $(LIBXSLT_DEF) \ /D "_CRT_SECURE_NO_DEPRECATE" \ /D "_CRT_NONSTDC_NO_DEPRECATE" \ /D "_WINDOWS" \ /D "WIN32" \ /FR"$(OBJDIR)\\" \ /Fo"$(OBJDIR)\\" \ /Fd"$(OBJDIR)\\" COMMON_C_INCLUDES= \ /I"$(INCLDIR)" \ /I"$(SRCDIR)\libstemmer_c\include" DEBUG_C_OPTIONS= \ /D "_DEBUG" \ /MDd /Od /Zi /Gm RELEASE_C_OPTIONS= \ /D "NDEBUG" \ /MD /O2 MVN_ARGS=-Dyaz.path="$(YAZPATH)" -Dyaz.include="$(YAZPATH)\src" # without >log below, mvn install does NOT work yaz4j: $(JAVADIR) cd $(YAZ4J_DIR) cmd /C mvn $(MVN_ARGS) clean package copy /Y target\native\yaz4j*.dll "$(MAKEDIR)\..\bin" copy /Y target\yaz4j*.jar "$(MAKEDIR)\..\java" ### Linker options LINK=link.exe LINK_LIBS= kernel32.lib ws2_32.lib advapi32.lib \ $(ICONV_LIB) $(LIBXML2_LIB) $(LIBXSLT_LIB) COMMON_LNK_OPTIONS= /nologo /subsystem:windows /incremental:no DEBUG_LNK_OPTIONS= /debug RELEASE_LNK_OPTIONS= DLL_LINK_OPTIONS= /dll CLIENT_LINK_OPTIONS = /subsystem:console COMMON_TCL_OPTIONS= yaz-asncomp -I$(INCLDIR) -i yaz # Final opt variables !if $(DEBUG) COPT= $(COMMON_C_OPTIONS) $(DEBUG_C_OPTIONS) $(COMMON_C_INCLUDES) LNKOPT= $(COMMON_LNK_OPTIONS) $(DEBUG_LNK_OPTIONS) $(LNK_LIBS) TCLOPT= $(COMMON_TCL_OPTIONS) !else COPT= $(COMMON_C_OPTIONS) $(RELEASE_C_OPTIONS) $(COMMON_C_INCLUDES) LNKOPT= $(COMMON_LNK_OPTIONS) $(RELEASE_LNK_OPTIONS) $(LNK_LIBS) TCLOPT= $(COMMON_TCL_OPTIONS) !endif LINK_PROGRAM = $(LINK) $(LNKOPT) \ $(CLIENT_LINK_OPTIONS) $(LINK_LIBS) $(YAZ_IMPLIB) LINK_DLL = $(LINK) $(LNKOPT) \ $(LINK_LIBS) $(DLL_LINK_OPTIONS) # Source and object modules # Note: Ordinary source files are not specified here at # all, make finds them in suitable dirs. The object modules # need to be specified, though YAZ_CLIENT_OBJS= \ $(OBJDIR)\client.obj \ $(OBJDIR)\tabcomplete.obj \ $(OBJDIR)\admin.obj \ $(OBJDIR)\fhistory.obj YAZ_ICU_OBJS= $(OBJDIR)\yaz-icu.obj YAZ_URL_OBJS= $(OBJDIR)\yaz-url.obj COND_DLL_OBJS= $(OBJDIR)\condvar.obj ZTEST_OBJS= \ $(OBJDIR)\dummy-opac.obj \ $(OBJDIR)\read-marc.obj \ $(OBJDIR)\read-grs.obj \ $(OBJDIR)\ztest.obj YAZ_ZOOMSH_OBJS = \ $(OBJDIR)\zoomsh.obj YAZ_ZOOMTST1_OBJS = \ $(OBJDIR)\zoomtst1.obj YAZ_ZOOMTST2_OBJS = \ $(OBJDIR)\zoomtst2.obj YAZ_ZOOMTST3_OBJS = \ $(OBJDIR)\zoomtst3.obj YAZ_ZOOMTST4_OBJS = \ $(OBJDIR)\zoomtst4.obj YAZ_ZOOMTST5_OBJS = \ $(OBJDIR)\zoomtst5.obj YAZ_ZOOMTST6_OBJS = \ $(OBJDIR)\zoomtst6.obj YAZ_ZOOMTST7_OBJS = \ $(OBJDIR)\zoomtst7.obj YAZ_ZOOMTST8_OBJS = \ $(OBJDIR)\zoomtst8.obj YAZ_ZOOMTST9_OBJS = \ $(OBJDIR)\zoomtst9.obj YAZ_ZOOMTST10_OBJS = \ $(OBJDIR)\zoomtst10.obj YAZ_CQL2PQF_OBJS = \ $(OBJDIR)\cql2pqf.obj YAZ_CQL2XCQL_OBJS = \ $(OBJDIR)\cql2xcql.obj YAZ_MARCDUMP_OBJS = \ $(OBJDIR)\marcdump.obj YAZ_ICONV_OBJS = \ $(OBJDIR)\yaziconv.obj YAZ_RECORD_CONV_OBJS = \ $(OBJDIR)\yaz-record-conv.obj YAZ_JSON_PARSE_OBJS = \ $(OBJDIR)\json-parse.obj TSTLOG_OBJS = \ $(OBJDIR)\test_log.obj TST_TIMING_OBJS = \ $(OBJDIR)\test_timing.obj TEST_MUTEX_OBJS = \ $(OBJDIR)\test_mutex.obj MISC_OBJS= \ $(OBJDIR)\diag_map.obj \ $(OBJDIR)\base64.obj \ $(OBJDIR)\version.obj \ $(OBJDIR)\oid_std.obj \ $(OBJDIR)\eventl.obj \ $(OBJDIR)\requestq.obj \ $(OBJDIR)\seshigh.obj \ $(OBJDIR)\statserv.obj \ $(OBJDIR)\tcpdchk.obj \ $(OBJDIR)\cclerrms.obj \ $(OBJDIR)\cclfind.obj \ $(OBJDIR)\cclptree.obj \ $(OBJDIR)\cclqfile.obj \ $(OBJDIR)\cclqual.obj \ $(OBJDIR)\cclstr.obj \ $(OBJDIR)\ccltoken.obj \ $(OBJDIR)\cclxmlconfig.obj \ $(OBJDIR)\ccl_stop_words.obj \ $(OBJDIR)\comstack.obj \ $(OBJDIR)\tcpip.obj \ $(OBJDIR)\ber_any.obj \ $(OBJDIR)\ber_bit.obj \ $(OBJDIR)\ber_bool.obj \ $(OBJDIR)\ber_int.obj \ $(OBJDIR)\ber_len.obj \ $(OBJDIR)\ber_null.obj \ $(OBJDIR)\ber_oct.obj \ $(OBJDIR)\ber_oid.obj \ $(OBJDIR)\ber_tag.obj \ $(OBJDIR)\dumpber.obj \ $(OBJDIR)\errno.obj \ $(OBJDIR)\odr.obj \ $(OBJDIR)\odr_any.obj \ $(OBJDIR)\odr_bit.obj \ $(OBJDIR)\odr_bool.obj \ $(OBJDIR)\odr_choice.obj \ $(OBJDIR)\odr_cons.obj \ $(OBJDIR)\odr_enum.obj \ $(OBJDIR)\odr_int.obj \ $(OBJDIR)\odr_mem.obj \ $(OBJDIR)\odr_null.obj \ $(OBJDIR)\odr_oct.obj \ $(OBJDIR)\odr_oid.obj \ $(OBJDIR)\odr_seq.obj \ $(OBJDIR)\odr_tag.obj \ $(OBJDIR)\odr_use.obj \ $(OBJDIR)\odr_util.obj \ $(OBJDIR)\atoin.obj \ $(OBJDIR)\log.obj \ $(OBJDIR)\malloc_info.obj \ $(OBJDIR)\marcdisp.obj \ $(OBJDIR)\marc_read_sax.obj \ $(OBJDIR)\marc_read_json.obj \ $(OBJDIR)\marc_read_xml.obj \ $(OBJDIR)\marc_read_iso2709.obj \ $(OBJDIR)\marc_read_line.obj \ $(OBJDIR)\nmem.obj \ $(OBJDIR)\nmemsdup.obj \ $(OBJDIR)\oid_db.obj \ $(OBJDIR)\oid_util.obj \ $(OBJDIR)\options.obj \ $(OBJDIR)\readconf.obj \ $(OBJDIR)\tpath.obj \ $(OBJDIR)\wrbuf.obj \ $(OBJDIR)\wrbuf_sha1.obj \ $(OBJDIR)\xmalloc.obj \ $(OBJDIR)\matchstr.obj \ $(OBJDIR)\siconv.obj \ $(OBJDIR)\iso5428.obj \ $(OBJDIR)\utf8.obj \ $(OBJDIR)\ucs4.obj \ $(OBJDIR)\advancegreek.obj \ $(OBJDIR)\snprintf.obj \ $(OBJDIR)\marc8.obj \ $(OBJDIR)\marc8r.obj \ $(OBJDIR)\iso5426.obj \ $(OBJDIR)\record_conv.obj \ $(OBJDIR)\retrieval.obj \ $(OBJDIR)\test.obj \ $(OBJDIR)\diagbib1.obj \ $(OBJDIR)\diagsru_update.obj \ $(OBJDIR)\diagsrw.obj \ $(OBJDIR)\diag-entry.obj \ $(OBJDIR)\zget.obj \ $(OBJDIR)\logrpn.obj \ $(OBJDIR)\querytowrbuf.obj \ $(OBJDIR)\pquery.obj \ $(OBJDIR)\yaz-ccl.obj \ $(OBJDIR)\otherinfo.obj \ $(OBJDIR)\sortspec.obj \ $(OBJDIR)\charneg.obj \ $(OBJDIR)\grs1disp.obj \ $(OBJDIR)\opac_to_xml.obj \ $(OBJDIR)\xml_get.obj \ $(OBJDIR)\xml_add.obj \ $(OBJDIR)\xml_match.obj \ $(OBJDIR)\xml_to_opac.obj \ $(OBJDIR)\zgdu.obj \ $(OBJDIR)\soap.obj \ $(OBJDIR)\solr.obj \ $(OBJDIR)\solrtransform.obj \ $(OBJDIR)\sru_facet.obj \ $(OBJDIR)\srw.obj \ $(OBJDIR)\srwutil.obj \ $(OBJDIR)\zoom-c.obj \ $(OBJDIR)\zoom-event.obj \ $(OBJDIR)\zoom-memcached.obj \ $(OBJDIR)\zoom-record-cache.obj \ $(OBJDIR)\zoom-z3950.obj \ $(OBJDIR)\zoom-sru.obj \ $(OBJDIR)\zoom-query.obj \ $(OBJDIR)\record_render.obj \ $(OBJDIR)\facet.obj \ $(OBJDIR)\zoom-opt.obj \ $(OBJDIR)\zoom-socket.obj \ $(OBJDIR)\initopt.obj \ $(OBJDIR)\init_diag.obj \ $(OBJDIR)\init_globals.obj \ $(OBJDIR)\xmlquery.obj \ $(OBJDIR)\xmlerror.obj \ $(OBJDIR)\mime.obj \ $(OBJDIR)\cookie.obj \ $(OBJDIR)\cql.obj \ $(OBJDIR)\cql2ccl.obj \ $(OBJDIR)\cql_sortkeys.obj \ $(OBJDIR)\cqlstdio.obj \ $(OBJDIR)\cqlstring.obj \ $(OBJDIR)\cqltransform.obj \ $(OBJDIR)\cqlutil.obj \ $(OBJDIR)\cqlstrer.obj \ $(OBJDIR)\rpn2cql.obj \ $(OBJDIR)\rpn2solr.obj \ $(OBJDIR)\xcqlutil.obj \ $(OBJDIR)\elementset.obj \ $(OBJDIR)\timing.obj \ $(OBJDIR)\uri.obj \ $(OBJDIR)\query-charset.obj \ $(OBJDIR)\tokenizer.obj \ $(OBJDIR)\copy_types.obj \ $(OBJDIR)\http.obj \ $(OBJDIR)\match_glob.obj \ $(OBJDIR)\poll.obj \ $(OBJDIR)\daemon.obj \ $(OBJDIR)\iconv_encode_danmarc.obj \ $(OBJDIR)\iconv_encode_iso_8859_1.obj \ $(OBJDIR)\iconv_encode_marc8.obj \ $(OBJDIR)\iconv_decode_marc8.obj \ $(OBJDIR)\iconv_encode_wchar.obj \ $(OBJDIR)\iconv_decode_iso5426.obj \ $(OBJDIR)\iconv_decode_danmarc.obj \ $(OBJDIR)\mutex.obj \ $(OBJDIR)\thread_create.obj \ $(OBJDIR)\spipe.obj \ $(OBJDIR)\gettimeofday.obj \ $(OBJDIR)\json.obj \ $(OBJDIR)\sc.obj \ $(OBJDIR)\xml_include.obj \ $(OBJDIR)\file_glob.obj \ $(OBJDIR)\thread_id.obj \ $(OBJDIR)\dirent.obj \ $(OBJDIR)\url.obj \ $(OBJDIR)\proxunit.obj \ $(OBJDIR)\backtrace.obj Z3950_OBJS= \ $(OBJDIR)\z-date.obj\ $(OBJDIR)\z-univ.obj\ $(OBJDIR)\zes-update.obj\ $(OBJDIR)\zes-admin.obj \ $(OBJDIR)\z-accdes1.obj \ $(OBJDIR)\z-accform1.obj \ $(OBJDIR)\z-acckrb1.obj \ $(OBJDIR)\z-core.obj \ $(OBJDIR)\z-diag1.obj \ $(OBJDIR)\z-espec1.obj \ $(OBJDIR)\z-estask.obj \ $(OBJDIR)\z-exp.obj \ $(OBJDIR)\z-grs.obj \ $(OBJDIR)\z-opac.obj \ $(OBJDIR)\z-uifr1.obj \ $(OBJDIR)\z-rrf1.obj \ $(OBJDIR)\z-rrf2.obj \ $(OBJDIR)\z-sum.obj \ $(OBJDIR)\z-sutrs.obj \ $(OBJDIR)\zes-expi.obj \ $(OBJDIR)\zes-exps.obj \ $(OBJDIR)\zes-order.obj \ $(OBJDIR)\zes-pquery.obj \ $(OBJDIR)\zes-psched.obj \ $(OBJDIR)\zes-pset.obj \ $(OBJDIR)\zes-update0.obj \ $(OBJDIR)\prt-ext.obj \ $(OBJDIR)\z-charneg.obj \ $(OBJDIR)\z-mterm2.obj \ $(OBJDIR)\z-oclcui.obj \ $(OBJDIR)\z-facet-1.obj ILL_OBJS= \ $(OBJDIR)\ill-get.obj\ $(OBJDIR)\ill-core.obj\ $(OBJDIR)\item-req.obj STEMMER_OBJS = \ $(OBJDIR)\libstemmer.obj \ $(OBJDIR)\api.obj \ $(OBJDIR)\utilities.obj \ $(OBJDIR)\stem_UTF_8_porter.obj \ $(OBJDIR)\stem_UTF_8_english.obj DLL_OBJS =\ $(MISC_OBJS) \ $(Z3950_OBJS) \ $(ILL_OBJS) ICU_DLL_OBJS =\ $(OBJDIR)\icu_chain.obj \ $(OBJDIR)\icu_utf16.obj \ $(OBJDIR)\icu_utf8.obj \ $(OBJDIR)\icu_transform.obj \ $(OBJDIR)\icu_casemap.obj \ $(OBJDIR)\icu_tokenizer.obj \ $(OBJDIR)\icu_sortkey.obj \ $(OBJDIR)\stemmer.obj \ $(STEMMER_OBJS) # Generated C and H files Z3950_C_DIR=$(SRCDIR) ILL_C_DIR=$(SRCDIR) #!!! Should be moved to OBJ, but that requires too much trickery # Files generated from datetime.asn DATETIME_H_FILES = $(INCLDIR)\yaz\z-date.h DATETIME_C_FILES = $(Z3950_C_DIR)\z-date.c # Files generated from univres.asn UNIVRES_H_FILES = $(INCLDIR)\yaz\z-univ.h UNIVRES_C_FILES = $(Z3950_C_DIR)\z-univ.c # Files generated from esupdate.asn ESUPDATE_H_FILES = $(INCLDIR)\yaz\zes-update.h ESUPDATE_C_FILES = $(Z3950_C_DIR)\zes-update.c # Files generated from esadmin.asn ESADMIN_H_FILES = $(INCLDIR)\yaz\zes-admin.h ESADMIN_C_FILES = $(Z3950_C_DIR)\zes-admin.c # Files generated from esadmin.asn CHARNEG_H_FILES = $(INCLDIR)\yaz\z-charneg.h CHARNEG_C_FILES = $(Z3950_C_DIR)\z-charneg.c # Files generated from mterm2.asn MTERM2_H_FILES = $(INCLDIR)\yaz\z-mterm2.h MTERM2_C_FILES = $(Z3950_C_DIR)\z-mterm2.c # Files generated from mterm2.asn OCLCUI_H_FILES = $(INCLDIR)\yaz\z-oclcui.h OCLCUI_C_FILES = $(Z3950_C_DIR)\z-oclcui.c # Files generated from facet.asn FACET_H_FILES = $(INCLDIR)\yaz\z-facet-1.h FACET_C_FILES = $(Z3950_C_DIR)\z-facet-1.c # Files created from z3950v3.asn Z3950V3_H_FILES= \ $(INCLDIR)\yaz\z-accdes1.h \ $(INCLDIR)\yaz\z-core.h Z3950V3_C_FILES= \ $(Z3950_C_DIR)\z-accdes1.c \ $(Z3950_C_DIR)\z-accform1.c \ $(Z3950_C_DIR)\z-acckrb1.c \ $(Z3950_C_DIR)\z-core.c \ $(Z3950_C_DIR)\z-diag1.c \ $(Z3950_C_DIR)\z-espec1.c \ $(Z3950_C_DIR)\z-estask.c \ $(Z3950_C_DIR)\z-exp.c \ $(Z3950_C_DIR)\z-grs.c \ $(Z3950_C_DIR)\z-opac.c \ $(Z3950_C_DIR)\z-uifr1.c \ $(Z3950_C_DIR)\z-rrf1.c \ $(Z3950_C_DIR)\z-rrf2.c \ $(Z3950_C_DIR)\z-sum.c \ $(Z3950_C_DIR)\z-sutrs.c \ $(Z3950_C_DIR)\zes-expi.c \ $(Z3950_C_DIR)\zes-exps.c \ $(Z3950_C_DIR)\zes-order.c \ $(Z3950_C_DIR)\zes-pquery.c \ $(Z3950_C_DIR)\zes-psched.c \ $(Z3950_C_DIR)\zes-pset.c \ $(Z3950_C_DIR)\zes-update0.c # Files generated from ill9702.asn ILL_CORE_H_FILES= \ $(INCLDIR)\yaz\ill-core.h ILL_CORE_C_FILES= \ $(ILL_C_DIR)\ill-core.c # Files generated from itemreq.asn ITEM_REQ_H_FILES= \ $(INCLDIR)\yaz\item-req.h ITEM_REQ_C_FILES= \ $(ILL_C_DIR)\item-req.c # Combined.. DATETIME_FILES = $(DATETIME_H_FILES) $(DATETIME_C_FILES) UNIVRES_FILES = $(UNIVRES_H_FILES) $(UNIVRES_C_FILES) ESUPDATE_FILES = $(ESUPDATE_H_FILES) $(ESUPDATE_C_FILES) ESADMIN_FILES = $(ESADMIN_H_FILES) $(ESADMIN_C_FILES) Z3950V3_FILES= $(Z3950V3_C_FILES) $(Z3950V3_H_FILES) ILL_CORE_FILES= $(ILL_CORE_C_FILES) $(ILL_CORE_H_FILES) ITEM_REQ_FILES= $(ITEM_REQ_C_FILES) $(ITEM_REQ_H_FILES) CHARNEG_FILES = $(CHARNEG_C_FILES) $(CHARNEG_H_FILES) MTERM2_FILES = $(MTERM2_C_FILES) $(MTERM2_H_FILES) OCLCUI_FILES = $(OCLCUI_C_FILES) $(OCLCUI_H_FILES) FACET_FILES = $(FACET_C_FILES) $(FACET_H_FILES) GENERATED_C_FILES= \ $(Z3950V3_C_FILES) \ $(ESUPDATE_C_FILES) \ $(UNIVRES_C_FILES) \ $(DATETIME_C_FILES) \ $(ESADMIN_C_FILES) \ $(CHARNEG_C_FILES) \ $(MTERM2_C_FILES) \ $(OCLCUI_C_FILES) \ $(FACET_C_FILES) \ $(ILL_CORE_C_FILES) \ $(ITEM_REQ_C_FILES) GENERATED_H_FILES= \ $(Z3950V3_H_FILES) \ $(ESUPDATE_H_FILES) \ $(UNIVRES_H_FILES) \ $(DATETIME_H_FILES) \ $(ESADMIN_H_FILES) \ $(CHARNEG_H_FILES) \ $(MTERM2_H_FILES) \ $(OCLCUI_H_FILES) \ $(FACET_H_FILES) \ $(ILL_CORE_H_FILES) \ $(ITEM_REQ_H_FILES) generate: \ $(GENERATED_H_FILES) \ $(GENERATED_C_FILES) \ $(SRCDIR)\diagsrw.c \ $(SRCDIR)\diagbib1.c \ $(SRCDIR)\diagsru_update.c \ $(INCLDIR)\yaz\yaz-version.h # Compiling # Note: This defines where to look for the necessary # source files. Funny way of doing it, but it works. # yaz client {$(CLIENTDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< /D"_CONSOLE" # Ztest {$(ZTESTDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< /D"_CONSOLE" # Server {$(SERVERDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< # Various YAZ source directories {$(SRCDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) /D"YAZ_DLL" $< {$(ZOOMDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< {$(UTILDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< {$(TESTDIR)}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< {$(SRCDIR)\libstemmer_c\libstemmer}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< {$(SRCDIR)\libstemmer_c\runtime}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< {$(SRCDIR)\libstemmer_c\src_c}.c{$(OBJDIR)}.obj: $(CPP) $(COPT) $< # ASN-generated files !if $(HAVE_TCL) $(Z3950V3_FILES): $(SRCDIR)\z3950v3.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl z3950v3.asn @cd $(WINDIR) $(DATETIME_FILES): $(SRCDIR)\datetime.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl datetime.asn @cd $(WINDIR) $(UNIVRES_FILES): $(SRCDIR)\univres.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl univres.asn @cd $(WINDIR) $(ESUPDATE_FILES): $(SRCDIR)\esupdate.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl esupdate.asn @cd $(WINDIR) $(ESADMIN_FILES): $(SRCDIR)\esadmin.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl esadmin.asn @cd $(WINDIR) $(CHARNEG_FILES): $(SRCDIR)\charneg-3.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl charneg-3.asn @cd $(WINDIR) $(MTERM2_FILES): $(SRCDIR)\mterm2.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl mterm2.asn @cd $(WINDIR) $(OCLCUI_FILES): $(SRCDIR)\oclcui.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl oclcui.asn @cd $(WINDIR) $(FACET_FILES): $(SRCDIR)\facet.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d z.tcl facet.asn @cd $(WINDIR) $(ILL_CORE_FILES): $(SRCDIR)\ill9702.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d ill.tcl ill9702.asn @cd $(WINDIR) $(ITEM_REQ_FILES): $(SRCDIR)\item-req.asn @cd $(SRCDIR) $(TCL) $(TCLOPT) -d ill.tcl item-req.asn @cd $(WINDIR) $(SRCDIR)\marc8.c: $(SRCDIR)\codetables.xml $(SRCDIR)\charconv.tcl @cd $(SRCDIR) $(TCL) charconv.tcl -p marc8 codetables.xml -o marc8.c $(SRCDIR)\marc8r.c: $(SRCDIR)\codetables.xml $(SRCDIR)\charconv.tcl @cd $(SRCDIR) $(TCL) charconv.tcl -r -p marc8r codetables.xml -o marc8r.c $(SRCDIR)\iso5426.c: $(SRCDIR)\codetables-iso5426.xml $(SRCDIR)\charconv.tcl @cd $(SRCDIR) $(TCL) charconv.tcl -r -p iso5426 codetables-iso5426.xml -o iso5426.c $(SRCDIR)\oid_std.c: $(SRCDIR)\oid.csv $(TCL) $(SRCDIR)/oidtoc.tcl $(SRCDIR)\oid.csv $(SRCDIR)\oid_std.c $(INCLDIR)\yaz\oid_std.h $(SRCDIR)\diagbib1.c: $(SRCDIR)\bib1.csv @cd $(SRCDIR) $(TCL) csvtodiag.tcl bib1.csv diagbib1.c $(INCLDIR)\yaz\diagbib1.h bib1 diagbib1_str $(SRCDIR)\diagsrw.c: $(SRCDIR)\srw.csv @cd $(SRCDIR) $(TCL) csvtodiag.tcl srw.csv diagsrw.c $(INCLDIR)\yaz\diagsrw.h srw $(SRCDIR)\diagsru_update.c: $(SRCDIR)\sru_update.csv @cd $(SRCDIR) $(TCL) csvtodiag.tcl sru_update.csv diagsru_update.c $(INCLDIR)\yaz\diagsru_update.h sru_update $(INCLDIR)\yaz\yaz-version.h: $(ROOTDIR)/IDMETA @cd $(M4DIR) $(TCL) mk_version.tcl $(ROOTDIR)/IDMETA $(INCLDIR)\yaz\yaz-version.h version.nsi: $(ROOTDIR)/IDMETA $(TCL) $(M4DIR)/mk_version.tcl $(ROOTDIR)/IDMETA version.nsi !endif !if $(HAVE_BISON) $(SRCDIR)\cql.c: $(SRCDIR)\cql.y @cd $(SRCDIR) $(BISON) -y -p cql_ -o cql.c cql.y !endif # Resources # The RC compiler (resource files) RSC=rc.exe YAZ_RC=$(WINDIR)\yaz.rc YAZ_RES=$(OBJDIR)\yaz.res YAZ_ICU_RES=$(OBJDIR)\yaz_icu.res !if $(DEBUG) RSOPT=/d_DEBUG !else RSOPT=/d_NDEBUG !endif $(YAZ_RES): $(YAZ_RC) $(RSC) $(RSOPT) /I$(INCLDIR) /fo"$(YAZ_RES)" $(YAZ_RC) $(YAZ_ICU_RES): $(YAZ_RC) $(RSC) $(RSOPT) /I$(INCLDIR) /DICU=1 /fo"$(YAZ_ICU_RES)" $(YAZ_RC) # Linking $(YAZ_DLL) $(YAZ_IMPLIB): "$(BINDIR)" $(DLL_OBJS) $(YAZ_RES) $(LINK_DLL) \ $(DLL_OBJS) \ $(YAZ_RES) \ /out:$@ \ /implib:"$(YAZ_IMPLIB)" $(YAZ_ICU_DLL) $(YAZ_ICU_IMPLIB): "$(BINDIR)" $(ICU_DLL_OBJS) $(YAZ_ICU_RES) $(LINK_DLL) $(ICU_LIBS) $(YAZ_IMPLIB)\ $(ICU_DLL_OBJS) \ $(YAZ_ICU_RES) \ /out:$@ \ /implib:"$(YAZ_ICU_IMPLIB)" $(YAZ_COND_DLL) $(YAZ_COND_IMPLIB): "$(BINDIR)" $(COND_DLL_OBJS) $(YAZ_COND_RES) $(LINK_DLL) $(COND_LIB) $(YAZ_IMPLIB)\ $(COND_DLL_OBJS) \ $(YAZ_COND_RES) \ /out:$@ \ /implib:"$(YAZ_COND_IMPLIB)" $(CLIENT) : "$(BINDIR)" $(YAZ_CLIENT_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_CLIENT_OBJS) /out:$@ $(YAZ_ICU) : "$(BINDIR)" $(YAZ_ICU_OBJS) $(YAZ_ICU_DLL) $(LINK_PROGRAM) $(ICU_LIBS) $(YAZ_ICU_IMPLIB) $(YAZ_ICU_OBJS) /out:$@ $(YAZ_URL) : "$(BINDIR)" $(YAZ_URL_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_URL_OBJS) /out:$@ $(ZOOMSH) : "$(BINDIR)" $(YAZ_ZOOMSH_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMSH_OBJS) /out:$@ $(ZOOMTST1) : "$(BINDIR)" $(YAZ_ZOOMTST1_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST1_OBJS) /out:$@ $(ZOOMTST2) : "$(BINDIR)" $(YAZ_ZOOMTST2_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST2_OBJS) /out:$@ $(ZOOMTST3) : "$(BINDIR)" $(YAZ_ZOOMTST3_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST3_OBJS) /out:$@ $(ZOOMTST4) : "$(BINDIR)" $(YAZ_ZOOMTST4_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST4_OBJS) /out:$@ $(ZOOMTST5) : "$(BINDIR)" $(YAZ_ZOOMTST5_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST5_OBJS) /out:$@ $(ZOOMTST6) : "$(BINDIR)" $(YAZ_ZOOMTST6_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST6_OBJS) /out:$@ $(ZOOMTST7) : "$(BINDIR)" $(YAZ_ZOOMTST7_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST7_OBJS) /out:$@ $(ZOOMTST8) : "$(BINDIR)" $(YAZ_ZOOMTST8_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST8_OBJS) /out:$@ $(ZOOMTST9) : "$(BINDIR)" $(YAZ_ZOOMTST9_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST9_OBJS) /out:$@ $(ZOOMTST10) : "$(BINDIR)" $(YAZ_ZOOMTST10_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ZOOMTST10_OBJS) /out:$@ $(CQL2PQF) : "$(BINDIR)" $(YAZ_CQL2PQF_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_CQL2PQF_OBJS) /out:$@ $(CQL2XCQL) : "$(BINDIR)" $(YAZ_CQL2XCQL_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_CQL2XCQL_OBJS) /out:$@ $(ZTEST) : "$(BINDIR)" $(ZTEST_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(ZTEST_OBJS) /out:$@ $(YAZ_MARCDUMP) : "$(BINDIR)" $(YAZ_MARCDUMP_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_MARCDUMP_OBJS) /out:$@ $(YAZ_ICONV) : "$(BINDIR)" $(YAZ_ICONV_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_ICONV_OBJS) /out:$@ $(YAZ_RECORD_CONV) : "$(BINDIR)" $(YAZ_RECORD_CONV_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_RECORD_CONV_OBJS) /out:$@ $(YAZ_JSON_PARSE) : "$(BINDIR)" $(YAZ_JSON_PARSE_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(YAZ_JSON_PARSE_OBJS) /out:$@ $(TSTLOG) : "$(BINDIR)" $(TSTLOG_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(TSTLOG_OBJS) /out:$@ $(TST_TIMING) : "$(BINDIR)" $(TST_TIMING_OBJS) $(YAZ_DLL) $(LINK_PROGRAM) $(TST_TIMING_OBJS) /out:$@ $(TEST_MUTEX) : "$(BINDIR)" $(TEST_MUTEX_OBJS) $(YAZ_COND_DLL) $(LINK_PROGRAM) $(YAZ_COND_IMPLIB) $(TEST_MUTEX_OBJS) /out:$@ # Other rules $(DOCDIR)\htmlhelp.chm: $(DOCDIR)\htmlhelp.hhp @cd $(DOCDIR) -$(HHC) htmlhelp.hhp @cd $(WINDIR) clean: -del $(BINDIR)\*.exe -del $(BINDIR)\*.dll -del $(BINDIR)\*.pdb -del $(TMPDIR)\*. -del $(LIBDIR)\*.LIB -del $(OBJDIR)\*.OBJ realclean: clean -del $(SRCDIR)\marc8.c -del $(SRCDIR)\cql.c -del $(SRCDIR)\z-*.c -del $(SRCDIR)\ill-core.c -del $(SRCDIR)\item-req.c -del $(INCLDIR)\yaz\ill-core.h -del $(INCLDIR)\yaz\item-req.h -del $(INCLDIR)\yaz\z-accdes1.h -del $(INCLDIR)\yaz\z-core.h -del $(DATETIME_H_FILES) -del $(UNIVRES_H_FILES) -del $(ESUPDATE_H_FILES) # Because DOS del will only accept one file name to delete, # the _H_ files work only on sets that have just one file. # Z3950_H_FILES had to be spelled out. One more point for MS! # check directories and create if needed dirs: $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR) $(OBJDIR) $(WINDIR) $(LIBDIR) $(BINDIR) $(TMPDIR) $(JAVADIR): if not exist "$@/$(NUL)" mkdir "$@" # Explicit dependencies # force recompilation of everything, if makefile changed $(Z3950_OBJS): $(GENERATED_C_FILES) $(GENERATED_H_FILES) $(ILL_OBJS): $(ILL_CORE_FILES) $(ITEM_REQ_FILES) # makes sure we generate before compiling anything, as the # new proto.h refers to the generated files, and is included # in various places yaz-5.34.4/win/yaz.nsi0000664000175000017500000001470314754707607010236 ; This file is part of the YAZ toolkit. ; Copyright (C) Index Data ; See the file LICENSE for details. ; Using https://nsis.sourceforge.io/EnVar_plug-in ; for path manipulation Unicode True !include version.nsi !include "MUI.nsh" Name "YAZ" !include "..\m4\common.nsi" RequestExecutionLevel admin SetCompressor bzip2 Caption "Index Data YAZ ${VERSION} Setup" OutFile "yaz_${VERSION}.exe" LicenseText "You must read the following license before installing:" LicenseData license.txt ComponentText "This will install the YAZ Toolkit on your computer:" InstType "Full (w/ Source)" InstType "Lite (w/o Source)" InstallDirRegKey HKLM "SOFTWARE\Index Data\YAZ" "" ;---------------------------- ; Pages !insertmacro MUI_PAGE_LICENSE "license.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ; Page components ; Page directory ; Page instfiles ; UninstPage uninstConfirm ; UninstPage instfiles ;-------------------------------- ;Languages !insertmacro MUI_LANGUAGE "English" ;-------------------------------- Section "" ; (default section) SetOutPath "$INSTDIR" ; add files / whatever that need to be installed here. WriteRegStr HKLM "SOFTWARE\Index Data\YAZ" "" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "DisplayName" "YAZ ${VERSION} (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" "UninstallString" '"$INSTDIR\uninst.exe"' ; write out uninstaller WriteUninstaller "$INSTDIR\uninst.exe" SetOutPath $SMPROGRAMS\YAZ CreateShortCut "$SMPROGRAMS\YAZ\YAZ Program Directory.lnk" \ "$INSTDIR" WriteINIStr "$SMPROGRAMS\YAZ\YAZ Home page.url" \ "InternetShortcut" "URL" "http://www.indexdata.com/yaz/" CreateShortCut "$SMPROGRAMS\YAZ\Uninstall YAZ.lnk" \ "$INSTDIR\uninst.exe" SetOutPath $INSTDIR File LICENSE.txt File ..\README.md File ..\NEWS SetOutPath $INSTDIR SetOutPath $INSTDIR\ztest File ..\ztest\dummy-grs File ..\ztest\dummy-words SetOutPath $INSTDIR\etc File ..\etc\*.xml File ..\etc\*.xsl File ..\etc\pqf.properties SectionEnd ; end of default section Section "YAZ Runtime" YAZ_Runtime SectionIn 1 2 SetOutPath $INSTDIR\bin File "${VS_REDIST_FULL}" ReadRegDword $1 HKLM "${VS_REDIST_KEY}" "Version" ${If} $1 == "" ExecWait '"$INSTDIR\bin\${VS_REDIST_EXE}" /passive /nostart' ${endif} Delete "$INSTDIR\bin\${VS_REDIST_EXE}" IfFileExists "$INSTDIR\bin\yaz-ztest.exe" 0 Noservice ExecWait '"$INSTDIR\bin\yaz-ztest.exe" -remove' Noservice: File ..\bin\*.dll File ..\bin\*.exe SetOutPath $SMPROGRAMS\YAZ CreateShortCut "$SMPROGRAMS\YAZ\YAZ Client.lnk" \ "$INSTDIR\bin\yaz-client.exe" SetOutPath $SMPROGRAMS\YAZ\Server CreateShortCut "$SMPROGRAMS\YAZ\Server\Server on console on port 9999.lnk" \ "$INSTDIR\bin\yaz-ztest.exe" '-w"$INSTDIR\ztest"' CreateShortCut "$SMPROGRAMS\YAZ\Server\Install Z39.50 service on port 210.lnk" \ "$INSTDIR\bin\yaz-ztest.exe" '-installa tcp:@:210' CreateShortCut "$SMPROGRAMS\YAZ\Server\Remove Z39.50 service.lnk" \ "$INSTDIR\bin\yaz-ztest.exe" '-remove' SectionEnd Section "YAZ Development" YAZ_Development SectionIn 1 2 SetOutPath $INSTDIR\include\yaz File ..\src\yaz\*.h SetOutPath $INSTDIR\lib File ..\lib\yaz*.lib SectionEnd Section "YAZ Documentation" YAZ_Documentation SectionIn 1 2 SetOutPath $INSTDIR\doc File /nonfatal /r ..\doc\*.css File /nonfatal /r ..\doc\*.ent File /nonfatal /r ..\doc\*.html File /r ..\doc\*.xml File /r ..\doc\*.png File /nonfatal /r ..\doc\*.xsl SetOutPath $SMPROGRAMS\YAZ CreateShortCut "$SMPROGRAMS\YAZ\HTML Documentation.lnk" \ "$INSTDIR\doc\index.html" SectionEnd Section "YAZ Source" YAZ_Source SectionIn 1 SetOutPath $INSTDIR File ..\IDMETA File /r ..\*.c File /r /x yaz ..\*.h SetOutPath $INSTDIR\util File ..\src\yaz-asncomp SetOutPath $INSTDIR\src File ..\src\*.y File ..\src\*.tcl File ..\src\*.csv File ..\src\*.asn File ..\src\codetables*.xml SetOutPath $INSTDIR\test File ..\test\*.sh File ..\test\*.xml File ..\test\*.asn SetOutPath $INSTDIR\test File /r ..\test\marc-files SetOutPath $INSTDIR\win File makefile File *.nsi File *.rc SetOutPath $INSTDIR\m4 File ..\m4\*.m4 File ..\m4\*.tcl File ..\m4\*.nsi SectionEnd Section "YAZ4J" YAZ4J SectionIn 1 2 SetOutPath $INSTDIR\bin File /nonfatal ..\bin\yaz4j*.dll SetOutPath $INSTDIR\java File /nonfatal ..\java\yaz4j*.jar SectionEnd Section "YAZ Path" YAZ_PATH SectionIn 1 2 EnVar::SetHKLM EnVar::AddValue "PATH" "$INSTDIR\bin" Pop $0 SectionEnd ; begin uninstall settings/section UninstallText "This will uninstall YAZ ${VERSION} from your system" Section Uninstall ExecWait '"$INSTDIR\bin\yaz-ztest" -remove' RMDir /r $SMPROGRAMS\YAZ Delete "$INSTDIR\uninst.exe" DeleteRegKey HKLM "SOFTWARE\Index Data\YAZ" DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\YAZ" RMDir /r $INSTDIR EnVar::SetHKLM EnVar::DeleteValue "PATH" "$INSTDIR\bin" Pop $0 IfFileExists $INSTDIR 0 Removed MessageBox MB_OK|MB_ICONEXCLAMATION \ "Note: $INSTDIR could not be removed." Removed: SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_YAZ_Runtime ${LANG_ENGLISH} "YAZ runtime files needed in order for YAZ to run, such as DLLs." LangString DESC_YAZ_Development ${LANG_ENGLISH} "Header files and import libraries required for developing software using YAZ." LangString DESC_YAZ_Documentation ${LANG_ENGLISH} "YAZ Users' guide and reference in HTML. Describes both YAZ applications and the API." LangString DESC_YAZ_Source ${LANG_ENGLISH} "Source code of YAZ. Required if you need to rebuild YAZ (for debugging purposes)." LangString DESC_YAZ4J ${LANG_ENGLISH} "Java wrapper for the ZOOM API of YAZ." LangString DESC_YAZ_PATH ${LANG_ENGLISH} "Update PATH to include binaries of YAZ." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Runtime} $(DESC_YAZ_Runtime) !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Development} $(DESC_YAZ_Development) !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Documentation} $(DESC_YAZ_Documentation) !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_Source} $(DESC_YAZ_Source) !insertmacro MUI_DESCRIPTION_TEXT ${YAZ4J} $(DESC_YAZ4J) !insertmacro MUI_DESCRIPTION_TEXT ${YAZ_PATH} $(DESC_YAZ_PATH) !insertmacro MUI_FUNCTION_DESCRIPTION_END ; eof yaz-5.34.4/win/LICENSE.txt0000664000175000017500000000266614754707607010550 Copyright (c) 1995-2025, Index Data. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. yaz-5.34.4/win/version.nsi.in0000664000175000017500000000003514754707607011516 !define VERSION "@VERSION@" yaz-5.34.4/win/yaz.rc0000664000175000017500000000213014754707607010040 #include "winver.h" #include "yaz\yaz-version.h" VS_VERSION_INFO VERSIONINFO FILEVERSION YAZ_FILEVERSION PRODUCTVERSION YAZ_FILEVERSION FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS VOS_NT FILETYPE VFT_DLL FILESUBTYPE VFT2_UNKNOWN { BLOCK "StringFileInfo" { BLOCK "000004b0" BEGIN VALUE "Comments", "https://www.indexdata.com/yaz/\0" VALUE "CompanyName", "Index Data\0" #ifdef ICU VALUE "FileDescription", "YAZ ICU DLL\0" #else VALUE "FileDescription", "YAZ DLL\0" #endif VALUE "FileVersion", YAZ_VERSION "\0" VALUE "InternalName", "YAZ\0" VALUE "LegalCopyright", "Copyright © 1995-2025 Index Data\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "yaz.res\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "YAZ\0" VALUE "ProductVersion", YAZ_VERSION "\0" VALUE "SpecialBuild", "\0" END } BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x0, 1200 END } yaz-5.34.4/etc/0000775000175000017500000000000014754707607006751 5yaz-5.34.4/etc/cqlpass.properties0000664000175000017500000000550514631643521012446 # Properties for pass-through index name to Bib-1 use attribute # Requires YAZ 2.1.49 or later. # Identifiers for prefixes used in this file. (index.*) set.cql = info:srw/cql-context-set/1/cql-v1.1 set.pass = http://indexdata.dk/yaz/cqlpass # The default set when an index doesn't specify one: CQL Passthrough set = http://indexdata.dk/yaz/cqlpass # The default index when none is specified by the query index.cql.serverChoice = 1=1016 index.pass.* = 1=* # Relation attributes are selected according to the CQL relation by # looking up the "relation." property: # relation.< = 2=1 relation.le = 2=2 relation.eq = 2=3 relation.exact = 2=3 relation.ge = 2=4 relation.> = 2=5 relation.<> = 2=6 # These two are what Zebra uses -- may not work on other servers relation.all = 4=6 relation.any = 4=105 # BIB-1 doesn't have a server choice relation, so we just make the # choice here, and use equality (which is clearly correct). relation.scr = 2=3 # Relation modifiers. # relationModifier.relevant = 2=102 relationModifier.fuzzy = 5=103 ### truncation=regExpr-2 (5=103) in Zebra is "fuzzy matching" relationModifier.stem = 2=101 relationModifier.phonetic = 2=100 # Non-standard extensions to provoke Zebra's inline sorting relationModifier.sort = 7=1 relationModifier.sort-desc = 7=2 relationModifier.numeric = 4=109 # Position attributes may be specified for anchored terms (those # beginning with "^", which is stripped) and unanchored (those not # beginning with "^"). This may change when we get a BIB-1 truncation # attribute that says "do what CQL does". # position.first = 3=1 6=1 # "first in field" position.any = 3=3 6=1 # "any position in field" position.last = 3=4 6=1 # not a standard BIB-1 attribute position.firstAndLast = 3=3 6=3 # search term is anchored to be complete field # Structure attributes may be specified for individual relations; a # default structure attribute my be specified by the pseudo-relation # "*", to be used whenever a relation not listed here occurs. # structure.exact = 4=108 # string structure.all = 4=2 structure.any = 4=2 structure.* = 4=1 # phrase # Truncation attributes used to implement CQL wildcard patterns. The # simpler forms, left, right- and both-truncation will be used for the # simplest patterns, so that we produce PQF queries that conform more # closely to the Bath Profile. However, when a more complex pattern # such as "foo*bar" is used, we fall back on Z39.58-style masking. # truncation.right = 5=1 truncation.left = 5=2 truncation.both = 5=3 truncation.none = 5=100 truncation.regexp = 5=102 truncation.z3958 = 5=104 # Finally, any additional attributes that should always be included # with each term can be specified in the "always" property. # always = 6=1 # 6=1: completeness = incomplete subfield yaz-5.34.4/etc/opacxml.xsd0000664000175000017500000000700314631643521011040 yaz-5.34.4/etc/Makefile.am0000664000175000017500000000054714631643521010717 ## This file is part of the YAZ toolkit. ## Copyright (C) Index Data etcdatadir = $(pkgdatadir)/etc etcdata_DATA = \ pqf.properties \ cqlpass.properties \ yazgfs.xml \ maps.xml \ MARC21slim2DC.xsl \ MARC21slim2MODS.xsl \ MARC21slim2RDFDC.xsl \ MARC21slimUtils.xsl \ marc21_to_endnote.xsl \ opacxml.xsd EXTRA_DIST = $(etcdata_DATA) debian.init.d yaz-5.34.4/etc/debian.init.d0000775000175000017500000000222614631643521011213 #! /bin/sh # Debian sample start/stop script for YAZ Generic Frontend Server # set -e DAEMON=/usr/local/bin/yaz-ztest NAME=yaz-ztest PIDFILE=/var/run/yaz-ztest.pid LOGFILE=/var/log/yaz-ztest.log RUNAS=nobody test -x $DAEMON || exit 0 case "$1" in start) echo -n "Starting YAZ server: " start-stop-daemon --start --pidfile $PIDFILE \ --exec $DAEMON -- \ -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210 echo "$NAME." ;; stop) echo -n "Stopping YAZ server: " start-stop-daemon --stop --pidfile $PIDFILE \ --oknodo --retry 30 --exec $DAEMON echo "$NAME." ;; restart) echo -n "Restarting YAZ server: " start-stop-daemon --stop --pidfile $PIDFILE \ --oknodo --retry 30 --exec $DAEMON start-stop-daemon --start --pidfile $PIDFILE d \ --exec $DAEMON -- \ -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210 echo "$NAME." ;; reload|force-reload) echo "Reloading $NAME configuration files" start-stop-daemon --stop --pidfile $PIDFILE \ --signal 1 --exec $DAEMON ;; *) echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}" exit 1 ;; esac exit 0 yaz-5.34.4/etc/pqf.properties0000664000175000017500000001204114631643521011557 # Properties file to drive org.z3950.zing.cql.CQLNode's toPQF() # back-end and the YAZ CQL-to-PQF converter. This specifies the # interpretation of various CQL indexes, relations, etc. in terms # of Type-1 query attributes. # # This configuration file generates queries using BIB-1 attributes. # See http://www.loc.gov/standards/sru/cql/contextSets/dc-context-set.html # for the Maintenance Agency's work-in-progress mapping of Dublin Core # indexes to Attribute Architecture (util, XD and BIB-2) # attributes. # Identifiers for prefixes used in this file. (index.*) set.cql = info:srw/cql-context-set/1/cql-v1.2 set.rec = info:srw/cql-context-set/2/rec-1.1 set.dc = info:srw/cql-context-set/1/dc-v1.1 set.bath = http://zing.z3950.org/cql/bath/2.0/ # The default set when an index doesn't specify one: Dublin Core set = info:srw/cql-context-set/1/dc-v1.1 # The default index when none is specified by the query index.cql.serverChoice = 1=1016 # srw.serverChoice is deprecated in favour of cql.serverChoice # BIB-1 "any" index.cql.allRecords = 1=_ALLRECORDS 2=103 index.rec.id = 1=12 index.dc.title = 1=4 index.dc.subject = 1=21 index.dc.creator = 1=1003 index.dc.author = 1=1003 ### Unofficial synonym for "creator" index.dc.editor = 1=1020 index.dc.publisher = 1=1018 index.dc.description = 1=62 # "abstract" index.dc.date = 1=30 index.dc.resourceType = 1=1031 # guesswork: "Material-type" index.dc.format = 1=1034 # guesswork: "Content-type" index.dc.resourceIdentifier = 1=12 # "Local number" index.dc.source = 1=1019 # "Record-source" index.dc.language = 1=54 # "Code--language" index.dc.relation = 1=? ### No idea how to represent this index.dc.coverage = 1=? ### No idea how to represent this index.dc.rights = 1=? ### No idea how to represent this # Relation attributes are selected according to the CQL relation by # looking up the "relation." property: # relation.< = 2=1 relation.le = 2=2 relation.eq = 2=3 relation.exact = 2=3 relation.ge = 2=4 relation.> = 2=5 relation.<> = 2=6 # These two are what Zebra uses -- may not work on other servers relation.all = 4=6 relation.any = 4=105 # BIB-1 doesn't have a server choice relation, so we just make the # choice here, and use equality (which is clearly correct). relation.scr = 2=3 # Relation modifiers. # relationModifier.relevant = 2=102 relationModifier.fuzzy = 5=103 ### truncation=regExpr-2 (5=103) in Zebra is "fuzzy matching" relationModifier.stem = 2=101 relationModifier.phonetic = 2=100 relationModifier.regexp = 5=102 relationModifier.unmasked = 5=100 relationModifier.masked = # Non-standard extensions to provoke Zebra's inline sorting relationModifier.sort = 7=1 relationModifier.sort-desc = 7=2 relationModifier.numeric = 4=109 # Position attributes may be specified for anchored terms (those # beginning with "^", which is stripped) and unanchored (those not # beginning with "^"). This may change when we get a BIB-1 truncation # attribute that says "do what CQL does". # position.first = 3=1 6=1 # "first in field" position.any = 3=3 6=1 # "any position in field" position.last = 3=4 6=1 # not a standard BIB-1 attribute position.firstAndLast = 3=3 6=3 # search term is anchored to be complete field # Structure attributes may be specified for individual relations; a # default structure attribute my be specified by the pseudo-relation # "*", to be used whenever a relation not listed here occurs. # structure.exact = 4=108 # string structure.all = 4=2 structure.any = 4=2 structure.* = 4=1 # phrase # Truncation attributes used to implement CQL wildcard patterns. The # simpler forms, left, right- and both-truncation will be used for the # simplest patterns, so that we produce PQF queries that conform more # closely to the Bath Profile. However, when a more complex pattern # such as "foo*bar" is used, we fall back on Z39.58-style masking. # truncation.right = 5=1 truncation.left = 5=2 truncation.both = 5=3 truncation.none = 5=100 truncation.regexp = 5=102 truncation.z3958 = 5=104 # Finally, any additional attributes that should always be included # with each term can be specified in the "always" property. # always = 6=1 # 6=1: completeness = incomplete subfield # Bath Profile support, added Thu Dec 18 13:06:20 GMT 2003 # See the Bath Profile for SRW at # http://zing.z3950.org/srw/bath/2.0/ # including the Bath Context Set defined within that document. # # In this file, we only map index-names to BIB-1 use attributes, doing # so in accordance with the specifications of the Z39.50 Bath Profile, # and leaving the relations, wildcards, etc. to fend for themselves. index.bath.keyTitle = 1=33 index.bath.possessingInstitution = 1=1044 index.bath.name = 1=1002 index.bath.personalName = 1=1 index.bath.corporateName = 1=2 index.bath.conferenceName = 1=3 index.bath.uniformTitle = 1=6 index.bath.isbn = 1=7 index.bath.issn = 1=8 index.bath.geographicName = 1=58 index.bath.notes = 1=63 index.bath.topicalSubject = 1=1079 index.bath.genreForm = 1=1075 yaz-5.34.4/etc/yazgfs.xml0000664000175000017500000000362614631643521010711 tcp:@:9000 . zebra.cfg pqf.properties xsl iso-8859-1 xsl/default.xsl 2000000 myserver.org 9000 Default yaz-5.34.4/etc/MARC21slimUtils.xsl0000664000175000017500000000470414631643521012205 yaz-5.34.4/etc/maps.xml0000664000175000017500000000157314631643521010345 yaz-5.34.4/etc/MARC21slim2DC.xsl0000664000175000017500000001470014631643521011452 abfghk yes yes text cartographic notated music sound recording still image moving image three dimensional object software, multimedia mixed material ab abcdq abcdq abcdq abcdq abcdq abcdq abcd abcdu ot yaz-5.34.4/etc/MARC21slim2MODS.xsl0000664000175000017500000017677414631643521011752 BK SE BK MM CF MP VM MU abfghk <xsl:value-of select="substring($title,@ind2+1)"/> <xsl:value-of select="$title"/> <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">ab</xsl:with-param> </xsl:call-template> <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">abh</xsl:with-param> </xsl:call-template> <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">abfh</xsl:with-param> </xsl:call-template> <xsl:variable name="str"> <xsl:for-each select="marc:subfield"> <xsl:if test="(contains('adfhklmor',@code) and (not(../marc:subfield[@code='n' or @code='p']) or (following-sibling::marc:subfield[@code='n' or @code='p'])))"> <xsl:value-of select="text()"/><xsl:text> </xsl:text> </xsl:if> </xsl:for-each> </xsl:variable> <xsl:value-of select="substring($str,1,string-length($str)-1)"/> <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">ah</xsl:with-param> </xsl:call-template> creator creator creator personal yes yes text cartographic notated music sound recording still image moving image three dimensional object software, multimedia mixed material globe remote sensing image map atlas database loose-leaf series newspaper periodical web site abstract or summary bibliography catalog dictionary encyclopedia handbook legal article index discography legislation theses survey of literature review programmed text filmography directory statistics technical report legal case and case notes law report or digest treaty conference publication numeric data database font game patent festschrift biography essay drama comic strip fiction humor, satire letter novel short story speech biography conference publication drama essay fiction folktale history humor, satire memoir poetry rehersal reporting sound speech art original kit art reproduction diorama filmstrip legal article picture graphic technical drawing motion picture chart flash card microscope slide model realia slide transparency videorecording toy abvxyz - monographic continuing ab rfc3066 iso639-2b reformatted digital
braille
electronic
microfiche
microfilm
abce
ab agrt ab adolescent adult general juvenile preschool specialized defg ab abx ab ab <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">av</xsl:with-param> </xsl:call-template> <xsl:call-template name="part"/> <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">av</xsl:with-param> </xsl:call-template> <xsl:call-template name="part"/> <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">g</xsl:with-param> </xsl:call-template> abcq t g <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">dg</xsl:with-param> </xsl:call-template> c t dgn <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">g</xsl:with-param> </xsl:call-template> aqdc t gn <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> </xsl:call-template> <xsl:value-of select="marc:subfield[@code='a']"/> <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">g</xsl:with-param> </xsl:call-template> abcq t g <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklmorsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">dg</xsl:with-param> </xsl:call-template> c t dgn <xsl:call-template name="specialSubfieldSelect"> <xsl:with-param name="anyCodes">tfklsv</xsl:with-param> <xsl:with-param name="axis">t</xsl:with-param> <xsl:with-param name="afterCodes">g</xsl:with-param> </xsl:call-template> aqdc t gn <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">adfgklmorsv</xsl:with-param> </xsl:call-template> issue number matrix number music plate music publisher videorecording identifier ab ab doi uri abj abcd35 abcde35
n n fghkdlmor p p fghkdlmor
cdn abcq acdeq constituent related <xsl:value-of select="."/> <xsl:value-of select="."/> lcsh lcshac mesh csh nal rvm abcq cdnp abcdeqnp <xsl:call-template name="subfieldSelect"> <xsl:with-param name="codes">adfhklor</xsl:with-param> </xsl:call-template> <xsl:call-template name="part"/> abcd
yaz-5.34.4/etc/MARC21slim2RDFDC.xsl0000664000175000017500000002061514631643521012010 abfghk yes yes text cartographic notated music sound recording still image moving image three dimensional object software, multimedia mixed material ab abcdq abcdq abcdq abcdq abcdq abcdq abcd abcdu ot yaz-5.34.4/etc/marc21_to_endnote.xsl0000664000175000017500000001515614631643521012720 % Electronic Resource Electronic Resource article Book 0 A A T B C I D K L P U V X @ @ yaz-5.34.4/etc/Makefile.in0000664000175000017500000003640314754707577010752 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_icu.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/yaz.m4 $(top_srcdir)/m4/yaz_libxml2.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(etcdatadir)" DATA = $(etcdata_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HIREDIS_LIBS = @HIREDIS_LIBS@ HTML_COMPILE = @HTML_COMPILE@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_CONFIG = @ICU_CONFIG@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ MEMCACHED_LIBS = @MEMCACHED_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ TCLSH = @TCLSH@ TCPD_LIBS = @TCPD_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YACC = @YACC@ YAZ_CONFIG_CFLAGS = @YAZ_CONFIG_CFLAGS@ YAZ_CONF_CFLAGS = @YAZ_CONF_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigpath = @pkgconfigpath@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ etcdatadir = $(pkgdatadir)/etc etcdata_DATA = \ pqf.properties \ cqlpass.properties \ yazgfs.xml \ maps.xml \ MARC21slim2DC.xsl \ MARC21slim2MODS.xsl \ MARC21slim2RDFDC.xsl \ MARC21slimUtils.xsl \ marc21_to_endnote.xsl \ opacxml.xsd EXTRA_DIST = $(etcdata_DATA) debian.init.d all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-etcdataDATA: $(etcdata_DATA) @$(NORMAL_INSTALL) @list='$(etcdata_DATA)'; test -n "$(etcdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(etcdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(etcdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(etcdatadir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(etcdatadir)" || exit $$?; \ done uninstall-etcdataDATA: @$(NORMAL_UNINSTALL) @list='$(etcdata_DATA)'; test -n "$(etcdatadir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(etcdatadir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(etcdatadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-etcdataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-etcdataDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-etcdataDATA install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-etcdataDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: yaz-5.34.4/Makefile.am0000664000175000017500000000146614753416137010153 ## This file is part of the YAZ toolkit. ## Copyright (C) Index Data ## See the file LICENSE for details. AUTOMAKE_OPTIONS = foreign ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src util test client ztest zoom doc etc aclocaldir=$(datadir)/aclocal aclocal_DATA = m4/yaz.m4 pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = yaz.pc yaz-icu.pc yaz-server.pc SPEC_FILE=$(PACKAGE).spec EXTRA_DIST=$(SPEC_FILE) IDMETA README.md LICENSE NEWS m4/id-config.sh \ m4/yaz.m4 m4/yaz_libxml2.m4 buildconf.sh \ m4/acx_pthread.m4 m4/ac_check_icu.m4 m4/common.nsi m4/mk_version.tcl dist-hook: if test -x /usr/bin/git -a -d .git; then git log >ChangeLog ; cp ChangeLog $(distdir); fi test -d $(distdir)/win || mkdir $(distdir)/win -cp $(srcdir)/win/* $(distdir)/win .PHONY:debian debian: dpkg-buildpackage -rfakeroot yaz-5.34.4/yaz.pc.in0000664000175000017500000000042614733253124007637 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: YAZ Version: @VERSION@ Description: YAZ library for building Z39.50 applications Requires: libexslt Libs: -L${libdir} -lyaz Libs.private: @LIBS@ Cflags: -I${includedir} @YAZ_CONFIG_CFLAGS@ yaz-5.34.4/README.md0000664000175000017500000000263714753417062007375 ## YAZ toolkit Copyright (C) 1995-2025 Index Data. See the file LICENSE for details. The primary output of the source here is the [YAZ](http://www.indexdata.com/yaz) library, which contains support functions for implementing the server or client role of Z39.50 and SRU. ### Documentation For more information about YAZ refer to the documentation in sub directory `doc` or [online](http://www.indexdata.com/yaz/doc). ### Cloning It's easiest to compile this software by using the source tar provided for official releases. Refer to ["FTP"](http://ftp.indexdata.com/pub/yaz/). If you want to clone and compile from Git, it's more complicated. Firstly, you need to clone with submodules. You need autoconf tools - such as autoconf, automake, libtool. For compilation besides the obvious C compiler (gcc, clang) and `make` you also need xsltproc, tcl, docbook xml. The `buildconf.sh` script creates the configure script and makefiles. For Debian based systems, read `debian/control` and install what's listed in `Build-Depends`. For RPM based systems, read `yaz.spec` and what's listed in `BuildRequires`. $ git clone --recursive https://github.com/indexdata/yaz.git $ cd yaz $ ./buildconf.sh $ ./configure $ make ### Mailing list To get more information or assistance, send mail to info@indexdata.com. Even better, sign on to the [YAZ mailing list](http://lists.indexdata.dk/cgi-bin/mailman/listinfo/yazlist) yaz-5.34.4/doc/0000775000175000017500000000000014754707607006743 5yaz-5.34.4/doc/server.backend.html0000664000175000017500000000440214754707607012445 3. The Backend API

3. The Backend API

The header file that you need to use the interface are in the include/yaz directory. It's called backend.h. It will include other files from the include/yaz directory, so you'll probably want to use the -I option of your compiler to tell it where to find the files. When you run make in the top-level YAZ directory, everything you need to create your server is to link with the lib/libyaz.la library.

yaz-5.34.4/doc/installation.win32.html0000664000175000017500000003305014754707607013214 3. Windows

3. Windows

The easiest way to install YAZ on Windows is by downloading an installer from Index Data's Windows support area . The installer comes with source too - in case you wish to compile YAZ with different compiler options, etc.

3.1. Compiling from Source on Windows

YAZ is shipped with "makefiles" for the NMAKE tool that comes with Microsoft Visual Studio. It has been tested with Microsoft Visual Studio 2017 and 2019.

Start a command prompt and switch the sub directory WIN where the file makefile is located. Customize the installation by editing the makefile file (for example by using notepad). The following summarizes the most important settings in that file:

DEBUG

If set to 1, the software is compiled with debugging libraries (code generation is multi-threaded debug DLL). If set to 0, the software is compiled with release libraries (code generation is multi-threaded DLL).

HAVE_TCL, TCL

If HAVE_TCL is set to 1, nmake will use the ASN.1 compiler (Tcl based). You must set TCL to the full path of the Tcl interpreter. A Windows version of Tcl is part of Git for Windows.

If you do not have Tcl installed, set HAVE_TCL to 0.

HAVE_BISON, BISON

If GNU Bison is present, you might set HAVE_BISON to 1 and specify the Bison executable in BISON. Bison is only required if you use the Git version of YAZ or if you modify the grammar for CQL (cql.y).

A Windows version of GNU Bison can be fetched from here: Index Data's Windows support area .

HAVE_ICONV, ICONV_DIR

If HAVE_ICONV is set to 1, YAZ is compiled with iconv support. In this configuration, set ICONV_DIR to the iconv source directory.

HAVE_LIBXML2, LIBXML2_DIR

If HAVE_LIBXML2 is set to 1, YAZ is compiled with SRU support. In this configuration, set LIBXML2_DIR to the libxml2 source directory.

You can get pre-compiled Libxml2+Libxslt DLLs and headers from here. Should you with to compile those libraries yourself, refer to to Section 3.3, “Compiling Libxml2 and Libxslt on windows”

HAVE_LIBXSLT, LIBXSLT_DIR

If HAVE_LIBXSLT is set to 1, YAZ is compiled with XSLT support. In this configuration, set LIBXSLT_DIR to the libxslt source directory.

Note

libxslt depends on libxml2.

HAVE_ICU, ICU_DIR

If HAVE_ICU is set to 1, YAZ is compiled with ICU support. In this configuration, set ICU_DIR to the ICU source directory.

Pre-compiled ICU libraries for various versions of Visual Studio can be found here or from Index Data's Windows support site.

When satisfied with the settings in the makefile, type

      nmake
     

Note

If the nmake command is not found on your system you probably haven't defined the environment variables required to use that tool. To fix that, find and run the batch file vcvarsall.bat. You need to run it from within the command prompt or set the environment variables "globally"; otherwise it doesn't work.

If you wish to recompile YAZ - for example if you modify settings in the makefile you can delete object files, etc by running.

      nmake clean
     

The following files are generated upon successful compilation:

bin/yaz5.dll / bin/yaz5d.dll

YAZ Release/Debug DLL.

lib/yaz5.lib / lib/yaz5d.lib

Import library for yaz5.dll / yaz5d.dll.

bin/yaz_cond5.dll / bin/yaz_cond5d.dll

Release/Debug DLL for condition variable utilities (condvar.c).

lib/yaz_cond5.lib / lib/yaz_cond5d.lib

Import library for yaz_cond5.dll / yaz_cond5d.dll.

bin/yaz_icu5.dll / bin/yaz_icu5d.dll

Release/Debug DLL for the ICU wrapper utility. Only build if HAVE_ICU is 1.

lib/yaz_icu5.lib / lib/yaz_icu5d.lib

Import library for yaz_icu5.dll / yaz_icu5d.dll.

bin/yaz-ztest.exe

Z39.50 multi-threaded test/example server. It's a WIN32 console application.

bin/yaz-client.exe

YAZ Z39.50 client application. It's a WIN32 console application. See chapter YAZ client for more information.

bin/yaz-icu.exe

This program exposes the ICU wrapper library if that is enabled for YAZ. Only if ICU is available this program is built.

bin/zoomsh.exe

Simple console application implemented on top of the ZOOM functions. The application is a command line shell that allows you to enter simple commands to perform ZOOM operations.

bin/zoomtst1.exe, bin/zoomtst2.exe, ..

Several small applications that demonstrate the ZOOM API.

3.2. How to make apps using YAZ on Windows

This section will go though the process of linking your Windows applications with YAZ.

Some people are confused by the fact that we use the nmake tool to build YAZ. They think they have to do that too - in order to make their Windows applications work with YAZ. The good news is that you don't have to. You can use the integrated environment of Visual Studio if desired for your own application.

When setting up a project or Makefile you have to set the following:

include path

Set it to the include directory of YAZ.

import library yaz5.lib

You must link with this library. It's located in the sub directory lib of YAZ. If you want to link with the debug version of YAZ, you must link against yaz5d.lib instead.

dynamic link library yaz5.dll

This DLL must be in your execution path when you invoke your application. Specifically, you should distribute this DLL with your application.

3.3. Compiling Libxml2 and Libxslt on windows

Download libxml2 and Libxslt source and unpack it. In the example below we install Libxml2 2.9.2 and Libxslt 1.1.28 for 32-bit, so we use the destination directories libxml2.2.9.2.win32 and libxslt-1.1.28.win32 to reflect both version and architecture.

      cd win32
      cscript configure.js prefix=c:\libxml2-2.9.2.win32 iconv=no
      nmake
      nmake install
     

Note

There's an error in configure.js for Libxml2 2.9.2. Line 17 should be assigned to configure.ac rather than configure.in.

For Libxslt it is similar. We must ensure that compilation of Libxslt links against the already installed libxml2.

      cd win32
      cscript configure.js prefix=c:\libxslt-1.1.28.win32 iconv=no \
          lib=c:\libxml2-2.9.2.win32\lib \
	  include=c:\libxml2-2.9.2.win32\include\libxml2
      nmake
      nmake install
     

yaz-5.34.4/doc/gfs-synopsis.xml0000664000175000017500000000310414631643521012033 &gfs-synopsis-app; listener-spec yaz-5.34.4/doc/bib1-attr-man.xml0000664000175000017500000001342714631643521011736 %local; %entities; %idcommon; ]> YAZ &version; Index Data Bib-1 Attribute Set 7 Conventions and miscellaneous bib1-attr Bib-1 Attribute Set DESCRIPTION This reference entry lists the Bib-1 attribute set types and values. TYPES The Bib-1 attribute set defines six attribute types: Use (1), Relation (2), Position (3), Structure (4), Truncation (5) and Completeness (6). USE (1) 1 Personal-name 2 Corporate-name 3 Conference-name 4 Title 5 Title-series 6 Title-uniform 7 ISBN 8 ISSN 9 LC-card-number 10 BNB-card-number 11 BGF-number 12 Local-number 13 Dewey-classification 14 UDC-classification 15 Bliss-classification 16 LC-call-number 17 NLM-call-number 18 NAL-call-number 19 MOS-call-number 20 Local-classification 21 Subject-heading 22 Subject-Rameau 23 BDI-index-subject 24 INSPEC-subject 25 MESH-subject 26 PA-subject 27 LC-subject-heading 28 RVM-subject-heading 29 Local-subject-index 30 Date 31 Date-of-publication 32 Date-of-acquisition 33 Title-key 34 Title-collective 35 Title-parallel 36 Title-cover 37 Title-added-title-page 38 Title-caption 39 Title-running 40 Title-spine 41 Title-other-variant 42 Title-former 43 Title-abbreviated 44 Title-expanded 45 Subject-precis 46 Subject-rswk 47 Subject-subdivision 48 Number-natl-biblio 49 Number-legal-deposit 50 Number-govt-pub 51 Number-music-publisher 52 Number-db 53 Number-local-call 54 Code-language 55 Code-geographic 56 Code-institution 57 Name-and-title 58 Name-geographic 59 Place-publication 60 CODEN 61 Microform-generation 62 Abstract 63 Note 1000 Author-title 1001 Record-type 1002 Name 1003 Author 1004 Author-name-personal 1005 Author-name-corporate 1006 Author-name-conference 1007 Identifier-standard 1008 Subject-LC-childrens 1009 Subject-name-personal 1010 Body-of-text 1011 Date/time-added-to-db 1012 Date/time-last-modified 1013 Authority/format-id 1014 Concept-text 1015 Concept-reference 1016 Any 1017 Server-choice 1018 Publisher 1019 Record-source 1020 Editor 1021 Bib-level 1022 Geographic-class 1023 Indexed-by 1024 Map-scale 1025 Music-key 1026 Related-periodical 1027 Report-number 1028 Stock-number 1030 Thematic-number 1031 Material-type 1032 Doc-id 1033 Host-item 1034 Content-type 1035 Anywhere 1036 Author-Title-Subject RELATION (2) 1 Less than 2 Less than or equal 3 Equal 4 Greater or equal 5 Greater than 6 Not equal 100 Phonetic 101 Stem 102 Relevance 103 AlwaysMatches POSITION (3) 1 First in field 2 First in subfield 3 Any position in field STRUCTURE (4) 1 Phrase 2 Word 3 Key 4 Year 5 Date (normalized) 6 Word list 100 Date (un-normalized) 101 Name (normalized) 102 Name (un-normalized) 103 Structure 104 Urx 105 Free-form-text 106 Document-text 107 Local-number 108 String 109 Numeric-string TRUNCATION (5) 1 Right truncation 2 Left truncation 3 Left and right truncation 100 Do not truncate 101 Process # in search term . regular #=.* 102 RegExpr-1 103 RegExpr-2 104 Process # ?n . regular: #=., ?n=.{0,n} or ?=.* Z39.58 The 105-106 truncation attributes below are only supported by Index Data's Zebra server. 105 Process * ! regular: *=.*, !=. and right truncate 106 Process * ! regular: *=.*, !=. COMPLETENESS (6) 1 Incomplete subfield 2 Complete subfield 3 Complete field SORTING (7) 1 ascending 2 descending Type 7 is an Index Data extension to RPN queries that allows embedding a sort critieria into a query. SEE ALSO Bib-1 Attribute Set Attribute Set Bib-1 Semantics. yaz-5.34.4/doc/yaz-iconv.html0000664000175000017500000001462414754707607011477 yaz-iconv

Name

yaz-iconv — YAZ Character set conversion utility

Synopsis

yaz-iconv [-f from] [-t to] [-v] [file...]

DESCRIPTION

yaz-iconv converts data in the character set specified by from to output in the character set as specified by to.

This yaz-iconv utility is similar to the iconv found on many POSIX systems (Glibc, Solaris, etc).

If no file is specified, yaz-iconv reads from standard input.

OPTIONS

-ffrom]

Specify the character set from of the input file. Should be used in conjunction with option -t.

-tto]

Specify the character set of of the output. Should be used in conjunction with option -f.

-v

Print more information about the conversion process.

ENCODINGS

The yaz-iconv command and the API as defined in yaz/yaz-iconv.h is a wrapper for the library system call iconv. But YAZ' iconv utility also implements conversions on its own. The table below lists characters sets (or encodings) that are supported by YAZ. Each character set is marked with either encode or decode. If an encoding is encode-enabled, YAZ may convert to the designated encoding. If an encoding is decode-enabled, YAZ may convert from the designated encoding.

marc8 (encode, decode)

The MARC8 encoding as defined by the Library of Congress. Most MARC21/USMARC records use this encoding.

marc8s (encode, decode)

Like MARC8 but conversion prefers non-combined characters in the Latin-1 plane over combined characters.

marc8lossy (encode)

Lossy encoding of MARC-8.

marc8lossless (encode)

Lossless encoding of MARC8.

utf8 (encode, decode)

The most commonly used UNICODE encoding on the Internet.

iso8859-1 (encode, decode)

ISO-8859-1, AKA Latin-1.

iso5426 (decode)

ISO 5426. Some MARC records (UNIMARC) use this encoding.

iso5428:1984 (encode, decode)

ISO 5428:1984.

advancegreek (encode, decode)

An encoding for Greek in use by some vendors (Advance).

danmarc (decode)

Danmarc (in danish) is an encoding based on UNICODE which is used for DanMARC2 records.

EXAMPLES

The following command converts from ISO-8859-1 (Latin-1) to UTF-8.

    yaz-iconv -f ISO-8859-1 -t UTF-8 <input.lst >output.lst
   

FILES

prefix/bin/yaz-iconv

prefix/include/yaz/yaz-iconv.h

SEE ALSO

yaz(7) iconv(1)

yaz-5.34.4/doc/server.vhosts.html0000664000175000017500000002630614754707607012413 7. GFS Configuration and Virtual Hosts

7. GFS Configuration and Virtual Hosts

The Virtual hosts mechanism allows a YAZ front-end server to support multiple back-ends. A back-end is selected on the basis of the TCP/IP binding (port+listening address) and/or the virtual host.

A back-end can be configured to execute in a particular working directory. Or the YAZ front-end may perform CQL to RPN conversion, thus allowing traditional Z39.50 back-ends to be offered as a SRW/SRU service. SRW/SRU Explain information for a particular back-end may also be specified.

For the HTTP protocol, the virtual host is specified in the Host header. For the Z39.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1.

Note

Not all Z39.50 clients allow the VHOST information to be set. For those, the selection of the back-end must rely on the TCP/IP information alone (port and address).

The YAZ front-end server uses XML to describe the back-end configurations. Command-line option -f specifies filename of the XML configuration.

The configuration uses the root element yazgfs. This element includes a list of listen elements, followed by one or more server elements.

The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server. Content for a listener:

CDATA (required)

The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc.

attribute id (optional)

Identifier for this listener. This may be referred to from server sections.

Note

We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers.

The server describes a server and the parameters for this server type. Content for a server:

attribute id (optional)

Identifier for this server. Currently not used for anything, but it might be for logging purposes.

attribute listenref (optional)

Specifies one or more listeners for this server. Each server ID is separated by a comma. If this attribute is not given, the server is accessible from all listeners. In order for the server to be used for real, however, the virtual host must match if specified in the configuration.

element config (optional)

Specifies the server configuration. This is equivalent to the config specified using command line option -c.

element directory (optional)

Specifies a working directory for this backend server. If specified, the YAZ frontend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init).

element host (optional)

Specifies the virtual host for this server. If this is specified a client must specify this host string in order to use this backend.

element cql2rpn (optional)

Specifies a filename that includes CQL to RPN conversion for this backend server. See Section 1.3.4, “Specification of CQL to RPN mappings”. If given, the backend server will only "see" a Type-1/RPN query.

element ccl2rpn (optional)

Specifies a filename that includes CCL to RPN conversion for this backend server. See Section 1.2.2, “CCL Qualifiers”. If given, the backend server will only "see" a Type-1/RPN query.

element stylesheet (optional)

Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one. If none is given, then if the client does not specify one, then no stylesheet reference is part of the SRU HTTP response.

element client_query_charset (optional)

If specified, a conversion from the character set given to UTF-8 is performed by the generic frontend server. It is only executed for Z39.50 search requests (SRU/Solr are assumed to be UTF-8 encoded already).

element docpath (optional)

Specifies a path for local file access using HTTP. All URLs with a leading prefix (/ excluded) that matches the value of docpath are used for file access. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/xsl will result in a local file access.

element explain (optional)

Specifies SRW/SRU ZeeRex content for this server. Copied verbatim to the client. As things are now, some of the Explain content seem redundant because host information, etc. is also stored elsewhere.

element maximumrecordsize (optional)

Specifies maximum record size/message size, in bytes. This value also serves as the maximum size of incoming packages (for Record Updates etc). It's the same value as that given by the -k option.

element retrievalinfo (optional)

Enables the retrieval facility to support conversions and specifications of record formats/types. See Section 6, “Retrieval Facility” for more information.

The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket. We name the TCP/IP server public and the other server internal.

  
 <yazgfs>
  <listen id="public">tcp:@:9900</listen>
  <listen id="internal">unix:/var/tmp/socket</listen>
  <server id="server1">
    <host>server1.mydomain</host>
    <directory>/var/www/s1</directory>
    <config>config.cfg</config>
  </server>
  <server id="server2" listenref="public,internal">
    <host>server2.mydomain</host>
    <directory>/var/www/s2</directory>
    <config>config.cfg</config>
    <cql2rpn>../etc/pqf.properties</cql2rpn>
    <explain xmlns="http://explain.z3950.org/dtd/2.0/">
      <serverInfo>
        <host>server2.mydomain</host>
        <port>9900</port>
        <database>a</database>
      </serverInfo>
    </explain>
  </server>
  <server id="server3" listenref="internal">
    <directory>/var/www/s3</directory>
    <config>config.cfg</config>
  </server>
 </yazgfs>

 

There are three configured backend servers. The first two servers, "server1" and "server2", can be reached by both listener addresses. "server1" is reached by all (two) since no listenref attribute is specified. "server2" is reached by the two listeners specified. In order to distinguish between the two, a virtual host has been specified for each server in the host elements.

For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small).

The third server, "server3" can only be reached via listener "internal".

yaz-5.34.4/doc/zoom.scan.html0000664000175000017500000001437714754707607011474 6. Scan

6. Scan

This section describes an interface for Scan. Scan is not an official part of the ZOOM model yet. The result of a scan operation is the ZOOM_scanset which is a set of terms returned by a target.

The Scan interface is supported for both Z39.50, SRU and Solr.

    ZOOM_scanset ZOOM_connection_scan(ZOOM_connection c,
                                      const char *startpqf);

    ZOOM_scanset ZOOM_connection_scan1(ZOOM_connection c,
                                       ZOOM_query q);

    size_t ZOOM_scanset_size(ZOOM_scanset scan);

    const char *ZOOM_scanset_term(ZOOM_scanset scan, size_t pos,
                                  size_t *occ, size_t *len);

    const char *ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos,
                                          size_t *occ, size_t *len);

    void ZOOM_scanset_destroy(ZOOM_scanset scan);

    const char *ZOOM_scanset_option_get(ZOOM_scanset scan,
                                        const char *key);

    void ZOOM_scanset_option_set(ZOOM_scanset scan, const char *key,
                                 const char *val);
    

The scan set is created by function ZOOM_connection_scan which performs a scan operation on the connection using the specified startpqf. If the operation was successful, the size of the scan set can be retrieved by a call to ZOOM_scanset_size. Like result sets, the items are numbered 0..size-1. To obtain information about a particular scan term, call function ZOOM_scanset_term. This function takes a scan set offset pos and returns a pointer to a raw term or NULL if non-present. If present, the occ and len are set to the number of occurrences and the length of the actual term respectively. ZOOM_scanset_display_term is similar to ZOOM_scanset_term except that it returns the display term rather than the raw term. In a few cases, the term is different from display term. Always use the display term for display and the raw term for subsequent scan operations (to get more terms, next scan result, etc).

A scan set may be freed by a call to function ZOOM_scanset_destroy. Functions ZOOM_scanset_option_get and ZOOM_scanset_option_set retrieves and sets an option respectively.

The startpqf is a subset of PQF, namely the Attributes+Term part. Multiple @attr can be used. For example to scan in title (complete) phrases:


     @attr 1=4 @attr 6=2 "science o"
    

The ZOOM_connecton_scan1 is a newer and more generic alternative to ZOOM_connection_scan which allows to use both CQL and PQF for Scan.

Table 3.5. ZOOM Scan Set Options

OptionDescriptionDefault
numberNumber of Scan Terms requested in next scan. After scan it holds the actual number of terms returned. 20
positionPreferred Position of term in response in next scan; actual position after completion of scan. 1
stepSizeStep Size 0
scanStatusAn integer indicating the Scan Status of last scan. 0
rpnCharsetCharacter set for RPN terms. If this is set, ZOOM C will assume that the ZOOM application is running UTF-8. Terms in RPN queries are then converted to the rpnCharset. If this is unset, ZOOM C will not assume any encoding of RPN terms and no conversion is performed. none

yaz-5.34.4/doc/sorting.html0000664000175000017500000001165514754707607011246 7. Sorting

7. Sorting

This chapter describes sorting and how it is supported in YAZ. Sorting applies to a result-set. The Z39.50 sorting facility takes one or more input result-sets and one result-set as output. The most simple case is that the input-set is the same as the output-set.

Z39.50 sorting has a separate APDU (service) that is, thus, performed following a search (two phases).

In SRU/Solr, however, the model is different. Here, sorting is specified during the search operation. Note, however, that SRU might perform sort as separate search, by referring to an existing result-set in the query (result-set reference).

7.1. Using the Z39.50 sort service

yaz-client and the ZOOM API support the Z39.50 sort facility. In any case the sort sequence or sort criteria is using a string notation. This notation is a one-line notation suitable for being manually entered or generated, and allows for easy logging (one liner). For the ZOOM API, the sort is specified in the call to ZOOM_query_sortby function. For yaz-client the sort is performed and specified using the sort and sort+ commands. For description of the sort criteria notation refer to the sort command in the yaz-client manual.

The ZOOM API might choose one of several sort strategies for sorting. Refer to Table 3.2, “ZOOM sort strategy”.

7.2. Type-7 sort

Type-7 sort is an extension to the Bib-1 based RPN query where the sort specification is embedded as an Attribute-Plus-Term.

The objectives for introducing Type-7 sorting is that it allows a client to perform sorting even if it does not implement/support Z39.50 sort. Virtually all Z39.50 client software supports RPN queries. It also may improve performance because the sort criteria is specified along with the search query.

The sort is triggered by the presence of type 7, and the value of type 7 specifies the sortRelation . The value for type 7 is 1 for ascending and 2 for descending. For the sortElement only the generic part is handled. If generic sortKey is of type sortField, then attribute type 1 is present and the value is sortField (InternationalString). If generic sortKey is of type sortAttributes, then the attributes in the list are used. Generic sortKey of type elementSpec is not supported.

The term in the sorting Attribute-Plus-Term combo should hold an integer. The value is 0 for primary sorting criteria, 1 for second criteria, etc.

yaz-5.34.4/doc/Makefile.am0000664000175000017500000000723114753422702010707 ## This file is part of the YAZ toolkit. ## Copyright (C) Index Data SUBDIRS = common XMLFILES = book.xml \ gfs-options.xml gfs-virtual.xml gfs-synopsis.xml \ std-oid-table.xml bib1-diag-table.xml srw-diag-table.xml \ manref.xml local.ent HTMLFILES = index.html MANFILES=yaz-client.1 yaz-ztest.8 \ yaz-config.1 yaz.7 zoomsh.1 yaz-asncomp.1 \ yaz-marcdump.1 yaz-iconv.1 yaz-log.7 \ yaz-illclient.1 yaz-icu.1 yaz-url.1 bib1-attr.7 \ yaz-json-parse.1 yaz-record-conv.1 REFFILES=yaz-client-man.xml yaz-ztest-man.xml yaz-config-man.xml \ yaz-man.xml zoomsh-man.xml yaz-asncomp-man.xml \ yaz-marcdump-man.xml yaz-iconv-man.xml yaz-log-man.xml \ yaz-illclient-man.xml yaz-icu-man.xml yaz-url-man.xml \ bib1-attr-man.xml yaz-json-parse-man.xml yaz-record-conv-man.xml SUPPORTFILES=entities.ent apilayer.obj doc_DATA = $(HTMLFILES) apilayer.png man_MANS = $(MANFILES) EXTRA_DIST = $(XMLFILES) $(SUPPORTFILES) $(man_MANS) $(REFFILES) \ $(doc_DATA) std-oid-table.xml: $(srcdir)/../src/oid.csv $(TCLSH) $(top_srcdir)/src/oidtoc.tcl $(top_srcdir)/src/oid.csv std-oid-table.xml bib1-diag-table.xml: $(srcdir)/../src/bib1.csv $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/bib1.csv bib1-diag-table.xml bib1-diag-table srw-diag-table.xml: $(srcdir)/../src/srw.csv $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/srw.csv srw-diag-table.xml srw-diag-table yaz-client.1: $(srcdir)/yaz-client-man.xml $(MAN_COMPILE) $(srcdir)/yaz-client-man.xml yaz-ztest.8: yaz-ztest-man.xml gfs-options.xml gfs-synopsis.xml gfs-virtual.xml $(MAN_COMPILE) $(srcdir)/yaz-ztest-man.xml yaz-config.1: yaz-config-man.xml $(MAN_COMPILE) $(srcdir)/yaz-config-man.xml yaz.7: yaz-man.xml $(MAN_COMPILE) $(srcdir)/yaz-man.xml bib1-attr.7: bib1-attr-man.xml $(MAN_COMPILE) $(srcdir)/bib1-attr-man.xml zoomsh.1: zoomsh-man.xml $(MAN_COMPILE) $(srcdir)/zoomsh-man.xml yaz-asncomp.1: yaz-asncomp-man.xml $(MAN_COMPILE) $(srcdir)/yaz-asncomp-man.xml yaz-marcdump.1: yaz-marcdump-man.xml $(MAN_COMPILE) $(srcdir)/yaz-marcdump-man.xml yaz-iconv.1: yaz-iconv-man.xml $(MAN_COMPILE) $(srcdir)/yaz-iconv-man.xml yaz-illclient.1: yaz-illclient-man.xml $(MAN_COMPILE) $(srcdir)/yaz-illclient-man.xml yaz-log.7: yaz-log-man.xml $(MAN_COMPILE) $(srcdir)/yaz-log-man.xml yaz-icu.1: yaz-icu-man.xml $(MAN_COMPILE) $(srcdir)/yaz-icu-man.xml yaz-url.1: yaz-url-man.xml $(MAN_COMPILE) $(srcdir)/yaz-url-man.xml yaz-json-parse.1: yaz-json-parse-man.xml $(MAN_COMPILE) $(srcdir)/yaz-json-parse-man.xml yaz-record-conv.1: yaz-record-conv-man.xml $(MAN_COMPILE) $(srcdir)/yaz-record-conv-man.xml $(HTMLFILES): $(XMLFILES) rm -f *.html $(HTML_COMPILE) $(srcdir)/book.xml $(MANFILES): local.ent yaz.pdf: $(XMLFILES) $(PDF_COMPILE) $(srcdir)/book.xml && mv book.pdf yaz.pdf yazj.pdf: jade -E14 -D $(srcdir) -d common/print.dsl -t tex $(srcdir)/common/xml.dcl $(srcdir)/book.xml rm -f yazj.pdf cp book.tex yazj.tex pdfjadetex yazj.tex pdfjadetex yazj.tex >/dev/null pdfjadetex yazj.tex >/dev/null manref.xml: $(REFFILES) $(srcdir)/common/stripref.xsl local.ent rm -f manref.xml for i in $(REFFILES); do \ xsltproc $(srcdir)/common/stripref.xsl $(srcdir)/$$i | sed 1d >>manref.xml; \ done apilayer.png: tgif -print -xbm apilayer.obj xbmtopbm apilayer.png dist-hook: if test -f index.html; then d=.; else d="$(srcdir)"; fi; \ for p in $$d/*.html; do \ cp $$p $(distdir); \ done doc-clean: rm -f manref.xml *.html *.[0-9] *.pdf toc.hhc htmlhelp.hhp install-data-hook: if test -f index.html; then d=.; else d="$(srcdir)"; fi; \ for p in $$d/*.html; do \ $(INSTALL_DATA) $$p $(DESTDIR)$(docdir); \ done uninstall-hook: rm -r $(DESTDIR)$(docdir) distclean-local: doc-clean yaz-5.34.4/doc/comstack.diagnostics.html0000664000175000017500000000546214754707607013672 8. Diagnostics

8. Diagnostics

All functions return -1 if an error occurs. Typically, the functions will return 0 on success, but the data exchange functions (cs_get, cs_put, cs_more) follow special rules. Consult their descriptions.

The error code for the COMSTACK can be retrieved using C macro cs_errno which will return one of the error codes CSYSERR, CSOUTSTATE, CSNODATA, ...

    int cs_errno(COMSTACK handle);
   

You can the textual representation of the error code by using cs_errmsg, which works like strerror(3).

    const char *cs_errmsg(int n);
   

It is also possible to get straight to the textual representation without the error code, by using cs_strerror.

    const char *cs_strerror(COMSTACK h);
   
yaz-5.34.4/doc/yaz-json-parse.10000664000175000017500000000377614754707606011643 '\" t .\" Title: yaz-json-parse .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-JSON\-PARSE" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-json-parse \- YAZ JSON parser .SH "SYNOPSIS" .HP \w'\fByaz\-json\-parse\fR\ 'u \fByaz\-json\-parse\fR [\-p] .SH "DESCRIPTION" .PP \fByaz\-json\-parse\fR is a utility which demonstrates the JSON API of YAZ\&. (yaz/json\&.h)\&. .PP The program attempts to parse a JSON from standard input (stdin)\&. It will return exit code 1 if parsing fails and the parsing error message will be printed to standard error (stderr)\&. The program returns exit code 0 if parsing succeeds, and returns no output unless \-p is given (see below)\&. .SH "OPTIONS" .PP \-p .RS 4 Makes the JSON parser echo the JSON result string to standard output, if parsing from stdin was successful\&. If \-p is given twice, then the output is a multi\-line output with indentation (pretty print)\&. .RE .SH "SEE ALSO" .PP \fByaz\fR(7) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/yaz-url.html0000664000175000017500000001055714754707607011164 yaz-url

Name

yaz-url — YAZ URL fetch utility

Synopsis

yaz-url [-H name:value] [-m method] [-O fname] [-p fname] [-R num] [-u user/password] [-v] [-x proxy] [url...]

DESCRIPTION

yaz-url is utility to get web content. It is very limited in functionality compared to programs such as curl, wget.

The options must precede the URL given on the command line, to take effect.

Fetched HTTP content is written to stdout, unless option -O is given.

OPTIONS

-H name:value

Specifies HTTP header content with name and value. This option can be given multiple times (for different names, of course).

-m method

Specifies the HTTP method to be used for the next URL. Default is method "GET". However, option -p sets it to "POST".

-O fname

Sets output filename for HTTP content.

-p fname

Sets a file to be POSTed in the following URL.

-R num

Sets maximum number of HTTP redirects to be followed. A value of zero disables follow of HTTP redirects.

-u user/password

Specifies a user and a password to be used in HTTP basic authentication in the following URL fetch. The user and password must be separated by a slash (thus it is not possible to specify a user with a slash in it).

-v

Makes yaz-url dump each HTTP request/response to stdout.

-x proxy

Specifies a proxy to be used for URL fetch.

SEE ALSO

yaz(7)

yaz-5.34.4/doc/comstack.server.html0000664000175000017500000000740014754707607012663 5. Server Side

5. Server Side

To establish a server under the inetd server, you can use

    COMSTACK cs_createbysocket(int socket, CS_TYPE type, int blocking,
                               int protocol);
   

The socket parameter is an established socket (when your application is invoked from inetd, the socket will typically be 0. The following parameters are identical to the ones for cs_create.

    int cs_bind(COMSTACK handle, void *address, int mode)
   

Binds a local address to the endpoint. Read about addresses below. The mode parameter should be either CS_CLIENT or CS_SERVER.

    int cs_listen(COMSTACK handle, char *addr, int *addrlen);
   

Call this to process incoming events on an endpoint that has been bound in listening mode. It will return 0 to indicate that the connect request has been received, 1 to signal a partial reception, and -1 to indicate an error condition.

    COMSTACK cs_accept(COMSTACK handle);
   

This finalizes the server-side association establishment, after cs_listen has completed successfully. It returns a new connection endpoint, which represents the new association. The application will typically wish to fork off a process to handle the association at this point, and continue listen for new connections on the old handle.

You can use the call

    const char *cs_addrstr(COMSTACK);
   

on an established connection to retrieve the host-name of the remote host.

Note

You may need to use this function with some care if your name server service is slow or unreliable.

yaz-5.34.4/doc/sru-diagnostics.html0000664000175000017500000002032614754707607012672 Appendix C. SRU diagnostics

Appendix C. SRU diagnostics

List of SRU diagnostics that are known to YAZ.

CodeText
1 Permanent system error
2 System temporarily unavailable
3 Authentication error
4 Unsupported operation
5 Unsupported version
6 Unsupported parameter value
7 Mandatory parameter not supplied
8 Unsupported parameter
10 Query syntax error
11 Unsupported query type
12 Too many characters in query
13 Invalid or unsupported use of parentheses
14 Invalid or unsupported use of quotes
15 Unsupported context set
16 Unsupported index
17 Unsupported combination of index and context set
18 Unsupported combination of indexes
19 Unsupported relation
20 Unsupported relation modifier
21 Unsupported combination of relation modifiers
22 Unsupported combination of relation and index
23 Too many characters in term
24 Unsupported combination of relation and term
25 Special characters not quoted in term
26 Non special character escaped in term
27 Empty term unsupported
28 Masking character not supported
29 Masked words too short
30 Too many masking characters in term
31 Anchoring character not supported
32 Anchoring character in unsupported position
33 Combination of proximity/adjacency and masking characters not supported
34 Combination of proximity/adjacency and anchoring characters not supported
35 Term contains only stopwords
36 Term in invalid format for index or relation
37 Unsupported boolean operator
38 Too many boolean operators in query
39 Proximity not supported
40 Unsupported proximity relation
41 Unsupported proximity distance
42 Unsupported proximity unit
43 Unsupported proximity ordering
44 Unsupported combination of proximity modifiers
45 Prefix assigned to multiple identifiers
46 Unsupported boolean modifier
47 Cannot process query; reason unknown
48 Query feature unsupported
49 Masking character in unsupported position
50 Result sets not supported
51 Result set does not exist
52 Result set temporarily unavailable
53 Result sets only supported for retrieval
54 Retrieval may only occur from an existing result set
55 Combination of result sets with search terms not supported
56 Only combination of single result set with search terms supported
57 Result set created but no records available
58 Result set created with unpredictable partial results available
59 Result set created with valid partial results available
60 Result set not created: too many matching records
61 First record position out of range
62 Negative number of records requested
63 System error in retrieving records
64 Record temporarily unavailable
65 Record does not exist
66 Unknown schema for retrieval
67 Record not available in this schema
68 Not authorised to send record
69 Not authorised to send record in this schema
70 Record too large to send
71 Unsupported record packing
72 XPath retrieval unsupported
73 XPath expression contains unsupported feature
74 Unable to evaluate XPath expression
80 Sort not supported
81 Unsupported sort type
82 Unsupported sort sequence
83 Too many records to sort
84 Too many sort keys to sort
85 Duplicate sort keys
86 Cannot sort: incompatible record formats
87 Unsupported schema for sort
88 Unsupported path for sort
89 Path unsupported for schema
90 Unsupported direction value
91 Unsupported case value
92 Unsupported missing value action
93 Sort ended due to missing value
100 Explain not supported
101 Explain request type not supported (SOAP vs GET)
102 Explain record temporarily unavailable
110 Stylesheets not supported
111 Unsupported stylesheet
120 Response position out of range
121 Too many terms requested
235 Database does not exist
236 Access to specified database denied
1015 Init/AC: Maximum number of simultaneous sessions for Userid
1074 Proxy failure
yaz-5.34.4/doc/srw-diag-table.xml0000664000175000017500000002040214754707604012202 Code Text 1 Permanent system error 2 System temporarily unavailable 3 Authentication error 4 Unsupported operation 5 Unsupported version 6 Unsupported parameter value 7 Mandatory parameter not supplied 8 Unsupported parameter 10 Query syntax error 11 Unsupported query type 12 Too many characters in query 13 Invalid or unsupported use of parentheses 14 Invalid or unsupported use of quotes 15 Unsupported context set 16 Unsupported index 17 Unsupported combination of index and context set 18 Unsupported combination of indexes 19 Unsupported relation 20 Unsupported relation modifier 21 Unsupported combination of relation modifiers 22 Unsupported combination of relation and index 23 Too many characters in term 24 Unsupported combination of relation and term 25 Special characters not quoted in term 26 Non special character escaped in term 27 Empty term unsupported 28 Masking character not supported 29 Masked words too short 30 Too many masking characters in term 31 Anchoring character not supported 32 Anchoring character in unsupported position 33 Combination of proximity/adjacency and masking characters not supported 34 Combination of proximity/adjacency and anchoring characters not supported 35 Term contains only stopwords 36 Term in invalid format for index or relation 37 Unsupported boolean operator 38 Too many boolean operators in query 39 Proximity not supported 40 Unsupported proximity relation 41 Unsupported proximity distance 42 Unsupported proximity unit 43 Unsupported proximity ordering 44 Unsupported combination of proximity modifiers 45 Prefix assigned to multiple identifiers 46 Unsupported boolean modifier 47 Cannot process query; reason unknown 48 Query feature unsupported 49 Masking character in unsupported position 50 Result sets not supported 51 Result set does not exist 52 Result set temporarily unavailable 53 Result sets only supported for retrieval 54 Retrieval may only occur from an existing result set 55 Combination of result sets with search terms not supported 56 Only combination of single result set with search terms supported 57 Result set created but no records available 58 Result set created with unpredictable partial results available 59 Result set created with valid partial results available 60 Result set not created: too many matching records 61 First record position out of range 62 Negative number of records requested 63 System error in retrieving records 64 Record temporarily unavailable 65 Record does not exist 66 Unknown schema for retrieval 67 Record not available in this schema 68 Not authorised to send record 69 Not authorised to send record in this schema 70 Record too large to send 71 Unsupported record packing 72 XPath retrieval unsupported 73 XPath expression contains unsupported feature 74 Unable to evaluate XPath expression 80 Sort not supported 81 Unsupported sort type 82 Unsupported sort sequence 83 Too many records to sort 84 Too many sort keys to sort 85 Duplicate sort keys 86 Cannot sort: incompatible record formats 87 Unsupported schema for sort 88 Unsupported path for sort 89 Path unsupported for schema 90 Unsupported direction value 91 Unsupported case value 92 Unsupported missing value action 93 Sort ended due to missing value 100 Explain not supported 101 Explain request type not supported (SOAP vs GET) 102 Explain record temporarily unavailable 110 Stylesheets not supported 111 Unsupported stylesheet 120 Response position out of range 121 Too many terms requested 235 Database does not exist 236 Access to specified database denied 1015 Init/AC: Maximum number of simultaneous sessions for Userid 1074 Proxy failure yaz-5.34.4/doc/manref.xml0000664000175000017500000042100314754707605010653 YAZ 5.34.4 Index Data yaz-client 1 Commands yaz-client Z39.50/SRU client for implementors yaz-client server-addr DESCRIPTION yaz-client is a Z39.50/SRU client (origin) with a simple command line interface that allows you to test behavior and performance of Z39.50 targets and SRU servers. From YAZ version 4.1.0 yaz-client may also operate as a Solr Web Service client. If the server-addr is specified, the client creates a connection to the Z39.50/SRU target at the address given. When yaz-client is started it tries to read commands from one of the following files: Command file if it is given by option -f. .yazclientrc in current working directory. .yazclientrc in the user's home directory. The value of the $HOME environment variable is used to determine the home directory. Normally, $HOME is only set on POSIX systems such as Linux, FreeBSD, Solaris. OPTIONS -a filename If specified, logging of protocol packages will be appended to the file given. If filename is specified as -, the output is written to stdout. -b filename If specified, YAZ will dump BER data in readable notation to the file specified. If filename is specified as - the output is written to stdout. -c filename If specified, CCL configuration will be read from the file given. -d dump If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named dump.DDD.raw, where DDD is 001, 002, 003, ... -f cmdfile Reads commands from cmdfile. When this option is used, YAZ client does not read .yazclientrc from current directory or home directory. -k size Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 65536 (64 MB). -m filename If specified, retrieved records will be appended to the file given. -p proxy-addr If specified, the client will use the proxy at the address given. YAZ client will connect to a proxy on the address and port given. The actual target will be specified as part of the InitRequest to inform the proxy about the actual target. -q filename If specified, CQL configuration will be read from the file given. -t displaycharset If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). -u auth If specified, the auth string will be used for authentication. -v level Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none. -V Prints YAZ version. -x Makes the YAZ client print hex dumps of packages sent and received on standard output. COMMANDS The YAZ client accepts the following commands. open zurl Opens a connection to a server. The syntax for zurl is the same as described above for connecting from the command line. Syntax: [(tcp|ssl|unix|http)':']host [:port][/base] quit Quits YAZ client find query Sends a Search Request using the query given. By default the query is assumed to be PQF. See command querytype for more information. delete setname Deletes result set with name setname on the server. base base1 base2 ... Sets the name(s) of the database(s) to search. One or more databases may be specified, separated by blanks. This command overrides the database given in zurl. show [start[+number [+resultset]]] Fetches records by sending a Present Request from the start position given by start and a number of records given by number, from the result set resultset. If start is not given, then the client will fetch from the position of the last retrieved record plus 1. If number is not given, then one record will be fetched at a time. If resultset is not given, the most recently retrieved result set is used. scan term Scans database index for a term. The syntax resembles the syntax for find. If you want to scan for the word water you could write scan water but if you want to scan only in, say the title field, you would write scan @attr 1=4 water setscan set term Scans database index for a term within a result set. This is similar to the scan command but has a result set as its first argument. scanpos pos Sets preferred position for scan. This value is used in the next scan. By default, position is 1. scansize size Sets number of entries to be returned by scan. Default number of entries is 20. scanstep step Set step-size for scan. This value is used in the next scan sent to the target. By default step-size is 0. sort sortspecs Sorts a result set. The sort command takes a sequence of space-separated sort specifications, with each sort specification consisting of two space-separated words (so that the whole specification list is made up of an even number of words). The first word of each specification holds a field (sort criterion) and the second holds flags. If the sort criterion includes = it is assumed that the SortKey is of type sortAttributes using Bib-1: in this case the integer before = is the attribute type and the integer following = is the attribute value. If no = character is in the criterion, it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of s for case sensitive or i for case insensitive, and < for ascending order or > for descending order. Example using sort criterion with attributes use=local-number and structure=numeric and ascending flag: 1=12,4=109 < Another example with "Title" sort field and descending flag: Title > sort+ Same as sort but stores the sorted result set in a new result set. authentication [auth1 [auth2 [auth3]]] Configures authentication strings to be sent to server. Zero, 1, 2 or 3 arguments may follow the auth command. If no (0) arguments are given, no authentication string is sent. If one argument is given, the Z39.50 v2 OpenStyle authentication is used. A common convention for the auth1 string is that the username and password is separated by a slash, e.g. myusername/mysecret. If two or more arguments is given Z39.50 v3 authentication is used, in which cased the first argument is used, second argument is group and third argument is password. If only two arguments are given the group is assumed to be empty. As for other commands in yaz-client, the arguments are separated by whitespace. A backslash character can be used to include a character verbatim. For example, auth myuser a\ b is a two argument auth command where user is myuser and password is a b. The authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent, so this command must be used before open in order to be effective. sru method version Selects Web Service method and version. Must be one of post, get, soap (default) or solr. Version should be either 1.1, 1.2 or 2.0 for SRU. Other versions are allowed - for testing purposes (version negotiation with SRU server). The version is currently not used for Solr Web Services list_all This command displays status and values for many settings. lslb n Sets the limit for when no records should be returned together with the search result. See the Z39.50 standard on set bounds for more details. ssub n Sets the limit for when all records should be returned with the search result. See the Z39.50 standard on set bounds for more details. mspn n Sets the number of records that should be returned if the number of records in the result set is between the values of lslb and ssub. See the Z39.50 standard on set bounds for more details. status Displays the values of lslb, ssub and mspn. setname Switches named result sets on and off. Default is on. cancel Sends a Trigger Resource Control Request to the target. facets spec Specifies requested facets to be used in search. The notation is specified in . format oid Sets the preferred transfer syntax for retrieved records. yaz-client supports all the record syntaxes that currently are registered. See Z39.50 Record Syntax Identifiers for more details. Commonly used records syntaxes include usmarc, sutrs and xml. elements e Sets the element set name for the records. Many targets support element sets B (for brief) and F (for full). close Sends a Z39.50 Close APDU and closes connection with the peer querytype type Sets the query type as used by command find. The following is supported: prefix for Prefix Query Notation (Type-1 Query); ccl for CCL search (Type-2 Query), cql for CQL (Type-104 search with CQL OID), ccl2rpn for CCL to RPN conversion (Type-1 Query), cql2rpn for CQL to RPN conversion (Type-1 Query). attributeset set Sets attribute set OID for prefix queries (RPN, Type-1). refid id Sets reference ID for Z39.50 Request(s). itemorder type no Sends an Item Order Request using the ILL External. type is either 1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The no is the Result Set position of the record to be ordered. update action recid doc Sends Item Update Request. The action argument must be the action type: one of insert, replace, delete and update. The second argument, recid, is the record identifier (any string). Third argument which is optional is the record document for the request. If doc is preceded with "<", then the following characters are treated as a filename with the records to be updated. Otherwise doc is treated as a document itself. The doc may also be quoted in double quotes. If doc is omitted, the last received record (as part of present response or piggybacked search response) is used for the update. source filename Executes list of commands from file filename, just like 'source' on most UNIX shells. A single dot (.) can be used as an alternative. ! args Executes command args in subshell using the system call. push_command command The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed. This command only works if you have GNU readline/history enabled. set_apdufile filename Sets that APDU should be logged to file filename. Another way to achieve APDU log is by using command-line option -a. set_auto_reconnect flag Specifies whether YAZ client automatically reconnects if the target closes connection (Z39.50 only). flag must be either on or off. set_auto_wait flag Specifies whether YAZ client should wait for response protocol packages after a request. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued. If off is used, YAZ client does not attempt to receive packages automatically. These will have to be manually received when command wait_response is used. flag must be either on or off. set_marcdump filename Specifies that all retrieved records should be appended to file filename. This command does the same thing as option -m. schema schemaid Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI. charset negotiationcharset [displaycharset] [[marccharset]] Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal). negotiationcharset is the name of the character set to be negotiated by the server. The special name - for negotiationcharset specifies no character set to be negotiated. If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). To disable conversion of characters to the output encoding, the special name - (dash) can be used. If the special name auto is given, YAZ client will convert strings to the encoding of the terminal as returned by nl_langinfo call. If marccharset is given, it specifies name of the character set of retrieved MARC records from server. See also marccharset command. Since character set negotiation takes effect in the Z39.50 Initialize Request you should issue this command before command open is used. MARC records are not covered by Z39.50 character set negotiation, so that's why there is a separate character that must be known in order to do meaningful conversion(s). negcharset charset Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command charset. displaycharset charset Specifies character set for output (display). The argument is the same as second argument for command charset. marccharset charset Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See charset command. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC variants. The charset argument is the same as third argument for command charset. querycharset charset Specifies character set for query terms for Z39.50 RPN queries and Z39.50 Scan Requests (termListAndStartPoint). This is a pure client-side conversion which converts from displayCharset to queryCharset. set_cclfile filename Specifies that CCL fields should be read from file file filename. This command does the same thing as option -c. set_cqlfile filename Specifies that CQL fields should be read from file file filename. This command does the same thing as option -q. register_oid name class OID This command allows you to register your own object identifier - so that instead of entering a long dot-notation you can use a short name instead. The name is your name for the OID, class is the class, and OID is the raw OID in dot notation. Class is one of: appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general. If you're in doubt use the general class. register_tab command string This command registers a TAB completion string for the command given. sleep seconds This command makes YAZ client sleep (be idle) for the number of seconds given. wait_response [ number] This command makes YAZ client wait for a number of response packages from target. If number is omitted, 1 is assumed. This command is rarely used and is only useful if command set_auto_wait is set to off. xmles OID doc Sends XML Extended Services request using the OID and doc given. zversion ver This command sets Z39.50 version for negotiation. Should be used before open. By default 3 (version 3) is used. options op1 op2.. This command sets Z39.50 options for negotiation. Should be used before open. The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema. EXAMPLE The simplest example of a Prefix Query would be something like f knuth or f "donald knuth" In those queries, no attributes were specified. This leaves it up to the server what fields to search but most servers will search in all fields. Some servers do not support this feature though, and require that some attributes are defined. To add one attribute you could do: f @attr 1=4 computer where we search in the title field, since the use(1) is title(4). If we want to search in the author field and in the title field, and in the title field using right truncation it could look something like this: f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer Finally using a mix of Bib-1 and GILS attributes could look something like this: f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather FILES yaz-<version>/client/client.c $HOME/.yazclientrc $HOME/.yazclient.history SEE ALSO yaz 7 bib1-attr 7 YAZ 5.34.4 Index Data yaz-ztest 8 System management commands yaz-ztest Z39.50/SRU Test Server application listener-spec DESCRIPTION yaz-ztest is a Z39.50/SRU test server that uses the YAZ generic front-end server (GFS) API. The server acts as a real Z39.50/SRU server but does not use a database. It returns a random hit count and returns a subset of a few built-in records. The listener-spec consists of a transport mode followed by a colon, followed by a listener address. The transport mode is either tcp, unix, or ssl. For TCP and SSL, an address has the form: hostname | IP-number [ : portnumber ] For UNIX local socket, the address is the filename of the local socket. OPTIONS -a file Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr. -S Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users. -1 Like -S but after one session the server exits. This mode is for debugging only. -T Operate the server in threaded mode. The server creates a thread for each connection rather than fork a process. Only available on UNIX systems that offer POSIX threads. -s Use the SR protocol (obsolete). -z Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports. -l file The logfile. -c config A user option that serves as a specifier for some sort of configuration, usually a filename. The argument to this option is transferred to member configname of the statserv_options_block. -f vconfig This specifies an XML file that describes one or more YAZ frontend virtual servers. -C fname Sets SSL certificate file name for server (PEM). -v level The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}. -u uid Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port. -w dir The server changes to this directory before listening to incoming connections. This option is useful when the server is operating from the inetd daemon (see -i). -p pidfile Specifies that the server should write its Process ID to the file given by pidfile. A typical location would be /var/run/yaz-ztest.pid. -i Use this to make the the server run from the inetd server (UNIX only). -D Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground. -install Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel. -installa Use this to install the server as an NT service and mark it as "auto-start. Control the server by going to the Services in the Control Panel. -remove Use this to remove the server from the NT services (Windows NT/2000/XP only). -t minutes Idle session timeout, in minutes. -k size Maximum record size/message size, in kilobytes. -K Forces no-keepalive for HTTP sessions. By default GFS will keep sessions alive for HTTP 1.1 sessions (as defined by the standard). Using this option will force GFS to close the connection for each operation. -r size Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB). -d daemon Set name of daemon to be used in hosts access file. See hosts_access 5 and tcpd 8 . -m time-format Sets the format of time-stamps in the log-file. Specify a string in the input format to strftime(). -V Display YAZ version and exit. TESTING yaz-ztest normally returns a random hit count between 0 and 24. However, if a query term includes leading digits, then the integer value of that term is used as hit count. This allows testers to return any number of hits. yaz-ztest includes 24 MARC records for testing. Hit counts exceeding 24 will make yaz-ztest return the same record batch over and over. So record at position 1, 25, 49, etc. are equivalent. For XML, if no element set is given or element has value "marcxml", MARCXML is returned (each of the 24 dummy records converted from ISO2709 to XML). For element set OP, then OPAC XML is returned. yaz-ztest may also return predefined XML records (for testing). This is enabled if YAZ_ZTEST_XML_FETCH environment variable is defined. A record is fetched from a file (one record per file). The path for the filename is FE.d.xml where F is the YAZ_ZTEST_XML_FETCH value (possibly empty), E is element-set, d is record position (starting from 1). The following databases are honored by yaz-ztest: Default, slow and db.* (all databases with prefix "db"). Any other database will make yaz-ztest return diagnostic 109: "Database unavailable". Options for search may be included in the form or URL get arguments included as part of the Z39.50 database name. The following database options are present: search-delay, present-delay, fetch-delay and seed. The former, delay type options, specify a fake delay (sleep) that yaz-ztest will perform when searching, presenting, fetching records respectively. The value of the delay may either be a fixed floating point value which specifies the delay in seconds. Alternatively the value may be given as two floating point numbers separated by colon, which will make yaz-ztest perform a random sleep between the first and second number. The database parameter seed takes an integer as value. This will call srand with this integer to ensure that the random behavior can be re-played. Suppose we want searches to take between 0.1 and 0.5 seconds and a fetch to take 0.2 second. To access test database Default we'd use: Default?search-delay=0.1:0.5&fetch-delay=0.2. GFS CONFIGURATION AND VIRTUAL HOSTS The Virtual hosts mechanism allows a YAZ front-end server to support multiple back-ends. A back-end is selected on the basis of the TCP/IP binding (port+listening address) and/or the virtual host. A back-end can be configured to execute in a particular working directory. Or the YAZ front-end may perform CQL to RPN conversion, thus allowing traditional Z39.50 back-ends to be offered as a SRW/SRU service. SRW/SRU Explain information for a particular back-end may also be specified. For the HTTP protocol, the virtual host is specified in the Host header. For the Z39.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1. Not all Z39.50 clients allow the VHOST information to be set. For those, the selection of the back-end must rely on the TCP/IP information alone (port and address). The YAZ front-end server uses XML to describe the back-end configurations. Command-line option -f specifies filename of the XML configuration. The configuration uses the root element yazgfs. This element includes a list of listen elements, followed by one or more server elements. The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server. Content for a listener: CDATA (required) The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc. attribute id (optional) Identifier for this listener. This may be referred to from server sections. We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers. The server describes a server and the parameters for this server type. Content for a server: attribute id (optional) Identifier for this server. Currently not used for anything, but it might be for logging purposes. attribute listenref (optional) Specifies one or more listeners for this server. Each server ID is separated by a comma. If this attribute is not given, the server is accessible from all listeners. In order for the server to be used for real, however, the virtual host must match if specified in the configuration. element config (optional) Specifies the server configuration. This is equivalent to the config specified using command line option -c. element directory (optional) Specifies a working directory for this backend server. If specified, the YAZ frontend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init). element host (optional) Specifies the virtual host for this server. If this is specified a client must specify this host string in order to use this backend. element cql2rpn (optional) Specifies a filename that includes CQL to RPN conversion for this backend server. See . If given, the backend server will only "see" a Type-1/RPN query. element ccl2rpn (optional) Specifies a filename that includes CCL to RPN conversion for this backend server. See . If given, the backend server will only "see" a Type-1/RPN query. element stylesheet (optional) Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one. If none is given, then if the client does not specify one, then no stylesheet reference is part of the SRU HTTP response. element client_query_charset (optional) If specified, a conversion from the character set given to UTF-8 is performed by the generic frontend server. It is only executed for Z39.50 search requests (SRU/Solr are assumed to be UTF-8 encoded already). element docpath (optional) Specifies a path for local file access using HTTP. All URLs with a leading prefix (/ excluded) that matches the value of docpath are used for file access. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/xsl will result in a local file access. element explain (optional) Specifies SRW/SRU ZeeRex content for this server. Copied verbatim to the client. As things are now, some of the Explain content seem redundant because host information, etc. is also stored elsewhere. element maximumrecordsize (optional) Specifies maximum record size/message size, in bytes. This value also serves as the maximum size of incoming packages (for Record Updates etc). It's the same value as that given by the -k option. element retrievalinfo (optional) Enables the retrieval facility to support conversions and specifications of record formats/types. See for more information. The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket. We name the TCP/IP server public and the other server internal. <yazgfs> <listen id="public">tcp:@:9900</listen> <listen id="internal">unix:/var/tmp/socket</listen> <server id="server1"> <host>server1.mydomain</host> <directory>/var/www/s1</directory> <config>config.cfg</config> </server> <server id="server2" listenref="public,internal"> <host>server2.mydomain</host> <directory>/var/www/s2</directory> <config>config.cfg</config> <cql2rpn>../etc/pqf.properties</cql2rpn> <explain xmlns="http://explain.z3950.org/dtd/2.0/"> <serverInfo> <host>server2.mydomain</host> <port>9900</port> <database>a</database> </serverInfo> </explain> </server> <server id="server3" listenref="internal"> <directory>/var/www/s3</directory> <config>config.cfg</config> </server> </yazgfs> There are three configured backend servers. The first two servers, "server1" and "server2", can be reached by both listener addresses. "server1" is reached by all (two) since no listenref attribute is specified. "server2" is reached by the two listeners specified. In order to distinguish between the two, a virtual host has been specified for each server in the host elements. For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small). The third server, "server3" can only be reached via listener "internal". FILES yaz-<version>/ztest/yaz-ztest.c yaz-<version>/include/yaz/backend.h SEE ALSO yaz 7 yaz-log 7 YAZ 5.34.4 Index Data yaz-config 1 Commands yaz-config Script to get information about YAZ. yaz-config libraries DESCRIPTION yaz-config is a script that returns information that your own software should use to build software that uses YAZ. The following libraries are supported: threads Use the threaded version of YAZ. OPTIONS --prefix[=DIR] Returns prefix of YAZ or assume a different one if DIR is specified. --version Returns version of YAZ. --libs Library specification be used when using YAZ. --lalibs Return library specification. --cflags Return C Compiler flags. --include Return C compiler includes for YAZ header files (-Ipath). --comp Returns full path to YAZ' ASN.1 compiler: yaz-asncomp. -V Returns YAZ SHA1 ID (from Git) and version. FILES /usr/bin/yaz-config /usr/lib/libyaz*.a /usr/include/yaz/*.h SEE ALSO yaz(7) Section "How to make apps using YAZ on UNIX" in the YAZ manual. YAZ 5.34.4 Index Data yaz 7 Conventions and miscellaneous yaz Z39.50 toolkit. DESCRIPTION YAZ is a C/C++ programmer's toolkit supporting the development of Z39.50v3 clients and servers. The YAZ toolkit offers several different levels of access to the ISO23950/Z39.50, SRU Solr (client only) and ILL protocols. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement. COPYRIGHT Copyright © 1995-2025 Index Data. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SEE ALSO yaz-client 1 , yaz-ztest 8 , yaz-config 8 , zoomsh 1 bib1-attr 7 YAZ manual ( /usr/share/doc/yaz) YAZ home page. Z39.50 Maintenance Agency Page. YAZ 5.34.4 Index Data zoomsh 1 Commands zoomsh ZOOM shell zoomsh commands DESCRIPTION zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets. You may pass one or more commands to zoomsh. These commands are invoked first. OPTIONS -a apdufile Logs protocol packages into apdufile (APDU log). -e Makes zoomsh stop processing commands as soon as an error occur. The exit code of zoomsh is 1 if error occurs; 0 otherwise. -v loglevel Sets YAZ log level to loglevel. EXAMPLES If you start the yaz-ztest in one console you can use the ZOOM shell as follows: $ zoomsh ZOOM>connect localhost:9999 ZOOM>search computer localhost:9999: 7 hits ZOOM>show 0 1 1 Default USmarc 001 11224466 003 DLC 005 00000000000000.0 008 910710c19910701nju 00010 eng 010 $a 11224466 040 $a DLC $c DLC 050 00 $a 123-xyz 100 10 $a Jack Collins 245 10 $a How to program a computer 260 1 $a Penguin 263 $a 8710 300 $a p. cm. ZOOM>quit You can also achieve the same result by passing the commands as arguments on a single command line: $ zoomsh "connect localhost:9999" "search computer" "show 0 1" quit COMMANDS connect zurl Connects to the target given by zurl. close [zurl] Closes connection to target given by zurl or all targets if zurl was omitted. show [start [count]] Displays count records starting at offset given by start. First records has offset 0 (unlike the Z39.50 protocol). quit Quits zoomsh. set name [value] Sets option name to value. get name Prints value of option name. help Prints list of available commands. SEE ALSO yaz 7 , yaz-ztest 8 , Section "Building clients with ZOOM" in the YAZ manual. ZOOM home page. YAZ 5.34.4 Index Data yaz-asncomp 1 Commands yaz-asncomp YAZ ASN.1 compiler yaz-asncomp filename DESCRIPTION yaz-asncomp is an ASN.1 compiler that reads an ASN.1 specification in filename and produces C/C++ definitions and BER encoders/decoders for it. The produced C/C++ code and header files uses the ODR module of YAZ which is a library that encodes/decodes/prints BER packages. yaz-asncomp allows you to specify name of resulting source via options. Alternatively, you can specify a DEFINITIONS file, which provides customized output to many output files - if the ASN.1 specification file consists of many modules. This utility is written in Tcl. Any version of Tcl should work. OPTIONS -v Makes the ASN.1 compiler print more verbose about the various stages of operations. -c cfile Specifies the name of the C/C++ file with encoders/decoders. -h hfile Specifies the name of header file with definitions. -p pfile Specifies the name of the a private header file with definitions. By default all definitions are put in header file (option -h). -d dfile Specifies the name of a definitions file. -I iout Specifies first part of directory in which header files are written. -i idir Specifies second part of directory in which header files are written. -m module Specifies that ASN.1 compiler should only process the module given. If this option is not specified, all modules in the ASN.1 file are processed. DEFINITIONS FILE The definitions file is really a Tcl script but follows traditional rules for Shell like configuration files. That is # denotes the beginning of a comment. Definitions are line oriented. The definitions files usually consist of a series of variable assignments of the form: set name value Available variables are: default-prefix Sets prefix for names in the produced output. The value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively. prefix(module) This value sets prefix values for module module. The value has same form as default-prefix. filename(module) Specifies filename for C/header file for module module. init(module,h) Code fragment to be put in first part of public header for module module. body(module,h) Code fragment to be put in last part of public header for module module (trailer). init(module,c) Code fragment to be put in first part of C based encoder/decoder for module module. body(module,c) Code fragment to be put in last part of C based encoder/decoder for module module (trailer). map(module,name) Maps ASN.1 type in module module of name to value. membermap(module,name,member) Maps member member in SEQUENCE/CHOICE of name in module module to value. The value consists of one or two tokens. First token is name of C preprocessor part. Second token is resulting C member name. If second token is omitted the value (one token) is both preprocessor part and C struct,union. unionmap(module,name,member) Maps member member in CHOICE of name in module module to value. Value consists of two or three tokens. The first token is name of the integer in the union that is used as selector for the union itself. The second token is name of the union. The third token overrides the name of the CHOICE member; if omitted the member name is used. FILES /usr/share/yaz/z39.50/z.tcl /usr/share/yaz/z39.50/*.asn SEE ALSO yaz 7 Section "The ODR Module" in the YAZ manual. YAZ 5.34.4 Index Data yaz-marcdump 1 Commands yaz-marcdump MARC record dump utility yaz-marcdump file DESCRIPTION yaz-marcdump reads MARC records from one or more files. It parses each record and supports output in line-format, ISO2709, MARCXML, MARC-in-JSON, MarcXchange as well as Hex output. This utility parses records ISO2709(raw MARC), line format, MARC-in-JSON format as well as XML if that is structured as MARCXML/MarcXchange. MARC-in-JSON encoding/decoding is supported in YAZ 5.0.5 and later. As of YAZ 2.1.18, OAI-MARC is no longer supported. OAI-MARC is deprecated. Use MARCXML instead. By default, each record is written to standard output in a line format with newline for each field, $x for each sub-field x. The output format may be changed with option -o, yaz-marcdump can also be requested to perform character set conversion of each record. OPTIONS -i format Specifies input format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON). -o format Specifies output format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON). -f from Specify the character set of the input MARC record. Should be used in conjunction with option -t. Refer to the yaz-iconv man page for supported character sets. -t to Specify the character set of the output. Should be used in conjunction with option -f. Refer to the yaz-iconv man page for supported character sets. -l leaderspec Specify a simple modification string for MARC leader. The leaderspec is a list of pos=value pairs, where pos is an integer offset (0 - 23) for leader. Value is either a quoted string or an integer (character value in decimal). Pairs are comma separated. For example, to set leader at offset 9 to a, use 9='a'. -s prefix Writes a chunk of records to a separate file with prefix given, i.e. splits a record batch into files with only at most "chunk" ISO2709 records per file. By default chunk is 1 (one record per file). See option -C. -C chunksize Specifies chunk size; to be used conjunction with option -s. -O offset Integer offset for at what position records whould be written. 0=first record, 1=second, .. With -L option, this allows a specific range of records to be processed. -L limit Integer limit for how many records should at most be written. With -O option, this allows a specific range of records to be processed. -p Makes yaz-marcdump print record number and input file offset of each record read. -n MARC output is omitted so that MARC input is only checked. -r Writes to stderr a summary about number of records read by yaz-marcdump. -v Writes more information about the parsing process. Useful if you have ill-formatted ISO2709 records as input. -V Prints YAZ version. EXAMPLES The following command converts MARC21/USMARC in MARC-8 encoding to MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'. Both input and output records are ISO2709 encoded. yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw The same records may be converted to MARCXML instead in UTF-8: yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml Turbo MARC is a compact XML notation with same semantics as MARCXML, but which allows for faster processing via XSLT. In order to generate Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one could use: yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml FILES prefix/bin/yaz-marcdump prefix/include/yaz/marcdisp.h SEE ALSO yaz 7 yaz-iconv 1 YAZ 5.34.4 Index Data yaz-iconv 1 Commands yaz-iconv YAZ Character set conversion utility yaz-iconv file DESCRIPTION yaz-iconv converts data in the character set specified by from to output in the character set as specified by to. This yaz-iconv utility is similar to the iconv found on many POSIX systems (Glibc, Solaris, etc). If no file is specified, yaz-iconv reads from standard input. OPTIONS -ffrom] Specify the character set from of the input file. Should be used in conjunction with option -t. -tto] Specify the character set of of the output. Should be used in conjunction with option -f. -v Print more information about the conversion process. ENCODINGS The yaz-iconv command and the API as defined in yaz/yaz-iconv.h is a wrapper for the library system call iconv. But YAZ' iconv utility also implements conversions on its own. The table below lists characters sets (or encodings) that are supported by YAZ. Each character set is marked with either encode or decode. If an encoding is encode-enabled, YAZ may convert to the designated encoding. If an encoding is decode-enabled, YAZ may convert from the designated encoding. marc8 (encode, decode) The MARC8 encoding as defined by the Library of Congress. Most MARC21/USMARC records use this encoding. marc8s (encode, decode) Like MARC8 but conversion prefers non-combined characters in the Latin-1 plane over combined characters. marc8lossy (encode) Lossy encoding of MARC-8. marc8lossless (encode) Lossless encoding of MARC8. utf8 (encode, decode) The most commonly used UNICODE encoding on the Internet. iso8859-1 (encode, decode) ISO-8859-1, AKA Latin-1. iso5426 (decode) ISO 5426. Some MARC records (UNIMARC) use this encoding. iso5428:1984 (encode, decode) ISO 5428:1984. advancegreek (encode, decode) An encoding for Greek in use by some vendors (Advance). danmarc (decode) Danmarc (in danish) is an encoding based on UNICODE which is used for DanMARC2 records. EXAMPLES The following command converts from ISO-8859-1 (Latin-1) to UTF-8. yaz-iconv -f ISO-8859-1 -t UTF-8 <input.lst >output.lst FILES prefix/bin/yaz-iconv prefix/include/yaz/yaz-iconv.h SEE ALSO yaz(7) iconv(1) YAZ 5.34.4 Index Data yaz-log 7 Conventions and miscellaneous yaz-log Log handling in all yaz-based programs yaz-XXXX DESCRIPTION All YAZ-based programs use a common log subsystem, and should support common command line options for controlling it. This man page documents those. OPTIONS -l logfile Specify the file where the log is to be written. If none is specified, stderr is used. The log is appended to this file. If the file grows overly large, it is silently rotated: It is renamed to logfile.1, logfile.2, .., 9 (old such file is deleted), and a new file is opened. The limit defaults to 1GB, but can be set by the program. The rotating limit can be specified with option -r for the YAZ frontend server (yaz-ztest). Rotation can also be implicitly enabled by using a filename which gets changed for a given date, due to substitutions as given by the strftime(3) function. -v loglevel Specify the logging level. The argument is a set of log level names, separated by commas (no whitespace!), optionally preceded by a '-' to negate that level. Most programs have their own default, often containing fatal,warn,log, and some application-specific values. The default list can be cleared with the word none, or individual bits can be removed by prefixing them with a dash '-'. LOG LEVELS TO CONTROL LOGGING Some of the log levels control the way the log is written. flush causes the log to be flushed after every write. This can have serious implications to performance, and should not be used in production. On the other hand, when debugging a program crash, this can be extremely useful. The option debug implies flush as well. notime prevents the writing of time stamps. This is intended for automatic test scripts, which should produce predictable log files that are easy to compare. GENERAL LOG LEVELS IN YAZ ITSELF YAZ itself uses the following log levels: fatal for fatal errors, that prevent further execution of the program. warn for warnings about things that should be corrected. debug for debugging. This flag may be used temporarily when developing or debugging yaz, or a program that uses yaz. It is practically deprecated, you should be defining and using your own log levels (see below). all turns on almost all hard-coded log levels. loglevel logs information about the log levels used by the program. Every time the log level is changed, lists all bits that are on. Every time a module asks for its log bits, this is logged. This can be used for getting an idea of what log levels are available in any program that uses yaz-log. Start the program with -v none,loglevel, and do some common operations with it. Another way is to grep for yaz_log_module_level in the source code, as in find . -name '*.[ch]' -print | xargs grep yaz_log_module_level | grep '"' | cut -d'"' -f2 | sort -u eventl, malloc, nmem, odr are used internally for debugging yaz. LOG LEVELS FOR CLIENTS zoom logs the calls to the zoom API, which may be useful in debugging client applications. LOG LEVELS FOR SERVERS server logs the server functions on a high level, starting up, listening on a port, etc. session logs individual sessions (connections). request logs a one-liner for each request (init, search, etc.). requestdetail logs the details of every request, before it is passed to the back-end, and the results received from it. Each server program (zebra, etc.) is supposed to define its own log levels in addition to these. As they depend on the server in question, they can not be described here. See above how to find out about them. LOGGING EXAMPLES See what log levels yaz-ztest is using: yaz-ztest -1 -v none,loglevel 14:43:29-23/11 [loglevel] Setting log level to 4096 = 0x00001000 14:43:29-23/11 [loglevel] Static log bit 00000001 'fatal' is off 14:43:29-23/11 [loglevel] Static log bit 00000002 'debug' is off 14:43:29-23/11 [loglevel] Static log bit 00000004 'warn' is off 14:43:29-23/11 [loglevel] Static log bit 00000008 'log' is off 14:43:29-23/11 [loglevel] Static log bit 00000080 'malloc' is off 14:43:29-23/11 [loglevel] Static log bit 00000800 'flush' is off 14:43:29-23/11 [loglevel] Static log bit 00001000 'loglevel' is ON 14:43:29-23/11 [loglevel] Static log bit 00002000 'server' is off 14:43:29-23/11 [loglevel] Dynamic log bit 00004000 'session' is off 14:43:29-23/11 [loglevel] Dynamic log bit 00008000 'request' is off 14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session' 14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x2000 for 'server' 14:44:13-23/11 yaz-ztest [loglevel] returning NO log bit for 'eventl' 14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session' 14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x8000 for 'request' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'requestdetail' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'odr' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'ztest' See the details of the requests for yaz-ztest ./yaz-ztest -1 -v requestdetail 14:45:35-23/11 yaz-ztest [server] Adding static Z3950 listener on tcp:@:9999 14:45:35-23/11 yaz-ztest [server] Starting server ./yaz-ztest pid=32200 14:45:38-23/11 yaz-ztest [session] Starting session from tcp:127.0.0.1 (pid=32200) 14:45:38-23/11 yaz-ztest [requestdetail] Got initRequest 14:45:38-23/11 yaz-ztest [requestdetail] Id: 81 14:45:38-23/11 yaz-ztest [requestdetail] Name: YAZ 14:45:38-23/11 yaz-ztest [requestdetail] Version: 2.0.28 14:45:38-23/11 yaz-ztest [requestdetail] Negotiated to v3: srch prst del extendedServices namedresults scan sort 14:45:38-23/11 yaz-ztest [request] Init from 'YAZ' (81) (ver 2.0.28) OK 14:45:39-23/11 yaz-ztest [requestdetail] Got SearchRequest. 14:45:39-23/11 yaz-ztest [requestdetail] ResultSet '1' 14:45:39-23/11 yaz-ztest [requestdetail] Database 'Default' 14:45:39-23/11 yaz-ztest [requestdetail] RPN query. Type: Bib-1 14:45:39-23/11 yaz-ztest [requestdetail] term 'foo' (general) 14:45:39-23/11 yaz-ztest [requestdetail] resultCount: 7 14:45:39-23/11 yaz-ztest [request] Search Z: @attrset Bib-1 foo OK:7 hits 14:45:41-23/11 yaz-ztest [requestdetail] Got PresentRequest. 14:45:41-23/11 yaz-ztest [requestdetail] Request to pack 1+1 1 14:45:41-23/11 yaz-ztest [requestdetail] pms=1048576, mrs=1048576 14:45:41-23/11 yaz-ztest [request] Present: [1] 1+1 OK 1 records returned LOG FILENAME EXAMPLES A file with format my_YYYYMMDD.log (where Y, M, D is year, month, and day digits) is given as follows: -l my_%Y%m%d.log . And since the filename is depending on day, rotation will occur on midnight. A weekly log could be specified as -l my_%Y%U.log. FILES prefix/include/yaz/log.h prefix/src/log.c SEE ALSO yaz 7 yaz-ztest 8 yaz-client 1 strftime 3 YAZ 5.34.4 Index Data yaz-illclient 1 Commands yaz-illclient ILL client yaz-illclient name=value server-addr DESCRIPTION yaz-illclient is a client which sends an ISO ILL request to a remote server and decodes the response from it. Exactly one server address ( server-addr ) must be specified. OPTIONS -f filename] Specify filename. -v loglevel] Specify the log level. -D name=value] Defines name & value pair. -o Enable OCLC authentication. -u user] Specify user. -p password] Specify password. -V Show yaz-illclient version. EXAMPLES None yet. FILES None yet. SEE ALSO yaz(7) YAZ 5.34.4 Index Data yaz-icu 1 Commands yaz-icu YAZ ICU utility yaz-icu -c config -p opt -s -x infile DESCRIPTION yaz-icu is a utility which demonstrates the ICU chain module of yaz. (yaz/icu.h). The utility can be used in two ways. It may read some text using an XML configuration for configuring ICU and show text analysis. This mode is triggered by option -c which specifies the configuration to be used. The input file is read from standard input or from a file if infile is specified. The utility may also show ICU information. This is triggered by option -p. OPTIONS -c config Specifies the file containing ICU chain configuration which is XML based. -p type Specifies extra information to be printed about the ICU system. If type is c then ICU converters are printed. If type is l, then available locales are printed. If type is t, then available transliterators are printed. -s Specifies that output should include sort key as well. Note that sort key differs between ICU versions. -x Specifies that output should be XML based rather than "text" based. ICU chain configuration The ICU chain configuration specifies one or more rules to convert text data into tokens. The configuration format is XML based. The toplevel element must be named icu_chain. The icu_chain element has one required attribute locale which specifies the ICU locale to be used in the conversion steps. The icu_chain element must include elements where each element specifies a conversion step. The conversion is performed in the order in which the conversion steps are specified. Each conversion element takes one attribute: rule which serves as argument to the conversion step. The following conversion elements are available: casemap Converts case (and rule specifies how): l Lower case using ICU function u_strToLower. u Upper case using ICU function u_strToUpper. t To title using ICU function u_strToTitle. f Fold case using ICU function u_strFoldCase. display This is a meta step which specifies that a term/token is to be displayed. This term is retrieved in an application using function icu_chain_token_display (yaz/icu.h). transform Specifies an ICU transform rule using a transliterator Identifier. The rule attribute is the transliterator Identifier. See ICU Transforms for more information. transliterate Specifies a rule-based transliterator. The rule attribute is the custom transformation rule to be used. See ICU Transforms for more information. tokenize Breaks / tokenizes a string into components using ICU functions ubrk_open, ubrk_setText, .. . The rule is one of: l Line. ICU: UBRK_LINE. s Sentence. ICU: UBRK_SENTENCE. w Word. ICU: UBRK_WORD. c Character. ICU: UBRK_CHARACTER. t Title. ICU: UBRK_TITLE. join Joins tokens into one string. The rule attribute is the joining string, which may be empty. The join conversion element was added in YAZ 4.2.49. EXAMPLES The following command analyzes text in file text using ICU chain configuration chain.xml: cat text | yaz-icu -c chain.xml The chain.xml might look as follows: <icu_chain locale="en"> <transform rule="[:Control:] Any-Remove"/> <tokenize rule="w"/> <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/> <transliterate rule="xy > z;"/> <display/> <casemap rule="l"/> </icu_chain> SEE ALSO yaz 7 ICU Home ICU Transforms YAZ 5.34.4 Index Data yaz-url 1 Commands yaz-url YAZ URL fetch utility yaz-url -H name:value -m method -O fname -p fname -R num -u user/password -v -x proxy url DESCRIPTION yaz-url is utility to get web content. It is very limited in functionality compared to programs such as curl, wget. The options must precede the URL given on the command line, to take effect. Fetched HTTP content is written to stdout, unless option -O is given. OPTIONS -H name:value Specifies HTTP header content with name and value. This option can be given multiple times (for different names, of course). -m method Specifies the HTTP method to be used for the next URL. Default is method "GET". However, option -p sets it to "POST". -O fname Sets output filename for HTTP content. -p fname Sets a file to be POSTed in the following URL. -R num Sets maximum number of HTTP redirects to be followed. A value of zero disables follow of HTTP redirects. -u user/password Specifies a user and a password to be used in HTTP basic authentication in the following URL fetch. The user and password must be separated by a slash (thus it is not possible to specify a user with a slash in it). -v Makes yaz-url dump each HTTP request/response to stdout. -x proxy Specifies a proxy to be used for URL fetch. SEE ALSO yaz 7 YAZ 5.34.4 Index Data Bib-1 Attribute Set 7 Conventions and miscellaneous bib1-attr Bib-1 Attribute Set DESCRIPTION This reference entry lists the Bib-1 attribute set types and values. TYPES The Bib-1 attribute set defines six attribute types: Use (1), Relation (2), Position (3), Structure (4), Truncation (5) and Completeness (6). USE (1) 1 Personal-name 2 Corporate-name 3 Conference-name 4 Title 5 Title-series 6 Title-uniform 7 ISBN 8 ISSN 9 LC-card-number 10 BNB-card-number 11 BGF-number 12 Local-number 13 Dewey-classification 14 UDC-classification 15 Bliss-classification 16 LC-call-number 17 NLM-call-number 18 NAL-call-number 19 MOS-call-number 20 Local-classification 21 Subject-heading 22 Subject-Rameau 23 BDI-index-subject 24 INSPEC-subject 25 MESH-subject 26 PA-subject 27 LC-subject-heading 28 RVM-subject-heading 29 Local-subject-index 30 Date 31 Date-of-publication 32 Date-of-acquisition 33 Title-key 34 Title-collective 35 Title-parallel 36 Title-cover 37 Title-added-title-page 38 Title-caption 39 Title-running 40 Title-spine 41 Title-other-variant 42 Title-former 43 Title-abbreviated 44 Title-expanded 45 Subject-precis 46 Subject-rswk 47 Subject-subdivision 48 Number-natl-biblio 49 Number-legal-deposit 50 Number-govt-pub 51 Number-music-publisher 52 Number-db 53 Number-local-call 54 Code-language 55 Code-geographic 56 Code-institution 57 Name-and-title 58 Name-geographic 59 Place-publication 60 CODEN 61 Microform-generation 62 Abstract 63 Note 1000 Author-title 1001 Record-type 1002 Name 1003 Author 1004 Author-name-personal 1005 Author-name-corporate 1006 Author-name-conference 1007 Identifier-standard 1008 Subject-LC-childrens 1009 Subject-name-personal 1010 Body-of-text 1011 Date/time-added-to-db 1012 Date/time-last-modified 1013 Authority/format-id 1014 Concept-text 1015 Concept-reference 1016 Any 1017 Server-choice 1018 Publisher 1019 Record-source 1020 Editor 1021 Bib-level 1022 Geographic-class 1023 Indexed-by 1024 Map-scale 1025 Music-key 1026 Related-periodical 1027 Report-number 1028 Stock-number 1030 Thematic-number 1031 Material-type 1032 Doc-id 1033 Host-item 1034 Content-type 1035 Anywhere 1036 Author-Title-Subject RELATION (2) 1 Less than 2 Less than or equal 3 Equal 4 Greater or equal 5 Greater than 6 Not equal 100 Phonetic 101 Stem 102 Relevance 103 AlwaysMatches POSITION (3) 1 First in field 2 First in subfield 3 Any position in field STRUCTURE (4) 1 Phrase 2 Word 3 Key 4 Year 5 Date (normalized) 6 Word list 100 Date (un-normalized) 101 Name (normalized) 102 Name (un-normalized) 103 Structure 104 Urx 105 Free-form-text 106 Document-text 107 Local-number 108 String 109 Numeric-string TRUNCATION (5) 1 Right truncation 2 Left truncation 3 Left and right truncation 100 Do not truncate 101 Process # in search term . regular #=.* 102 RegExpr-1 103 RegExpr-2 104 Process # ?n . regular: #=., ?n=.{0,n} or ?=.* Z39.58 The 105-106 truncation attributes below are only supported by Index Data's Zebra server. 105 Process * ! regular: *=.*, !=. and right truncate 106 Process * ! regular: *=.*, !=. COMPLETENESS (6) 1 Incomplete subfield 2 Complete subfield 3 Complete field SORTING (7) 1 ascending 2 descending Type 7 is an Index Data extension to RPN queries that allows embedding a sort critieria into a query. SEE ALSO Bib-1 Attribute Set Attribute Set Bib-1 Semantics. YAZ 5.34.4 Index Data yaz-json-parse 1 Commands yaz-json-parse YAZ JSON parser yaz-json-parse -p DESCRIPTION yaz-json-parse is a utility which demonstrates the JSON API of YAZ. (yaz/json.h). The program attempts to parse a JSON from standard input (stdin). It will return exit code 1 if parsing fails and the parsing error message will be printed to standard error (stderr). The program returns exit code 0 if parsing succeeds, and returns no output unless -p is given (see below). OPTIONS -p Makes the JSON parser echo the JSON result string to standard output, if parsing from stdin was successful. If -p is given twice, then the output is a multi-line output with indentation (pretty print). SEE ALSO yaz 7 YAZ 5.34.4 Index Data yaz-record-iconv 1 Commands yaz-record-conv YAZ Record Conversion Utility yaz-record-conv config fname DESCRIPTION yaz-record-conv is a program that exercises the record conversion sub system. Refer to record_conv.h header. OPTIONS -v level Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none. EXAMPLES The following backend configuration converts MARC records (ISO2709) to Dublin-Core XML. <backend name="F" syntax="usmarc"> <marc inputcharset="marc-8" inputformat="marc" outputformat="marcxml"/> <xslt stylesheet="../etc/MARC21slim2DC.xsl"/> </backend> We can convert one of the sample records from YAZ' test directory with: $ ../util/yaz-record-conv record-conv-conf.xml marc6.marc <?xml version="1.0"?> <dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/"> <dc:title>How to program a computer</dc:title> <dc:creator> Jack Collins </dc:creator> <dc:type>text</dc:type> <dc:publisher>Penguin</dc:publisher> <dc:language>eng</dc:language> </dc:dc> FILES record_conv.h SEE ALSO yaz(7) yaz-5.34.4/doc/soap.html0000664000175000017500000000517514754707607010523 Chapter 6. SOAP and SRU

Chapter 6. SOAP and SRU

1. Introduction

YAZ uses a very simple implementation of SOAP that only (currently) supports what is sufficient to offer SRU SOAP functionality. The implementation uses the tree API of libxml2 to encode and decode SOAP packages.

Like the Z39.50 ASN.1 module, the YAZ SRU implementation uses simple C structs to represent SOAP packages as well as HTTP packages.

yaz-5.34.4/doc/comstack.introduction.html0000664000175000017500000000676514754707607014113 2. Introduction

2. Introduction

The COMSTACK subsystem provides a transparent interface to different types of transport stacks for the exchange of BER-encoded data and HTTP packets. At present, the RFC1729 method (BER over TCP/IP), local UNIX socket and an experimental SSL stack are supported, but others may be added in time. The philosophy of the module is to provide a simple interface by hiding unused options and facilities of the underlying libraries. This is always done at the risk of losing generality, and it may prove that the interface will need extension later on.

Note

There hasn't been interest in the XTImOSI stack for some years. Therefore, it is no longer supported.

The interface is implemented in such a fashion that only the sub-layers constructed to the transport methods that you wish to use in your application are linked in.

You will note that even though simplicity was a goal in the design, the interface is still orders of magnitudes more complex than the transport systems found in many other packages. One reason is that the interface needs to support the somewhat different requirements of the different lower-layer communications stacks; another important reason is that the interface seeks to provide a more or less industrial-strength approach to asynchronous event-handling. When no function is allowed to block, things get more complex - particularly on the server side. We urge you to have a look at the demonstration client and server provided with the package. They are meant to be easily readable and instructive, while still being at least moderately useful.

yaz-5.34.4/doc/yaz-client.10000664000175000017500000005135014754707605011026 '\" t .\" Title: yaz-client .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-CLIENT" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-client \- Z39\&.50/SRU client for implementors .SH "SYNOPSIS" .HP \w'\fByaz\-client\fR\ 'u \fByaz\-client\fR [\fB\-a\ \fR\fB\fIapdulog\fR\fR] [\fB\-b\ \fR\fB\fIberdump\fR\fR] [\fB\-c\ \fR\fB\fIcclfile\fR\fR] [\fB\-d\ \fR\fB\fIdump\fR\fR] [\fB\-f\ \fR\fB\fIcmdfile\fR\fR] [\fB\-k\ \fR\fB\fIsize\fR\fR] [\fB\-m\ \fR\fB\fImarclog\fR\fR] [\fB\-p\ \fR\fB\fIproxy\-addr\fR\fR] [\fB\-q\ \fR\fB\fIcqlfile\fR\fR] [\fB\-t\ \fR\fB\fIdispcharset\fR\fR] [\fB\-u\ \fR\fB\fIauth\fR\fR] [\fB\-v\ \fR\fB\fIloglevel\fR\fR] [\fB\-V\fR] [\fB\-x\fR] [server\-addr] .SH "DESCRIPTION" .PP \fByaz\-client\fR is a \m[blue]\fBZ39\&.50\fR\m[]\&\s-2\u[1]\d\s+2/\m[blue]\fBSRU\fR\m[]\&\s-2\u[2]\d\s+2 client (origin) with a simple command line interface that allows you to test behavior and performance of Z39\&.50 targets and SRU servers\&. .PP From YAZ version 4\&.1\&.0 \fByaz\-client\fR may also operate as a \m[blue]\fBSolr\fR\m[]\&\s-2\u[3]\d\s+2 Web Service client\&. .PP If the \fIserver\-addr\fR is specified, the client creates a connection to the Z39\&.50/SRU target at the address given\&. .PP When \fByaz\-client\fR is started it tries to read commands from one of the following files: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Command file if it is given by option \-f\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \&.yazclientrc in current working directory\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} \&.yazclientrc in the user\*(Aqs home directory\&. The value of the $HOME environment variable is used to determine the home directory\&. Normally, $HOME is only set on POSIX systems such as Linux, FreeBSD, Solaris\&. .RE .sp .SH "OPTIONS" .PP \-a \fIfilename\fR .RS 4 If specified, logging of protocol packages will be appended to the file given\&. If \fIfilename\fR is specified as \-, the output is written to stdout\&. .RE .PP \-b \fIfilename\fR .RS 4 If specified, YAZ will dump BER data in readable notation to the file specified\&. If \fIfilename\fR is specified as \- the output is written to stdout\&. .RE .PP \-c \fIfilename\fR .RS 4 If specified, CCL configuration will be read from the file given\&. .RE .PP \-d \fIdump\fR .RS 4 If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named \fIdump\fR\&.DDD\&.raw, where DDD is 001, 002, 003, \&.\&.\&. .RE .PP \-f \fIcmdfile\fR .RS 4 Reads commands from \fIcmdfile\fR\&. When this option is used, YAZ client does not read \&.yazclientrc from current directory or home directory\&. .RE .PP \-k \fIsize\fR .RS 4 Sets preferred messages and maximum record size for Initialize Request in kilobytes\&. Default value is 65536 (64 MB)\&. .RE .PP \-m \fIfilename\fR .RS 4 If specified, retrieved records will be appended to the file given\&. .RE .PP \-p \fIproxy\-addr\fR .RS 4 If specified, the client will use the proxy at the address given\&. YAZ client will connect to a proxy on the address and port given\&. The actual target will be specified as part of the InitRequest to inform the proxy about the actual target\&. .RE .PP \-q \fIfilename\fR .RS 4 If specified, CQL configuration will be read from the file given\&. .RE .PP \-t \fIdisplaycharset\fR .RS 4 If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running)\&. .RE .PP \-u \fIauth\fR .RS 4 If specified, the \fIauth\fR string will be used for authentication\&. .RE .PP \-v \fIlevel\fR .RS 4 Sets the LOG level to \fIlevel\fR\&. Level is a sequence of tokens separated by comma\&. Each token is a integer or a named LOG item \- one of fatal, debug, warn, log, malloc, all, none\&. .RE .PP \-V .RS 4 Prints YAZ version\&. .RE .PP \-x .RS 4 Makes the YAZ client print hex dumps of packages sent and received on standard output\&. .RE .SH "COMMANDS" .PP The YAZ client accepts the following commands\&. .PP open \fIzurl\fR .RS 4 Opens a connection to a server\&. The syntax for \fIzurl\fR is the same as described above for connecting from the command line\&. .sp Syntax: .sp [(tcp|ssl|unix|http)\*(Aq:\*(Aq]\fIhost\fR [:\fIport\fR][/\fIbase\fR] .RE .PP quit .RS 4 Quits YAZ client .RE .PP find \fIquery\fR .RS 4 Sends a Search Request using the \fIquery\fR given\&. By default the query is assumed to be PQF\&. See command querytype for more information\&. .RE .PP delete \fIsetname\fR .RS 4 Deletes result set with name \fIsetname\fR on the server\&. .RE .PP base \fIbase1\fR \fIbase2\fR \&.\&.\&. .RS 4 Sets the name(s) of the database(s) to search\&. One or more databases may be specified, separated by blanks\&. This command overrides the database given in \fIzurl\fR\&. .RE .PP show [\fIstart\fR[+\fInumber\fR [+\fIresultset\fR]]] .RS 4 Fetches records by sending a Present Request from the start position given by \fIstart\fR and a number of records given by \fInumber\fR, from the result set \fIresultset\fR\&. If \fIstart\fR is not given, then the client will fetch from the position of the last retrieved record plus 1\&. If \fInumber\fR is not given, then one record will be fetched at a time\&. If \fIresultset\fR is not given, the most recently retrieved result set is used\&. .RE .PP scan \fIterm\fR .RS 4 Scans database index for a term\&. The syntax resembles the syntax for find\&. If you want to scan for the word water you could write .sp .if n \{\ .RS 4 .\} .nf scan water .fi .if n \{\ .RE .\} .sp but if you want to scan only in, say the title field, you would write .sp .if n \{\ .RS 4 .\} .nf scan @attr 1=4 water .fi .if n \{\ .RE .\} .RE .PP setscan \fIset\fR \fIterm\fR .RS 4 Scans database index for a term within a result set\&. This is similar to the scan command but has a result set as its first argument\&. .RE .PP scanpos \fIpos\fR .RS 4 Sets preferred position for scan\&. This value is used in the next scan\&. By default, position is 1\&. .RE .PP scansize \fIsize\fR .RS 4 Sets number of entries to be returned by scan\&. Default number of entries is 20\&. .RE .PP scanstep \fIstep\fR .RS 4 Set step\-size for scan\&. This value is used in the next scan sent to the target\&. By default step\-size is 0\&. .RE .PP sort \fIsortspecs\fR .RS 4 Sorts a result set\&. The sort command takes a sequence of space\-separated sort specifications, with each sort specification consisting of two space\-separated words (so that the whole specification list is made up of an even number of words)\&. The first word of each specification holds a field (sort criterion) and the second holds flags\&. If the sort criterion includes = it is assumed that the SortKey is of type sortAttributes using Bib\-1: in this case the integer before = is the attribute type and the integer following = is the attribute value\&. If no = character is in the criterion, it is treated as a sortfield of type InternationalString\&. The flags word of each sort specification must consist of s for case sensitive or i for case insensitive, and < for ascending order or > for descending order\&. .sp Example using sort criterion with attributes use=local\-number and structure=numeric and ascending flag: 1=12,4=109 < .sp Another example with "Title" sort field and descending flag: Title > .RE .PP sort+ .RS 4 Same as sort but stores the sorted result set in a new result set\&. .RE .PP authentication [\fIauth1\fR [\fIauth2\fR [\fIauth3\fR]]] .RS 4 Configures authentication strings to be sent to server\&. Zero, 1, 2 or 3 arguments may follow the auth command\&. .sp If no (0) arguments are given, no authentication string is sent\&. .sp If one argument is given, the Z39\&.50 v2 OpenStyle authentication is used\&. A common convention for the \fIauth1\fR string is that the username and password is separated by a slash, e\&.g\&. myusername/mysecret\&. .sp If two or more arguments is given Z39\&.50 v3 authentication is used, in which cased the first argument is used, second argument is group and third argument is password\&. If only two arguments are given the group is assumed to be empty\&. .sp As for other commands in yaz\-client, the arguments are separated by whitespace\&. A backslash character can be used to include a character verbatim\&. For example, auth myuser a\e b is a two argument auth command where user is myuser and password is a b\&. .sp The authentication string is first sent to the server when the open command is issued and the Z39\&.50 Initialize Request is sent, so this command must be used before open in order to be effective\&. .RE .PP sru \fImethod\fR \fIversion\fR .RS 4 Selects Web Service method and version\&. Must be one of post, get, soap (default) or solr\&. Version should be either 1\&.1, 1\&.2 or 2\&.0 for SRU\&. Other versions are allowed \- for testing purposes (version negotiation with SRU server)\&. The version is currently not used for Solr Web Services .RE .PP list_all .RS 4 This command displays status and values for many settings\&. .RE .PP lslb \fIn\fR .RS 4 Sets the limit for when no records should be returned together with the search result\&. See the \m[blue]\fBZ39\&.50 standard on set bounds\fR\m[]\&\s-2\u[4]\d\s+2 for more details\&. .RE .PP ssub \fIn\fR .RS 4 Sets the limit for when all records should be returned with the search result\&. See the \m[blue]\fBZ39\&.50 standard on set bounds\fR\m[]\&\s-2\u[4]\d\s+2 for more details\&. .RE .PP mspn \fIn\fR .RS 4 Sets the number of records that should be returned if the number of records in the result set is between the values of lslb and ssub\&. See the \m[blue]\fBZ39\&.50 standard on set bounds\fR\m[]\&\s-2\u[4]\d\s+2 for more details\&. .RE .PP status .RS 4 Displays the values of lslb, ssub and mspn\&. .RE .PP setname .RS 4 Switches named result sets on and off\&. Default is on\&. .RE .PP cancel .RS 4 Sends a Trigger Resource Control Request to the target\&. .RE .PP facets \fIspec\fR .RS 4 Specifies requested facets to be used in search\&. The notation is specified in ???\&. .RE .PP format \fIoid\fR .RS 4 Sets the preferred transfer syntax for retrieved records\&. yaz\-client supports all the record syntaxes that currently are registered\&. See \m[blue]\fBZ39\&.50 Record Syntax Identifiers\fR\m[]\&\s-2\u[5]\d\s+2 for more details\&. Commonly used records syntaxes include usmarc, sutrs and xml\&. .RE .PP elements \fIe\fR .RS 4 Sets the element set name for the records\&. Many targets support element sets B (for brief) and F (for full)\&. .RE .PP close .RS 4 Sends a Z39\&.50 Close APDU and closes connection with the peer .RE .PP querytype \fItype\fR .RS 4 Sets the query type as used by command find\&. The following is supported: prefix for Prefix Query Notation (Type\-1 Query); ccl for CCL search (Type\-2 Query), cql for CQL (Type\-104 search with CQL OID), ccl2rpn for CCL to RPN conversion (Type\-1 Query), cql2rpn for CQL to RPN conversion (Type\-1 Query)\&. .RE .PP attributeset \fIset\fR .RS 4 Sets attribute set OID for prefix queries (RPN, Type\-1)\&. .RE .PP refid \fIid\fR .RS 4 Sets reference ID for Z39\&.50 Request(s)\&. .RE .PP itemorder \fItype\fR \fIno\fR .RS 4 Sends an Item Order Request using the ILL External\&. \fItype\fR is either 1 or 2 which corresponds to ILL\-Profile 1 and 2 respectively\&. The \fIno\fR is the Result Set position of the record to be ordered\&. .RE .PP update \fIaction\fR \fIrecid\fR \fIdoc\fR .RS 4 Sends Item Update Request\&. The \fIaction\fR argument must be the action type: one of insert, replace, delete and update\&. The second argument, \fIrecid\fR, is the record identifier (any string)\&. Third argument which is optional is the record document for the request\&. If doc is preceded with "<", then the following characters are treated as a filename with the records to be updated\&. Otherwise doc is treated as a document itself\&. The doc may also be quoted in double quotes\&. If doc is omitted, the last received record (as part of present response or piggybacked search response) is used for the update\&. .RE .PP source \fIfilename\fR .RS 4 Executes list of commands from file \fIfilename\fR, just like \*(Aqsource\*(Aq on most UNIX shells\&. A single dot (\&.) can be used as an alternative\&. .RE .PP ! \fIargs\fR .RS 4 Executes command \fIargs\fR in subshell using the system call\&. .RE .PP push_command \fIcommand\fR .RS 4 The push_command takes another command as its argument\&. That command is then added to the history information (so you can retrieve it later)\&. The command itself is not executed\&. This command only works if you have GNU readline/history enabled\&. .RE .PP set_apdufile \fIfilename\fR .RS 4 Sets that APDU should be logged to file \fIfilename\fR\&. Another way to achieve APDU log is by using command\-line option \-a\&. .RE .PP set_auto_reconnect \fIflag\fR .RS 4 Specifies whether YAZ client automatically reconnects if the target closes connection (Z39\&.50 only)\&. .sp \fIflag\fR must be either on or off\&. .RE .PP set_auto_wait \fIflag\fR .RS 4 Specifies whether YAZ client should wait for response protocol packages after a request\&. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued\&. If off is used, YAZ client does not attempt to receive packages automatically\&. These will have to be manually received when command wait_response is used\&. .sp \fIflag\fR must be either on or off\&. .RE .PP set_marcdump \fIfilename\fR .RS 4 Specifies that all retrieved records should be appended to file \fIfilename\fR\&. This command does the same thing as option \-m\&. .RE .PP schema \fIschemaid\fR .RS 4 Specifies schema for retrieval\&. Schema may be specified as an OID for Z39\&.50\&. For SRU, schema is a simple string URI\&. .RE .PP charset \fInegotiationcharset\fR [\fIdisplaycharset\fR] [[\fImarccharset\fR]] .RS 4 Specifies character set (encoding) for Z39\&.50 negotiation / SRU encoding and/or character set for output (terminal)\&. .sp \fInegotiationcharset\fR is the name of the character set to be negotiated by the server\&. The special name \- for \fInegotiationcharset\fR specifies \fIno\fR character set to be negotiated\&. .sp If \fIdisplaycharset\fR is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running)\&. To disable conversion of characters to the output encoding, the special name \- (dash) can be used\&. If the special name auto is given, YAZ client will convert strings to the encoding of the terminal as returned by \fBnl_langinfo\fR call\&. .sp If \fImarccharset\fR is given, it specifies name of the character set of retrieved MARC records from server\&. See also marccharset command\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br Since character set negotiation takes effect in the Z39\&.50 Initialize Request you should issue this command before command open is used\&. .sp .5v .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br MARC records are not covered by Z39\&.50 character set negotiation, so that\*(Aqs why there is a separate character that must be known in order to do meaningful conversion(s)\&. .sp .5v .RE .RE .PP negcharset \fIcharset\fR .RS 4 Specifies character set for negotiation (Z39\&.50)\&. The argument is the same as second argument for command charset\&. .RE .PP displaycharset \fIcharset\fR .RS 4 Specifies character set for output (display)\&. The argument is the same as second argument for command charset\&. .RE .PP marccharset \fIcharset\fR .RS 4 Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display\&. See charset command\&. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO\-8859\-1 for all other MARC variants\&. The charset argument is the same as third argument for command charset\&. .RE .PP querycharset \fIcharset\fR .RS 4 Specifies character set for query terms for Z39\&.50 RPN queries and Z39\&.50 Scan Requests (termListAndStartPoint)\&. This is a pure client\-side conversion which converts from displayCharset to queryCharset\&. .RE .PP set_cclfile \fIfilename\fR .RS 4 Specifies that CCL fields should be read from file file \fIfilename\fR\&. This command does the same thing as option \-c\&. .RE .PP set_cqlfile \fIfilename\fR .RS 4 Specifies that CQL fields should be read from file file \fIfilename\fR\&. This command does the same thing as option \-q\&. .RE .PP register_oid \fIname\fR \fIclass\fR \fIOID\fR .RS 4 This command allows you to register your own object identifier \- so that instead of entering a long dot\-notation you can use a short name instead\&. The \fIname\fR is your name for the OID, \fIclass\fR is the class, and \fIOID\fR is the raw OID in dot notation\&. Class is one of: appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general\&. If you\*(Aqre in doubt use the general class\&. .RE .PP register_tab \fIcommand\fR \fIstring\fR .RS 4 This command registers a TAB completion string for the command given\&. .RE .PP sleep \fIseconds\fR .RS 4 This command makes YAZ client sleep (be idle) for the number of seconds given\&. .RE .PP wait_response [ \fInumber\fR] .RS 4 This command makes YAZ client wait for a number of response packages from target\&. If \fInumber\fR is omitted, 1 is assumed\&. .sp This command is rarely used and is only useful if command set_auto_wait is set to off\&. .RE .PP xmles \fIOID\fR \fIdoc\fR .RS 4 Sends XML Extended Services request using the OID and doc given\&. .RE .PP zversion \fIver\fR .RS 4 This command sets Z39\&.50 version for negotiation\&. Should be used before open\&. By default 3 (version 3) is used\&. .RE .PP options \fIop1 op2\&.\&.\fR .RS 4 This command sets Z39\&.50 options for negotiation\&. Should be used before open\&. .sp The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema\&. .RE .SH "EXAMPLE" .PP The simplest example of a Prefix Query would be something like .sp .if n \{\ .RS 4 .\} .nf f knuth .fi .if n \{\ .RE .\} .sp or .sp .if n \{\ .RS 4 .\} .nf f "donald knuth" .fi .if n \{\ .RE .\} .sp In those queries, no attributes were specified\&. This leaves it up to the server what fields to search but most servers will search in all fields\&. Some servers do not support this feature though, and require that some attributes are defined\&. To add one attribute you could do: .sp .if n \{\ .RS 4 .\} .nf f @attr 1=4 computer .fi .if n \{\ .RE .\} .sp where we search in the title field, since the use(1) is title(4)\&. If we want to search in the author field \fIand\fR in the title field, and in the title field using right truncation it could look something like this: .sp .if n \{\ .RS 4 .\} .nf f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer .fi .if n \{\ .RE .\} .sp Finally using a mix of Bib\-1 and GILS attributes could look something like this: .sp .if n \{\ .RS 4 .\} .nf f @attrset Bib\-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP yaz\-/client/client\&.c .PP $HOME/\&.yazclientrc .PP $HOME/\&.yazclient\&.history .SH "SEE ALSO" .PP \fByaz\fR(7) \fBbib1-attr\fR(7) .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 Z39.50 .RS 4 \%https://www.loc.gov/z3950/agency/ .RE .IP " 2." 4 SRU .RS 4 \%https://www.loc.gov/standards/sru/ .RE .IP " 3." 4 Solr .RS 4 \%https://lucene.apache.org/solr/ .RE .IP " 4." 4 Z39.50 standard on set bounds .RS 4 \%http://www.loc.gov/z3950/agency/markup/04.html#3.2.2.1.6 .RE .IP " 5." 4 Z39.50 Record Syntax Identifiers .RS 4 \%http://www.loc.gov/z3950/agency/defns/oids.html#5 .RE yaz-5.34.4/doc/tools.log.html0000664000175000017500000002060114754707607011470 4. Log

4. Log

YAZ has evolved a fairly complex log system which should be useful both for debugging YAZ itself, debugging applications that use YAZ, and for production use of those applications.

The log functions are declared in header yaz/log.h and implemented in src/log.c. Due to name clash with syslog and some math utilities the logging interface has been modified as of YAZ 2.0.29. The obsolete interface is still available in header file yaz/log.h. The key points of the interface are:

    void yaz_log(int level, const char *fmt, ...)
    void yaz_log_init(int level, const char *prefix, const char *name);
    void yaz_log_init_file(const char *fname);
    void yaz_log_init_level(int level);
    void yaz_log_init_prefix(const char *prefix);
    void yaz_log_time_format(const char *fmt);
    void yaz_log_init_max_size(int mx);

    int yaz_log_mask_str(const char *str);
    int yaz_log_module_level(const char *name);
   

The reason for the whole log module is the yaz_log function. It takes a bitmask indicating the log levels, a printf-like format string, and a variable number of arguments to log.

The log level is a bit mask, that says on which level(s) the log entry should be made, and optionally set some behaviour of the logging. In the most simple cases, it can be one of YLOG_FATAL, YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits that modify the way the log entry is written:YLOG_ERRNO, YLOG_NOTIME, YLOG_FLUSH. Most of the rest of the bits are deprecated, and should not be used. Use the dynamic log levels instead.

Applications that use YAZ, should not use the LOG_LOG for ordinary messages, but should make use of the dynamic loglevel system. This consists of two parts, defining the loglevel and checking it.

To define the log levels, the (main) program should pass a string to yaz_log_mask_str to define which log levels are to be logged. This string should be a comma-separated list of log level names, and can contain both hard-coded names and dynamic ones. The log level calculation starts with YLOG_DEFAULT_LEVEL and adds a bit for each word it meets, unless the word starts with a '-', in which case it clears the bit. If the string 'none' is found, all bits are cleared. Typically this string comes from the command-line, often identified by -v. The yaz_log_mask_str returns a log level that should be passed to yaz_log_init_level for it to take effect.

Each module should check what log bits should be used, by calling yaz_log_module_level with a suitable name for the module. The name is cleared of a preceding path and an extension, if any, so it is quite possible to use __FILE__ for it. If the name has been passed to yaz_log_mask_str, the routine returns a non-zero bitmask, which should then be used in consequent calls to yaz_log. (It can also be tested, so as to avoid unnecessary calls to yaz_log, in time-critical places, or when the log entry would take time to construct.)

Yaz uses the following dynamic log levels: server, session, request, requestdetail for the server functionality. zoom for the zoom client API. ztest for the simple test server. malloc, nmem, odr, eventl for internal debugging of yaz itself. Of course, any program using yaz is welcome to define as many new ones as it needs.

By default the log is written to stderr, but this can be changed by a call to yaz_log_init_file or yaz_log_init. If the log is directed to a file, the file size is checked at every write, and if it exceeds the limit given in yaz_log_init_max_size, the log is rotated. The rotation keeps one old version (with a .1 appended to the name). The size defaults to 1GB. Setting it to zero will disable the rotation feature.

    A typical yaz-log looks like this
  13:23:14-23/11 yaz-ztest(1) [session] Starting session from tcp:127.0.0.1 (pid=30968)
  13:23:14-23/11 yaz-ztest(1) [request] Init from 'YAZ' (81) (ver 2.0.28) OK
  13:23:17-23/11 yaz-ztest(1) [request] Search Z: @attrset Bib-1 foo  OK:7 hits
  13:23:22-23/11 yaz-ztest(1) [request] Present: [1] 2+2  OK 2 records returned
  13:24:13-23/11 yaz-ztest(1) [request] Close OK
   

The log entries start with a time stamp. This can be omitted by setting the YLOG_NOTIME bit in the loglevel. This way automatic tests can be hoped to produce identical log files, that are easy to diff. The format of the time stamp can be set with yaz_log_time_format, which takes a format string just like strftime.

Next in a log line comes the prefix, often the name of the program. For yaz-based servers, it can also contain the session number. Then comes one or more logbits in square brackets, depending on the logging level set by yaz_log_init_level and the loglevel passed to yaz_log_init_level. Finally comes the format string and additional values passed to yaz_log

The log level YLOG_LOGLVL, enabled by the string loglevel, will log all the log-level affecting operations. This can come in handy if you need to know what other log levels would be useful. Grep the logfile for [loglevel].

The log system is almost independent of the rest of YAZ, the only important dependence is of nmem, and that only for using the semaphore definition there.

The dynamic log levels and log rotation were introduced in YAZ 2.0.28. At the same time, the log bit names were changed from LOG_something to YLOG_something, to avoid collision with syslog.h.

yaz-5.34.4/doc/odr.programming.html0000664000175000017500000006505714754707607012673 3. Programming with ODR

3. Programming with ODR

The API of ODR is designed to reflect the structure of ASN.1, rather than BER itself. Future releases may be able to represent data in other external forms.

Tip

There is an ASN.1 tutorial available at this site. This site also has standards for ASN.1 (X.680) and BER (X.690) online.

The ODR interface is based loosely on that of the Sun Microsystems XDR routines. Specifically, each function which corresponds to an ASN.1 primitive type has a dual function. Depending on the settings of the ODR stream which is supplied as a parameter, the function may be used either to encode or decode data. The functions that can be built using these primitive functions, to represent more complex data types, share this quality. The result is that you only have to enter the definition for a type once - and you have the functionality of encoding, decoding (and pretty-printing) all in one unit. The resulting C source code is quite compact, and is a pretty straightforward representation of the source ASN.1 specification.

In many cases, the model of the XDR functions works quite well in this role. In others, it is less elegant. Most of the hassle comes from the optional SEQUENCE members which don't exist in XDR.

3.1. The Primitive ASN.1 Types

ASN.1 defines a number of primitive types (many of which correspond roughly to primitive types in structured programming languages, such as C).

3.1.1. INTEGER

The ODR function for encoding or decoding (or printing) the ASN.1 INTEGER type looks like this:

      int odr_integer(ODR o, Odr_int **p, int optional, const char *name);
     

The Odr_int is just a simple integer.

This form is typical of the primitive ODR functions. They are named after the type of data that they encode or decode. They take an ODR stream, an indirect reference to the type in question, and an optional flag (corresponding to the OPTIONAL keyword of ASN.1) as parameters. They all return an integer value of either one or zero. When you use the primitive functions to construct encoders for complex types of your own, you should follow this model as well. This ensures that your new types can be reused as elements in yet more complex types.

The o parameter should obviously refer to a properly initialized ODR stream of the right type (encoding/decoding/printing) for the operation that you wish to perform.

When encoding or printing, the function first looks at * p. If * p (the pointer pointed to by p) is a null pointer, this is taken to mean that the data element is absent. If the optional parameter is nonzero, the function will return one (signifying success) without any further processing. If the optional is zero, an internal error flag is set in the ODR stream, and the function will return 0. No further operations can be carried out on the stream without a call to the function odr_reset().

If *p is not a null pointer, it is expected to point to an instance of the data type. The data will be subjected to the encoding rules, and the result will be placed in the buffer held by the ODR stream.

The other ASN.1 primitives have similar functions that operate in similar manners:

3.1.2. BOOLEAN

int odr_bool(ODR o, Odr_bool **p, int optional, const char *name);
     

3.1.3. REAL

Not defined.

3.1.4. NULL

int odr_null(ODR o, Odr_null **p, int optional, const char *name);
     

In this case, the value of **p is not important. If *p is different from the null pointer, the null value is present, otherwise it's absent.

3.1.5. OCTET STRING

typedef struct odr_oct
{
    unsigned char *buf;
    int len;
} Odr_oct;

int odr_octetstring(ODR o, Odr_oct **p, int optional,
                    const char *name);
     

The buf field should point to the character array that holds the octetstring. The len field holds the actual length. The character array need not be null-terminated.

To make things a little easier, an alternative is given for string types that are not expected to contain embedded NULL characters (e.g. VisibleString):

      int odr_cstring(ODR o, char **p, int optional, const char *name);
     

which encodes or decodes between OCTETSTRING representations and null-terminated C strings.

Functions are provided for the derived string types, e.g.:

int odr_visiblestring(ODR o, char **p, int optional,
                      const char *name);
     

3.1.6. BIT STRING

int odr_bitstring(ODR o, Odr_bitmask **p, int optional,
                  const char *name);
     

The opaque type Odr_bitmask is only suitable for holding relatively brief bit strings, e.g. for options fields, etc. The constant ODR_BITMASK_SIZE multiplied by 8 gives the maximum possible number of bits.

A set of macros are provided for manipulating the Odr_bitmask type:

void ODR_MASK_ZERO(Odr_bitmask *b);

void ODR_MASK_SET(Odr_bitmask *b, int bitno);

void ODR_MASK_CLEAR(Odr_bitmask *b, int bitno);

int ODR_MASK_GET(Odr_bitmask *b, int bitno);
     

The functions are modeled after the manipulation functions that accompany the fd_set type used by the select(2) call. ODR_MASK_ZERO should always be called first on a new bitmask, to initialize the bits to zero.

3.1.7. OBJECT IDENTIFIER

int odr_oid(ODR o, Odr_oid **p, int optional, const char *name);
     

The C OID representation is simply an array of integers, terminated by the value -1 (the Odr_oid type is synonymous with the short type). We suggest that you use the OID database module (see Section 2.1, “OID database”) to handle object identifiers in your application.

3.2. Tagging Primitive Types

The simplest way of tagging a type is to use the odr_implicit_tag() or odr_explicit_tag() macros:

int odr_implicit_tag(ODR o, Odr_fun fun, int class, int tag,
                     int optional, const char *name);

int odr_explicit_tag(ODR o, Odr_fun fun, int class, int tag,
                     int optional, const char *name);
    

To create a type derived from the integer type by implicit tagging, you might write:

     MyInt ::= [210] IMPLICIT INTEGER
    

In the ODR system, this would be written like:

int myInt(ODR o, Odr_int **p, int optional, const char *name)
{
    return odr_implicit_tag(o, odr_integer, p,
			    ODR_CONTEXT, 210, optional, name);
}
    

The function myInt() can then be used like any of the primitive functions provided by ODR. Note that the behavior of odr_explicit_tag() and odr_implicit_tag() macros act exactly the same as the functions they are applied to - they respond to error conditions, etc, in the same manner - they simply have three extra parameters. The class parameter may take one of the values: ODR_CONTEXT, ODR_PRIVATE, ODR_UNIVERSAL, or /ODR_APPLICATION.

3.3. Constructed Types

Constructed types are created by combining primitive types. The ODR system only implements the SEQUENCE and SEQUENCE OF constructions (although adding the rest of the container types should be simple enough, if the need arises).

For implementing SEQUENCEs, the functions

int odr_sequence_begin(ODR o, void *p, int size, const char *name);
int odr_sequence_end(ODR o);
    

are provided.

The odr_sequence_begin() function should be called in the beginning of a function that implements a SEQUENCE type. Its parameters are the ODR stream, a pointer (to a pointer to the type you're implementing), and the size of the type (typically a C structure). On encoding, it returns 1 if * p is a null pointer. The size parameter is ignored. On decoding, it returns 1 if the type is found in the data stream. size bytes of memory are allocated, and *p is set to point to this space. The odr_sequence_end() is called at the end of the complex function. Assume that a type is defined like this:

MySequence ::= SEQUENCE {
     intval INTEGER,
     boolval BOOLEAN OPTIONAL
}
    

The corresponding ODR encoder/decoder function and the associated data structures could be written like this:

typedef struct MySequence
{
    Odr_int *intval;
    Odr_bool *boolval;
} MySequence;

int mySequence(ODR o, MySequence **p, int optional, const char *name)
{
    if (odr_sequence_begin(o, p, sizeof(**p), name) == 0)
        return optional && odr_ok(o);
    return
        odr_integer(o, &(*p)->intval, 0, "intval") &&
        odr_bool(o, &(*p)->boolval, 1, "boolval") &&
        odr_sequence_end(o);
}
    

Note the 1 in the call to odr_bool(), to mark that the sequence member is optional. If either of the member types had been tagged, the macros odr_implicit_tag() or odr_explicit_tag() could have been used. The new function can be used exactly like the standard functions provided with ODR. It will encode, decode or pretty-print a data value of the MySequence type. We like to name types with an initial capital, as done in ASN.1 definitions, and to name the corresponding function with the first character of the name in lower case. You could, of course, name your structures, types, and functions any way you please - as long as you're consistent, and your code is easily readable. odr_ok is just that - a predicate that returns the state of the stream. It is used to ensure that the behavior of the new type is compatible with the interface of the primitive types.

3.4. Tagging Constructed Types

Note

See Section 3.2, “Tagging Primitive Types” for information on how to tag the primitive types, as well as types that are already defined.

3.4.1. Implicit Tagging

Assume the type above had been defined as

MySequence ::= [10] IMPLICIT SEQUENCE {
      intval INTEGER,
      boolval BOOLEAN OPTIONAL
}
     

You would implement this in ODR by calling the function

int odr_implicit_settag(ODR o, int class, int tag);
     

which overrides the tag of the type immediately following it. The macro odr_implicit_tag() works by calling odr_implicit_settag() immediately before calling the function pointer argument. Your type function could look like this:

int mySequence(ODR o, MySequence **p, int optional, const char *name)
{
    if (odr_implicit_settag(o, ODR_CONTEXT, 10) == 0 ||
        odr_sequence_begin(o, p, sizeof(**p), name) == 0)
        return optional && odr_ok(o);
    return
        odr_integer(o, &(*p)->intval, 0, "intval") &&
        odr_bool(o, &(*p)->boolval, 1, "boolval") &&
        odr_sequence_end(o);
}
     

The definition of the structure MySequence would be the same.

3.4.2. Explicit Tagging

Explicit tagging of constructed types is a little more complicated, since you are in effect adding a level of construction to the data.

Assume the definition:

MySequence ::= [10] IMPLICIT SEQUENCE {
   intval INTEGER,
   boolval BOOLEAN OPTIONAL
}
     

Since the new type has an extra level of construction, two new functions are needed to encapsulate the base type:

int odr_constructed_begin(ODR o, void *p, int class, int tag,
                          const char *name);

int odr_constructed_end(ODR o);
     

Assume that the IMPLICIT in the type definition above were replaced with EXPLICIT (or that the IMPLICIT keyword was simply deleted, which would be equivalent). The structure definition would look the same, but the function would look like this:

int mySequence(ODR o, MySequence **p, int optional, const char *name)
{
    if (odr_constructed_begin(o, p, ODR_CONTEXT, 10, name) == 0)
        return optional && odr_ok(o);
    if (o->direction == ODR_DECODE)
        *p = odr_malloc(o, sizeof(**p));
    if (odr_sequence_begin(o, p, sizeof(**p), 0) == 0)
    {
        *p = 0; /* this is almost certainly a protocol error */
        return 0;
    }
    return
        odr_integer(o, &(*p)->intval, 0, "intval") &&
        odr_bool(o, &(*p)->boolval, 1, "boolval") &&
        odr_sequence_end(o) &&
        odr_constructed_end(o);
}
     

Notice that the interface here gets kind of nasty. The reason is simple: Explicitly tagged, constructed types are fairly rare in the protocols that we care about, so the aesthetic annoyance (not to mention the dangers of a cluttered interface) is less than the time that would be required to develop a better interface. Nevertheless, it is far from satisfying, and it's a point that will be worked on in the future. One option for you would be to simply apply the odr_explicit_tag() macro to the first function, and not have to worry about odr_constructed_* yourself. Incidentally, as you might have guessed, the odr_sequence_ functions are themselves implemented using the /odr_constructed_ functions.

3.5. SEQUENCE OF

To handle sequences (arrays) of a specific type, the function

int odr_sequence_of(ODR o, int (*fun)(ODR o, void *p, int optional),
                    void *p, int *num, const char *name);
    

The fun parameter is a pointer to the decoder/encoder function of the type. p is a pointer to an array of pointers to your type. num is the number of elements in the array.

Assume a type

MyArray ::= SEQUENCE OF INTEGER
    

The C representation might be

typedef struct MyArray
{
    int num_elements;
    Odr_int **elements;
} MyArray;
    

And the function might look like

int myArray(ODR o, MyArray **p, int optional, const char *name)
{
    if (o->direction == ODR_DECODE)
        *p = odr_malloc(o, sizeof(**p));
    if (odr_sequence_of(o, odr_integer, &(*p)->elements,
        &(*p)->num_elements, name))
        return 1;
    *p = 0;
        return optional && odr_ok(o);
}
    

3.6. CHOICE Types

The choice type is used fairly often in some ASN.1 definitions, so some work has gone into streamlining its interface.

CHOICE types are handled by the function:

int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp,
               const char *name);
    

The arm array is used to describe each of the possible types that the CHOICE type may assume. Internally in your application, the CHOICE type is represented as a discriminated union. That is, a C union accompanied by an integer (or enum) identifying the active 'arm' of the union. whichp is a pointer to the union discriminator. When encoding, it is examined to determine the current type. When decoding, it is set to reference the type that was found in the input stream.

The Odr_arm type is defined thus:

typedef struct odr_arm
{
    int tagmode;
    int class;
    int tag;
    int which;
    Odr_fun fun;
    char *name;
} Odr_arm;
    

The interpretation of the fields are:

tagmode

Either ODR_IMPLICIT, ODR_EXPLICIT, or ODR_NONE (-1) to mark no tagging.

which

The value of the discriminator that corresponds to this CHOICE element. Typically, it will be a #defined constant, or an enum member.

fun

A pointer to a function that implements the type of the CHOICE member. It may be either a standard ODR type or a type defined by yourself.

name

Name of tag.

A handy way to prepare the array for use by the odr_choice() function is to define it as a static, initialized array in the beginning of your decoding/encoding function. Assume the type definition:

MyChoice ::= CHOICE {
    untagged INTEGER,
    tagged   [99] IMPLICIT INTEGER,
    other    BOOLEAN
}
    

Your C type might look like

typedef struct MyChoice
{
    enum
    {
        MyChoice_untagged,
        MyChoice_tagged,
        MyChoice_other
    } which;
    union
    {
        Odr_int *untagged;
        Odr_int *tagged;
        Odr_bool *other;
    } u;
};
    

And your function could look like this:

int myChoice(ODR o, MyChoice **p, int optional, const char *name)
{
    static Odr_arm arm[] =
    {
      {-1, -1, -1, MyChoice_untagged, odr_integer, "untagged"},
      {ODR_IMPLICIT, ODR_CONTEXT, 99, MyChoice_tagged, odr_integer,
      "tagged"},
      {-1, -1, -1, MyChoice_other, odr_boolean, "other"},
      {-1, -1, -1, -1, 0}
    };

    if (o->direction == ODR_DECODE)
        *p = odr_malloc(o, sizeof(**p);
    else if (!*p)
        return optional && odr_ok(o);

    if (odr_choice(o, arm, &(*p)->u, &(*p)->which), name)
        return 1;
    *p = 0;
        return optional && odr_ok(o);
}
    

In some cases (say, a non-optional choice which is a member of a sequence), you can "embed" the union and its discriminator in the structure belonging to the enclosing type, and you won't need to fiddle with memory allocation to create a separate structure to wrap the discriminator and union.

The corresponding function is somewhat nicer in the Sun XDR interface. Most of the complexity of this interface comes from the possibility of declaring sequence elements (including CHOICEs) optional.

The ASN.1 specifications naturally require that each member of a CHOICE have a distinct tag, so they can be told apart on decoding. Sometimes it can be useful to define a CHOICE that has multiple types that share the same tag. You'll need some other mechanism, perhaps keyed to the context of the CHOICE type. In effect, we would like to introduce a level of context-sensitiveness to our ASN.1 specification. When encoding an internal representation, we have no problem, as long as each CHOICE member has a distinct discriminator value. For decoding, we need a way to tell the choice function to look for a specific arm of the table. The function

void odr_choice_bias(ODR o, int what);
    

provides this functionality. When called, it leaves a notice for the next call to odr_choice() to be called on the decoding stream o, that only the arm entry with a which field equal to what should be tried.

The most important application (perhaps the only one, really) is in the definition of application-specific EXTERNAL encoders/decoders which will automatically decode an ANY member given the direct or indirect reference.

yaz-5.34.4/doc/index.html0000664000175000017500000006237614754707607010676 YAZ User's Guide and Reference

YAZ User's Guide and Reference

Sebastian Hammer

Adam Dickmeiss

Mike Taylor

Heikki Levanto

Dennis Schafroth

Jakub Skoczen

5.34.4

Abstract

This document is the programmer's guide and reference to the YAZ package version 5.34.4. YAZ is a compact toolkit that provides access to the Z39.50 and SRU/Solr protocols, as well as a set of higher-level tools for implementing the server and client roles, respectively. The documentation can be used on its own, or as a reference when looking at the example applications provided with the package.


Table of Contents

1. Introduction
1. Reading this Manual
2. The API
2. Compilation and Installation
1. Introduction
2. UNIX/macOS
2.1. Compiling from source on Unix
2.2. Compiling from source on macOS
2.3. How to make apps using YAZ on UNIX
3. Windows
3.1. Compiling from Source on Windows
3.2. How to make apps using YAZ on Windows
3.3. Compiling Libxml2 and Libxslt on windows
3. ZOOM
1. Connections
1.1. Z39.50 Protocol behavior
1.2. SRU/Solr Protocol behavior
2. Queries
3. Result sets
3.1. Z39.50 Result-set Sort
3.2. Z39.50 Protocol behavior
3.3. SRU Protocol behavior
4. Records
4.1. Z39.50 Protocol behavior
4.2. SRU/Solr Protocol behavior
5. ZOOM Facets
6. Scan
7. Extended Services
7.1. Item Order
7.2. Record Update
7.3. Database Create
7.4. Database Drop
7.5. Commit Operation
7.6. Protocol behavior
8. Options
9. Query conversions
10. Events
4. Generic server
1. Introduction
2. The Database Frontend
3. The Backend API
4. Your main() Routine
5. The Backend Functions
5.1. Init
5.2. Search and Retrieve
5.3. Delete
5.4. Scan
6. Application Invocation
7. GFS Configuration and Virtual Hosts
5. The Z39.50 ASN.1 Module
1. Introduction
2. Preparing PDUs
3. EXTERNAL Data
4. PDU Contents Table
6. SOAP and SRU
1. Introduction
2. HTTP
3. SOAP Packages
4. SRU
7. Supporting Tools
1. Query Syntax Parsers
1.1. Prefix Query Format
1.1.1. Using Proximity Operators with PQF
1.1.2. PQF queries
1.2. CCL
1.2.1. CCL Syntax
1.2.2. CCL Qualifiers
1.2.3. CCL API
1.3. CQL
1.3.1. CQL parsing
1.3.2. CQL tree
1.3.3. CQL to PQF conversion
1.3.4. Specification of CQL to RPN mappings
1.3.5. CQL to XCQL conversion
1.3.6. PQF to CQL conversion
2. Object Identifiers
2.1. OID database
2.2. Standard OIDs
3. Nibble Memory
4. Log
5. MARC
5.1. TurboMARC
6. Retrieval Facility
6.1. Retrieval XML format
6.2. Retrieval Facility Examples
6.3. API
7. Sorting
7.1. Using the Z39.50 sort service
7.2. Type-7 sort
8. Facets
8. The ODR Module
1. Introduction
2. Using ODR
2.1. ODR Streams
2.2. Memory Management
2.3. Encoding and Decoding Data
2.4. Printing
2.5. Diagnostics
2.6. Summary and Synopsis
3. Programming with ODR
3.1. The Primitive ASN.1 Types
3.1.1. INTEGER
3.1.2. BOOLEAN
3.1.3. REAL
3.1.4. NULL
3.1.5. OCTET STRING
3.1.6. BIT STRING
3.1.7. OBJECT IDENTIFIER
3.2. Tagging Primitive Types
3.3. Constructed Types
3.4. Tagging Constructed Types
3.4.1. Implicit Tagging
3.4.2. Explicit Tagging
3.5. SEQUENCE OF
3.6. CHOICE Types
4. Debugging
9. The COMSTACK Module
1. Synopsis (blocking mode)
2. Introduction
3. Common Functions
3.1. Managing Endpoints
3.2. Data Exchange
4. Client Side
5. Server Side
6. Addresses
7. SSL
8. Diagnostics
9. Summary and Synopsis
10. Future Directions
I. Reference
yaz-client — Z39.50/SRU client for implementors
yaz-ztest — Z39.50/SRU Test Server
yaz-config — Script to get information about YAZ.
yaz — Z39.50 toolkit.
zoomsh — ZOOM shell
yaz-asncomp — YAZ ASN.1 compiler
yaz-marcdump — MARC record dump utility
yaz-iconv — YAZ Character set conversion utility
yaz-log — Log handling in all yaz-based programs
yaz-illclient — ILL client
yaz-icu — YAZ ICU utility
yaz-url — YAZ URL fetch utility
Bib-1 Attribute Set — Bib-1 Attribute Set
yaz-json-parse — YAZ JSON parser
yaz-record-iconv — YAZ Record Conversion Utility
A. List of Object Identifiers
B. Bib-1 diagnostics
C. SRU diagnostics
D. License
1. Index Data Copyright
E. About Index Data
F. Credits

List of Figures

1.1. YAZ layers
yaz-5.34.4/doc/license.html0000664000175000017500000000726414754707607011204 Appendix D. License

Appendix D. License

Table of Contents

1. Index Data Copyright

1. Index Data Copyright

Copyright © 1995-2025 Index Data.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY INDEX DATA ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

yaz-5.34.4/doc/yaz-iconv-man.xml0000664000175000017500000001344114631643521012064 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-iconv 1 Commands yaz-iconv YAZ Character set conversion utility yaz-iconv file DESCRIPTION yaz-iconv converts data in the character set specified by from to output in the character set as specified by to. This yaz-iconv utility is similar to the iconv found on many POSIX systems (Glibc, Solaris, etc). If no file is specified, yaz-iconv reads from standard input. OPTIONS -ffrom] Specify the character set from of the input file. Should be used in conjunction with option -t. -tto] Specify the character set of of the output. Should be used in conjunction with option -f. -v Print more information about the conversion process. ENCODINGS The yaz-iconv command and the API as defined in yaz/yaz-iconv.h is a wrapper for the library system call iconv. But YAZ' iconv utility also implements conversions on its own. The table below lists characters sets (or encodings) that are supported by YAZ. Each character set is marked with either encode or decode. If an encoding is encode-enabled, YAZ may convert to the designated encoding. If an encoding is decode-enabled, YAZ may convert from the designated encoding. marc8 (encode, decode) The MARC8 encoding as defined by the Library of Congress. Most MARC21/USMARC records use this encoding. marc8s (encode, decode) Like MARC8 but conversion prefers non-combined characters in the Latin-1 plane over combined characters. marc8lossy (encode) Lossy encoding of MARC-8. marc8lossless (encode) Lossless encoding of MARC8. utf8 (encode, decode) The most commonly used UNICODE encoding on the Internet. iso8859-1 (encode, decode) ISO-8859-1, AKA Latin-1. iso5426 (decode) ISO 5426. Some MARC records (UNIMARC) use this encoding. iso5428:1984 (encode, decode) ISO 5428:1984. advancegreek (encode, decode) An encoding for Greek in use by some vendors (Advance). danmarc (decode) Danmarc (in danish) is an encoding based on UNICODE which is used for DanMARC2 records. EXAMPLES The following command converts from ISO-8859-1 (Latin-1) to UTF-8. yaz-iconv -f ISO-8859-1 -t UTF-8 <input.lst >output.lst FILES prefix/bin/yaz-iconv prefix/include/yaz/yaz-iconv.h SEE ALSO yaz(7) iconv(1) yaz-5.34.4/doc/tools.oid.html0000664000175000017500000002115714754707607011471 2. Object Identifiers

2. Object Identifiers

The basic YAZ representation of an OID is an array of integers, terminated with the value -1. This integer is of type Odr_oid.

Fundamental OID operations and the type Odr_oid are defined in yaz/oid_util.h.

An OID can either be declared as a automatic variable or it can be allocated using the memory utilities or ODR/NMEM. It's guaranteed that an OID can fit in OID_SIZE integers.

Example 7.13. Create OID on stack

We can create an OID for the Bib-1 attribute set with:

      Odr_oid bib1[OID_SIZE];
      bib1[0] = 1;
      bib1[1] = 2;
      bib1[2] = 840;
      bib1[3] = 10003;
      bib1[4] = 3;
      bib1[5] = 1;
      bib1[6] = -1;
     


And OID may also be filled from a string-based representation using dots (.). This is achieved by the function

     int oid_dotstring_to_oid(const char *name, Odr_oid *oid);
    

This functions returns 0 if name could be converted; -1 otherwise.

Example 7.14. Using oid_oiddotstring_to_oid

We can fill the Bib-1 attribute set OID more easily with:

      Odr_oid bib1[OID_SIZE];
      oid_oiddotstring_to_oid("1.2.840.10003.3.1", bib1);
     


We can also allocate an OID dynamically on an ODR stream with:

    Odr_oid *odr_getoidbystr(ODR o, const char *str);
    

This creates an OID from a string-based representation using dots. This function take an ODR stream as parameter. This stream is used to allocate memory for the data elements, which is released on a subsequent call to odr_reset() on that stream.

Example 7.15. Using odr_getoidbystr

We can create an OID for the Bib-1 attribute set with:

      Odr_oid *bib1 = odr_getoidbystr(odr, "1.2.840.10003.3.1");
     


The function

     char *oid_oid_to_dotstring(const Odr_oid *oid, char *oidbuf)
    

does the reverse of oid_oiddotstring_to_oid. It converts an OID to the string-based representation using dots. The supplied char buffer oidbuf holds the resulting string and must be at least OID_STR_MAX in size.

OIDs can be copied with oid_oidcpy which takes two OID lists as arguments. Alternatively, an OID copy can be allocated on an ODR stream with:

     Odr_oid *odr_oiddup(ODR odr, const Odr_oid *o);
    

OIDs can be compared with oid_oidcmp which returns zero if the two OIDs provided are identical; non-zero otherwise.

2.1. OID database

From YAZ version 3 and later, the oident system has been replaced by an OID database. OID database is a misnomer .. the old odient system was also a database.

The OID database is really just a map between named Object Identifiers (string) and their OID raw equivalents. Most operations either convert from string to OID or other way around.

Unfortunately, whenever we supply a string we must also specify the OID class. The class is necessary because some strings correspond to multiple OIDs. An example of such a string is Bib-1 which may either be an attribute-set or a diagnostic-set.

Applications using the YAZ database should include yaz/oid_db.h.

A YAZ database handle is of type yaz_oid_db_t. Actually that's a pointer. You need not deal with that. YAZ has a built-in database which can be considered "constant" for most purposes. We can get hold of that by using function yaz_oid_std.

All functions with prefix yaz_string_to_oid converts from class + string to OID. We have variants of this operation due to different memory allocation strategies.

All functions with prefix yaz_oid_to_string converts from OID to string + class.

Example 7.16. Create OID with YAZ DB

We can create an OID for the Bib-1 attribute set on the ODR stream odr with:

        Odr_oid *bib1 =
	yaz_string_to_oid_odr(yaz_oid_std(), CLASS_ATTSET, "Bib-1", odr);
      

This is more complex than using odr_getoidbystr. You would only use yaz_string_to_oid_odr when the string (here Bib-1) is supplied by a user or configuration.


2.2. Standard OIDs

All the object identifiers in the standard OID database as returned by yaz_oid_std can be referenced directly in a program as a constant OID. Each constant OID is prefixed with yaz_oid_ - followed by OID class (lowercase) - then by OID name (normalized and lowercase).

See Appendix A, List of Object Identifiers for list of all object identifiers built into YAZ. These are declared in yaz/oid_std.h but are included by yaz/oid_db.h as well.

Example 7.17. Use a built-in OID

We can allocate our own OID filled with the constant OID for Bib-1 with:

       Odr_oid *bib1 = odr_oiddup(o, yaz_oid_attset_bib1);
      


yaz-5.34.4/doc/yaz-client-man.xml0000664000175000017500000010752114753417062012233 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-client 1 Commands yaz-client Z39.50/SRU client for implementors yaz-client server-addr DESCRIPTION yaz-client is a Z39.50/SRU client (origin) with a simple command line interface that allows you to test behavior and performance of Z39.50 targets and SRU servers. From YAZ version 4.1.0 yaz-client may also operate as a Solr Web Service client. If the server-addr is specified, the client creates a connection to the Z39.50/SRU target at the address given. When yaz-client is started it tries to read commands from one of the following files: Command file if it is given by option -f. .yazclientrc in current working directory. .yazclientrc in the user's home directory. The value of the $HOME environment variable is used to determine the home directory. Normally, $HOME is only set on POSIX systems such as Linux, FreeBSD, Solaris. OPTIONS -a filename If specified, logging of protocol packages will be appended to the file given. If filename is specified as -, the output is written to stdout. -b filename If specified, YAZ will dump BER data in readable notation to the file specified. If filename is specified as - the output is written to stdout. -c filename If specified, CCL configuration will be read from the file given. -d dump If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named dump.DDD.raw, where DDD is 001, 002, 003, ... -f cmdfile Reads commands from cmdfile. When this option is used, YAZ client does not read .yazclientrc from current directory or home directory. -k size Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 65536 (64 MB). -m filename If specified, retrieved records will be appended to the file given. -p proxy-addr If specified, the client will use the proxy at the address given. YAZ client will connect to a proxy on the address and port given. The actual target will be specified as part of the InitRequest to inform the proxy about the actual target. -q filename If specified, CQL configuration will be read from the file given. -t displaycharset If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). -u auth If specified, the auth string will be used for authentication. -v level Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none. -V Prints YAZ version. -x Makes the YAZ client print hex dumps of packages sent and received on standard output. COMMANDS The YAZ client accepts the following commands. open zurl Opens a connection to a server. The syntax for zurl is the same as described above for connecting from the command line. Syntax: [(tcp|ssl|unix|http)':']host [:port][/base] quit Quits YAZ client find query Sends a Search Request using the query given. By default the query is assumed to be PQF. See command querytype for more information. delete setname Deletes result set with name setname on the server. base base1 base2 ... Sets the name(s) of the database(s) to search. One or more databases may be specified, separated by blanks. This command overrides the database given in zurl. show [start[+number [+resultset]]] Fetches records by sending a Present Request from the start position given by start and a number of records given by number, from the result set resultset. If start is not given, then the client will fetch from the position of the last retrieved record plus 1. If number is not given, then one record will be fetched at a time. If resultset is not given, the most recently retrieved result set is used. scan term Scans database index for a term. The syntax resembles the syntax for find. If you want to scan for the word water you could write scan water but if you want to scan only in, say the title field, you would write scan @attr 1=4 water setscan set term Scans database index for a term within a result set. This is similar to the scan command but has a result set as its first argument. scanpos pos Sets preferred position for scan. This value is used in the next scan. By default, position is 1. scansize size Sets number of entries to be returned by scan. Default number of entries is 20. scanstep step Set step-size for scan. This value is used in the next scan sent to the target. By default step-size is 0. sort sortspecs Sorts a result set. The sort command takes a sequence of space-separated sort specifications, with each sort specification consisting of two space-separated words (so that the whole specification list is made up of an even number of words). The first word of each specification holds a field (sort criterion) and the second holds flags. If the sort criterion includes = it is assumed that the SortKey is of type sortAttributes using Bib-1: in this case the integer before = is the attribute type and the integer following = is the attribute value. If no = character is in the criterion, it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of s for case sensitive or i for case insensitive, and < for ascending order or > for descending order. Example using sort criterion with attributes use=local-number and structure=numeric and ascending flag: 1=12,4=109 < Another example with "Title" sort field and descending flag: Title > sort+ Same as sort but stores the sorted result set in a new result set. authentication [auth1 [auth2 [auth3]]] Configures authentication strings to be sent to server. Zero, 1, 2 or 3 arguments may follow the auth command. If no (0) arguments are given, no authentication string is sent. If one argument is given, the Z39.50 v2 OpenStyle authentication is used. A common convention for the auth1 string is that the username and password is separated by a slash, e.g. myusername/mysecret. If two or more arguments is given Z39.50 v3 authentication is used, in which cased the first argument is used, second argument is group and third argument is password. If only two arguments are given the group is assumed to be empty. As for other commands in yaz-client, the arguments are separated by whitespace. A backslash character can be used to include a character verbatim. For example, auth myuser a\ b is a two argument auth command where user is myuser and password is a b. The authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent, so this command must be used before open in order to be effective. sru method version Selects Web Service method and version. Must be one of post, get, soap (default) or solr. Version should be either 1.1, 1.2 or 2.0 for SRU. Other versions are allowed - for testing purposes (version negotiation with SRU server). The version is currently not used for Solr Web Services list_all This command displays status and values for many settings. lslb n Sets the limit for when no records should be returned together with the search result. See the Z39.50 standard on set bounds for more details. ssub n Sets the limit for when all records should be returned with the search result. See the Z39.50 standard on set bounds for more details. mspn n Sets the number of records that should be returned if the number of records in the result set is between the values of lslb and ssub. See the Z39.50 standard on set bounds for more details. status Displays the values of lslb, ssub and mspn. setname Switches named result sets on and off. Default is on. cancel Sends a Trigger Resource Control Request to the target. facets spec Specifies requested facets to be used in search. The notation is specified in . format oid Sets the preferred transfer syntax for retrieved records. yaz-client supports all the record syntaxes that currently are registered. See Z39.50 Record Syntax Identifiers for more details. Commonly used records syntaxes include usmarc, sutrs and xml. elements e Sets the element set name for the records. Many targets support element sets B (for brief) and F (for full). close Sends a Z39.50 Close APDU and closes connection with the peer querytype type Sets the query type as used by command find. The following is supported: prefix for Prefix Query Notation (Type-1 Query); ccl for CCL search (Type-2 Query), cql for CQL (Type-104 search with CQL OID), ccl2rpn for CCL to RPN conversion (Type-1 Query), cql2rpn for CQL to RPN conversion (Type-1 Query). attributeset set Sets attribute set OID for prefix queries (RPN, Type-1). refid id Sets reference ID for Z39.50 Request(s). itemorder type no Sends an Item Order Request using the ILL External. type is either 1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The no is the Result Set position of the record to be ordered. update action recid doc Sends Item Update Request. The action argument must be the action type: one of insert, replace, delete and update. The second argument, recid, is the record identifier (any string). Third argument which is optional is the record document for the request. If doc is preceded with "<", then the following characters are treated as a filename with the records to be updated. Otherwise doc is treated as a document itself. The doc may also be quoted in double quotes. If doc is omitted, the last received record (as part of present response or piggybacked search response) is used for the update. source filename Executes list of commands from file filename, just like 'source' on most UNIX shells. A single dot (.) can be used as an alternative. ! args Executes command args in subshell using the system call. push_command command The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed. This command only works if you have GNU readline/history enabled. set_apdufile filename Sets that APDU should be logged to file filename. Another way to achieve APDU log is by using command-line option -a. set_auto_reconnect flag Specifies whether YAZ client automatically reconnects if the target closes connection (Z39.50 only). flag must be either on or off. set_auto_wait flag Specifies whether YAZ client should wait for response protocol packages after a request. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued. If off is used, YAZ client does not attempt to receive packages automatically. These will have to be manually received when command wait_response is used. flag must be either on or off. set_marcdump filename Specifies that all retrieved records should be appended to file filename. This command does the same thing as option -m. schema schemaid Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI. charset negotiationcharset [displaycharset] [[marccharset]] Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal). negotiationcharset is the name of the character set to be negotiated by the server. The special name - for negotiationcharset specifies no character set to be negotiated. If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). To disable conversion of characters to the output encoding, the special name - (dash) can be used. If the special name auto is given, YAZ client will convert strings to the encoding of the terminal as returned by nl_langinfo call. If marccharset is given, it specifies name of the character set of retrieved MARC records from server. See also marccharset command. Since character set negotiation takes effect in the Z39.50 Initialize Request you should issue this command before command open is used. MARC records are not covered by Z39.50 character set negotiation, so that's why there is a separate character that must be known in order to do meaningful conversion(s). negcharset charset Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command charset. displaycharset charset Specifies character set for output (display). The argument is the same as second argument for command charset. marccharset charset Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See charset command. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC variants. The charset argument is the same as third argument for command charset. querycharset charset Specifies character set for query terms for Z39.50 RPN queries and Z39.50 Scan Requests (termListAndStartPoint). This is a pure client-side conversion which converts from displayCharset to queryCharset. set_cclfile filename Specifies that CCL fields should be read from file file filename. This command does the same thing as option -c. set_cqlfile filename Specifies that CQL fields should be read from file file filename. This command does the same thing as option -q. register_oid name class OID This command allows you to register your own object identifier - so that instead of entering a long dot-notation you can use a short name instead. The name is your name for the OID, class is the class, and OID is the raw OID in dot notation. Class is one of: appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general. If you're in doubt use the general class. register_tab command string This command registers a TAB completion string for the command given. sleep seconds This command makes YAZ client sleep (be idle) for the number of seconds given. wait_response [ number] This command makes YAZ client wait for a number of response packages from target. If number is omitted, 1 is assumed. This command is rarely used and is only useful if command set_auto_wait is set to off. xmles OID doc Sends XML Extended Services request using the OID and doc given. zversion ver This command sets Z39.50 version for negotiation. Should be used before open. By default 3 (version 3) is used. options op1 op2.. This command sets Z39.50 options for negotiation. Should be used before open. The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema. EXAMPLE The simplest example of a Prefix Query would be something like f knuth or f "donald knuth" In those queries, no attributes were specified. This leaves it up to the server what fields to search but most servers will search in all fields. Some servers do not support this feature though, and require that some attributes are defined. To add one attribute you could do: f @attr 1=4 computer where we search in the title field, since the use(1) is title(4). If we want to search in the author field and in the title field, and in the title field using right truncation it could look something like this: f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer Finally using a mix of Bib-1 and GILS attributes could look something like this: f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather FILES yaz-<version>/client/client.c $HOME/.yazclientrc $HOME/.yazclient.history SEE ALSO yaz 7 bib1-attr 7 yaz-5.34.4/doc/odr.use.html0000664000175000017500000005051214754707607011133 2. Using ODR

2. Using ODR

2.1. ODR Streams

Conceptually, the ODR stream is the source of encoded data in the decoding mode; when encoding, it is the receptacle for the encoded data. Before you can use an ODR stream it must be allocated. This is done with the function

     ODR odr_createmem(int direction);
    

The odr_createmem() function takes as argument one of three manifest constants: ODR_ENCODE, ODR_DECODE, or ODR_PRINT. An ODR stream can be in only one mode - it is not possible to change its mode once it's selected. Typically, your program will allocate at least two ODR streams - one for decoding, and one for encoding.

When you're done with the stream, you can use

     void odr_destroy(ODR o);
    

to release the resources allocated for the stream.

2.2. Memory Management

Two forms of memory management take place in the ODR system. The first one, which has to do with allocating little bits of memory (sometimes quite large bits of memory, actually) when a protocol package is decoded, and turned into a complex of interlinked structures. This section deals with this system, and how you can use it for your own purposes. The next section deals with the memory management which is required when encoding data - to make sure that a large enough buffer is available to hold the fully encoded PDU.

The ODR module has its own memory management system, which is used whenever memory is required. Specifically, it is used to allocate space for data when decoding incoming PDUs. You can use the memory system for your own purposes, by using the function

     void *odr_malloc(ODR o, size_t size);
    

You can't use the normal free(2) routine to free memory allocated by this function, and ODR doesn't provide a parallel function. Instead, you can call

     void odr_reset(ODR o);
    

when you are done with the memory: Everything allocated since the last call to odr_reset() is released. The odr_reset() call is also required to clear up an error condition on a stream.

The function

     size_t odr_total(ODR o);
    

returns the number of bytes allocated on the stream since the last call to odr_reset().

The memory subsystem of ODR is fairly efficient at allocating and releasing little bits of memory. Rather than managing the individual, small bits of space, the system maintains a free-list of larger chunks of memory, which are handed out in small bits. This scheme is generally known as a nibble-memory system. It is very useful for maintaining short-lived constructions such as protocol PDUs.

If you want to retain a bit of memory beyond the next call to odr_reset(), you can use the function

     ODR_MEM odr_extract_mem(ODR o);
    

This function will give you control of the memory recently allocated on the ODR stream. The memory will live (past calls to odr_reset()), until you call the function

     void odr_release_mem(ODR_MEM p);
    

The opaque ODR_MEM handle has no other purpose than referencing the memory block for you until you want to release it.

You can use odr_extract_mem() repeatedly between allocating data, to retain individual control of separate chunks of data.

2.3. Encoding and Decoding Data

When encoding data, the ODR stream will write the encoded octet string in an internal buffer. To retrieve the data, use the function

     char *odr_getbuf(ODR o, int *len, int *size);
    

The integer pointed to by len is set to the length of the encoded data, and a pointer to that data is returned. *size is set to the size of the buffer (unless size is null, signaling that you are not interested in the size). The next call to a primitive function using the same ODR stream will overwrite the data, unless a different buffer has been supplied using the call

     void odr_setbuf(ODR o, char *buf, int len, int can_grow);
    

which sets the encoding (or decoding) buffer used by o to buf, using the length len. Before a call to an encoding function, you can use odr_setbuf() to provide the stream with an encoding buffer of sufficient size (length). The can_grow parameter tells the encoding ODR stream whether it is allowed to use realloc(2) to increase the size of the buffer when necessary. The default condition of a new encoding stream is equivalent to the results of calling

     odr_setbuf(stream, 0, 0, 1);
    

In this case, the stream will allocate and reallocate memory as necessary. The stream reallocates memory by repeatedly doubling the size of the buffer - the result is that the buffer will typically reach its maximum, working size with only a small number of reallocation operations. The memory is freed by the stream when the latter is destroyed, unless it was assigned by the user with the can_grow parameter set to zero (in this case, you are expected to retain control of the memory yourself).

To assume full control of an encoded buffer, you must first call odr_getbuf() to fetch the buffer and its length. Next, you should call odr_setbuf() to provide a different buffer (or a null pointer) to the stream. In the simplest case, you will reuse the same buffer over and over again, and you will just need to call odr_getbuf() after each encoding operation to get the length and address of the buffer. Note that the stream may reallocate the buffer during an encoding operation, so it is necessary to retrieve the correct address after each encoding operation.

It is important to realize that the ODR stream will not release this memory when you call odr_reset(): It will merely update its internal pointers to prepare for the encoding of a new data value. When the stream is released by the odr_destroy() function, the memory given to it by odr_setbuf will be released only if the can_grow parameter to odr_setbuf() was nonzero. The can_grow parameter, in other words, is a way of signaling who is to own the buffer, you or the ODR stream. If you never call odr_setbuf() on your encoding stream, which is typically the case, the buffer allocated by the stream will belong to the stream by default.

When you wish to decode data, you should first call odr_setbuf(), to tell the decoding stream where to find the encoded data, and how long the buffer is (the can_grow parameter is ignored by a decoding stream). After this, you can call the function corresponding to the data you wish to decode (e.g. odr_integer() odr z_APDU()).

Example 8.1. Encoding and decoding functions

      int odr_integer(ODR o, Odr_int **p, int optional, const char *name);

      int z_APDU(ODR o, Z_APDU **p, int optional, const char *name);
     

If the data is absent (or doesn't match the tag corresponding to the type), the return value will be either 0 or 1 depending on the optional flag. If optional is 0 and the data is absent, an error flag will be raised in the stream, and you'll need to call odr_reset() before you can use the stream again. If optional is nonzero, the pointer pointed to/ by p will be set to the null value, and the function will return 1. The name argument is used to pretty-print the tag in question. It may be set to NULL if pretty-printing is not desired.

If the data value is found where it's expected, the pointer pointed to by the p argument will be set to point to the decoded type. The space for the type will be allocated and owned by the ODR stream, and it will live until you call odr_reset() on the stream. You cannot use free(2) to release the memory. You can decode several data elements (by repeated calls to odr_setbuf() and your decoding function), and new memory will be allocated each time. When you do call odr_reset(), everything decoded since the last call to odr_reset() will be released.

Example 8.2. Encoding and decoding of an integer

The use of the double indirection can be a little confusing at first (its purpose will become clear later on, hopefully), so an example is in order. We'll encode an integer value, and immediately decode it again using a different stream. A useless, but informative operation.

void do_nothing_useful(Odr_int value)
{
    ODR encode, decode;
    Odr_int *valp, *resvalp;
    char *bufferp;
    int len;

    /* allocate streams */
    if (!(encode = odr_createmem(ODR_ENCODE)))
        return;
    if (!(decode = odr_createmem(ODR_DECODE)))
        return;

    valp = &value;
    if (odr_integer(encode, &valp, 0, 0) == 0)
    {
        printf("encoding went bad\n");
        return;
    }
    bufferp = odr_getbuf(encode, &len, 0);
    printf("length of encoded data is %d\n", len);

    /* now let's decode the thing again */
    odr_setbuf(decode, bufferp, len, 0);
    if (odr_integer(decode, &resvalp, 0, 0) == 0)
    {
        printf("decoding went bad\n");
        return;
    }
    /* ODR_INT_PRINTF format for printf (such as %d) */
    printf("the value is " ODR_INT_PRINTF "\n", *resvalp);

    /* clean up */
    odr_destroy(encode);
    odr_destroy(decode);
}

     

This looks like a lot of work, offhand. In practice, the ODR streams will typically be allocated once, in the beginning of your program (or at the beginning of a new network session), and the encoding and decoding will only take place in a few, isolated places in your program, so the overhead is quite manageable.


2.4. Printing

When an ODR stream is created of type ODR_PRINT the ODR module will print the contents of a PDU in a readable format. By default output is written to the stderr stream. This behavior can be changed, however, by calling the function

      odr_setprint(ODR o, FILE *file);
     

before encoders or decoders are being invoked. It is also possible to direct the output to a buffer (or indeed another file), by using the more generic mechanism:

      void odr_set_stream(ODR o, void *handle,
                         void (*stream_write)(ODR o, void *handle, int type,
                                              const char *buf, int len),
                         void (*stream_close)(void *handle));
     

Here the user provides an opaque handle and two handlers, stream_write for writing, and stream_close which is supposed to close/free resources associated with handle. The stream_close handler is optional and if NULL for the function is provided, it will not be invoked. The stream_write takes the ODR handle as parameter, the user-defined handle, a type ODR_OCTETSTRING, ODR_VISIBLESTRING which indicates the type of contents being written.

Another utility useful for diagnostics (error handling) or as part of the printing facilities is:

      const char **odr_get_element_path(ODR o);
     

which returns a list of current elements that ODR deals with at the moment. For the returned array, say ar, then ar[0] is the top level element, ar[n] is the last. The last element has the property that ar[n+1] == NULL.

Example 8.3. Element Path for record

For a database record part of a PresentResponse the array returned by odr_get_element is presentResponse, databaseOrSurDiagnostics, ?, record, ?, databaseRecord . The question mark appears due to unnamed constructions.


2.5. Diagnostics

The encoding/decoding functions all return 0 when an error occurs. Until you call odr_reset(), you cannot use the stream again, and any function called will immediately return 0.

To provide information to the programmer or administrator, the function

     void odr_perror(ODR o, char *message);
    

is provided, which prints the message argument to stderr along with an error message from the stream.

You can also use the function

     int odr_geterror(ODR o);
    

to get the current error number from the screen. The number will be one of these constants:

Table 8.1. ODR Error codes

codeDescription
OMEMORYMemory allocation failed.
OSYSERRA system- or library call has failed. The standard diagnostic variable errno should be examined to determine the actual error.
OSPACENo more space for encoding. This will only occur when the user has explicitly provided a buffer for an encoding stream without allowing the system to allocate more space.
OREQUIREDThis is a common protocol error; A required data element was missing during encoding or decoding.
OUNEXPECTEDAn unexpected data element was found during decoding.
OOTHEROther error. This is typically an indication of misuse of the ODR system by the programmer, and also that the diagnostic system isn't as good as it should be, yet.

The character string array

     char *odr_errlist[]
    

can be indexed by the error code to obtain a human-readable representation of the problem.

2.6. Summary and Synopsis

     #include <yaz/odr.h>

     ODR odr_createmem(int direction);

     void odr_destroy(ODR o);

     void odr_reset(ODR o);

     char *odr_getbuf(ODR o, int *len, int *size);

     void odr_setbuf(ODR o, char *buf, int len, int can_grow);

     void *odr_malloc(ODR o, int size);

     NMEM odr_extract_mem(ODR o);

     int odr_geterror(ODR o);

     void odr_perror(ODR o, const char *message);

     extern char *odr_errlist[];
    
yaz-5.34.4/doc/facets.html0000664000175000017500000000716014754707607011022 8. Facets

8. Facets

YAZ supports facets in the Solr, SRU 2.0 and Z39.50 protocols.

Like Type-1/RPN, YAZ supports a string notation for specifying facets. This notataion maps straight to facets.asn. The notation is parsed by function yaz_pqf_parse_facet_list defined in header yaz/pquery.h.

For ZOOM C the facets are specified by option "facets". For yaz-client, the 'facets' command is used.

The grammar of this specification is as follows:


   facet-spec ::= facet-list

   facet-list ::= facet-list ',' attr-spec | attr-spec

   attr-spec ::= attr-spec '@attr' string | '@attr' string

    

The notation is inspired by PQF. The string following '@attr' must not include blanks and is of the form type=value, where type is an integer and value is a string or an integer.

There is no formal facets attribute set (it is not given in the protocol by the facets, although it could). The following types apply:

Table 7.4. Facet attributes

TypeDescription
1 Field-name. This is often a string, e.g. "Author", "Year", etc.
2 Sort order. Value should be an integer. Value 0: count descending (frequency). Value 1: alpha ascending.
3 Number of terms requested.
4 Start offset (starting from 1)

yaz-5.34.4/doc/server.main.html0000664000175000017500000002056214754707607012007 4. Your main() Routine

4. Your main() Routine

As mentioned, your main() routine can be quite brief. If you want to initialize global parameters, or read global configuration tables, this is the place to do it. At the end of the routine, you should call the function

int statserv_main(int argc, char **argv,
                  bend_initresult *(*bend_init)(bend_initrequest *r),
                  void (*bend_close)(void *handle));
   

The third and fourth arguments are pointers to handlers. Handler bend_init is called whenever the server receives an Initialize Request, so it serves as a Z39.50 session initializer. The bend_close handler is called when the session is closed.

statserv_main will establish listening sockets according to the parameters given. When connection requests are received, the event handler will typically fork() and create a sub-process to handle a new connection. Alternatively the server may be setup to create threads for each connection. If you do use global variables and forking, you should be aware, then, that these cannot be shared between associations, unless you explicitly disable forking by command line parameters.

The server provides a mechanism for controlling some of its behavior without using command-line options. The function

    statserv_options_block *statserv_getcontrol(void);
   

will return a pointer to a struct statserv_options_block describing the current default settings of the server. The structure contains these elements:

int dynamic

A boolean value, which determines whether the server will fork on each incoming request (TRUE), or not (FALSE). Default is TRUE. This flag is only read by UNIX-based servers (WIN32-based servers do not fork).

int threads

A boolean value, which determines whether the server will create a thread on each incoming request (TRUE), or not (FALSE). Default is FALSE. This flag is only read by UNIX-based servers that offer POSIX Threads support. WIN32-based servers always operate in threaded mode.

int inetd

A boolean value, which determines whether the server will operate under a UNIX INET daemon (inetd). Default is FALSE.

char logfile[ODR_MAXNAME+1]

File for diagnostic output ("": stderr).

char apdufile[ODR_MAXNAME+1]

Name of file for logging incoming and outgoing APDUs ("": don't log APDUs, "-": stderr).

char default_listen[1024]

Same form as the command-line specification of listener address. "": no default listener address. Default is to listen at "tcp:@:9999". You can only specify one default listener address in this fashion.

enum oid_proto default_proto;

Either PROTO_Z3950 or PROTO_SR. Default is PROTO_Z39_50.

int idle_timeout;

Maximum session idle-time, in minutes. Zero indicates no (infinite) timeout. Default is 15 minutes.

int maxrecordsize;

Maximum permissible record (message) size. Default is 64 MB. This amount of memory will only be allocated if a client requests a very large amount of records in one operation (or a big record). Set it to a lower number if you are worried about resource consumption on your host system.

char configname[ODR_MAXNAME+1]

Passed to the backend when a new connection is received.

char setuid[ODR_MAXNAME+1]

Set user id to the user specified, after binding the listener addresses.

void (*bend_start)(struct statserv_options_block *p)

Pointer to function which is called after the command line options have been parsed - but before the server starts listening. For forked UNIX servers, this handler is called in the mother process; for threaded servers, this handler is called in the main thread. The default value of this pointer is NULL in which case it isn't invoked by the frontend server. When the server operates as an NT service, this handler is called whenever the service is started.

void (*bend_stop)(struct statserv_options_block *p)

Pointer to function which is called whenever the server has stopped listening for incoming connections. This function pointer has a default value of NULL in which case it isn't called. When the server operates as an NT service, this handler is called whenever the service is stopped.

void *handle

User defined pointer (default value NULL). This is a per-server handle that can be used to specify "user-data". Do not confuse this with the session-handle as returned by bend_init.

The pointer returned by statserv_getcontrol points to a static area. You are allowed to change the contents of the structure, but the changes will not take effect until you call

void statserv_setcontrol(statserv_options_block *block);
   

Note

You should generally update this structure before calling statserv_main().

yaz-5.34.4/doc/server.html0000664000175000017500000001213414754707607011060 Chapter 4. Generic server

Chapter 4. Generic server

1. Introduction

If you aren't into documentation, a good way to learn how the back end interface works is to look at the backend.h file. Then, look at the small dummy-server in ztest/ztest.c. The backend.h file also makes a good reference, once you've chewed your way through the prose of this file.

If you have a database system that you would like to make available by means of Z39.50 or SRU, YAZ basically offers two options. You can use the APIs provided by the Z39.50 ASN.1, ODR, and COMSTACK modules to create and decode PDUs, and exchange them with a client. Using this low-level interface gives you access to all fields and options of the protocol, and you can construct your server as close to your existing database as you like. It is also a fairly involved process, requiring you to set up an event-handling mechanism, protocol state machine, etc. To simplify server implementation, we have implemented a compact and simple, but reasonably full-functioned server-frontend that will handle most of the protocol mechanics, while leaving you to concentrate on your database interface.

Note

The backend interface was designed in anticipation of a specific integration task, while still attempting to achieve some degree of generality. We realize fully that there are points where the interface can be improved significantly. If you have specific functions or parameters that you think could be useful, send us a mail (or better, sign on to the mailing list referred to in the top-level README file). We will try to fit good suggestions into future releases, to the extent that it can be done without requiring too many structural changes in existing applications.

Note

The YAZ server does not support XCQL.

yaz-5.34.4/doc/yaz.html0000664000175000017500000001103214754707607010351 yaz

Name

yaz — Z39.50 toolkit.

DESCRIPTION

YAZ is a C/C++ programmer's toolkit supporting the development of Z39.50v3 clients and servers. The YAZ toolkit offers several different levels of access to the ISO23950/Z39.50, SRU Solr (client only) and ILL protocols. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement.

COPYRIGHT

Copyright © 1995-2025 Index Data.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

  • Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

SEE ALSO

yaz-client(1), yaz-ztest(8), yaz-config(8), zoomsh(1) bib1-attr(7)

YAZ manual ( /usr/share/doc/yaz)

YAZ home page.

Z39.50 Maintenance Agency Page.

yaz-5.34.4/doc/yaz-asncomp.10000664000175000017500000001264014754707605011207 '\" t .\" Title: yaz-asncomp .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-ASNCOMP" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-asncomp \- YAZ ASN\&.1 compiler .SH "SYNOPSIS" .HP \w'\fByaz\-asncomp\fR\ 'u \fByaz\-asncomp\fR [\fB\-v\fR] [\fB\-c\ \fR\fB\fIcfile\fR\fR] [\fB\-h\ \fR\fB\fIhfile\fR\fR] [\fB\-p\ \fR\fB\fIpfile\fR\fR] [\fB\-d\ \fR\fB\fIconfig\fR\fR] [\fB\-I\ \fR\fB\fIincludeout\fR\fR] [\fB\-i\ \fR\fB\fIincludedir\fR\fR] [\fB\-m\ \fR\fB\fImodule\fR\fR] [filename] .SH "DESCRIPTION" .PP \fByaz\-asncomp\fR is an ASN\&.1 compiler that reads an ASN\&.1 specification in \fIfilename\fR and produces C/C++ definitions and BER encoders/decoders for it\&. .PP The produced C/C++ code and header files uses the ODR module of YAZ which is a library that encodes/decodes/prints BER packages\&. \fByaz\-asncomp\fR allows you to specify name of resulting source via options\&. Alternatively, you can specify a DEFINITIONS file, which provides customized output to many output files \- if the ASN\&.1 specification file consists of many modules\&. .PP This utility is written in Tcl\&. Any version of Tcl should work\&. .SH "OPTIONS" .PP \-v .RS 4 Makes the ASN\&.1 compiler print more verbose about the various stages of operations\&. .RE .PP \-c \fIcfile\fR .RS 4 Specifies the name of the C/C++ file with encoders/decoders\&. .RE .PP \-h \fIhfile\fR .RS 4 Specifies the name of header file with definitions\&. .RE .PP \-p \fIpfile\fR .RS 4 Specifies the name of the a private header file with definitions\&. By default all definitions are put in header file (option \-h)\&. .RE .PP \-d \fIdfile\fR .RS 4 Specifies the name of a definitions file\&. .RE .PP \-I \fIiout\fR .RS 4 Specifies first part of directory in which header files are written\&. .RE .PP \-i \fIidir\fR .RS 4 Specifies second part of directory in which header files are written\&. .RE .PP \-m \fImodule\fR .RS 4 Specifies that ASN\&.1 compiler should only process the module given\&. If this option is not specified, all modules in the ASN\&.1 file are processed\&. .RE .SH "DEFINITIONS FILE" .PP The definitions file is really a Tcl script but follows traditional rules for Shell like configuration files\&. That is # denotes the beginning of a comment\&. Definitions are line oriented\&. The definitions files usually consist of a series of variable assignments of the form: .PP set \fIname\fR \fIvalue\fR .PP Available variables are: .PP default\-prefix .RS 4 Sets prefix for names in the produced output\&. The value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively\&. .RE .PP prefix(\fImodule\fR) .RS 4 This value sets prefix values for module \fImodule\fR\&. The value has same form as default\-prefix\&. .RE .PP filename(\fImodule\fR) .RS 4 Specifies filename for C/header file for module \fImodule\fR\&. .RE .PP init(\fImodule\fR,h) .RS 4 Code fragment to be put in first part of public header for module \fImodule\fR\&. .RE .PP body(\fImodule\fR,h) .RS 4 Code fragment to be put in last part of public header for module \fImodule\fR (trailer)\&. .RE .PP init(\fImodule\fR,c) .RS 4 Code fragment to be put in first part of C based encoder/decoder for module \fImodule\fR\&. .RE .PP body(\fImodule\fR,c) .RS 4 Code fragment to be put in last part of C based encoder/decoder for module \fImodule\fR (trailer)\&. .RE .PP map(\fImodule\fR,\fIname\fR) .RS 4 Maps ASN\&.1 type in module \fImodule\fR of \fIname\fR to value\&. .RE .PP membermap(\fImodule\fR,\fIname\fR,\fImember\fR) .RS 4 Maps member \fImember\fR in SEQUENCE/CHOICE of \fIname\fR in module \fImodule\fR to value\&. The value consists of one or two tokens\&. First token is name of C preprocessor part\&. Second token is resulting C member name\&. If second token is omitted the value (one token) is both preprocessor part and C struct,union\&. .RE .PP unionmap(\fImodule\fR,\fIname\fR,\fImember\fR) .RS 4 Maps member \fImember\fR in CHOICE of \fIname\fR in module \fImodule\fR to value\&. Value consists of two or three tokens\&. The first token is name of the integer in the union that is used as selector for the union itself\&. The second token is name of the union\&. The third token overrides the name of the CHOICE member; if omitted the member name is used\&. .RE .SH "FILES" .PP /usr/share/yaz/z39\&.50/z\&.tcl .PP /usr/share/yaz/z39\&.50/*\&.asn .SH "SEE ALSO" .PP \fByaz\fR(7) .PP Section "The ODR Module" in the YAZ manual\&. .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/soap.xml.html0000664000175000017500000001270014754707607011312 3. SOAP Packages

3. SOAP Packages

Every SOAP package in YAZ is represented as follows:

#include <yaz/soap.h>

typedef struct {
    char *fault_code;
    char *fault_string;
    char *details;
} Z_SOAP_Fault;

typedef struct {
    int no;
    char *ns;
    void *p;
} Z_SOAP_Generic;

#define Z_SOAP_fault 1
#define Z_SOAP_generic 2
#define Z_SOAP_error 3
typedef struct {
    int which;
    union {
        Z_SOAP_Fault   *fault;
        Z_SOAP_Generic *generic;
        Z_SOAP_Fault   *soap_error;
    } u;
    const char *ns;
} Z_SOAP;
    

The fault and soap_error arms both represent a SOAP fault - struct Z_SOAP_Fault. Any other generic (valid) package is represented by Z_SOAP_Generic.

The ns as part of Z_SOAP is the namespace for SOAP itself and reflects the SOAP version. For version 1.1 it is http://schemas.xmlsoap.org/soap/envelope/, for version 1.2 it is http://www.w3.org/2001/06/soap-envelope.

int z_soap_codec(ODR o, Z_SOAP **pp,
                 char **content_buf, int *content_len,
                 Z_SOAP_Handler *handlers);
   

The content_buf and content_len is XML buffer and length of buffer respectively.

The handlers is a list of SOAP codec handlers - one handler for each service namespace. For SRU SOAP, the namespace would be http://www.loc.gov/zing/srw/v1.0/.

When decoding, the z_soap_codec inspects the XML content and tries to match one of the services namespaces of the supplied handlers. If there is a match. a handler function is invoked which decodes that particular SOAP package. If successful, the returned Z_SOAP package will be of type Z_SOAP_Generic. Member no is set the offset of the handler that matched; ns is set to namespace of the matching handler; the void pointer p is set to the C data structure associated with the handler.

When a NULL namespace is met (member ns below), that specifies end-of-list.

Each handler is defined as follows:

typedef struct {
    char *ns;
    void *client_data;
    Z_SOAP_fun f;
} Z_SOAP_Handler;
    

The ns is the namespace of the service associated with handler f. The client_data is user-defined data which is passed to the handler.

The prototype for a SOAP service handler is:

int handler(ODR o, void * ptr, void **handler_data,
            void *client_data, const char *ns);
    

The o specifies the mode (decode/encode) as usual. The second argument, ptr, is a libxml2 tree node pointer (xmlNodePtr) and is a pointer to the Body element of the SOAP package. The handler_data is an opaque pointer to C definitions associated with the SOAP service. The client_data is the pointer which was set as part of the Z_SOAP_handler. Finally, ns is the service namespace.

yaz-5.34.4/doc/yaz-log-man.xml0000664000175000017500000002447014631643521011533 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-log 7 Conventions and miscellaneous yaz-log Log handling in all yaz-based programs yaz-XXXX DESCRIPTION All YAZ-based programs use a common log subsystem, and should support common command line options for controlling it. This man page documents those. OPTIONS -l logfile Specify the file where the log is to be written. If none is specified, stderr is used. The log is appended to this file. If the file grows overly large, it is silently rotated: It is renamed to logfile.1, logfile.2, .., 9 (old such file is deleted), and a new file is opened. The limit defaults to 1GB, but can be set by the program. The rotating limit can be specified with option -r for the YAZ frontend server (yaz-ztest). Rotation can also be implicitly enabled by using a filename which gets changed for a given date, due to substitutions as given by the strftime(3) function. -v loglevel Specify the logging level. The argument is a set of log level names, separated by commas (no whitespace!), optionally preceded by a '-' to negate that level. Most programs have their own default, often containing fatal,warn,log, and some application-specific values. The default list can be cleared with the word none, or individual bits can be removed by prefixing them with a dash '-'. LOG LEVELS TO CONTROL LOGGING Some of the log levels control the way the log is written. flush causes the log to be flushed after every write. This can have serious implications to performance, and should not be used in production. On the other hand, when debugging a program crash, this can be extremely useful. The option debug implies flush as well. notime prevents the writing of time stamps. This is intended for automatic test scripts, which should produce predictable log files that are easy to compare. GENERAL LOG LEVELS IN YAZ ITSELF YAZ itself uses the following log levels: fatal for fatal errors, that prevent further execution of the program. warn for warnings about things that should be corrected. debug for debugging. This flag may be used temporarily when developing or debugging yaz, or a program that uses yaz. It is practically deprecated, you should be defining and using your own log levels (see below). all turns on almost all hard-coded log levels. loglevel logs information about the log levels used by the program. Every time the log level is changed, lists all bits that are on. Every time a module asks for its log bits, this is logged. This can be used for getting an idea of what log levels are available in any program that uses yaz-log. Start the program with -v none,loglevel, and do some common operations with it. Another way is to grep for yaz_log_module_level in the source code, as in find . -name '*.[ch]' -print | xargs grep yaz_log_module_level | grep '"' | cut -d'"' -f2 | sort -u eventl, malloc, nmem, odr are used internally for debugging yaz. LOG LEVELS FOR CLIENTS zoom logs the calls to the zoom API, which may be useful in debugging client applications. LOG LEVELS FOR SERVERS server logs the server functions on a high level, starting up, listening on a port, etc. session logs individual sessions (connections). request logs a one-liner for each request (init, search, etc.). requestdetail logs the details of every request, before it is passed to the back-end, and the results received from it. Each server program (zebra, etc.) is supposed to define its own log levels in addition to these. As they depend on the server in question, they can not be described here. See above how to find out about them. LOGGING EXAMPLES See what log levels yaz-ztest is using: yaz-ztest -1 -v none,loglevel 14:43:29-23/11 [loglevel] Setting log level to 4096 = 0x00001000 14:43:29-23/11 [loglevel] Static log bit 00000001 'fatal' is off 14:43:29-23/11 [loglevel] Static log bit 00000002 'debug' is off 14:43:29-23/11 [loglevel] Static log bit 00000004 'warn' is off 14:43:29-23/11 [loglevel] Static log bit 00000008 'log' is off 14:43:29-23/11 [loglevel] Static log bit 00000080 'malloc' is off 14:43:29-23/11 [loglevel] Static log bit 00000800 'flush' is off 14:43:29-23/11 [loglevel] Static log bit 00001000 'loglevel' is ON 14:43:29-23/11 [loglevel] Static log bit 00002000 'server' is off 14:43:29-23/11 [loglevel] Dynamic log bit 00004000 'session' is off 14:43:29-23/11 [loglevel] Dynamic log bit 00008000 'request' is off 14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session' 14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x2000 for 'server' 14:44:13-23/11 yaz-ztest [loglevel] returning NO log bit for 'eventl' 14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session' 14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x8000 for 'request' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'requestdetail' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'odr' 14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'ztest' See the details of the requests for yaz-ztest ./yaz-ztest -1 -v requestdetail 14:45:35-23/11 yaz-ztest [server] Adding static Z3950 listener on tcp:@:9999 14:45:35-23/11 yaz-ztest [server] Starting server ./yaz-ztest pid=32200 14:45:38-23/11 yaz-ztest [session] Starting session from tcp:127.0.0.1 (pid=32200) 14:45:38-23/11 yaz-ztest [requestdetail] Got initRequest 14:45:38-23/11 yaz-ztest [requestdetail] Id: 81 14:45:38-23/11 yaz-ztest [requestdetail] Name: YAZ 14:45:38-23/11 yaz-ztest [requestdetail] Version: 2.0.28 14:45:38-23/11 yaz-ztest [requestdetail] Negotiated to v3: srch prst del extendedServices namedresults scan sort 14:45:38-23/11 yaz-ztest [request] Init from 'YAZ' (81) (ver 2.0.28) OK 14:45:39-23/11 yaz-ztest [requestdetail] Got SearchRequest. 14:45:39-23/11 yaz-ztest [requestdetail] ResultSet '1' 14:45:39-23/11 yaz-ztest [requestdetail] Database 'Default' 14:45:39-23/11 yaz-ztest [requestdetail] RPN query. Type: Bib-1 14:45:39-23/11 yaz-ztest [requestdetail] term 'foo' (general) 14:45:39-23/11 yaz-ztest [requestdetail] resultCount: 7 14:45:39-23/11 yaz-ztest [request] Search Z: @attrset Bib-1 foo OK:7 hits 14:45:41-23/11 yaz-ztest [requestdetail] Got PresentRequest. 14:45:41-23/11 yaz-ztest [requestdetail] Request to pack 1+1 1 14:45:41-23/11 yaz-ztest [requestdetail] pms=1048576, mrs=1048576 14:45:41-23/11 yaz-ztest [request] Present: [1] 1+1 OK 1 records returned LOG FILENAME EXAMPLES A file with format my_YYYYMMDD.log (where Y, M, D is year, month, and day digits) is given as follows: -l my_%Y%m%d.log . And since the filename is depending on day, rotation will occur on midnight. A weekly log could be specified as -l my_%Y%U.log. FILES prefix/include/yaz/log.h prefix/src/log.c SEE ALSO yaz 7 yaz-ztest 8 yaz-client 1 strftime 3 yaz-5.34.4/doc/yaz-ztest.html0000664000175000017500000005766214754707607011543 yaz-ztest

Name

yaz-ztest — Z39.50/SRU Test Server

Synopsis

application [-install] [-installa] [-remove] [-a file] [-v level] [-l file] [-u uid] [-c config] [-f vconfig] [-C fname] [-t minutes] [-k kilobytes] [-K] [-d daemon] [-w dir] [-p pidfile] [-r kilobytes] [-ziDSTV1] [listener-spec...]

DESCRIPTION

yaz-ztest is a Z39.50/SRU test server that uses the YAZ generic front-end server (GFS) API. The server acts as a real Z39.50/SRU server but does not use a database. It returns a random hit count and returns a subset of a few built-in records.

The listener-spec consists of a transport mode followed by a colon, followed by a listener address. The transport mode is either tcp, unix, or ssl.

For TCP and SSL, an address has the form:

    hostname | IP-number [ : portnumber ]
   

For UNIX local socket, the address is the filename of the local socket.

OPTIONS

-a file

Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr.

-S

Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users.

-1

Like -S but after one session the server exits. This mode is for debugging only.

-T

Operate the server in threaded mode. The server creates a thread for each connection rather than fork a process. Only available on UNIX systems that offer POSIX threads.

-s

Use the SR protocol (obsolete).

-z

Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports.

-l file

The logfile.

-c config

A user option that serves as a specifier for some sort of configuration, usually a filename. The argument to this option is transferred to member configname of the statserv_options_block.

-f vconfig

This specifies an XML file that describes one or more YAZ frontend virtual servers.

-C fname

Sets SSL certificate file name for server (PEM).

-v level

The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}.

-u uid

Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port.

-w dir

The server changes to this directory before listening to incoming connections. This option is useful when the server is operating from the inetd daemon (see -i).

-p pidfile

Specifies that the server should write its Process ID to the file given by pidfile. A typical location would be /var/run/yaz-ztest.pid.

-i

Use this to make the the server run from the inetd server (UNIX only).

-D

Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground.

-install

Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel.

-installa

Use this to install the server as an NT service and mark it as "auto-start. Control the server by going to the Services in the Control Panel.

-remove

Use this to remove the server from the NT services (Windows NT/2000/XP only).

-t minutes

Idle session timeout, in minutes.

-k size

Maximum record size/message size, in kilobytes.

-K

Forces no-keepalive for HTTP sessions. By default GFS will keep sessions alive for HTTP 1.1 sessions (as defined by the standard). Using this option will force GFS to close the connection for each operation.

-r size

Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB).

-d daemon

Set name of daemon to be used in hosts access file. See hosts_access(5) and tcpd(8).

-m time-format

Sets the format of time-stamps in the log-file. Specify a string in the input format to strftime().

-V

Display YAZ version and exit.

TESTING

yaz-ztest normally returns a random hit count between 0 and 24. However, if a query term includes leading digits, then the integer value of that term is used as hit count. This allows testers to return any number of hits. yaz-ztest includes 24 MARC records for testing. Hit counts exceeding 24 will make yaz-ztest return the same record batch over and over. So record at position 1, 25, 49, etc. are equivalent.

For XML, if no element set is given or element has value "marcxml", MARCXML is returned (each of the 24 dummy records converted from ISO2709 to XML). For element set OP, then OPAC XML is returned.

yaz-ztest may also return predefined XML records (for testing). This is enabled if YAZ_ZTEST_XML_FETCH environment variable is defined. A record is fetched from a file (one record per file). The path for the filename is FE.d.xml where F is the YAZ_ZTEST_XML_FETCH value (possibly empty), E is element-set, d is record position (starting from 1).

The following databases are honored by yaz-ztest: Default, slow and db.* (all databases with prefix "db"). Any other database will make yaz-ztest return diagnostic 109: "Database unavailable".

Options for search may be included in the form or URL get arguments included as part of the Z39.50 database name. The following database options are present: search-delay, present-delay, fetch-delay and seed.

The former, delay type options, specify a fake delay (sleep) that yaz-ztest will perform when searching, presenting, fetching records respectively. The value of the delay may either be a fixed floating point value which specifies the delay in seconds. Alternatively the value may be given as two floating point numbers separated by colon, which will make yaz-ztest perform a random sleep between the first and second number.

The database parameter seed takes an integer as value. This will call srand with this integer to ensure that the random behavior can be re-played.

Suppose we want searches to take between 0.1 and 0.5 seconds and a fetch to take 0.2 second. To access test database Default we'd use: Default?search-delay=0.1:0.5&fetch-delay=0.2.

GFS CONFIGURATION AND VIRTUAL HOSTS

The Virtual hosts mechanism allows a YAZ front-end server to support multiple back-ends. A back-end is selected on the basis of the TCP/IP binding (port+listening address) and/or the virtual host.

A back-end can be configured to execute in a particular working directory. Or the YAZ front-end may perform CQL to RPN conversion, thus allowing traditional Z39.50 back-ends to be offered as a SRW/SRU service. SRW/SRU Explain information for a particular back-end may also be specified.

For the HTTP protocol, the virtual host is specified in the Host header. For the Z39.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1.

Note

Not all Z39.50 clients allow the VHOST information to be set. For those, the selection of the back-end must rely on the TCP/IP information alone (port and address).

The YAZ front-end server uses XML to describe the back-end configurations. Command-line option -f specifies filename of the XML configuration.

The configuration uses the root element yazgfs. This element includes a list of listen elements, followed by one or more server elements.

The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server. Content for a listener:

CDATA (required)

The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc.

attribute id (optional)

Identifier for this listener. This may be referred to from server sections.

Note

We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers.

The server describes a server and the parameters for this server type. Content for a server:

attribute id (optional)

Identifier for this server. Currently not used for anything, but it might be for logging purposes.

attribute listenref (optional)

Specifies one or more listeners for this server. Each server ID is separated by a comma. If this attribute is not given, the server is accessible from all listeners. In order for the server to be used for real, however, the virtual host must match if specified in the configuration.

element config (optional)

Specifies the server configuration. This is equivalent to the config specified using command line option -c.

element directory (optional)

Specifies a working directory for this backend server. If specified, the YAZ frontend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init).

element host (optional)

Specifies the virtual host for this server. If this is specified a client must specify this host string in order to use this backend.

element cql2rpn (optional)

Specifies a filename that includes CQL to RPN conversion for this backend server. See Section 1.3.4, “Specification of CQL to RPN mappings”. If given, the backend server will only "see" a Type-1/RPN query.

element ccl2rpn (optional)

Specifies a filename that includes CCL to RPN conversion for this backend server. See Section 1.2.2, “CCL Qualifiers”. If given, the backend server will only "see" a Type-1/RPN query.

element stylesheet (optional)

Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one. If none is given, then if the client does not specify one, then no stylesheet reference is part of the SRU HTTP response.

element client_query_charset (optional)

If specified, a conversion from the character set given to UTF-8 is performed by the generic frontend server. It is only executed for Z39.50 search requests (SRU/Solr are assumed to be UTF-8 encoded already).

element docpath (optional)

Specifies a path for local file access using HTTP. All URLs with a leading prefix (/ excluded) that matches the value of docpath are used for file access. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/xsl will result in a local file access.

element explain (optional)

Specifies SRW/SRU ZeeRex content for this server. Copied verbatim to the client. As things are now, some of the Explain content seem redundant because host information, etc. is also stored elsewhere.

element maximumrecordsize (optional)

Specifies maximum record size/message size, in bytes. This value also serves as the maximum size of incoming packages (for Record Updates etc). It's the same value as that given by the -k option.

element retrievalinfo (optional)

Enables the retrieval facility to support conversions and specifications of record formats/types. See Section 6, “Retrieval Facility” for more information.

The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket. We name the TCP/IP server public and the other server internal.

  
 <yazgfs>
  <listen id="public">tcp:@:9900</listen>
  <listen id="internal">unix:/var/tmp/socket</listen>
  <server id="server1">
    <host>server1.mydomain</host>
    <directory>/var/www/s1</directory>
    <config>config.cfg</config>
  </server>
  <server id="server2" listenref="public,internal">
    <host>server2.mydomain</host>
    <directory>/var/www/s2</directory>
    <config>config.cfg</config>
    <cql2rpn>../etc/pqf.properties</cql2rpn>
    <explain xmlns="http://explain.z3950.org/dtd/2.0/">
      <serverInfo>
        <host>server2.mydomain</host>
        <port>9900</port>
        <database>a</database>
      </serverInfo>
    </explain>
  </server>
  <server id="server3" listenref="internal">
    <directory>/var/www/s3</directory>
    <config>config.cfg</config>
  </server>
 </yazgfs>

 

There are three configured backend servers. The first two servers, "server1" and "server2", can be reached by both listener addresses. "server1" is reached by all (two) since no listenref attribute is specified. "server2" is reached by the two listeners specified. In order to distinguish between the two, a virtual host has been specified for each server in the host elements.

For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small).

The third server, "server3" can only be reached via listener "internal".

FILES

yaz-<version>/ztest/yaz-ztest.c

yaz-<version>/include/yaz/backend.h

SEE ALSO

yaz(7) yaz-log(7)

yaz-5.34.4/doc/zoom.records.html0000664000175000017500000002746314754707607012211 4. Records

4. Records

A record object is a retrieval record on the client side - created from result sets.

     void ZOOM_resultset_records(ZOOM_resultset r,
                                 ZOOM_record *recs,
                                 size_t start, size_t count);
     ZOOM_record ZOOM_resultset_record(ZOOM_resultset s, size_t pos);

     const char *ZOOM_record_get(ZOOM_record rec, const char *type,
                                 size_t *len);

     int ZOOM_record_error(ZOOM_record rec, const char **msg,
                           const char **addinfo, const char **diagset);

     ZOOM_record ZOOM_record_clone(ZOOM_record rec);

     void ZOOM_record_destroy(ZOOM_record rec);
   

References to temporary records are returned by functions ZOOM_resultset_records or ZOOM_resultset_record.

If a persistent reference to a record is desired ZOOM_record_clone should be used. It returns a record reference that should be destroyed by a call to ZOOM_record_destroy.

A single record is returned by function ZOOM_resultset_record that takes a position as argument. First record has position zero. If no record could be obtained NULL is returned.

Error information for a record can be checked with ZOOM_record_error which returns non-zero (error code) if record is in error, called Surrogate Diagnostics in Z39.50.

Function ZOOM_resultset_records retrieves a number of records from a result set. Parameter start and count specifies the range of records to be returned. Upon completion, the array recs[0], ..recs[count-1] holds record objects for the records. The array of records recs should be allocated prior the call ZOOM_resultset_records. Note that for those records that couldn't be retrieved from the target, recs[ ..] is set to NULL.

In order to extract information about a single record, ZOOM_record_get is provided. The function returns a pointer to certain record information. The nature (type) of the pointer depends on the parameter, type.

The type is a string of the format:

format[;charset=from[/opacfrom][,to]][;format=v][;base64=xpath]

If charset is given, then from specifies the character set of the record in its original form (as returned by the server), to specifies the output (returned) character set encoding. If to is omitted, then UTF-8 is assumed. If charset is not given, then no character set conversion takes place. OPAC records may be returned in a different set from the bibliographic MARC record. If this is this the case, opacfrom should be set to the character set of the OPAC record part.

The format is generic but can only be used to specify XML indentation when the value v is 1 (format=1).

The base64 allows a full record to be extracted from base64-encoded string in an XML document.

Note

Specifying the OPAC record character set requires YAZ 4.1.5 or later.

Specifying the base64 parameter requires YAZ 4.2.35 or later.

The format argument controls whether record data should be XML pretty-printed (post process operation). It is enabled only if format value v is 1 and the record content is XML well-formed.

In addition, for certain types, the length len passed will be set to the size in bytes of the returned information.

The following are the supported values for form.

database

The Database of the record is returned as a C null-terminated string. Return type const char *.

syntax

The transfer syntax of the record is returned as a C null-terminated string containing the symbolic name of the record syntax, e.g. Usmarc. Return type is const char *.

schema

The schema of the record is returned as a C null-terminated string. Return type is const char *.

render

The record is returned in a display friendly format. Upon completion, buffer is returned (type const char *) and length is stored in *len.

raw

The record is returned in the internal YAZ specific format. For GRS-1, Explain, and others, the raw data is returned as type Z_External * which is just the type for the member retrievalRecord in type NamePlusRecord. For SUTRS and octet aligned record (including all MARCs) the octet buffer is returned and the length of the buffer.

xml

The record is returned in XML if possible. SRU, Solr and Z39.50 records with transfer syntax XML are returned verbatim. MARC records are returned in MARCXML (converted from ISO2709 to MARCXML by YAZ). OPAC records are also converted to XML and the bibliographic record is converted to MARCXML (when possible). GRS-1 records are not supported for this form. Upon completion, the XML buffer is returned (type const char *) and length is stored in *len.

opac

OPAC information for record is returned in XML if an OPAC record is present at the position given. If no OPAC record is present, a NULL pointer is returned.

txml

The record is returned in TurboMARC if possible. SRU and Z39.50 records with transfer syntax XML are returned verbatim. MARC records are returned in TurboMARC (converted from ISO2709 to TurboMARC by YAZ). Upon completion, the XML buffer is returned (type const char *) and length is stored in *len.

json

Like xml, but MARC records are converted to MARC-in-JSON.

Most MARC21 records uses the MARC-8 character set encoding. An application that wishes to display in Latin-1 would use

     render; charset=marc8,iso-8859-1
    

4.1. Z39.50 Protocol behavior

The functions ZOOM_resultset_record and ZOOM_resultset_records inspects the client-side record cache. Records not found in cache are fetched using Present. The functions may block (and perform network I/O) - even though option async is 1, because they return records objects. (And there's no way to return records objects without retrieving them!)

There is a trick, however, in the usage of function ZOOM_resultset_records that allows for delayed retrieval (and makes it non-blocking). By using a null pointer for recs you're indicating you're not interested in getting records objects now.

4.2. SRU/Solr Protocol behavior

The ZOOM driver for SRU/Solr treats records returned by a SRU/Solr server as if they where Z39.50 records with transfer syntax XML and no element set name or database name.

yaz-5.34.4/doc/asn.html0000664000175000017500000000637714754707607010347 Chapter 5. The Z39.50 ASN.1 Module

Chapter 5. The Z39.50 ASN.1 Module

1. Introduction

The Z39.50 ASN.1 module provides you with a set of C struct definitions for the various PDUs of the Z39.50 protocol, as well as for the complex types appearing within the PDUs. For the primitive data types, the C representation often takes the form of an ordinary C language type, such as Odr_int which is equivalent to an integral C integer. For ASN.1 constructs that have no direct representation in C, such as general octet strings and bit strings, the ODR module (see section The ODR Module) provides auxiliary definitions.

The Z39.50 ASN.1 module is located in sub directory z39.50. There you'll find C files that implement encoders and decoders for the Z39.50 types. You'll also find the protocol definitions: z3950v3.asn, esupdate.asn, and others.

yaz-5.34.4/doc/marc.html0000664000175000017500000002241714754707607010501 5. MARC

5. MARC

YAZ provides a fast utility for working with MARC records. Early versions of the MARC utility only allowed decoding of ISO2709. Today the utility may both encode - and decode to a variety of formats.

    #include <yaz/marcdisp.h>

    /* create handler */
    yaz_marc_t yaz_marc_create(void);
    /* destroy */
    void yaz_marc_destroy(yaz_marc_t mt);

    /* set XML mode YAZ_MARC_LINE, YAZ_MARC_SIMPLEXML, ... */
    void yaz_marc_xml(yaz_marc_t mt, int xmlmode);
    #define YAZ_MARC_LINE      0
    #define YAZ_MARC_SIMPLEXML 1
    #define YAZ_MARC_OAIMARC   2
    #define YAZ_MARC_MARCXML   3
    #define YAZ_MARC_ISO2709   4
    #define YAZ_MARC_XCHANGE   5
    #define YAZ_MARC_CHECK     6
    #define YAZ_MARC_TURBOMARC 7
    #define YAZ_MARC_JSON      8

    /* supply iconv handle for character set conversion .. */
    void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd);

    /* set debug level, 0=none, 1=more, 2=even more, .. */
    void yaz_marc_debug(yaz_marc_t mt, int level);

    /* decode MARC in buf of size bsize. Returns >0 on success; <=0 on failure.
    On success, result in *result with size *rsize. */
    int yaz_marc_decode_buf(yaz_marc_t mt, const char *buf, int bsize,
                            const char **result, size_t *rsize);

    /* decode MARC in buf of size bsize. Returns >0 on success; <=0 on failure.
       On success, result in WRBUF */
    int yaz_marc_decode_wrbuf(yaz_marc_t mt, const char *buf,
                              int bsize, WRBUF wrbuf);

   

Note

The synopsis is just a basic subset of all functionality. Refer to the actual header file marcdisp.h for details.

A MARC conversion handle must be created by using yaz_marc_create and destroyed by calling yaz_marc_destroy.

All other functions operate on a yaz_marc_t handle. The output is specified by a call to yaz_marc_xml. The xmlmode must be one of

YAZ_MARC_LINE

A simple line-by-line format suitable for display but not recommended for further (machine) processing.

YAZ_MARC_MARCXML

MARCXML.

YAZ_MARC_ISO2709

ISO2709 (sometimes just referred to as "MARC").

YAZ_MARC_XCHANGE

MarcXchange.

YAZ_MARC_CHECK

Pseudo format for validation only. Does not generate any real output except diagnostics.

YAZ_MARC_TURBOMARC

XML format with same semantics as MARCXML but more compact and geared towards fast processing with XSLT. Refer to Section 5.1, “TurboMARC” for more information.

YAZ_MARC_JSON

MARC-in-JSON format.

The actual conversion functions are yaz_marc_decode_buf and yaz_marc_decode_wrbuf which decodes and encodes a MARC record. The former function operates on simple buffers, and stores the resulting record in a WRBUF handle (WRBUF is a simple string type).

Example 7.18. Display of MARC record

The following program snippet illustrates how the MARC API may be used to convert a MARC record to the line-by-line format:

      void print_marc(const char *marc_buf, int marc_buf_size)
      {
         char *result;      /* for result buf */
         size_t result_len;    /* for size of result */
         yaz_marc_t mt = yaz_marc_create();
         yaz_marc_xml(mt, YAZ_MARC_LINE);
         yaz_marc_decode_buf(mt, marc_buf, marc_buf_size,
                             &result, &result_len);
         fwrite(result, result_len, 1, stdout);
         yaz_marc_destroy(mt);  /* note that result is now freed... */
      }

     


5.1. TurboMARC

TurboMARC is yet another XML encoding of a MARC record. The format was designed for fast processing with XSLT.

Applications like Pazpar2 uses XSLT to convert an XML encoded MARC record to an internal representation. This conversion mostly checks the tag of a MARC field to determine the basic rules in the conversion. This check is costly when that tag is encoded as an attribute in MARCXML. By having the tag value as the element instead, makes processing many times faster (at least for Libxslt).

TurboMARC is encoded as follows:

  • Record elements is part of namespace "http://www.indexdata.com/turbomarc".

  • A record is enclosed in element r.

  • A collection of records is enclosed in element collection.

  • The leader is encoded as element l with the leader content as its (text) value.

  • A control field is encoded as element c concatenated with the tag value of the control field if the tag value matches the regular expression [a-zA-Z0-9]*. If the tag value does not match the regular expression [a-zA-Z0-9]* the control field is encoded as element c and attribute code will hold the tag value. This rule ensures that in the rare cases where a tag value might result in a non-well-formed XML, then YAZ will encode it as a coded attribute (as in MARCXML).

    The control field content is the text value of this element. Indicators are encoded as attribute names i1, i2, etc. and corresponding values for each indicator.

  • A data field is encoded as element d concatenated with the tag value of the data field or using the attribute code as described in the rules for control fields. The children of the data field element are subfield elements. Each subfield element is encoded as s concatenated with the sub field code. The text of the subfield element is the contents of the subfield. Indicators are encoded as attributes for the data field element, similar to the encoding for control fields.

yaz-5.34.4/doc/comstack.ssl.html0000664000175000017500000000563114754707607012162 7. SSL

7. SSL

     void *cs_get_ssl(COMSTACK cs);
    

Returns the SSL handle, SSL * for comstack. If comstack is not of type SSL, then NULL is returned.

     int cs_set_ssl_ctx(COMSTACK cs, void *ctx);
    

Sets SSL context for comstack. The parameter is expected to be of type SSL_CTX *. This function should be called just after comstack has been created (before connect, bind, etc). This function returns 1 for success; 0 for failure.

     int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname);
    

Sets SSL certificate for comstack as a PEM file. This function returns 1 for success; 0 for failure.

     int cs_get_ssl_peer_certificate_x509(COMSTACK cs, char **buf, int *len);
    

This function returns the peer certificate. If successful, *buf and *len holds X509 buffer and length respectively. Buffer should be freed with xfree. This function returns 1 for success; 0 for failure.

yaz-5.34.4/doc/zoomsh.10000664000175000017500000000677314754707605010277 '\" t .\" Title: zoomsh .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "ZOOMSH" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zoomsh \- ZOOM shell .SH "SYNOPSIS" .HP \w'\fBzoomsh\fR\ 'u \fBzoomsh\fR [\fB\-a\ \fR\fB\fIapdufile\fR\fR] [\fB\-e\fR] [\fB\-v\ \fR\fB\fIloglevel\fR\fR] [commands...] .SH "DESCRIPTION" .PP \fBzoomsh\fR is a ZOOM client with a simple command line interface\&. The client demonstrates the ZOOM API and is useful for testing targets\&. .PP You may pass one or more commands to \fBzoomsh\fR\&. These commands are invoked first\&. .SH "OPTIONS" .PP \-a \fIapdufile\fR .RS 4 Logs protocol packages into apdufile (APDU log)\&. .RE .PP \-e .RS 4 Makes zoomsh stop processing commands as soon as an error occur\&. The exit code of zoomsh is 1 if error occurs; 0 otherwise\&. .RE .PP \-v \fIloglevel\fR .RS 4 Sets YAZ log level to \fIloglevel\fR\&. .RE .SH "EXAMPLES" .PP If you start the \fByaz\-ztest\fR in one console you can use the ZOOM shell as follows: .sp .if n \{\ .RS 4 .\} .nf $ zoomsh ZOOM>connect localhost:9999 ZOOM>search computer localhost:9999: 7 hits ZOOM>show 0 1 1 Default USmarc 001 11224466 003 DLC 005 00000000000000\&.0 008 910710c19910701nju 00010 eng 010 $a 11224466 040 $a DLC $c DLC 050 00 $a 123\-xyz 100 10 $a Jack Collins 245 10 $a How to program a computer 260 1 $a Penguin 263 $a 8710 300 $a p\&. cm\&. ZOOM>quit .fi .if n \{\ .RE .\} .PP You can also achieve the same result by passing the commands as arguments on a single command line: .PP $ zoomsh "connect localhost:9999" "search computer" "show 0 1" quit .SH "COMMANDS" .PP connect \fIzurl\fR .RS 4 Connects to the target given by \fIzurl\fR\&. .RE .PP close [\fIzurl\fR] .RS 4 Closes connection to target given by \fIzurl\fR or all targets if \fIzurl\fR was omitted\&. .RE .PP show [\fIstart\fR [\fIcount\fR]] .RS 4 Displays count records starting at offset given by \fIstart\fR\&. First records has offset 0 (unlike the Z39\&.50 protocol)\&. .RE .PP quit .RS 4 Quits \fBzoomsh\fR\&. .RE .PP set \fIname\fR [\fIvalue\fR] .RS 4 Sets option \fIname\fR to \fIvalue\fR\&. .RE .PP get \fIname\fR .RS 4 Prints value of option \fIname\fR\&. .RE .PP help .RS 4 Prints list of available commands\&. .RE .SH "SEE ALSO" .PP \fByaz\fR(7), \fByaz-ztest\fR(8), .PP Section "Building clients with ZOOM" in the YAZ manual\&. .PP \m[blue]\fBZOOM home page\fR\m[]\&\s-2\u[1]\d\s+2\&. .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 ZOOM home page .RS 4 \%http://zoom.z3950.org/ .RE yaz-5.34.4/doc/yaz-icu-man.xml0000664000175000017500000001720314631643521011526 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-icu 1 Commands yaz-icu YAZ ICU utility yaz-icu -c config -p opt -s -x infile DESCRIPTION yaz-icu is a utility which demonstrates the ICU chain module of yaz. (yaz/icu.h). The utility can be used in two ways. It may read some text using an XML configuration for configuring ICU and show text analysis. This mode is triggered by option -c which specifies the configuration to be used. The input file is read from standard input or from a file if infile is specified. The utility may also show ICU information. This is triggered by option -p. OPTIONS -c config Specifies the file containing ICU chain configuration which is XML based. -p type Specifies extra information to be printed about the ICU system. If type is c then ICU converters are printed. If type is l, then available locales are printed. If type is t, then available transliterators are printed. -s Specifies that output should include sort key as well. Note that sort key differs between ICU versions. -x Specifies that output should be XML based rather than "text" based. ICU chain configuration The ICU chain configuration specifies one or more rules to convert text data into tokens. The configuration format is XML based. The toplevel element must be named icu_chain. The icu_chain element has one required attribute locale which specifies the ICU locale to be used in the conversion steps. The icu_chain element must include elements where each element specifies a conversion step. The conversion is performed in the order in which the conversion steps are specified. Each conversion element takes one attribute: rule which serves as argument to the conversion step. The following conversion elements are available: casemap Converts case (and rule specifies how): l Lower case using ICU function u_strToLower. u Upper case using ICU function u_strToUpper. t To title using ICU function u_strToTitle. f Fold case using ICU function u_strFoldCase. display This is a meta step which specifies that a term/token is to be displayed. This term is retrieved in an application using function icu_chain_token_display (yaz/icu.h). transform Specifies an ICU transform rule using a transliterator Identifier. The rule attribute is the transliterator Identifier. See ICU Transforms for more information. transliterate Specifies a rule-based transliterator. The rule attribute is the custom transformation rule to be used. See ICU Transforms for more information. tokenize Breaks / tokenizes a string into components using ICU functions ubrk_open, ubrk_setText, .. . The rule is one of: l Line. ICU: UBRK_LINE. s Sentence. ICU: UBRK_SENTENCE. w Word. ICU: UBRK_WORD. c Character. ICU: UBRK_CHARACTER. t Title. ICU: UBRK_TITLE. join Joins tokens into one string. The rule attribute is the joining string, which may be empty. The join conversion element was added in YAZ 4.2.49. EXAMPLES The following command analyzes text in file text using ICU chain configuration chain.xml: cat text | yaz-icu -c chain.xml The chain.xml might look as follows: ]]> SEE ALSO yaz 7 ICU Home ICU Transforms yaz-5.34.4/doc/zoom.html0000664000175000017500000006220614754707607010543 Chapter 3. ZOOM

Chapter 3. ZOOM

ZOOM is an acronym for 'Z39.50 Object-Orientation Model' and is an initiative started by Mike Taylor (Mike is from the UK, which explains the peculiar name of the model). The goal of ZOOM is to provide a common Z39.50 client API not bound to a particular programming language or toolkit.

From YAZ version 2.1.12, SRU is supported. You can make SRU ZOOM connections by specifying scheme http:// for the hostname for a connection. The dialect of SRU used is specified by the value of the connection's sru option, which may be SRU over HTTP GET (get), SRU over HTTP POST (post), (SRU over SOAP) (soap) or solr (Solr Web Service). Using the facility for embedding options in target strings, a connection can be forced to use SRU rather the SRW (the default) by prefixing the target string with sru=get,, like this: sru=get,http://sru.miketaylor.org.uk:80/sru.pl

Solr protocol support was added to YAZ in version 4.1.0, as a dialect of a SRU protocol, since both are HTTP based protocols.

The lack of a simple Z39.50 client API for YAZ has become more and more apparent over time. So when the first ZOOM specification became available, an implementation for YAZ was quickly developed. For the first time, it is now as easy (or easier!) to develop clients as it is to develop servers with YAZ. This chapter describes the ZOOM C binding. Before going further, please reconsider whether C is the right programming language for the job. There are other language bindings available for YAZ, and still more are in active development. See the ZOOM web-site for more information.

In order to fully understand this chapter you should read and try the example programs zoomtst1.c, zoomtst2.c, .. in the zoom directory.

The C language misses features found in object oriented languages such as C++, Java, etc. For example, you'll have to manually, destroy all objects you create, even though you may think of them as temporary. Most objects have a _create - and a _destroy variant. All objects are in fact pointers to internal stuff, but you don't see that because of typedefs. All destroy methods should gracefully ignore a NULL pointer.

In each of the sections below you'll find a sub section called protocol behavior, that describes how the API maps to the Z39.50 protocol.

1. Connections

The Connection object is a session with a target.

    #include <yaz/zoom.h>

    ZOOM_connection ZOOM_connection_new(const char *host, int portnum);

    ZOOM_connection ZOOM_connection_create(ZOOM_options options);

    void ZOOM_connection_connect(ZOOM_connection c, const char *host,
                                 int portnum);
    void ZOOM_connection_destroy(ZOOM_connection c);
   

Connection objects are created with either function ZOOM_connection_new or ZOOM_connection_create. The former creates and automatically attempts to establish a network connection with the target. The latter doesn't establish a connection immediately, thus allowing you to specify options before establishing network connection using the function ZOOM_connection_connect. If the port number, portnum, is zero, the host is consulted for a port specification. If no port is given, 210 is used. A colon denotes the beginning of a port number in the host string. If the host string includes a slash, the following part specifies a database for the connection.

You can prefix the host with a scheme followed by colon. The default scheme is tcp (Z39.50 protocol). The scheme http selects SRU/SOAP over HTTP by default, but can be changed with option sru.

You can prefix the scheme-qualified host-string with one or more comma-separated key=value sequences, each of which represents an option to be set into the connection structure before the protocol-level connection is forged and the initialization handshake takes place. This facility can be used to provide authentication credentials, as in host-strings such as: user=admin,password=halfAm4n,tcp:localhost:8017/db

Connection objects should be destroyed using the function ZOOM_connection_destroy.

    void ZOOM_connection_option_set(ZOOM_connection c,
                                    const char *key, const char *val);

    void ZOOM_connection_option_setl(ZOOM_connection c,
                                     const char *key,
                                     const char *val, int len);

    const char *ZOOM_connection_option_get(ZOOM_connection c,
                                           const char *key);
    const char *ZOOM_connection_option_getl(ZOOM_connection c,
                                            const char *key,
                                            int *lenp);
   

The functions ZOOM_connection_option_set and ZOOM_connection_option_setl allows you to set an option given by key to the value value for the connection. For ZOOM_connection_option_set, the value is assumed to be a 0-terminated string. Function ZOOM_connection_option_setl specifies a value of a certain size (len).

Functions ZOOM_connection_option_get and ZOOM_connection_option_getl returns the value for an option given by key.

Table 3.1. ZOOM Connection Options

OptionDescriptionDefault
implementationNameName of your client none
userAuthentication user name none
groupAuthentication group name none
passwordAuthentication password. none
authenticationModeHow authentication is encoded. basic
hostTarget host. This setting is "read-only". It's automatically set internally when connecting to a target. none
proxyProxy host. If set, the logical host is encoded in the otherInfo area of the Z39.50 Init PDU with OID 1.2.840.10003.10.1000.81.1. none
clientIPClient IP. If set, is encoded in the otherInfo area of a Z39.50 PDU with OID 1.2.840.10003.10.1000.81.3. Holds the original IP addresses of a client. Is used if ZOOM is used in a gateway of some sort. none
timeoutIdle timeout which specifies how long ZOOM will wait for network I/O before giving up. Thus, the actual waiting time might be longer than this value if the target makes a chunked response and the time between each chunk arrive is less this value. For the connect+init, this is the time ZOOM will wait until receiving first byte from Init response. 30
asyncIf true (1) the connection operates in asynchronous operation which means that all calls are non-blocking except ZOOM_event. 0
maximumRecordSize Maximum size of single record. 1 MB
preferredMessageSize Maximum size of multiple records. 1 MB
lang Language for negotiation. none
charset Character set for negotiation. none
rpnCharset Client-side character conversion for RPN queries and scan terms. The input terms are converted from UTF-8 to the character set of rpnCharset. none (no conversion)
serverImplementationId Implementation ID of server. (The old targetImplementationId option is also supported for the benefit of old applications.) none
targetImplementationName Implementation Name of server. (The old targetImplementationName option is also supported for the benefit of old applications.) none
serverImplementationVersion Implementation Version of server. (The old targetImplementationVersion option is also supported for the benefit of old applications.) none
databaseNameOne or more database names separated by character plus (+), which is to be used by subsequent search requests on this Connection. Default
piggybackTrue (1) if piggyback should be used in searches; false (0) if not. 1
smallSetUpperBoundIf hits is less than or equal to this value, then target will return all records using small element set name 0
largeSetLowerBoundIf hits is greater than this value, the target will return no records. 1
mediumSetPresentNumberThis value represents the number of records to be returned as part of a search when hits is less than or equal to large set lower bound and if hits is greater than small set upper bound. 0
smallSetElementSetName The element set name to be used for small result sets. none
mediumSetElementSetName The element set name to be used for medium-sized result sets. none
init_opt_search, init_opt_present, init_opt_delSet, etc. After a successful Init, these options may be interrogated to discover whether the server claims to support the specified operations. none
sru SRU/Solr transport type. Must be either soap, get, post, or solr. soap if scheme is already http; ignored otherwise
sru_version SRU/SRW version. Should be 1.1, or 1.2. This is, prior to connect, the version to offer (highest version). And following connect (in fact first operation), holds the negotiated version with the server (same or lower version). 1.2
extraArgs Extra arguments for SRU/Solr URLs. The value must be URL encoded already.  
facets Requested or recommended facets may be given before a search is sent. The value of this setting is described in Section 8, “Facets” For inspection of the facets returned, refer to the functions described in Section 5, “ZOOM Facets”. none
apdulog If set to a true value such as "1", a log of low-level protocol packets is emitted on standard error stream. This can be very useful for debugging. 0
saveAPDU If set to a true value such as "1", a log of low-level protocol packets is saved. The log can be retrieved by reading option APDU. Setting saveAPDU always has the side effect of resetting the currently saved log. This setting is write-only. If read, NULL will be returned. It is only recognized in ZOOM_connection_option_set. 0
APDU Returns the log of protocol packets. Will be empty if logging is not enabled (see saveAPDU above). This setting is read-only. It is only recognized if used in call to ZOOM_connection_option_get or ZOOM_connection_option_getl.  
memcached If given and non-empty, libMemcached will be configured for the connection. This option is inspected by ZOOM when a connection is established. If the memcached option is given and YAZ is compiled without libMemcached support, an internal diagnostic (10018) will be thrown. libMemcached support is available for YAZ 5.0.13 or later. If this option is supplied for an earlier version of YAZ, it is ignored. The value of this option is a list options - each is of the form --name=value. Option --server=host[:port] specifies a memcached server. It may be repeated for multiple memcached servers. Option --expire=seconds sets expiry time in seconds for how long result sets are to be cached. none
redis If given and non-empty, a redis context will be created for the connection. This option is inspected by ZOOM when a connection is established. If the redis option is given and YAZ is compiled without redis support, an internal diagnostic (10018) will be thrown. redis support is available for YAZ 5.2.0 or later. If this option is supplied for an earlier version of YAZ, it is ignored. The value of this option is a set of options, similar to that of the memcached setting. At this stage only --server=host[:port] and --expire=seconds are supported. none

If either option lang or charset is set, then Character Set and Language Negotiation is in effect.

     int ZOOM_connection_error(ZOOM_connection c, const char **cp,
                               const char **addinfo);
     int ZOOM_connection_error_x(ZOOM_connection c, const char **cp,
                                 const char **addinfo, const char **dset);
   

Function ZOOM_connection_error checks for errors for the last operation(s) performed. The function returns zero if no errors occurred; non-zero otherwise indicating the error. Pointers cp and addinfo holds messages for the error and additional-info if passed as non-NULL. Function ZOOM_connection_error_x is an extended version of ZOOM_connection_error that is capable of returning name of diagnostic set in dset.

1.1. Z39.50 Protocol behavior

The calls ZOOM_connection_new and ZOOM_connection_connect establishes a TCP/IP connection and sends an Initialize Request to the target if possible. In addition, the calls wait for an Initialize Response from the target and the result is inspected (OK or rejected).

If proxy is set then the client will establish a TCP/IP connection with the peer as specified by the proxy host and the hostname as part of the connect calls will be set as part of the Initialize Request. The proxy server will then "forward" the PDUs transparently to the target behind the proxy.

For the authentication parameters, if option user is set and both options group and pass are unset, then Open style authentication is used (Version 2/3) in which case the username is usually followed by a slash, then by a password. If either group or pass is set then idPass authentication (Version 3 only) is used. If none of the options are set, no authentication parameters are set as part of the Initialize Request (obviously).

When option async is 1, it really means that all network operations are postponed (and queued) until the function ZOOM_event is invoked. When doing so it doesn't make sense to check for errors after ZOOM_connection_new is called since that operation "connecting - and init" is still incomplete and the API cannot tell the outcome (yet).

1.2. SRU/Solr Protocol behavior

The HTTP based protocols (SRU, SRW, Solr) do not feature an Inititialize Request, so the connection phase merely establishes a TCP/IP connection with the HTTP server.

Most of the ZOOM connection options do not affect SRU/Solr and they are ignored. However, future versions of YAZ might honor implementationName and put that as part of User-Agent header for HTTP requests.

The charset is used in the Content-Type header of HTTP requests.

Setting authentcationMode specifies how authentication parameters are encoded for HTTP. The default is "basic" where user and password are encoded by using HTTP basic authentication.

If authentcationMode is "url", then user and password are encoded in the URL by parameters x-username and x-password as given by the SRU standard.

yaz-5.34.4/doc/apilayer.obj0000664000175000017500000001572614631643521011164 %TGIF 4.2.5-QPL state(1,37,100.000,0,20,1,16,1,0,0,0,0,0,3,1,1,0,'Helvetica',0,138240,0,0,1,5,0,1,1,1,0,16,0,0,1,1,1,0,1485,1050,0,0,2880,0). % % @(#)$Header$ % %W% % unit("1 pixel/pixel"). color_info(67,65535,0,[ "Black", 0, 0, 0, 0, 0, 0, 1, "White", 65535, 65535, 65535, 65535, 65535, 65535, 1, "#000080", 0, 0, 32896, 0, 0, 32768, 1, "#008000", 0, 32896, 0, 0, 32768, 0, 1, "#008080", 0, 32896, 32896, 0, 32768, 32768, 1, "#800000", 32896, 0, 0, 32768, 0, 0, 1, "#800080", 32896, 0, 32896, 32768, 0, 32768, 1, "#ff8000", 65535, 32896, 0, 65280, 32768, 0, 1, "#808080", 32896, 32896, 32896, 32768, 32768, 32768, 1, "#c0c0c0", 49344, 49344, 49344, 49152, 49152, 49152, 1, "#0000ff", 0, 0, 65535, 0, 0, 65280, 1, "#00ff00", 0, 65535, 0, 0, 65280, 0, 1, "#00ffff", 0, 65535, 65535, 0, 65280, 65280, 1, "#ff0000", 65535, 0, 0, 65280, 0, 0, 1, "#ff00ff", 65535, 0, 65535, 65280, 0, 65280, 1, "#ffff00", 65535, 65535, 0, 65280, 65280, 0, 1, "#4c4c4c", 19532, 19532, 19532, 19456, 19456, 19456, 1, "#b3b3b3", 46003, 46003, 46003, 45824, 45824, 45824, 1, "#e6e6e6", 59110, 59110, 59110, 58880, 58880, 58880, 1, "#dc2300", 56540, 8995, 0, 56320, 8960, 0, 1, "#ff3333", 65535, 13107, 13107, 65280, 13056, 13056, 1, "#b84747", 47288, 18247, 18247, 47104, 18176, 18176, 1, "#99284c", 39321, 10280, 19532, 39168, 10240, 19456, 1, "#94476b", 38036, 18247, 27499, 37888, 18176, 27392, 1, "#9966cc", 39321, 26214, 52428, 39168, 26112, 52224, 1, "#6b2394", 27499, 8995, 38036, 27392, 8960, 37888, 1, "#5e11a6", 24158, 4369, 42662, 24064, 4352, 42496, 1, "#4700b8", 18247, 0, 47288, 18176, 0, 47104, 1, "#2323dc", 8995, 8995, 56540, 8960, 8960, 56320, 1, "#0099ff", 0, 39321, 65535, 0, 39168, 65280, 1, "#99ccff", 39321, 52428, 65535, 39168, 52224, 65280, 1, "#00dcff", 0, 56540, 65535, 0, 56320, 65280, 1, "#23b8dc", 8995, 47288, 56540, 8960, 47104, 56320, 1, "#33a3a3", 13107, 41891, 41891, 13056, 41728, 41728, 1, "#355e00", 13621, 24158, 0, 13568, 24064, 0, 1, "#7da647", 32125, 42662, 18247, 32000, 42496, 18176, 1, "#00ae00", 0, 44718, 0, 0, 44544, 0, 1, "#3deb3d", 15677, 60395, 15677, 15616, 60160, 15616, 1, "#ffff99", 65535, 65535, 39321, 65280, 65280, 39168, 1, "#e6e64c", 59110, 59110, 19532, 58880, 58880, 19456, 1, "#b3b300", 46003, 46003, 0, 45824, 45824, 0, 1, "#666600", 26214, 26214, 0, 26112, 26112, 0, 1, "#4c1900", 19532, 6425, 0, 19456, 6400, 0, 1, "#663300", 26214, 13107, 0, 26112, 13056, 0, 1, "#804c19", 32896, 19532, 6425, 32768, 19456, 6400, 1, "#996633", 39321, 26214, 13107, 39168, 26112, 13056, 1, "#cc6633", 52428, 26214, 13107, 52224, 26112, 13056, 1, "#ff6633", 65535, 26214, 13107, 65280, 26112, 13056, 1, "#ff9966", 65535, 39321, 26214, 65280, 39168, 26112, 1, "#ffcc99", 65535, 52428, 39321, 65280, 52224, 39168, 1, "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, "red", 65535, 0, 0, 65535, 0, 0, 1, "green", 0, 65535, 0, 0, 65535, 0, 1, "blue", 0, 0, 65535, 0, 0, 65535, 1, "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, "pink", 65535, 49344, 52171, 65535, 49344, 52171, 1, "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, "CadetBlue", 24415, 40606, 41120, 24415, 40606, 41120, 1, "DarkSlateGray", 12079, 20303, 20303, 12079, 20303, 20303, 1, "#00000000c000", 0, 0, 49344, 0, 0, 49152, 1, "#820782070000", 33410, 33410, 0, 33287, 33287, 0, 1, "#3cf3fbee34d2", 15420, 64507, 13364, 15603, 64494, 13522, 1, "#3cf3fbed34d3", 15420, 64507, 13364, 15603, 64493, 13523, 1, "#ffffa6990000", 65535, 42662, 0, 65535, 42649, 0, 1, "#ffff0000fffe", 65535, 0, 65535, 65535, 0, 65534, 1, "#fffe0000fffe", 65535, 0, 65535, 65534, 0, 65534, 1, "#fffe00000000", 65535, 0, 0, 65534, 0, 0, 1 ]). script_frac("0.6"). fg_bg_colors('Black','white'). dont_reencode("FFDingbests:ZapfDingbats"). objshadow_info('#c0c0c0',2,2). rotate_pivot(0,0,0,0). spline_tightness(1). page(1,"",1,''). text('Black',95,51,2,0,1,155,34,6,14,3,0,0,0,0,2,155,34,0,0,"",0,0,0,0,65,'',[ minilines(155,34,0,0,0,0,0,[ mini_line(155,14,3,0,0,0,[ str_block(0,155,14,3,0,-1,0,0,0,[ str_seg('Black','Helvetica',0,80640,155,14,3,0,-1,0,0,0,0,0, "Client/Server Application")]) ]), mini_line(0,14,3,0,0,0,[ str_block(0,0,14,3,0,0,0,0,0,[ str_seg('Black','Helvetica',0,80640,0,14,3,0,0,0,0,0,0,0, "")]) ]) ])]). text('Black',120,121,2,0,1,44,34,21,14,3,0,0,0,0,2,44,34,0,0,"",0,0,0,0,135,'',[ minilines(44,34,0,0,0,0,0,[ mini_line(44,14,3,0,0,0,[ str_block(0,44,14,3,0,-1,0,0,0,[ str_seg('Black','Helvetica',0,80640,44,14,3,0,-1,0,0,0,0,0, "Z39.50")]) ]), mini_line(39,14,3,0,0,0,[ str_block(0,39,14,3,0,-3,0,0,0,[ str_seg('Black','Helvetica',0,80640,39,14,3,0,-3,0,0,0,0,0, "ASN.1")]) ]) ])]). text('Black',190,186,1,0,1,37,17,25,14,3,0,0,0,0,2,37,17,0,0,"",0,0,0,0,200,'',[ minilines(37,17,0,0,0,0,0,[ mini_line(37,14,3,0,0,0,[ str_block(0,37,14,3,0,-1,0,0,0,[ str_seg('Black','Helvetica',0,80640,37,14,3,0,-1,0,0,0,0,0, "HTTP")]) ]) ])]). text('Black',240,266,1,0,1,26,17,53,14,3,0,0,0,0,2,26,17,0,0,"",0,0,0,0,280,'',[ minilines(26,17,0,0,0,0,0,[ mini_line(26,14,3,0,0,0,[ str_block(0,26,14,3,0,0,0,0,0,[ str_seg('Black','Helvetica',0,80640,26,14,3,0,0,0,0,0,0,0, "SSL")]) ]) ])]). box('Black','',35,230,305,255,0,1,1,197,0,0,0,0,0,'1',0,[ ]). box('Black','',175,180,305,215,0,1,1,198,0,0,0,0,0,'1',0,[ ]). box('Black','',175,115,240,165,0,1,1,200,0,0,0,0,0,'1',0,[ ]). box('Black','',100,115,170,165,0,1,1,203,0,0,0,0,0,'1',0,[ ]). box('Black','',205,255,305,290,0,1,1,214,0,0,0,0,0,'1',0,[ ]). text('Black',95,231,1,0,1,79,17,224,14,3,0,0,0,0,2,79,17,0,0,"",0,0,0,0,245,'',[ minilines(79,17,0,0,0,0,0,[ mini_line(79,14,3,0,0,0,[ str_block(0,79,14,3,0,0,0,0,0,[ str_seg('Black','Helvetica',0,80640,79,14,3,0,0,0,0,0,0,0, "COMSTACK")]) ]) ])]). text('Black',80,186,1,0,1,73,17,254,14,3,0,0,0,0,2,73,17,0,0,"",0,0,0,0,200,'',[ minilines(73,17,0,0,0,0,0,[ mini_line(73,14,3,0,0,0,[ str_block(0,73,14,3,0,-1,0,0,0,[ str_seg('Black','Helvetica',0,80640,73,14,3,0,-1,0,0,0,0,0, "ODR (BER)")]) ]) ])]). box('Black','',35,180,170,215,0,1,1,266,0,0,0,0,0,'1',0,[ ]). box('Black','',35,45,305,90,0,1,1,268,0,0,0,0,0,'1',0,[ ]). box('Black','',240,115,305,165,0,1,1,292,5,0,0,0,0,'1',0,[ ]). text('Black',255,126,1,0,1,25,17,293,14,3,0,0,0,0,2,25,17,0,0,"",0,0,0,0,140,'',[ minilines(25,17,0,0,0,0,0,[ mini_line(25,14,3,0,0,0,[ str_block(0,25,14,3,0,0,0,0,0,[ str_seg('Black','Helvetica',0,80640,25,14,3,0,0,0,0,0,0,0, "Solr")]) ]) ])]). text('Black',50,121,2,0,1,39,34,303,14,3,0,0,0,0,2,39,34,0,0,"",0,0,0,0,135,'',[ minilines(39,34,0,0,0,0,0,[ mini_line(20,14,3,0,0,0,[ str_block(0,20,14,3,0,0,0,0,0,[ str_seg('Black','Helvetica',0,80640,20,14,3,0,0,0,0,0,0,0, "ILL")]) ]), mini_line(39,14,3,0,0,0,[ str_block(0,39,14,3,0,-3,0,0,0,[ str_seg('Black','Helvetica',0,80640,39,14,3,0,-3,0,0,0,0,0, "ASN.1")]) ]) ])]). box('Black','',35,115,100,165,0,1,1,305,0,0,0,0,0,'1',0,[ ]). box('Black','',240,115,305,165,0,1,1,306,0,0,0,0,0,'1',0,[ ]). text('Black',190,126,1,0,1,29,17,323,14,3,0,0,0,0,2,29,17,0,0,"",0,0,0,0,140,'',[ minilines(29,17,0,0,0,0,0,[ mini_line(29,14,3,0,0,0,[ str_block(0,29,14,3,0,-1,0,0,0,[ str_seg('Black','Helvetica',0,80640,29,14,3,0,-1,0,0,0,0,0, "SRU")]) ]) ])]). yaz-5.34.4/doc/reference.html0000664000175000017500000000762414754707607011520 Reference

Reference


The material in this chapter is drawn directly from the individual manual entries.

Table of Contents

yaz-client — Z39.50/SRU client for implementors
yaz-ztest — Z39.50/SRU Test Server
yaz-config — Script to get information about YAZ.
yaz — Z39.50 toolkit.
zoomsh — ZOOM shell
yaz-asncomp — YAZ ASN.1 compiler
yaz-marcdump — MARC record dump utility
yaz-iconv — YAZ Character set conversion utility
yaz-log — Log handling in all yaz-based programs
yaz-illclient — ILL client
yaz-icu — YAZ ICU utility
yaz-url — YAZ URL fetch utility
Bib-1 Attribute Set — Bib-1 Attribute Set
yaz-json-parse — YAZ JSON parser
yaz-record-iconv — YAZ Record Conversion Utility
yaz-5.34.4/doc/apilayer.png0000664000175000017500000000161314631643521011164 ‰PNG  IHDRöà¾?öRIDAThíØAOA`= W¤ý †D¢zôâo úàPƒ`)ñÀ‘3)¦GOêM ¥ D¶ô€I%[ú $­FÚTv„Ýqw¶Eètv*bÙ—46ß¼yÓìL·«K ¦ój“0V‹8-‹11C f˜ñ%ï4¿s’ˆåtÔ°Ó‰§r 0*½Aéë— ¨êI^% ¾z‘…±”Mv½IâÞZĨ&%öŒ«â Ÿ´]—Ì^¥D×ÇŒØÕÍàp‰`iøä7HѶ'œÉâ“ËL³HAÌrTE,ÝPÊT„&"*ÂRy%©Ô•„¨‡«žQu±«ûTEá“‹&+§ïc?¤V6/öIEND®B`‚yaz-5.34.4/doc/yaz-illclient-man.xml0000664000175000017500000000625514631643521012732 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-illclient 1 Commands yaz-illclient ILL client yaz-illclient name=value server-addr DESCRIPTION yaz-illclient is a client which sends an ISO ILL request to a remote server and decodes the response from it. Exactly one server address ( server-addr ) must be specified. OPTIONS -f filename] Specify filename. -v loglevel] Specify the log level. -D name=value] Defines name & value pair. -o Enable OCLC authentication. -u user] Specify user. -p password] Specify password. -V Show yaz-illclient version. EXAMPLES None yet. FILES None yet. SEE ALSO yaz(7) yaz-5.34.4/doc/server.frontend.html0000664000175000017500000000671214754707607012703 2. The Database Frontend

2. The Database Frontend

We refer to this software as a generic database frontend. Your database system is the backend database, and the interface between the two is called the backend API. The backend API consists of a small number of function handlers and structure definitions. You are required to provide the main() routine for the server (which can be quite simple), as well as a set of handlers to match each of the prototypes. The interface functions that you write can use any mechanism you like to communicate with your database system: You might link the whole thing together with your database application and access it by function calls; you might use IPC to talk to a database server somewhere; or you might link with third-party software that handles the communication for you (like a commercial database client library). At any rate, the handlers will perform the tasks of:

  • Initialization.

  • Searching.

  • Fetching records.

  • Scanning the database index (optional - if you wish to implement SCAN).

  • Extended Services (optional).

  • Result-Set Delete (optional).

  • Result-Set Sort (optional).

  • Return Explain for SRU (optional).

(more functions will be added in time to support as much of Z39.50-1995 as possible).

yaz-5.34.4/doc/yaz-asncomp.html0000664000175000017500000002445214754707607012021 yaz-asncomp

Name

yaz-asncomp — YAZ ASN.1 compiler

Synopsis

yaz-asncomp [-v] [-c cfile] [-h hfile] [-p pfile] [-d config] [-I includeout] [-i includedir] [-m module] [filename]

DESCRIPTION

yaz-asncomp is an ASN.1 compiler that reads an ASN.1 specification in filename and produces C/C++ definitions and BER encoders/decoders for it.

The produced C/C++ code and header files uses the ODR module of YAZ which is a library that encodes/decodes/prints BER packages. yaz-asncomp allows you to specify name of resulting source via options. Alternatively, you can specify a DEFINITIONS file, which provides customized output to many output files - if the ASN.1 specification file consists of many modules.

This utility is written in Tcl. Any version of Tcl should work.

OPTIONS

-v

Makes the ASN.1 compiler print more verbose about the various stages of operations.

-c cfile

Specifies the name of the C/C++ file with encoders/decoders.

-h hfile

Specifies the name of header file with definitions.

-p pfile

Specifies the name of the a private header file with definitions. By default all definitions are put in header file (option -h).

-d dfile

Specifies the name of a definitions file.

-I iout

Specifies first part of directory in which header files are written.

-i idir

Specifies second part of directory in which header files are written.

-m module

Specifies that ASN.1 compiler should only process the module given. If this option is not specified, all modules in the ASN.1 file are processed.

DEFINITIONS FILE

The definitions file is really a Tcl script but follows traditional rules for Shell like configuration files. That is # denotes the beginning of a comment. Definitions are line oriented. The definitions files usually consist of a series of variable assignments of the form:

set name value

Available variables are:

default-prefix

Sets prefix for names in the produced output. The value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively.

prefix(module)

This value sets prefix values for module module. The value has same form as default-prefix.

filename(module)

Specifies filename for C/header file for module module.

init(module,h)

Code fragment to be put in first part of public header for module module.

body(module,h)

Code fragment to be put in last part of public header for module module (trailer).

init(module,c)

Code fragment to be put in first part of C based encoder/decoder for module module.

body(module,c)

Code fragment to be put in last part of C based encoder/decoder for module module (trailer).

map(module,name)

Maps ASN.1 type in module module of name to value.

membermap(module,name,member)

Maps member member in SEQUENCE/CHOICE of name in module module to value. The value consists of one or two tokens. First token is name of C preprocessor part. Second token is resulting C member name. If second token is omitted the value (one token) is both preprocessor part and C struct,union.

unionmap(module,name,member)

Maps member member in CHOICE of name in module module to value. Value consists of two or three tokens. The first token is name of the integer in the union that is used as selector for the union itself. The second token is name of the union. The third token overrides the name of the CHOICE member; if omitted the member name is used.

FILES

/usr/share/yaz/z39.50/z.tcl

/usr/share/yaz/z39.50/*.asn

SEE ALSO

yaz(7)

Section "The ODR Module" in the YAZ manual.

yaz-5.34.4/doc/tools.html0000664000175000017500000017653514754707607010732 Chapter 7. Supporting Tools

Chapter 7. Supporting Tools

In support of the service API - primarily the ASN module, which provides the programmatic interface to the Z39.50 APDUs, YAZ contains a collection of tools that support the development of applications.

1. Query Syntax Parsers

Since the type-1 (RPN) query structure has no direct, useful string representation, every origin application needs to provide some form of mapping from a local query notation or representation to a Z_RPNQuery structure. Some programmers will prefer to construct the query manually, perhaps using odr_malloc() to simplify memory management. The YAZ distribution includes three separate, query-generating tools that may be of use to you.

1.1. Prefix Query Format

Since RPN or reverse polish notation is really just a fancy way of describing a suffix notation format (operator follows operands), it would seem that the confusion is total when we now introduce a prefix notation for RPN. The reason is one of simple laziness - it's somewhat simpler to interpret a prefix format, and this utility was designed for maximum simplicity, to provide a baseline representation for use in simple test applications and scripting environments (like Tcl). The demonstration client included with YAZ uses the PQF.

Note

The PQF has been adopted by other parties developing Z39.50 software. It is often referred to as Prefix Query Notation - PQN.

The PQF is defined by the pquery module in the YAZ library. There are two sets of functions that have similar behavior. First set operates on a PQF parser handle, second set doesn't. First set of functions are more flexible than the second set. Second set is obsolete and is only provided to ensure backwards compatibility.

First set of functions all operate on a PQF parser handle:

     #include <yaz/pquery.h>

     YAZ_PQF_Parser yaz_pqf_create(void);

     void yaz_pqf_destroy(YAZ_PQF_Parser p);

     Z_RPNQuery *yaz_pqf_parse(YAZ_PQF_Parser p, ODR o, const char *qbuf);

     Z_AttributesPlusTerm *yaz_pqf_scan(YAZ_PQF_Parser p, ODR o,
                          Odr_oid **attributeSetId, const char *qbuf);

     int yaz_pqf_error(YAZ_PQF_Parser p, const char **msg, size_t *off);
    

A PQF parser is created and destructed by functions yaz_pqf_create and yaz_pqf_destroy respectively. Function yaz_pqf_parse parses the query given by string qbuf. If parsing was successful, a Z39.50 RPN Query is returned which is created using ODR stream o. If parsing failed, a NULL pointer is returned. Function yaz_pqf_scan takes a scan query in qbuf. If parsing was successful, the function returns attributes plus term pointer and modifies attributeSetId to hold attribute set for the scan request - both allocated using ODR stream o. If parsing failed, yaz_pqf_scan returns a NULL pointer. Error information for bad queries can be obtained by a call to yaz_pqf_error which returns an error code and modifies *msg to point to an error description, and modifies *off to the offset within the last query where parsing failed.

The second set of functions are declared as follows:

     #include <yaz/pquery.h>

     Z_RPNQuery *p_query_rpn(ODR o, oid_proto proto, const char *qbuf);

     Z_AttributesPlusTerm *p_query_scan(ODR o, oid_proto proto,
                             Odr_oid **attributeSetP, const char *qbuf);

     int p_query_attset(const char *arg);
    

The function p_query_rpn() takes as arguments an ODR stream (see section The ODR Module) to provide a memory source (the structure created is released on the next call to odr_reset() on the stream), a protocol identifier (one of the constants PROTO_Z3950 and PROTO_SR), an attribute set reference, and finally a null-terminated string holding the query string.

If the parse went well, p_query_rpn() returns a pointer to a Z_RPNQuery structure which can be placed directly into a Z_SearchRequest. If parsing failed, due to syntax error, a NULL pointer is returned.

The p_query_attset specifies which attribute set to use if the query doesn't specify one by the @attrset operator. The p_query_attset returns 0 if the argument is a valid attribute set specifier; otherwise the function returns -1.

The grammar of the PQF is as follows:


     query ::= top-set query-struct.

     top-set ::= [ '@attrset' string ]

     query-struct ::= attr-spec | simple | complex | '@term' term-type query

     attr-spec ::= '@attr' [ string ] string query-struct

     complex ::= operator query-struct query-struct.

     operator ::= '@and' | '@or' | '@not' | '@prox' proximity.

     simple ::= result-set | term.

     result-set ::= '@set' string.

     term ::= string.

     proximity ::= exclusion distance ordered relation which-code unit-code.

     exclusion ::= '1' | '0' | 'void'.

     distance ::= integer.

     ordered ::= '1' | '0'.

     relation ::= integer.

     which-code ::= 'known' | 'private' | integer.

     unit-code ::= integer.

     term-type ::= 'general' | 'numeric' | 'string' | 'oid' | 'datetime' | 'null'.
    

You will note that the syntax above is a fairly faithful representation of RPN, except for the Attribute, which has been moved a step away from the term, allowing you to associate one or more attributes with an entire query structure. The parser will automatically apply the given attributes to each term as required.

The @attr operator is followed by an attribute specification (attr-spec above). The specification consists of an optional attribute set, an attribute type-value pair and a sub-query. The attribute type-value pair is packed in one string: an attribute type, an equals sign, and an attribute value, like this: @attr 1=1003. The type is always an integer, but the value may be either an integer or a string (if it doesn't start with a digit character). A string attribute-value is encoded as a Type-1 "complex" attribute with the list of values containing the single string specified, and including no semantic indicators.

Version 3 of the Z39.50 specification defines various encoding of terms. Use @term type string, where type is one of: general, numeric or string (for InternationalString). If no term type has been given, the general form is used. This is the only encoding allowed in both versions 2 and 3 of the Z39.50 standard.

1.1.1. Using Proximity Operators with PQF

Note

This is an advanced topic, describing how to construct queries that make very specific requirements on the relative location of their operands. You may wish to skip this section and go straight to the example PQF queries.

Warning

Most Z39.50 servers do not support proximity searching, or support only a small subset of the full functionality that can be expressed using the PQF proximity operator. Be aware that the ability to express a query in PQF is no guarantee that any given server will be able to execute it.

The proximity operator @prox is a special and more restrictive version of the conjunction operator @and. Its semantics are described in section 3.7.2 (Proximity) of Z39.50 the standard itself, which can be read on-line at https://www.loc.gov/z3950/agency/markup/09.html#3.7.2

In PQF, the proximity operation is represented by a sequence of the form

       @prox exclusion distance ordered relation which-code unit-code
      

in which the meanings of the parameters are as described in the standard, and they can take the following values:

  • exclusion.  0 = false (i.e. the proximity condition specified by the remaining parameters must be satisfied) or 1 = true (the proximity condition specified by the remaining parameters must not be satisfied).

  • distance.  An integer specifying the difference between the locations of the operands: e.g. two adjacent words would have distance=1 since their locations differ by one unit.

  • ordered.  1 = ordered (the operands must occur in the order the query specifies them) or 0 = unordered (they may appear in either order).

  • relation.  Recognised values are 1 (lessThan), 2 (lessThanOrEqual), 3 (equal), 4 (greaterThanOrEqual), 5 (greaterThan) and 6 (notEqual).

  • which-code.  known or k (the unit-code parameter is taken from the well-known list of alternatives described below) or private or p (the unit-code parameter has semantics specific to an out-of-band agreement such as a profile).

  • unit-code.  If the which-code parameter is known then the recognised values are 1 (character), 2 (word), 3 (sentence), 4 (paragraph), 5 (section), 6 (chapter), 7 (document), 8 (element), 9 (subelement), 10 (elementType) and 11 (byte). If which-code is private then the acceptable values are determined by the profile.

(The numeric values of the relation and well-known unit-code parameters are taken straight from the ASN.1 of the proximity structure in the standard.)

1.1.2. PQF queries

Example 7.1. PQF queries using simple terms

	dylan

	"bob dylan"
       


Example 7.2. PQF boolean operators

	@or "dylan" "zimmerman"

	@and @or dylan zimmerman when

	@and when @or dylan zimmerman
       


Example 7.3. PQF references to result sets

	@set Result-1

	@and @set seta @set setb
       


Example 7.4. Attributes for terms

	@attr 1=4 computer

	@attr 1=4 @attr 4=1 "self portrait"

	@attrset exp1 @attr 1=1 CategoryList

	@attr gils 1=2008 Copenhagen

	@attr 1=/book/title computer
       


Example 7.5. PQF Proximity queries

	@prox 0 3 1 2 k 2 dylan zimmerman
       

Here the parameters 0, 3, 1, 2, k and 2 represent exclusion, distance, ordered, relation, which-code and unit-code, in that order. So:

  • exclusion = 0: the proximity condition must hold

  • distance = 3: the terms must be three units apart

  • ordered = 1: they must occur in the order they are specified

  • relation = 2: lessThanOrEqual (to the distance of 3 units)

  • which-code is "known", so the standard unit-codes are used

  • unit-code = 2: word.

So the whole proximity query means that the words dylan and zimmerman must both occur in the record, in that order, differing in position by three or fewer words (i.e. with two or fewer words between them.) The query would find "Bob Dylan, aka. Robert Zimmerman", but not "Bob Dylan, born as Robert Zimmerman" since the distance in this case is four.


Example 7.6. PQF specification of search term type

	@term string "a UTF-8 string, maybe?"
       


Example 7.7. PQF mixed queries

	@or @and bob dylan @set Result-1

	@attr 4=1 @and @attr 1=1 "bob dylan" @attr 1=4 "slow train coming"

	@and @attr 2=4 @attr gils 1=2038 -114 @attr 2=2 @attr gils 1=2039 -109
       

The last of these examples is a spatial search: in the GILS attribute set, access point 2038 indicates West Bounding Coordinate and 2030 indicates East Bounding Coordinate, so the query is for areas extending from -114 degrees longitude to no more than -109 degrees longitude.


1.2. CCL

Not all users enjoy typing in prefix query structures and numerical attribute values, even in a minimalistic test client. In the library world, the more intuitive Common Command Language - CCL (ISO 8777) has enjoyed some popularity - especially before the widespread availability of graphical interfaces. It is still useful in applications where you for some reason or other need to provide a symbolic language for expressing boolean query structures.

1.2.1. CCL Syntax

The CCL parser obeys the following grammar for the FIND argument. The syntax is annotated using lines prefixed by --.

      CCL-Find ::= CCL-Find Op Elements
                | Elements.

      Op ::= "and" | "or" | "not"
      -- The above means that Elements are separated by boolean operators.

      Elements ::= '(' CCL-Find ')'
                | Set
                | Terms
                | Qualifiers Relation Terms
                | Qualifiers Relation '(' CCL-Find ')'
                | Qualifiers '=' string '-' string
      -- Elements is either a recursive definition, a result set reference, a
      -- list of terms, qualifiers followed by terms, qualifiers followed
      -- by a recursive definition or qualifiers in a range (lower - upper).

      Set ::= 'set' = string
      -- Reference to a result set

      Terms ::= Terms Prox Term
             | Term
      -- Proximity of terms.

      Term ::= Term string
            | string
      -- This basically means that a term may include a blank

      Qualifiers ::= Qualifiers ',' string
                  | string
      -- Qualifiers is a list of strings separated by comma

      Relation ::= '=' | '>=' | '<=' | '<>' | '>' | '<'
      -- Relational operators. This really doesn't follow the ISO8777
      -- standard.

      Prox ::= '%' | '!'
      -- Proximity operator

     

Example 7.8. CCL queries

The following queries are all valid:

       dylan

       "bob dylan"

       dylan or zimmerman

       set=1

       (dylan and bob) or set=1

       righttrunc?

       "notrunc?"

       singlechar#mask
      

Assuming that the qualifiers ti and au and date are defined, we may use:

       ti=self portrait

       au=(bob dylan and slow train coming)

       date>1980 and (ti=((self portrait)))
      

1.2.2. CCL Qualifiers

Qualifiers are used to direct the search to a particular searchable index, such as title (ti) and author indexes (au). The CCL standard itself doesn't specify a particular set of qualifiers, but it does suggest a few short-hand notations. You can customize the CCL parser to support a particular set of qualifiers to reflect the current target profile. Traditionally, a qualifier would map to a particular use-attribute within the BIB-1 attribute set. It is also possible to set other attributes, such as the structure attribute.

A CCL profile is a set of predefined CCL qualifiers that may be read from a file or set in the CCL API. The YAZ client reads its CCL qualifiers from a file named default.bib. There are four types of lines in a CCL profile: qualifier specification, qualifier alias, comments and directives.

1.2.2.1. Qualifier specification

A qualifier specification is of the form:

qualifier-name [attributeset,]type=val [attributeset,]type=val ...

where qualifier-name is the name of the qualifier to be used (e.g. ti), type is attribute type in the attribute set (Bib-1 is used if no attribute set is given) and val is attribute value. The type can be specified as an integer, or as a single-letter: u for use, r for relation, p for position, s for structure,t for truncation, or c for completeness. The attributes for the special qualifier name term are used when no CCL qualifier is given in a query.

Table 7.1. Common Bib-1 attributes

TypeDescription
u=value Use attribute (1). Common use attributes are 1 Personal-name, 4 Title, 7 ISBN, 8 ISSN, 30 Date, 62 Subject, 1003 Author, 1016 Any. Specify value as an integer.
r=value Relation attribute (2). Common values are 1 <, 2 <=, 3 =, 4 >=, 5 >, 6 <>, 100 phonetic, 101 stem, 102 relevance, 103 always matches.
p=value Position attribute (3). Values: 1 first in field, 2 first in any subfield, 3 any position in field.
s=value Structure attribute (4). Values: 1 phrase, 2 word, 3 key, 4 year, 5 date, 6 word list, 100 date (un), 101 name (norm), 102 name (un), 103 structure, 104 urx, 105 free-form-text, 106 document-text, 107 local-number, 108 string, 109 numeric string.
t=value Truncation attribute (5). Values: 1 right, 2 left, 3 left and right, 100 none, 101 process #, 102 regular-1, 103 regular-2, 104 CCL.
c=value Completeness attribute (6). Values: 1 incomplete subfield, 2 complete subfield, 3 complete field.


Refer to Bib-1 Attribute Set(7) or the complete list of Bib-1 attributes

It is also possible to specify non-numeric attribute values, which are used in combination with certain types. The special combinations are:

Table 7.2. Special attribute combos

NameDescription
s=pw The structure is set to either word or phrase depending on the number of tokens in a term (phrase-word).
s=al Each token in the term is ANDed (and-list). This does not set the structure at all.
s=ol Each token in the term is ORed (or-list). This does not set the structure at all.
s=ag Tokens that appears as phrases (with blank in them) gets structure phrase attached (4=1). Tokens that appear to be words gets structure word attached (4=2). Phrases and words are ANDed. This is a variant of s=al and s=pw, with the main difference that words are not split (with operator AND) but instead kept in one RPN token. This facility appeared in YAZ 4.2.38.
s=sl Tokens are split into sub-phrases of all combinations - in order. This facility appeared in YAZ 5.14.0.
r=o Allows ranges and the operators greater-than, less-than, ... equals. This sets Bib-1 relation attribute accordingly (relation ordered). A query construct is only treated as a range if dash is used and that is surrounded by white-space. So -1980 is treated as term "-1980" not <= 1980. If - 1980 is used, however, that is treated as a range.
r=r Similar to r=o but assumes that terms are non-negative (not prefixed with -). Thus, a dash will always be treated as a range. The construct 1980-1990 is treated as a range with r=r but as a single term "1980-1990" with r=o. The special attribute r=r is available in YAZ 2.0.24 or later.
r=omiteq This will omit relation=equals (@attr 2=3) when r=o / r=r is used. This is useful for servers that somehow break when an explicit relation=equals is used. Omitting the relation is usually safe because "equals" is the default behavior. This tweak was added in YAZ version 5.1.2.
t=l Allows term to be left-truncated. If term is of the form ?x, the resulting Type-1 term is x and truncation is left.
t=r Allows term to be right-truncated. If term is of the form x?, the resulting Type-1 term is x and truncation is right.
t=n If term is does not include ?, the truncation attribute is set to none (100).
t=b Allows term to be both left-and-right truncated. If term is of the form ?x?, the resulting term is x and truncation is set to both left and right.
t=x Allows masking anywhere in a term, thus fully supporting # (mask one character) and ? (zero or more of any). If masking is used, truncation is set to 102 (regexp-1 in term) and the term is converted accordingly to a regular expression.
t=z Allows masking anywhere in a term, thus fully supporting # (mask one character) and ? (zero or more of any). If masking is used, truncation is set to 104 (Z39.58 in term) and the term is converted accordingly to Z39.58 masking term - actually the same truncation as CCL itself.


Example 7.9. CCL profile

Consider the following definition:

	ti       u=4 s=1
	au       u=1 s=1
	term     s=105
	ranked   r=102
	date     u=30 r=o
       

ti and au both set structure attribute to phrase (s=1). ti sets the use-attribute to 4. au sets the use-attribute to 1. When no qualifiers are used in the query, the structure-attribute is set to free-form-text (105) (rule for term). The date sets the relation attribute to the relation used in the CCL query and sets the use attribute to 30 (Bib-1 Date).

You can combine attributes. To Search for "ranked title" you can do

	 ti,ranked=knuth computer
	

which will set relation=ranked, use=title, structure=phrase.

Query

	 date > 1980
	

is a valid query. But

	 ti > 1980
	

is invalid.


1.2.2.2. Qualifier alias

A qualifier alias is of the form:

q q1 q2 ..

which declares q to be an alias for q1, q2... such that the CCL query q=x is equivalent to q1=x or q2=x or ....

1.2.2.3. Comments

Lines with white space or lines that begin with character # are treated as comments.

1.2.2.4. Directives

Directive specifications takes the form

@directive value

Table 7.3. CCL directives

NameDescriptionDefault
truncationTruncation character?
maskMasking character. Requires YAZ 4.2.58 or later#
fieldSpecifies how multiple fields are to be combined. There are two modes: or: multiple qualifier fields are ORed, merge: attributes for the qualifier fields are merged and assigned to one term. merge
caseSpecifies if CCL operators and qualifiers should be compared with case sensitivity or not. Specify 1 for case sensitive; 0 for case insensitive.1
andSpecifies token for CCL operator AND.and
orSpecifies token for CCL operator OR.or
notSpecifies token for CCL operator NOT.not
setSpecifies token for CCL operator SET.set

1.2.3. CCL API

All public definitions can be found in the header file ccl.h. A profile identifier is of type CCL_bibset. A profile must be created with the call to the function ccl_qual_mk which returns a profile handle of type CCL_bibset.

To read a file containing qualifier definitions the function ccl_qual_file may be convenient. This function takes an already opened FILE handle pointer as argument along with a CCL_bibset handle.

To parse a simple string with a FIND query use the function

struct ccl_rpn_node *ccl_find_str(CCL_bibset bibset, const char *str,
                                  int *error, int *pos);
     

which takes the CCL profile (bibset) and query (str) as input. Upon successful completion the RPN tree is returned. If an error occurs, such as a syntax error, the integer pointed to by error holds the error code and pos holds the offset inside query string in which the parsing failed.

An English representation of the error may be obtained by calling the ccl_err_msg function. The error codes are listed in ccl.h.

To convert the CCL RPN tree (type struct ccl_rpn_node *) to the Z_RPNQuery of YAZ the function ccl_rpn_query must be used. This function which is part of YAZ is implemented in yaz-ccl.c. After calling this function the CCL RPN tree is probably no longer needed. The ccl_rpn_delete destroys the CCL RPN tree.

A CCL profile may be destroyed by calling the ccl_qual_rm function.

The token names for the CCL operators may be changed by setting the globals (all type char *) ccl_token_and, ccl_token_or, ccl_token_not and ccl_token_set. An operator may have aliases, i.e. there may be more than one name for the operator. To do this, separate each alias with a space character.

1.3. CQL

CQL - Common Query Language - was defined for the SRU protocol. In many ways CQL has a similar syntax to CCL. The objective of CQL is different. Where CCL aims to be an end-user language, CQL is the protocol query language for SRU.

Tip

If you are new to CQL, read the Gentle Introduction.

The CQL parser in YAZ provides the following:

  • It parses and validates a CQL query.

  • It generates a C structure that allows you to convert a CQL query to some other query language, such as SQL.

  • The parser converts a valid CQL query to PQF, thus providing a way to use CQL for both SRU servers and Z39.50 targets at the same time.

  • The parser converts CQL to XCQL. XCQL is an XML representation of CQL. XCQL is part of the SRU specification. However, since SRU supports CQL only, we don't expect XCQL to be widely used. Furthermore, CQL has the advantage over XCQL that it is easy to read.

1.3.1. CQL parsing

A CQL parser is represented by the CQL_parser handle. Its contents should be considered YAZ internal (private).

#include <yaz/cql.h>

typedef struct cql_parser *CQL_parser;

CQL_parser cql_parser_create(void);
void cql_parser_destroy(CQL_parser cp);
      

A parser is created by cql_parser_create and is destroyed by cql_parser_destroy.

To parse a CQL query string, the following function is provided:

int cql_parser_string(CQL_parser cp, const char *str);
      

A CQL query is parsed by the cql_parser_string which takes a query str. If the query was valid (no syntax errors), then zero is returned; otherwise -1 is returned to indicate a syntax error.

int cql_parser_stream(CQL_parser cp,
                      int (*getbyte)(void *client_data),
                      void (*ungetbyte)(int b, void *client_data),
                      void *client_data);

int cql_parser_stdio(CQL_parser cp, FILE *f);
      

The functions cql_parser_stream and cql_parser_stdio parse a CQL query - just like cql_parser_string. The only difference is that the CQL query can be fed to the parser in different ways. The cql_parser_stream uses a generic byte stream as input. The cql_parser_stdio uses a FILE handle which is opened for reading.

1.3.2. CQL tree

If the query string is valid, the CQL parser generates a tree representing the structure of the CQL query.

struct cql_node *cql_parser_result(CQL_parser cp);
      

cql_parser_result returns a pointer to the root node of the resulting tree.

Each node in a CQL tree is represented by a struct cql_node. It is defined as follows:

#define CQL_NODE_ST 1
#define CQL_NODE_BOOL 2
#define CQL_NODE_SORT 3
struct cql_node {
    int which;
    union {
        struct {
            char *index;
	    char *index_uri;
            char *term;
            char *relation;
	    char *relation_uri;
            struct cql_node *modifiers;
        } st;
        struct {
            char *value;
            struct cql_node *left;
            struct cql_node *right;
            struct cql_node *modifiers;
        } boolean;
        struct {
            char *index;
            struct cql_node *next;
            struct cql_node *modifiers;
            struct cql_node *search;
        } sort;
    } u;
};
      

There are three node types: search term (ST), boolean (BOOL) and sortby (SORT). A modifier is treated as a search term too.

The search term node has five members:

  • index: index for search term. If an index is unspecified for a search term, index will be NULL.

  • index_uri: index URI for search term or NULL if none could be resolved for the index.

  • term: the search term itself.

  • relation: relation for search term.

  • relation_uri: relation URI for search term.

  • modifiers: relation modifiers for search term. The modifiers list itself of cql_nodes each of type ST.

The boolean node represents and, or, not + proximity.

  • left and right: left - and right operand respectively.

  • modifiers: proximity arguments.

The sort node represents both the SORTBY clause.

1.3.3. CQL to PQF conversion

Conversion to PQF (and Z39.50 RPN) is tricky by the fact that the resulting RPN depends on the Z39.50 target capabilities (combinations of supported attributes). In addition, the CQL and SRU operates on index prefixes (URI or strings), whereas the RPN uses Object Identifiers for attribute sets.

The CQL library of YAZ defines a cql_transform_t type. It represents a particular mapping between CQL and RPN. This handle is created and destroyed by the functions:

cql_transform_t cql_transform_open_FILE (FILE *f);
cql_transform_t cql_transform_open_fname(const char *fname);
void cql_transform_close(cql_transform_t ct);
     

The first two functions create a transformation handle from either an already open FILE or from a filename respectively.

The handle is destroyed by cql_transform_close in which case no further reference of the handle is allowed.

When a cql_transform_t handle has been created you can convert to RPN.

int cql_transform_buf(cql_transform_t ct,
                      struct cql_node *cn, char *out, int max);
      

This function converts the CQL tree cn using handle ct. For the resulting PQF, you supply a buffer out which must be able to hold at at least max characters.

If conversion failed, cql_transform_buf returns a non-zero SRU error code; otherwise zero is returned (conversion successful). The meanings of the numeric error codes are listed in the SRU specification somewhere (no direct link anymore).

If conversion fails, more information can be obtained by calling

int cql_transform_error(cql_transform_t ct, char **addinfop);
      

This function returns the most recently returned numeric error-code and sets the string-pointer at *addinfop to point to a string containing additional information about the error that occurred: for example, if the error code is 15 ("Illegal or unsupported context set"), the additional information is the name of the requested context set that was not recognised.

The SRU error-codes may be translated into brief human-readable error messages using

const char *cql_strerror(int code);
      

If you wish to be able to produce a PQF result in a different way, there are two alternatives.

void cql_transform_pr(cql_transform_t ct,
                      struct cql_node *cn,
                      void (*pr)(const char *buf, void *client_data),
                      void *client_data);

int cql_transform_FILE(cql_transform_t ct,
                       struct cql_node *cn, FILE *f);
      

The former function produces output to a user-defined output stream. The latter writes the result to an already open FILE.

1.3.4. Specification of CQL to RPN mappings

The file supplied to functions cql_transform_open_FILE, cql_transform_open_fname follows a structure found in many Unix utilities. It consists of mapping specifications - one per line. Lines starting with # are ignored (comments).

Each line is of the form


       CQL pattern =   RPN equivalent
      

An RPN pattern is a simple attribute list. Each attribute pair takes the form:


       [settype=value
      

The attribute set is optional. The type is the attribute type, value the attribute value.

The character * (asterisk) has special meaning when used in the RPN pattern. Each occurrence of * is substituted with the CQL matching name (index, relation, qualifier etc). This facility can be used to copy a CQL name verbatim to the RPN result.

The following CQL patterns are recognized:

index.set.name

This pattern is invoked when a CQL index, such as dc.title is converted. set and name are the context set and index name respectively. Typically, the RPN specifies an equivalent use attribute.

For terms not bound by an index, the pattern index.cql.serverChoice is used. Here, the prefix cql is defined as http://www.loc.gov/zing/cql/cql-indexes/v1.0/. If this pattern is not defined, the mapping will fail.

The pattern, index.set.* is used when no other index pattern is matched.

qualifier.set.name (DEPRECATED)

For backwards compatibility, this is recognised as a synonym of index.set.name

relation.relation

This pattern specifies how a CQL relation is mapped to RPN. The pattern is name of relation operator. Since = is used as separator between CQL pattern and RPN, CQL relations including = cannot be used directly. To avoid a conflict, the names ge, eq, le, must be used for CQL operators, greater-than-or-equal, equal, less-than-or-equal respectively. The RPN pattern is supposed to include a relation attribute.

For terms not bound by a relation, the pattern relation.scr is used. If the pattern is not defined, the mapping will fail.

The special pattern, relation.* is used when no other relation pattern is matched.

relationModifier.mod

This pattern specifies how a CQL relation modifier is mapped to RPN. The RPN pattern is usually a relation attribute.

structure.type

This pattern specifies how a CQL structure is mapped to RPN. Note that this CQL pattern is somewhat similar to CQL pattern relation. The type is a CQL relation.

The pattern, structure.* is used when no other structure pattern is matched. Usually, the RPN equivalent specifies a structure attribute.

position.type

This pattern specifies how the anchor (position) of CQL is mapped to RPN. The type is one of first, any, last, firstAndLast.

The pattern, position.* is used when no other position pattern is matched.

set.prefix

This specification defines a CQL context set for a given prefix. The value on the right hand side is the URI for the set - not RPN. All prefixes used in index patterns must be defined this way.

set

This specification defines a default CQL context set for index names. The value on the right hand side is the URI for the set.

Example 7.10. CQL to RPN mapping file

This simple file defines two context sets, three indexes and three relations, a position pattern and a default structure.

       set.cql  = http://www.loc.gov/zing/cql/context-sets/cql/v1.1/
       set.dc   = http://www.loc.gov/zing/cql/dc-indexes/v1.0/

       index.cql.serverChoice = 1=1016
       index.dc.title         = 1=4
       index.dc.subject       = 1=21

       relation.<             = 2=1
       relation.eq            = 2=3
       relation.scr           = 2=3

       position.any           = 3=3 6=1

       structure.*            = 4=1

      

With the mappings above, the CQL query

        computer
       

is converted to the PQF:

        @attr 1=1016 @attr 2=3 @attr 4=1 @attr 3=3 @attr 6=1 "computer"
       

by rules index.cql.serverChoice, relation.scr, structure.*, position.any.

CQL query

        computer^
       

is rejected, since position.right is undefined.

CQL query

        >my = "http://www.loc.gov/zing/cql/dc-indexes/v1.0/" my.title = x
       

is converted to

        @attr 1=4 @attr 2=3 @attr 4=1 @attr 3=3 @attr 6=1 "x"
       


Example 7.11. CQL to RPN string attributes

In this example we allow any index to be passed to RPN as a use attribute.

       # Identifiers for prefixes used in this file. (index.*)
       set.cql  = info:srw/cql-context-set/1/cql-v1.1
       set.rpn  = http://bogus/rpn
       set      = http://bogus/rpn

       # The default index when none is specified by the query
       index.cql.serverChoice     = 1=any

       index.rpn.*                = 1=*
       relation.eq                = 2=3
       structure.*                = 4=1
       position.any               = 3=3

      

The http://bogus/rpn context set is also the default so we can make queries such as

        title = a
       

which is converted to

        @attr 2=3 @attr 4=1 @attr 3=3 @attr 1=title "a"
       


Example 7.12. CQL to RPN using Bath Profile

The file etc/pqf.properties has mappings from the Bath Profile and Dublin Core to RPN. If YAZ is installed as a package it's usually located in /usr/share/yaz/etc and part of the development package, such as libyaz-dev.


1.3.5. CQL to XCQL conversion

Conversion from CQL to XCQL is trivial and does not require a mapping to be defined. There are three functions to choose from depending on the way you wish to store the resulting output (XML buffer containing XCQL).

int cql_to_xml_buf(struct cql_node *cn, char *out, int max);
void cql_to_xml(struct cql_node *cn,
                void (*pr)(const char *buf, void *client_data),
                void *client_data);
void cql_to_xml_stdio(struct cql_node *cn, FILE *f);
      

Function cql_to_xml_buf converts to XCQL and stores the result in a user-supplied buffer of a given max size.

cql_to_xml writes the result in a user-defined output stream. cql_to_xml_stdio writes to a a file.

1.3.6. PQF to CQL conversion

Conversion from PQF to CQL is offered by the two functions shown below. The former uses a generic stream for result. The latter puts result in a WRBUF (string container).

#include <yaz/rpn2cql.h>

int cql_transform_rpn2cql_stream(cql_transform_t ct,
                                 void (*pr)(const char *buf, void *client_data),
                                 void *client_data,
                                 Z_RPNQuery *q);

int cql_transform_rpn2cql_wrbuf(cql_transform_t ct,
                                WRBUF w,
                                Z_RPNQuery *q);
      

The configuration is the same as used in CQL to PQF conversions.

yaz-5.34.4/doc/local0.ent.in0000664000175000017500000000003614631643521011135 yaz-5.34.4/doc/yaz-config-man.xml0000664000175000017500000000720114631643521012210 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-config 1 Commands yaz-config Script to get information about YAZ. yaz-config libraries DESCRIPTION yaz-config is a script that returns information that your own software should use to build software that uses YAZ. The following libraries are supported: threads Use the threaded version of YAZ. OPTIONS --prefix[=DIR] Returns prefix of YAZ or assume a different one if DIR is specified. --version Returns version of YAZ. --libs Library specification be used when using YAZ. --lalibs Return library specification. --cflags Return C Compiler flags. --include Return C compiler includes for YAZ header files (-Ipath). --comp Returns full path to YAZ' ASN.1 compiler: yaz-asncomp. -V Returns YAZ SHA1 ID (from Git) and version. FILES /usr/bin/yaz-config /usr/lib/libyaz*.a /usr/include/yaz/*.h SEE ALSO yaz(7) Section "How to make apps using YAZ on UNIX" in the YAZ manual. yaz-5.34.4/doc/gfs-virtual.xml0000664000175000017500000002233414631643521011640 The Virtual hosts mechanism allows a YAZ front-end server to support multiple back-ends. A back-end is selected on the basis of the TCP/IP binding (port+listening address) and/or the virtual host. A back-end can be configured to execute in a particular working directory. Or the YAZ front-end may perform CQL to RPN conversion, thus allowing traditional Z39.50 back-ends to be offered as a SRW/SRU service. SRW/SRU Explain information for a particular back-end may also be specified. For the HTTP protocol, the virtual host is specified in the Host header. For the Z39.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1.2.840.10003.10.1000.81.1. Not all Z39.50 clients allow the VHOST information to be set. For those, the selection of the back-end must rely on the TCP/IP information alone (port and address). The YAZ front-end server uses XML to describe the back-end configurations. Command-line option -f specifies filename of the XML configuration. The configuration uses the root element yazgfs. This element includes a list of listen elements, followed by one or more server elements. The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server. Content for a listener: CDATA (required) The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc. attribute id (optional) Identifier for this listener. This may be referred to from server sections. We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers. The server describes a server and the parameters for this server type. Content for a server: attribute id (optional) Identifier for this server. Currently not used for anything, but it might be for logging purposes. attribute listenref (optional) Specifies one or more listeners for this server. Each server ID is separated by a comma. If this attribute is not given, the server is accessible from all listeners. In order for the server to be used for real, however, the virtual host must match if specified in the configuration. element config (optional) Specifies the server configuration. This is equivalent to the config specified using command line option -c. element directory (optional) Specifies a working directory for this backend server. If specified, the YAZ frontend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init). element host (optional) Specifies the virtual host for this server. If this is specified a client must specify this host string in order to use this backend. element cql2rpn (optional) Specifies a filename that includes CQL to RPN conversion for this backend server. See &reference-tools-cql-map;. If given, the backend server will only "see" a Type-1/RPN query. element ccl2rpn (optional) Specifies a filename that includes CCL to RPN conversion for this backend server. See &reference-tools-ccl-qualifiers;. If given, the backend server will only "see" a Type-1/RPN query. element stylesheet (optional) Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one. If none is given, then if the client does not specify one, then no stylesheet reference is part of the SRU HTTP response. element client_query_charset (optional) If specified, a conversion from the character set given to UTF-8 is performed by the generic frontend server. It is only executed for Z39.50 search requests (SRU/Solr are assumed to be UTF-8 encoded already). element docpath (optional) Specifies a path for local file access using HTTP. All URLs with a leading prefix (/ excluded) that matches the value of docpath are used for file access. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/xsl will result in a local file access. element explain (optional) Specifies SRW/SRU ZeeRex content for this server. Copied verbatim to the client. As things are now, some of the Explain content seem redundant because host information, etc. is also stored elsewhere. element maximumrecordsize (optional) Specifies maximum record size/message size, in bytes. This value also serves as the maximum size of incoming packages (for Record Updates etc). It's the same value as that given by the -k option. element retrievalinfo (optional) Enables the retrieval facility to support conversions and specifications of record formats/types. See for more information. The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket. We name the TCP/IP server public and the other server internal. tcp:@:9900 unix:/var/tmp/socket server1.mydomain /var/www/s1 config.cfg server2.mydomain /var/www/s2 config.cfg ../etc/pqf.properties server2.mydomain 9900 a /var/www/s3 config.cfg ]]> There are three configured backend servers. The first two servers, "server1" and "server2", can be reached by both listener addresses. "server1" is reached by all (two) since no listenref attribute is specified. "server2" is reached by the two listeners specified. In order to distinguish between the two, a virtual host has been specified for each server in the host elements. For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small). The third server, "server3" can only be reached via listener "internal". yaz-5.34.4/doc/indexdata.html0000664000175000017500000000543614754707607011522 Appendix E. About Index Data

Appendix E. About Index Data

Index Data is a consulting and software-development enterprise that specializes in library and information management systems. Our interests and expertise span a broad range of related fields, and one of our primary, long-term objectives is the development of a powerful information management system with open network interfaces and hyper-media capabilities.

We make this software available free of charge, on a fairly unrestrictive license; as a service to the networking community, and to further the development of quality software for open network communication.

We'll be happy to answer questions about the software, and about ourselves in general.

The Hacker's Jargon File has the following to say about the use of the prefix "YA" in the name of a software product.

[ Yet Another. adj. 1. Of your own work: A humorous allusion often used in titles to acknowledge that the topic is not original, though the content is. As in "Yet Another AI Group" or "Yet Another Simulated Annealing Algorithm". 2. Of others' work: Describes something of which there are already far too many. ]

yaz-5.34.4/doc/yaz-icu.10000664000175000017500000001260414754707605010327 '\" t .\" Title: yaz-icu .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-ICU" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-icu \- YAZ ICU utility .SH "SYNOPSIS" .HP \w'\fByaz\-icu\fR\ 'u \fByaz\-icu\fR [\-c\ \fIconfig\fR] [\-p\ \fIopt\fR] [\-s] [\-x] [infile] .SH "DESCRIPTION" .PP \fByaz\-icu\fR is a utility which demonstrates the ICU chain module of yaz\&. (yaz/icu\&.h)\&. .PP The utility can be used in two ways\&. It may read some text using an XML configuration for configuring ICU and show text analysis\&. This mode is triggered by option \-c which specifies the configuration to be used\&. The input file is read from standard input or from a file if infile is specified\&. .PP The utility may also show ICU information\&. This is triggered by option \-p\&. .SH "OPTIONS" .PP \-c \fIconfig\fR .RS 4 Specifies the file containing ICU chain configuration which is XML based\&. .RE .PP \-p \fItype\fR .RS 4 Specifies extra information to be printed about the ICU system\&. If \fItype\fR is c then ICU converters are printed\&. If \fItype\fR is l, then available locales are printed\&. If \fItype\fR is t, then available transliterators are printed\&. .RE .PP \-s .RS 4 Specifies that output should include sort key as well\&. Note that sort key differs between ICU versions\&. .RE .PP \-x .RS 4 Specifies that output should be XML based rather than "text" based\&. .RE .SH "ICU CHAIN CONFIGURATION" .PP The ICU chain configuration specifies one or more rules to convert text data into tokens\&. The configuration format is XML based\&. .PP The toplevel element must be named icu_chain\&. The icu_chain element has one required attribute locale which specifies the ICU locale to be used in the conversion steps\&. .PP The icu_chain element must include elements where each element specifies a conversion step\&. The conversion is performed in the order in which the conversion steps are specified\&. Each conversion element takes one attribute: rule which serves as argument to the conversion step\&. .PP The following conversion elements are available: .PP casemap .RS 4 Converts case (and rule specifies how): .PP l .RS 4 Lower case using ICU function u_strToLower\&. .RE .PP u .RS 4 Upper case using ICU function u_strToUpper\&. .RE .PP t .RS 4 To title using ICU function u_strToTitle\&. .RE .PP f .RS 4 Fold case using ICU function u_strFoldCase\&. .RE .sp .RE .PP display .RS 4 This is a meta step which specifies that a term/token is to be displayed\&. This term is retrieved in an application using function icu_chain_token_display (yaz/icu\&.h)\&. .RE .PP transform .RS 4 Specifies an ICU transform rule using a transliterator Identifier\&. The rule attribute is the transliterator Identifier\&. See \m[blue]\fBICU Transforms\fR\m[]\&\s-2\u[1]\d\s+2 for more information\&. .RE .PP transliterate .RS 4 Specifies a rule\-based transliterator\&. The rule attribute is the custom transformation rule to be used\&. See \m[blue]\fBICU Transforms\fR\m[]\&\s-2\u[1]\d\s+2 for more information\&. .RE .PP tokenize .RS 4 Breaks / tokenizes a string into components using ICU functions ubrk_open, ubrk_setText, \&.\&. \&. The rule is one of: .PP l .RS 4 Line\&. ICU: UBRK_LINE\&. .RE .PP s .RS 4 Sentence\&. ICU: UBRK_SENTENCE\&. .RE .PP w .RS 4 Word\&. ICU: UBRK_WORD\&. .RE .PP c .RS 4 Character\&. ICU: UBRK_CHARACTER\&. .RE .PP t .RS 4 Title\&. ICU: UBRK_TITLE\&. .RE .sp .RE .PP join .RS 4 Joins tokens into one string\&. The rule attribute is the joining string, which may be empty\&. The join conversion element was added in YAZ 4\&.2\&.49\&. .RE .SH "EXAMPLES" .PP The following command analyzes text in file text using ICU chain configuration chain\&.xml: .sp .if n \{\ .RS 4 .\} .nf cat text | yaz\-icu \-c chain\&.xml .fi .if n \{\ .RE .\} .sp The chain\&.xml might look as follows: .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .PP \fByaz\fR(7) .PP \m[blue]\fBICU Home\fR\m[]\&\s-2\u[2]\d\s+2 .PP \m[blue]\fBICU Transforms\fR\m[]\&\s-2\u[1]\d\s+2 .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 ICU Transforms .RS 4 \%http://userguide.icu-project.org/transforms/general .RE .IP " 2." 4 ICU Home .RS 4 \%http://www.icu-project.org/ .RE yaz-5.34.4/doc/asn.preparing.html0000664000175000017500000001514614754707607012327 2. Preparing PDUs

2. Preparing PDUs

A structure representing a complex ASN.1 type doesn't in itself contain the members of that type. Instead, the structure contains pointers to the members of the type. This is necessary, in part, to allow a mechanism for specifying which of the optional structure (SEQUENCE) members are present, and which are not. It follows that you will need to somehow provide space for the individual members of the structure, and set the pointers to refer to the members.

The conversion routines don't care how you allocate and maintain your C structures - they just follow the pointers that you provide. Depending on the complexity of your application, and your personal taste, there are at least three different approaches that you may take when you allocate the structures.

You can use static or automatic local variables in the function that prepares the PDU. This is a simple approach, and it provides the most efficient form of memory management. While it works well for flat PDUs like the InitRequest, it will generally not be sufficient for say, the generation of an arbitrarily complex RPN query structure.

You can individually create the structure and its members using the malloc(2) function. If you want to ensure that the data is freed when it is no longer needed, you will have to define a function that individually releases each member of a structure before freeing the structure itself.

You can use the odr_malloc() function (see Section 2, “Using ODR” for details). When you use odr_malloc(), you can release all of the allocated data in a single operation, independent of any pointers and relations between the data. The odr_malloc() function is based on a "nibble-memory" scheme, in which large portions of memory are allocated, and then gradually handed out with each call to odr_malloc(). The next time you call odr_reset(), all of the memory allocated since the last call is recycled for future use (actually, it is placed on a free-list).

You can combine all of the methods described here. This will often be the most practical approach. For instance, you might use odr_malloc() to allocate an entire structure and some of its elements, while you leave other elements pointing to global or per-session default variables.

The Z39.50 ASN.1 module provides an important aid in creating new PDUs. For each of the PDU types (say, Z_InitRequest), a function is provided that allocates and initializes an instance of that PDU type for you. In the case of the InitRequest, the function is simply named zget_InitRequest(), and it sets up reasonable default value for all of the mandatory members. The optional members are generally initialized to null pointers. This last aspect is very important: it ensures that if the PDU definitions are extended after you finish your implementation (to accommodate new versions of the protocol, say), you won't get into trouble with uninitialized pointers in your structures. The functions use odr_malloc() to allocate the PDUs and its members, so you can free everything again with a single call to odr_reset(). We strongly recommend that you use the zget_* functions whenever you are preparing a PDU (in a C++ API, the zget_ functions would probably be promoted to constructors for the individual types).

The prototype for the individual PDU types generally look like this:

    Z_<type> *zget_<type>(ODR o);
   

e.g.:

    Z_InitRequest *zget_InitRequest(ODR o);
   

The ODR handle should generally be your encoding stream, but it needn't be.

As well as the individual PDU functions, a function zget_APDU() is provided, which allocates a top-level Z-APDU of the type requested:

    Z_APDU *zget_APDU(ODR o, int which);
   

The which parameter is (of course) the discriminator belonging to the Z_APDU CHOICE type. All of the interface described here is provided by the Z39.50 ASN.1 module, and you access it through the proto.h header file.

yaz-5.34.4/doc/gfs-options.xml0000664000175000017500000001634214631643521011647 -a file Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr. -S Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users. -1 Like -S but after one session the server exits. This mode is for debugging only. -T Operate the server in threaded mode. The server creates a thread for each connection rather than fork a process. Only available on UNIX systems that offer POSIX threads. -s Use the SR protocol (obsolete). -z Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports. -l file The logfile. -c config A user option that serves as a specifier for some sort of configuration, usually a filename. The argument to this option is transferred to member configname of the statserv_options_block. -f vconfig This specifies an XML file that describes one or more YAZ frontend virtual servers. -C fname Sets SSL certificate file name for server (PEM). -v level The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}. -u uid Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port. -w dir The server changes to this directory before listening to incoming connections. This option is useful when the server is operating from the inetd daemon (see -i). -p pidfile Specifies that the server should write its Process ID to the file given by pidfile. A typical location would be /var/run/yaz-ztest.pid. -i Use this to make the the server run from the inetd server (UNIX only). -D Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground. -install Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel. -installa Use this to install the server as an NT service and mark it as "auto-start. Control the server by going to the Services in the Control Panel. -remove Use this to remove the server from the NT services (Windows NT/2000/XP only). -t minutes Idle session timeout, in minutes. -k size Maximum record size/message size, in kilobytes. -K Forces no-keepalive for HTTP sessions. By default GFS will keep sessions alive for HTTP 1.1 sessions (as defined by the standard). Using this option will force GFS to close the connection for each operation. -r size Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB). -d daemon Set name of daemon to be used in hosts access file. See hosts_access 5 and tcpd 8 . -m time-format Sets the format of time-stamps in the log-file. Specify a string in the input format to strftime(). -V Display YAZ version and exit. yaz-5.34.4/doc/yaz-log.70000664000175000017500000002164614754707605010344 '\" t .\" Title: yaz-log .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Conventions and miscellaneous .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-LOG" "7" "02/17/2025" "YAZ 5.34.4" "Conventions and miscellaneous" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-log \- Log handling in all yaz\-based programs .SH "SYNOPSIS" .HP \w'\fByaz\-XXXX\fR\ 'u \fByaz\-XXXX\fR [\fB\-v\ \fR\fB\fIloglevel,\&.\&.\&.\fR\fR] [\fB\-l\ \fR\fB\fIlogfile\fR\fR] .SH "DESCRIPTION" .PP All YAZ\-based programs use a common log subsystem, and should support common command line options for controlling it\&. This man page documents those\&. .PP .SH "OPTIONS" .PP \-l\fI logfile\fR .RS 4 Specify the file where the log is to be written\&. If none is specified, stderr is used\&. The log is appended to this file\&. If the file grows overly large, it is silently rotated: It is renamed to \fIlogfile\fR\&.1, \fIlogfile\fR\&.2, \&.\&., 9 (old such file is deleted), and a new file is opened\&. The limit defaults to 1GB, but can be set by the program\&. The rotating limit can be specified with option \-r for the YAZ frontend server (yaz\-ztest)\&. .sp Rotation can also be implicitly enabled by using a filename which gets changed for a given date, due to substitutions as given by the strftime(3) function\&. .RE .PP \-v\fI loglevel\fR .RS 4 Specify the logging level\&. The argument is a set of log level names, separated by commas (no whitespace!), optionally preceded by a \*(Aq\-\*(Aq to negate that level\&. Most programs have their own default, often containing fatal,warn,log, and some application\-specific values\&. The default list can be cleared with the word none, or individual bits can be removed by prefixing them with a dash \*(Aq\-\*(Aq\&. .RE .SH "LOG LEVELS TO CONTROL LOGGING" .PP Some of the log levels control the way the log is written\&. .PP flush causes the log to be flushed after every write\&. This can have serious implications to performance, and should not be used in production\&. On the other hand, when debugging a program crash, this can be extremely useful\&. The option debug implies flush as well\&. .PP notime prevents the writing of time stamps\&. This is intended for automatic test scripts, which should produce predictable log files that are easy to compare\&. .SH "GENERAL LOG LEVELS IN YAZ ITSELF" .PP YAZ itself uses the following log levels: .PP fatal for fatal errors, that prevent further execution of the program\&. .PP warn for warnings about things that should be corrected\&. .PP debug for debugging\&. This flag may be used temporarily when developing or debugging yaz, or a program that uses yaz\&. It is practically deprecated, you should be defining and using your own log levels (see below)\&. .PP all turns on almost all hard\-coded log levels\&. .PP loglevel logs information about the log levels used by the program\&. Every time the log level is changed, lists all bits that are on\&. Every time a module asks for its log bits, this is logged\&. This can be used for getting an idea of what log levels are available in any program that uses yaz\-log\&. Start the program with \-v none,loglevel, and do some common operations with it\&. Another way is to grep for \fByaz_log_module_level\fR in the source code, as in .sp .if n \{\ .RS 4 .\} .nf find \&. \-name \*(Aq*\&.[ch]\*(Aq \-print | xargs grep yaz_log_module_level | grep \*(Aq"\*(Aq | cut \-d\*(Aq"\*(Aq \-f2 | sort \-u .fi .if n \{\ .RE .\} .PP eventl, malloc, nmem, odr are used internally for debugging yaz\&. .PP .SH "LOG LEVELS FOR CLIENTS" .PP zoom logs the calls to the zoom API, which may be useful in debugging client applications\&. .SH "LOG LEVELS FOR SERVERS" .PP server logs the server functions on a high level, starting up, listening on a port, etc\&. .PP session logs individual sessions (connections)\&. .PP request logs a one\-liner for each request (init, search, etc\&.)\&. .PP requestdetail logs the details of every request, before it is passed to the back\-end, and the results received from it\&. .PP Each server program (zebra, etc\&.) is supposed to define its own log levels in addition to these\&. As they depend on the server in question, they can not be described here\&. See above how to find out about them\&. .SH "LOGGING EXAMPLES" .PP See what log levels yaz\-ztest is using: .sp .if n \{\ .RS 4 .\} .nf yaz\-ztest \-1 \-v none,loglevel 14:43:29\-23/11 [loglevel] Setting log level to 4096 = 0x00001000 14:43:29\-23/11 [loglevel] Static log bit 00000001 \*(Aqfatal\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00000002 \*(Aqdebug\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00000004 \*(Aqwarn\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00000008 \*(Aqlog\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00000080 \*(Aqmalloc\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00000800 \*(Aqflush\*(Aq is off 14:43:29\-23/11 [loglevel] Static log bit 00001000 \*(Aqloglevel\*(Aq is ON 14:43:29\-23/11 [loglevel] Static log bit 00002000 \*(Aqserver\*(Aq is off 14:43:29\-23/11 [loglevel] Dynamic log bit 00004000 \*(Aqsession\*(Aq is off 14:43:29\-23/11 [loglevel] Dynamic log bit 00008000 \*(Aqrequest\*(Aq is off 14:44:13\-23/11 yaz\-ztest [loglevel] returning log bit 0x4000 for \*(Aqsession\*(Aq 14:44:13\-23/11 yaz\-ztest [loglevel] returning log bit 0x2000 for \*(Aqserver\*(Aq 14:44:13\-23/11 yaz\-ztest [loglevel] returning NO log bit for \*(Aqeventl\*(Aq 14:44:20\-23/11 yaz\-ztest [loglevel] returning log bit 0x4000 for \*(Aqsession\*(Aq 14:44:20\-23/11 yaz\-ztest [loglevel] returning log bit 0x8000 for \*(Aqrequest\*(Aq 14:44:20\-23/11 yaz\-ztest [loglevel] returning NO log bit for \*(Aqrequestdetail\*(Aq 14:44:20\-23/11 yaz\-ztest [loglevel] returning NO log bit for \*(Aqodr\*(Aq 14:44:20\-23/11 yaz\-ztest [loglevel] returning NO log bit for \*(Aqztest\*(Aq .fi .if n \{\ .RE .\} .PP See the details of the requests for yaz\-ztest .sp .if n \{\ .RS 4 .\} .nf \&./yaz\-ztest \-1 \-v requestdetail 14:45:35\-23/11 yaz\-ztest [server] Adding static Z3950 listener on tcp:@:9999 14:45:35\-23/11 yaz\-ztest [server] Starting server \&./yaz\-ztest pid=32200 14:45:38\-23/11 yaz\-ztest [session] Starting session from tcp:127\&.0\&.0\&.1 (pid=32200) 14:45:38\-23/11 yaz\-ztest [requestdetail] Got initRequest 14:45:38\-23/11 yaz\-ztest [requestdetail] Id: 81 14:45:38\-23/11 yaz\-ztest [requestdetail] Name: YAZ 14:45:38\-23/11 yaz\-ztest [requestdetail] Version: 2\&.0\&.28 14:45:38\-23/11 yaz\-ztest [requestdetail] Negotiated to v3: srch prst del extendedServices namedresults scan sort 14:45:38\-23/11 yaz\-ztest [request] Init from \*(AqYAZ\*(Aq (81) (ver 2\&.0\&.28) OK 14:45:39\-23/11 yaz\-ztest [requestdetail] Got SearchRequest\&. 14:45:39\-23/11 yaz\-ztest [requestdetail] ResultSet \*(Aq1\*(Aq 14:45:39\-23/11 yaz\-ztest [requestdetail] Database \*(AqDefault\*(Aq 14:45:39\-23/11 yaz\-ztest [requestdetail] RPN query\&. Type: Bib\-1 14:45:39\-23/11 yaz\-ztest [requestdetail] term \*(Aqfoo\*(Aq (general) 14:45:39\-23/11 yaz\-ztest [requestdetail] resultCount: 7 14:45:39\-23/11 yaz\-ztest [request] Search Z: @attrset Bib\-1 foo OK:7 hits 14:45:41\-23/11 yaz\-ztest [requestdetail] Got PresentRequest\&. 14:45:41\-23/11 yaz\-ztest [requestdetail] Request to pack 1+1 1 14:45:41\-23/11 yaz\-ztest [requestdetail] pms=1048576, mrs=1048576 14:45:41\-23/11 yaz\-ztest [request] Present: [1] 1+1 OK 1 records returned .fi .if n \{\ .RE .\} .sp .SH "LOG FILENAME EXAMPLES" .PP A file with format my_YYYYMMDD\&.log (where Y, M, D is year, month, and day digits) is given as follows: \-l my_%Y%m%d\&.log \&. And since the filename is depending on day, rotation will occur on midnight\&. .PP A weekly log could be specified as \-l my_%Y%U\&.log\&. .SH "FILES" .PP \fIprefix\fR/include/yaz/log\&.h \fIprefix\fR/src/log\&.c .SH "SEE ALSO" .PP \fByaz\fR(7) \fByaz-ztest\fR(8) \fByaz-client\fR(1) \fBstrftime\fR(3) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/yaz-marcdump.10000664000175000017500000001450514754707605011361 '\" t .\" Title: yaz-marcdump .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-MARCDUMP" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-marcdump \- MARC record dump utility .SH "SYNOPSIS" .HP \w'\fByaz\-marcdump\fR\ 'u \fByaz\-marcdump\fR [\fB\-i\ \fR\fB\fIformat\fR\fR] [\fB\-o\ \fR\fB\fIformat\fR\fR] [\fB\-f\ \fR\fB\fIfrom\fR\fR] [\fB\-t\ \fR\fB\fIto\fR\fR] [\fB\-l\ \fR\fB\fIspec\fR\fR] [\fB\-c\ \fR\fB\fIcfile\fR\fR] [\fB\-s\ \fR\fB\fIprefix\fR\fR] [\fB\-C\ \fR\fB\fIsize\fR\fR] [\fB\-O\ \fR\fB\fIoffset\fR\fR] [\fB\-L\ \fR\fB\fIlimit\fR\fR] [\fB\-n\fR] [\fB\-p\fR] [\fB\-r\fR] [\fB\-v\fR] [\fB\-V\fR] [file...] .SH "DESCRIPTION" .PP \fByaz\-marcdump\fR reads MARC records from one or more files\&. It parses each record and supports output in line\-format, ISO2709, \m[blue]\fBMARCXML\fR\m[]\&\s-2\u[1]\d\s+2, \m[blue]\fBMARC\-in\-JSON\fR\m[]\&\s-2\u[2]\d\s+2, \m[blue]\fBMarcXchange\fR\m[]\&\s-2\u[3]\d\s+2 as well as Hex output\&. .PP This utility parses records ISO2709(raw MARC), line format, MARC\-in\-JSON format as well as XML if that is structured as MARCXML/MarcXchange\&. .PP MARC\-in\-JSON encoding/decoding is supported in YAZ 5\&.0\&.5 and later\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP As of YAZ 2\&.1\&.18, OAI\-MARC is no longer supported\&. OAI\-MARC is deprecated\&. Use MARCXML instead\&. .sp .5v .RE .PP By default, each record is written to standard output in a line format with newline for each field, $x for each sub\-field x\&. The output format may be changed with option \-o, .PP \fByaz\-marcdump\fR can also be requested to perform character set conversion of each record\&. .SH "OPTIONS" .PP \-i \fIformat\fR .RS 4 Specifies input format\&. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC\-in\-JSON)\&. .RE .PP \-o \fIformat\fR .RS 4 Specifies output format\&. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC\-in\-JSON)\&. .RE .PP \-f \fIfrom\fR .RS 4 Specify the character set of the input MARC record\&. Should be used in conjunction with option \-t\&. Refer to the yaz\-iconv man page for supported character sets\&. .RE .PP \-t \fIto\fR .RS 4 Specify the character set of the output\&. Should be used in conjunction with option \-f\&. Refer to the yaz\-iconv man page for supported character sets\&. .RE .PP \-l \fIleaderspec\fR .RS 4 Specify a simple modification string for MARC leader\&. The \fIleaderspec\fR is a list of pos=value pairs, where pos is an integer offset (0 \- 23) for leader\&. Value is either a quoted string or an integer (character value in decimal)\&. Pairs are comma separated\&. For example, to set leader at offset 9 to a, use 9=\*(Aqa\*(Aq\&. .RE .PP \-s \fIprefix\fR .RS 4 Writes a chunk of records to a separate file with prefix given, i\&.e\&. splits a record batch into files with only at most "chunk" ISO2709 records per file\&. By default chunk is 1 (one record per file)\&. See option \-C\&. .RE .PP \-C \fIchunksize\fR .RS 4 Specifies chunk size; to be used conjunction with option \-s\&. .RE .PP \-O \fIoffset\fR .RS 4 Integer offset for at what position records whould be written\&. 0=first record, 1=second, \&.\&. With \-L option, this allows a specific range of records to be processed\&. .RE .PP \-L \fIlimit\fR .RS 4 Integer limit for how many records should at most be written\&. With \-O option, this allows a specific range of records to be processed\&. .RE .PP \-p .RS 4 Makes yaz\-marcdump print record number and input file offset of each record read\&. .RE .PP \-n .RS 4 MARC output is omitted so that MARC input is only checked\&. .RE .PP \-r .RS 4 Writes to stderr a summary about number of records read by yaz\-marcdump\&. .RE .PP \-v .RS 4 Writes more information about the parsing process\&. Useful if you have ill\-formatted ISO2709 records as input\&. .RE .PP \-V .RS 4 Prints YAZ version\&. .RE .SH "EXAMPLES" .PP The following command converts MARC21/USMARC in MARC\-8 encoding to MARC21/USMARC in UTF\-8 encoding\&. Leader offset 9 is set to \*(Aqa\*(Aq\&. Both input and output records are ISO2709 encoded\&. .sp .if n \{\ .RS 4 .\} .nf yaz\-marcdump \-f MARC\-8 \-t UTF\-8 \-o marc \-l 9=97 marc21\&.raw >marc21\&.utf8\&.raw .fi .if n \{\ .RE .\} .PP The same records may be converted to MARCXML instead in UTF\-8: .sp .if n \{\ .RS 4 .\} .nf yaz\-marcdump \-f MARC\-8 \-t UTF\-8 \-o marcxml marc21\&.raw >marcxml\&.xml .fi .if n \{\ .RE .\} .PP Turbo MARC is a compact XML notation with same semantics as MARCXML, but which allows for faster processing via XSLT\&. In order to generate Turbo MARC records encoded in UTF\-8 from MARC21 (ISO), one could use: .sp .if n \{\ .RS 4 .\} .nf yaz\-marcdump \-f MARC8 \-t UTF8 \-o turbomarc \-i marc marc21\&.raw >out\&.xml .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP \fIprefix\fR/bin/yaz\-marcdump .PP \fIprefix\fR/include/yaz/marcdisp\&.h .SH "SEE ALSO" .PP \fByaz\fR(7) .PP \fByaz-iconv\fR(1) .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 MARCXML .RS 4 \%https://www.loc.gov/standards/marcxml/ .RE .IP " 2." 4 MARC-in-JSON .RS 4 \%https://rossfsinger.com/blog/2010/09/a-proposal-to-serialize-marc-in-json/ .RE .IP " 3." 4 MarcXchange .RS 4 \%https://www.loc.gov/standards/iso25577/ .RE yaz-5.34.4/doc/entities.ent0000664000175000017500000000137014753417062011210 ODR"> COMSTACK"> ZOOM"> "> "> yaz-5.34.4/doc/credits.html0000664000175000017500000000724614754707607011217 Appendix F. Credits

Appendix F. Credits

This appendix lists individuals that have contributed in the development of YAZ. Some have contributed with code, while others have provided bug fixes or suggestions. If we're missing somebody, of if you, for whatever reason, don't like to be listed here, let us know.

  • Gary Anderson

  • Dimitrios Andreadis

  • Morten Bøgeskov

  • Rocco Carbone

  • Matthew Carey

  • Hans van Dalen

  • Irina Dijour

  • Larry E. Dixson

  • Hans van den Dool

  • Mads Bondo Dydensborg

  • Franck Falcoz

  • Kevin Gamiel

  • Morten Garkier Hendriksen

  • Morten Holmqvist

  • Ian Ibbotson

  • Shigeru Ishida

  • Heiko Jansen

  • David Johnson

  • Oleg Kolobov

  • Giannis Kosmas

  • Kang-Jin Lee

  • Pieter Van Lierop

  • Stefan Lohrum

  • Ronald van der Meer

  • Thomas W. Place

  • Peter Popovics

  • Jacob Chr. Poulsen

  • Ko van der Sloot

  • Mike Taylor

  • Rustam T. Usmanov

  • Charles Woodfield

  • Tom André Øverland

  • Hugh McMaster

  • Guillaume Jactat

yaz-5.34.4/doc/yaz-ztest-man.xml0000664000175000017500000001305514631643521012120 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-ztest 8 System management commands yaz-ztest Z39.50/SRU Test Server &gfs-synopsis; DESCRIPTION yaz-ztest is a Z39.50/SRU test server that uses the YAZ generic front-end server (GFS) API. The server acts as a real Z39.50/SRU server but does not use a database. It returns a random hit count and returns a subset of a few built-in records. The listener-spec consists of a transport mode followed by a colon, followed by a listener address. The transport mode is either tcp, unix, or ssl. For TCP and SSL, an address has the form: hostname | IP-number [ : portnumber ] For UNIX local socket, the address is the filename of the local socket. OPTIONS &gfs-options; TESTING yaz-ztest normally returns a random hit count between 0 and 24. However, if a query term includes leading digits, then the integer value of that term is used as hit count. This allows testers to return any number of hits. yaz-ztest includes 24 MARC records for testing. Hit counts exceeding 24 will make yaz-ztest return the same record batch over and over. So record at position 1, 25, 49, etc. are equivalent. For XML, if no element set is given or element has value "marcxml", MARCXML is returned (each of the 24 dummy records converted from ISO2709 to XML). For element set OP, then OPAC XML is returned. yaz-ztest may also return predefined XML records (for testing). This is enabled if YAZ_ZTEST_XML_FETCH environment variable is defined. A record is fetched from a file (one record per file). The path for the filename is FE.d.xml where F is the YAZ_ZTEST_XML_FETCH value (possibly empty), E is element-set, d is record position (starting from 1). The following databases are honored by yaz-ztest: Default, slow and db.* (all databases with prefix "db"). Any other database will make yaz-ztest return diagnostic 109: "Database unavailable". Options for search may be included in the form or URL get arguments included as part of the Z39.50 database name. The following database options are present: search-delay, present-delay, fetch-delay and seed. The former, delay type options, specify a fake delay (sleep) that yaz-ztest will perform when searching, presenting, fetching records respectively. The value of the delay may either be a fixed floating point value which specifies the delay in seconds. Alternatively the value may be given as two floating point numbers separated by colon, which will make yaz-ztest perform a random sleep between the first and second number. The database parameter seed takes an integer as value. This will call srand with this integer to ensure that the random behavior can be re-played. Suppose we want searches to take between 0.1 and 0.5 seconds and a fetch to take 0.2 second. To access test database Default we'd use: Default?search-delay=0.1:0.5&fetch-delay=0.2. GFS CONFIGURATION AND VIRTUAL HOSTS &gfs-virtual; FILES yaz-<version>/ztest/yaz-ztest.c yaz-<version>/include/yaz/backend.h SEE ALSO yaz 7 yaz-log 7 yaz-5.34.4/doc/std-oid-table.xml0000664000175000017500000007361314754707604012044 Name Class Constant / OID BER TRANSYN yaz_oid_transyn_ber 2.1.1 ISO2709 TRANSYN yaz_oid_transyn_iso2709 1.0.2709.1.1 ISOILL-1 GENERAL yaz_oid_general_isoill_1 1.0.10161.2.1 Z-APDU ABSYN yaz_oid_absyn_z_apdu 2.1 Z-BASIC APPCTX yaz_oid_appctx_z_basic 1.1 Bib-1 ATTSET yaz_oid_attset_bib_1 Z3950_PREFIX.3.1 Exp-1 ATTSET yaz_oid_attset_exp_1 Z3950_PREFIX.3.2 Ext-1 ATTSET yaz_oid_attset_ext_1 Z3950_PREFIX.3.3 CCL-1 ATTSET yaz_oid_attset_ccl_1 Z3950_PREFIX.3.4 GILS ATTSET yaz_oid_attset_gils Z3950_PREFIX.3.5 GILS-attset ATTSET yaz_oid_attset_gils_attset Z3950_PREFIX.3.5 STAS-attset ATTSET yaz_oid_attset_stas_attset Z3950_PREFIX.3.6 Collections-attset ATTSET yaz_oid_attset_collections_attset Z3950_PREFIX.3.7 CIMI-attset ATTSET yaz_oid_attset_cimi_attset Z3950_PREFIX.3.8 Geo-attset ATTSET yaz_oid_attset_geo_attset Z3950_PREFIX.3.9 ZBIG ATTSET yaz_oid_attset_zbig Z3950_PREFIX.3.10 Util ATTSET yaz_oid_attset_util Z3950_PREFIX.3.11 XD-1 ATTSET yaz_oid_attset_xd_1 Z3950_PREFIX.3.12 Zthes ATTSET yaz_oid_attset_zthes Z3950_PREFIX.3.13 Fin-1 ATTSET yaz_oid_attset_fin_1 Z3950_PREFIX.3.14 Dan-1 ATTSET yaz_oid_attset_dan_1 Z3950_PREFIX.3.15 Holdings ATTSET yaz_oid_attset_holdings Z3950_PREFIX.3.16 MARC ATTSET yaz_oid_attset_marc Z3950_PREFIX.3.17 Bib-2 ATTSET yaz_oid_attset_bib_2 Z3950_PREFIX.3.18 ZeeRex ATTSET yaz_oid_attset_zeerex Z3950_PREFIX.3.19 Thesaurus-attset ATTSET yaz_oid_attset_thesaurus_attset Z3950_PREFIX.3.1000.81.1 IDXPATH ATTSET yaz_oid_attset_idxpath Z3950_PREFIX.3.1000.81.2 EXTLITE ATTSET yaz_oid_attset_extlite Z3950_PREFIX.3.1000.81.3 Bib-1 DIAGSET yaz_oid_diagset_bib_1 Z3950_PREFIX.4.1 Diag-1 DIAGSET yaz_oid_diagset_diag_1 Z3950_PREFIX.4.2 Diag-ES DIAGSET yaz_oid_diagset_diag_es Z3950_PREFIX.4.3 Diag-General DIAGSET yaz_oid_diagset_diag_general Z3950_PREFIX.4.3 Unimarc RECSYN yaz_oid_recsyn_unimarc Z3950_PREFIX.5.1 Intermarc RECSYN yaz_oid_recsyn_intermarc Z3950_PREFIX.5.2 CCF RECSYN yaz_oid_recsyn_ccf Z3950_PREFIX.5.3 USmarc RECSYN yaz_oid_recsyn_usmarc Z3950_PREFIX.5.10 MARC21 RECSYN yaz_oid_recsyn_marc21 Z3950_PREFIX.5.10 UKmarc RECSYN yaz_oid_recsyn_ukmarc Z3950_PREFIX.5.11 Normarc RECSYN yaz_oid_recsyn_normarc Z3950_PREFIX.5.12 Librismarc RECSYN yaz_oid_recsyn_librismarc Z3950_PREFIX.5.13 Danmarc RECSYN yaz_oid_recsyn_danmarc Z3950_PREFIX.5.14 Finmarc RECSYN yaz_oid_recsyn_finmarc Z3950_PREFIX.5.15 MAB RECSYN yaz_oid_recsyn_mab Z3950_PREFIX.5.16 Canmarc RECSYN yaz_oid_recsyn_canmarc Z3950_PREFIX.5.17 SBN RECSYN yaz_oid_recsyn_sbn Z3950_PREFIX.5.18 Picamarc RECSYN yaz_oid_recsyn_picamarc Z3950_PREFIX.5.19 Ausmarc RECSYN yaz_oid_recsyn_ausmarc Z3950_PREFIX.5.20 Ibermarc RECSYN yaz_oid_recsyn_ibermarc Z3950_PREFIX.5.21 Carmarc RECSYN yaz_oid_recsyn_carmarc Z3950_PREFIX.5.22 Malmarc RECSYN yaz_oid_recsyn_malmarc Z3950_PREFIX.5.23 JPmarc RECSYN yaz_oid_recsyn_jpmarc Z3950_PREFIX.5.24 SWEmarc RECSYN yaz_oid_recsyn_swemarc Z3950_PREFIX.5.25 SIGLEmarc RECSYN yaz_oid_recsyn_siglemarc Z3950_PREFIX.5.26 ISDSmarc RECSYN yaz_oid_recsyn_isdsmarc Z3950_PREFIX.5.27 RUSmarc RECSYN yaz_oid_recsyn_rusmarc Z3950_PREFIX.5.28 Hunmarc RECSYN yaz_oid_recsyn_hunmarc Z3950_PREFIX.5.29 NACSIS-CATP RECSYN yaz_oid_recsyn_nacsis_catp Z3950_PREFIX.5.30 FINMARC2000 RECSYN yaz_oid_recsyn_finmarc2000 Z3950_PREFIX.5.31 MARC21-fin RECSYN yaz_oid_recsyn_marc21_fin Z3950_PREFIX.5.32 Explain RECSYN yaz_oid_recsyn_explain Z3950_PREFIX.5.100 SUTRS RECSYN yaz_oid_recsyn_sutrs Z3950_PREFIX.5.101 OPAC RECSYN yaz_oid_recsyn_opac Z3950_PREFIX.5.102 Summary RECSYN yaz_oid_recsyn_summary Z3950_PREFIX.5.103 GRS-0 RECSYN yaz_oid_recsyn_grs_0 Z3950_PREFIX.5.104 GRS-1 RECSYN yaz_oid_recsyn_grs_1 Z3950_PREFIX.5.105 Extended RECSYN yaz_oid_recsyn_extended Z3950_PREFIX.5.106 Fragment RECSYN yaz_oid_recsyn_fragment Z3950_PREFIX.5.107 pdf RECSYN yaz_oid_recsyn_pdf Z3950_PREFIX.5.109.1 postscript RECSYN yaz_oid_recsyn_postscript Z3950_PREFIX.5.109.2 html RECSYN yaz_oid_recsyn_html Z3950_PREFIX.5.109.3 tiff RECSYN yaz_oid_recsyn_tiff Z3950_PREFIX.5.109.4 gif RECSYN yaz_oid_recsyn_gif Z3950_PREFIX.5.109.5 jpeg RECSYN yaz_oid_recsyn_jpeg Z3950_PREFIX.5.109.6 png RECSYN yaz_oid_recsyn_png Z3950_PREFIX.5.109.7 mpeg RECSYN yaz_oid_recsyn_mpeg Z3950_PREFIX.5.109.8 sgml RECSYN yaz_oid_recsyn_sgml Z3950_PREFIX.5.109.9 tiff-b RECSYN yaz_oid_recsyn_tiff_b Z3950_PREFIX.5.110.1 wav RECSYN yaz_oid_recsyn_wav Z3950_PREFIX.5.110.2 SQL-RS RECSYN yaz_oid_recsyn_sql_rs Z3950_PREFIX.5.111 SOIF RECSYN yaz_oid_recsyn_soif Z3950_PREFIX.5.1000.81.2 JSON RECSYN yaz_oid_recsyn_json Z3950_PREFIX.5.1000.81.3 XML RECSYN yaz_oid_recsyn_xml Z3950_PREFIX.5.109.10 text-XML RECSYN yaz_oid_recsyn_text_xml Z3950_PREFIX.5.109.10 application-XML RECSYN yaz_oid_recsyn_application_xml Z3950_PREFIX.5.109.11 Resource-1 RESFORM yaz_oid_resform_resource_1 Z3950_PREFIX.7.1 Resource-2 RESFORM yaz_oid_resform_resource_2 Z3950_PREFIX.7.2 UNIverse-Resource-Report RESFORM yaz_oid_resform_universe_resource_report Z3950_PREFIX.7.1000.81.1 Prompt-1 ACCFORM yaz_oid_accform_prompt_1 Z3950_PREFIX.8.1 Des-1 ACCFORM yaz_oid_accform_des_1 Z3950_PREFIX.8.2 Krb-1 ACCFORM yaz_oid_accform_krb_1 Z3950_PREFIX.8.3 Persistent set EXTSERV yaz_oid_extserv_persistent_set Z3950_PREFIX.9.1 Persistent query EXTSERV yaz_oid_extserv_persistent_query Z3950_PREFIX.9.2 Periodic query EXTSERV yaz_oid_extserv_periodic_query Z3950_PREFIX.9.3 Item order EXTSERV yaz_oid_extserv_item_order Z3950_PREFIX.9.4 Database Update (first version) EXTSERV yaz_oid_extserv_database_update_first_version Z3950_PREFIX.9.5 Database Update (second version) EXTSERV yaz_oid_extserv_database_update_second_version Z3950_PREFIX.9.5.1 Database Update EXTSERV yaz_oid_extserv_database_update Z3950_PREFIX.9.5.1.1 exp. spec. EXTSERV yaz_oid_extserv_exp__spec_ Z3950_PREFIX.9.6 exp. inv. EXTSERV yaz_oid_extserv_exp__inv_ Z3950_PREFIX.9.7 Admin EXTSERV yaz_oid_extserv_admin Z3950_PREFIX.9.1000.81.1 searchResult-1 USERINFO yaz_oid_userinfo_searchresult_1 Z3950_PREFIX.10.1 CharSetandLanguageNegotiation USERINFO yaz_oid_userinfo_charsetandlanguagenegotiation Z3950_PREFIX.10.2 UserInfo-1 USERINFO yaz_oid_userinfo_userinfo_1 Z3950_PREFIX.10.3 MultipleSearchTerms-1 USERINFO yaz_oid_userinfo_multiplesearchterms_1 Z3950_PREFIX.10.4 MultipleSearchTerms-2 USERINFO yaz_oid_userinfo_multiplesearchterms_2 Z3950_PREFIX.10.5 DateTime USERINFO yaz_oid_userinfo_datetime Z3950_PREFIX.10.6 Proxy USERINFO yaz_oid_userinfo_proxy Z3950_PREFIX.10.1000.81.1 Cookie USERINFO yaz_oid_userinfo_cookie Z3950_PREFIX.10.1000.81.2 Client-IP USERINFO yaz_oid_userinfo_client_ip Z3950_PREFIX.10.1000.81.3 Scan-Set USERINFO yaz_oid_userinfo_scan_set Z3950_PREFIX.10.1000.81.4 Facet-1 USERINFO yaz_oid_userinfo_facet_1 Z3950_PREFIX.10.1000.81.5 Espec-1 ELEMSPEC yaz_oid_elemspec_espec_1 Z3950_PREFIX.11.1 Variant-1 VARSET yaz_oid_varset_variant_1 Z3950_PREFIX.12.1 WAIS-schema SCHEMA yaz_oid_schema_wais_schema Z3950_PREFIX.13.1 GILS-schema SCHEMA yaz_oid_schema_gils_schema Z3950_PREFIX.13.2 Collections-schema SCHEMA yaz_oid_schema_collections_schema Z3950_PREFIX.13.3 Geo-schema SCHEMA yaz_oid_schema_geo_schema Z3950_PREFIX.13.4 CIMI-schema SCHEMA yaz_oid_schema_cimi_schema Z3950_PREFIX.13.5 Update ES SCHEMA yaz_oid_schema_update_es Z3950_PREFIX.13.6 Holdings SCHEMA yaz_oid_schema_holdings Z3950_PREFIX.13.7 Zthes SCHEMA yaz_oid_schema_zthes Z3950_PREFIX.13.8 thesaurus-schema SCHEMA yaz_oid_schema_thesaurus_schema Z3950_PREFIX.13.1000.81.1 Explain-schema SCHEMA yaz_oid_schema_explain_schema Z3950_PREFIX.13.1000.81.2 TagsetM TAGSET yaz_oid_tagset_tagsetm Z3950_PREFIX.14.1 TagsetG TAGSET yaz_oid_tagset_tagsetg Z3950_PREFIX.14.2 STAS-tagset TAGSET yaz_oid_tagset_stas_tagset Z3950_PREFIX.14.3 GILS-tagset TAGSET yaz_oid_tagset_gils_tagset Z3950_PREFIX.14.4 Collections-tagset TAGSET yaz_oid_tagset_collections_tagset Z3950_PREFIX.14.5 CIMI-tagset TAGSET yaz_oid_tagset_cimi_tagset Z3950_PREFIX.14.6 thesaurus-tagset TAGSET yaz_oid_tagset_thesaurus_tagset Z3950_PREFIX.14.1000.81.1 Explain-tagset TAGSET yaz_oid_tagset_explain_tagset Z3950_PREFIX.14.1000.81.2 Zthes-tagset TAGSET yaz_oid_tagset_zthes_tagset Z3950_PREFIX.14.8 Charset-3 NEGOT yaz_oid_negot_charset_3 Z3950_PREFIX.15.3 Charset-4 NEGOT yaz_oid_negot_charset_4 Z3950_PREFIX.15.4 Charset-ID NEGOT yaz_oid_negot_charset_id Z3950_PREFIX.15.1000.81.1 CQL USERINFO yaz_oid_userinfo_cql Z3950_PREFIX.16.2 UCS-2 GENERAL yaz_oid_general_ucs_2 1.0.10646.1.0.2 UCS-4 GENERAL yaz_oid_general_ucs_4 1.0.10646.1.0.4 UTF-16 GENERAL yaz_oid_general_utf_16 1.0.10646.1.0.5 UTF-8 GENERAL yaz_oid_general_utf_8 1.0.10646.1.0.8 OCLC-userInfo USERINFO yaz_oid_userinfo_oclc_userinfo Z3950_PREFIX.10.1000.17.1 XML-ES EXTSERV yaz_oid_extserv_xml_es Z3950_PREFIX.9.1000.105.4 yaz-5.34.4/doc/comstack.client.html0000664000175000017500000000506514754707607012640 4. Client Side

4. Client Side

    int cs_connect(COMSTACK handle, void *address);
   

Initiate a connection with the target at address (more on addresses below). The function will return 0 on success, and 1 if the operation does not complete immediately (this will only happen on a nonblocking endpoint). In this case, use cs_rcvconnect to complete the operation, when select(2) or poll(2) reports input pending on the association.

    int cs_rcvconnect(COMSTACK handle);
   

Complete a connect operation initiated by cs_connect(). It will return 0 on success; 1 if the operation has not yet completed (in this case, call the function again later); -1 if an error has occurred.

yaz-5.34.4/doc/future.html0000664000175000017500000000572014754707607011067 Chapter 10. Future Directions

Chapter 10. Future Directions

We have a new and better version of the front-end server on the drawing board. Resources and external commitments will govern when we'll be able to do something real with it. Features should include greater flexibility, greater support for access/resource control, and easy support for Explain (possibly with Zebra as an extra database engine).

YAZ is a BER toolkit and as such should support all protocols out there based on that. We'd like to see running ILL applications. It shouldn't be that hard. Another thing that would be interesting is LDAP. Maybe a generic framework for doing IR using both LDAP and Z39.50 transparently.

The SOAP implementation is incomplete. In the future we hope to add more features to it. Perhaps make a WSDL/XML Schema compiler. The authors of libxml2 are already working on XML Schema and RELAX NG compilers so this may not be too hard.

It would be neat to have a proper module mechanism for the Generic Frontend Server so that backend would be dynamically loaded (as shared objects / DLLs).

Other than that, YAZ generally moves in the directions which appear to make the most people happy (including ourselves, as prime users of the software). If there's something you'd like to see in here, then drop us a note and let's see what we can come up with.

yaz-5.34.4/doc/yaz-illclient.html0000664000175000017500000000735314754707607012341 yaz-illclient

Name

yaz-illclient — ILL client

Synopsis

yaz-illclient [-f filename] [-v loglevel] [-D name=value...] [-o] [-u user] [-p password] [-V] [server-addr]

DESCRIPTION

yaz-illclient is a client which sends an ISO ILL request to a remote server and decodes the response from it. Exactly one server address ( server-addr ) must be specified.

OPTIONS

-f filename]

Specify filename.

-v loglevel]

Specify the log level.

-D name=value]

Defines name & value pair.

-o

Enable OCLC authentication.

-u user]

Specify user.

-p password]

Specify password.

-V

Show yaz-illclient version.

EXAMPLES

None yet.

FILES

None yet.

SEE ALSO

yaz(7)

yaz-5.34.4/doc/comstack.common.html0000664000175000017500000002320114754707607012642 3. Common Functions

3. Common Functions

3.1. Managing Endpoints

     COMSTACK cs_create(CS_TYPE type, int blocking, int protocol);
    

Creates an instance of the protocol stack - a communications endpoint. The type parameter determines the mode of communication. At present the following values are supported:

tcpip_type

TCP/IP (BER over TCP/IP or HTTP over TCP/IP)

ssl_type

Secure Socket Layer (SSL). This COMSTACK is experimental and is not fully implemented. If HTTP is used, this effectively is HTTPS.

unix_type

Unix socket (unix only). Local Transfer via file socket. See unix(7).

The cs_create function returns a null-pointer if a system error occurs. The blocking parameter should be '1' if you wish the association to operate in blocking mode, and '0' otherwise. The protocol field should be PROTO_Z3950 or PROTO_HTTP. Protocol PROTO_SR is no longer supported.

     void cs_close(COMSTACK handle);
    

Closes the connection (as elegantly as the lower layers will permit), and releases the resources pointed to by the handle parameter. The handle should not be referenced again after this call.

Note

We really need a soft disconnect, don't we?

3.2. Data Exchange

     int cs_put(COMSTACK handle, char *buf, int len);
    

Sends buf down the wire. In blocking mode, this function will return only when a full buffer has been written, or an error has occurred. In nonblocking mode, it's possible that the function will be unable to send the full buffer at once, which will be indicated by a return value of 1. The function will keep track of the number of octets already written; you should call it repeatedly with the same values of buf and len, until the buffer has been transmitted. When a full buffer has been sent, the function will return 0 for success. The return value -1 indicates an error condition (see below).

     int cs_get(COMSTACK handle, char **buf, int *size);
    

Receives a PDU or HTTP Response from the peer. Returns the number of bytes read. In nonblocking mode, it is possible that not all of the packet can be read at once. In this case, the function returns 1. To simplify the interface, the function is responsible for managing the size of the buffer. It will be reallocated if necessary to contain large packages, and will sometimes be moved around internally by the subsystem when partial packages are read. Before calling cs_get for the first time, the buffer can be initialized to the null pointer, and the length should also be set to 0 (cs_get will perform a malloc(2) on the buffer for you). When a full buffer has been read, the size of the package is returned (which will always be greater than 1). The return value -1 indicates an error condition.

See also the cs_more() function below.

     int cs_more(COMSTACK handle);
    

The cs_more() function should be used in conjunction with cs_get and select(2). The cs_get() function will sometimes (notably in the TCP/IP mode) read more than a single protocol package off the network. When this happens, the extra package is stored by the subsystem. After calling cs_get(), and before waiting for more input, You should always call cs_more() to check if there's a full protocol package already read. If cs_more() returns 1, cs_get() can be used to immediately fetch the new package. For the mOSI subsystem, the function should always return 0, but if you want your stuff to be protocol independent, you should use it.

Note

The cs_more() function is required because the RFC1729-method does not provide a way of separating individual PDUs, short of partially decoding the BER. Some other implementations will carefully nibble at the packet by calling read(2) several times. This was felt to be too inefficient (or at least clumsy) - hence the call for this extra function.

     int cs_look(COMSTACK handle);
    

This function is useful when you're operating in nonblocking mode. Call it when select(2) tells you there's something happening on the line. It returns one of the following values:

CS_NONE

No event is pending. The data found on the line was not a complete package.

CS_CONNECT

A response to your connect request has been received. Call cs_rcvconnect to process the event and to finalize the connection establishment.

CS_DISCON

The other side has closed the connection (or maybe sent a disconnect request - but do we care? Maybe later). Call cs_close to close your end of the association as well.

CS_LISTEN

A connect request has been received. Call cs_listen to process the event.

CS_DATA

There's data to be found on the line. Call cs_get to get it.

Note

You should be aware that even if cs_look() tells you that there's an event event pending, the corresponding function may still return and tell you there was nothing to be found. This means that only part of a package was available for reading. The same event will show up again, when more data has arrived.

     int cs_fileno(COMSTACK h);
    

returns the file descriptor of the association. Use this when file-level operations on the endpoint are required (select(2) operations, specifically).

yaz-5.34.4/doc/yaz-man.xml0000664000175000017500000000766014631643521010756 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz 7 Conventions and miscellaneous yaz Z39.50 toolkit. DESCRIPTION YAZ is a C/C++ programmer's toolkit supporting the development of Z39.50v3 clients and servers. The YAZ toolkit offers several different levels of access to the ISO23950/Z39.50, SRU Solr (client only) and ILL protocols. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement. COPYRIGHT Copyright © ©right-year; Index Data. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. SEE ALSO yaz-client 1 , yaz-ztest 8 , yaz-config 8 , zoomsh 1 bib1-attr 7 YAZ manual ( /usr/share/doc/yaz) YAZ home page. Z39.50 Maintenance Agency Page. yaz-5.34.4/doc/soap.srw.html0000664000175000017500000001107414754707607011330 4. SRU

4. SRU

SRU SOAP is just one implementation of a SOAP handler as described in the previous section. The encoder/decoder handler for SRU is defined as follows:

#include <yaz/srw.h>

int yaz_srw_codec(ODR o, void * pptr,
                  Z_SRW_GDU **handler_data,
                  void *client_data, const char *ns);
    

Here, Z_SRW_GDU is either searchRetrieveRequest or a searchRetrieveResponse.

Note

The xQuery and xSortKeys are not handled yet by the SRW implementation of YAZ. Explain is also missing. Future versions of YAZ will include these features.

The definition of searchRetrieveRequest is:

typedef struct {

#define Z_SRW_query_type_cql  1
#define Z_SRW_query_type_xcql 2
#define Z_SRW_query_type_pqf  3
    int query_type;
    union {
        char *cql;
        char *xcql;
        char *pqf;
    } query;

#define Z_SRW_sort_type_none 1
#define Z_SRW_sort_type_sort 2
#define Z_SRW_sort_type_xSort 3
    int sort_type;
    union {
        char *none;
        char *sortKeys;
        char *xSortKeys;
    } sort;
    int  *startRecord;
    int  *maximumRecords;
    char *recordSchema;
    char *recordPacking;
    char *database;
} Z_SRW_searchRetrieveRequest;
    

Please observe that data of type xsd:string is represented as a char pointer (char *). A null pointer means that the element is absent. Data of type xsd:integer is represented as a pointer to an int (int *). Again, a null pointer is used for absent elements.

The SearchRetrieveResponse has the following definition.

typedef struct {
    int * numberOfRecords;
    char * resultSetId;
    int * resultSetIdleTime;

    Z_SRW_record *records;
    int num_records;

    Z_SRW_diagnostic *diagnostics;
    int num_diagnostics;
    int *nextRecordPosition;
} Z_SRW_searchRetrieveResponse;
    

The num_records and num_diagnostics is number of returned records and diagnostics respectively, and also correspond to the "size of" arrays records and diagnostics.

A retrieval record is defined as follows:

typedef struct {
    char *recordSchema;
    char *recordData_buf;
    int recordData_len;
    int *recordPosition;
} Z_SRW_record;
    

The record data is defined as a buffer of some length so that data can be of any type. SRW 1.0 currently doesn't allow for this (only XML), but future versions might do.

And, a diagnostic as:

typedef struct {
    int  *code;
    char *details;
} Z_SRW_diagnostic;
    

yaz-5.34.4/doc/yaz-iconv.10000664000175000017500000001021514754707605010661 '\" t .\" Title: yaz-iconv .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-ICONV" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-iconv \- YAZ Character set conversion utility .SH "SYNOPSIS" .HP \w'\fByaz\-iconv\fR\ 'u \fByaz\-iconv\fR [\fB\-f\ \fR\fB\fIfrom\fR\fR] [\fB\-t\ \fR\fB\fIto\fR\fR] [\fB\-v\fR] [file...] .SH "DESCRIPTION" .PP \fByaz\-iconv\fR converts data in the character set specified by \fIfrom\fR to output in the character set as specified by \fIto\fR\&. .PP This \fByaz\-iconv\fR utility is similar to the \fBiconv\fR found on many POSIX systems (Glibc, Solaris, etc)\&. .PP If no \fIfile\fR is specified, \fByaz\-iconv\fR reads from standard input\&. .SH "OPTIONS" .PP \-f\fIfrom\fR] .RS 4 Specify the character set \fIfrom\fR of the input file\&. Should be used in conjunction with option \-t\&. .RE .PP \-t\fIto\fR] .RS 4 Specify the character set \fIof\fR of the output\&. Should be used in conjunction with option \-f\&. .RE .PP \-v .RS 4 Print more information about the conversion process\&. .RE .SH "ENCODINGS" .PP The yaz\-iconv command and the API as defined in yaz/yaz\-iconv\&.h is a wrapper for the library system call iconv\&. But YAZ\*(Aq iconv utility also implements conversions on its own\&. The table below lists characters sets (or encodings) that are supported by YAZ\&. Each character set is marked with either \fIencode\fR or \fIdecode\fR\&. If an encoding is encode\-enabled, YAZ may convert \fIto\fR the designated encoding\&. If an encoding is decode\-enabled, YAZ may convert \fIfrom\fR the designated encoding\&. .PP marc8 (encode, decode) .RS 4 The \m[blue]\fBMARC8\fR\m[]\&\s-2\u[1]\d\s+2 encoding as defined by the Library of Congress\&. Most MARC21/USMARC records use this encoding\&. .RE .PP marc8s (encode, decode) .RS 4 Like MARC8 but conversion prefers non\-combined characters in the Latin\-1 plane over combined characters\&. .RE .PP marc8lossy (encode) .RS 4 Lossy encoding of MARC\-8\&. .RE .PP marc8lossless (encode) .RS 4 Lossless encoding of MARC8\&. .RE .PP utf8 (encode, decode) .RS 4 The most commonly used UNICODE encoding on the Internet\&. .RE .PP iso8859\-1 (encode, decode) .RS 4 ISO\-8859\-1, AKA Latin\-1\&. .RE .PP iso5426 (decode) .RS 4 ISO 5426\&. Some MARC records (UNIMARC) use this encoding\&. .RE .PP iso5428:1984 (encode, decode) .RS 4 ISO 5428:1984\&. .RE .PP advancegreek (encode, decode) .RS 4 An encoding for Greek in use by some vendors (Advance)\&. .RE .PP danmarc (decode) .RS 4 \m[blue]\fBDanmarc (in danish)\fR\m[]\&\s-2\u[2]\d\s+2 is an encoding based on UNICODE which is used for DanMARC2 records\&. .RE .SH "EXAMPLES" .PP The following command converts from ISO\-8859\-1 (Latin\-1) to UTF\-8\&. .sp .if n \{\ .RS 4 .\} .nf yaz\-iconv \-f ISO\-8859\-1 \-t UTF\-8 output\&.lst .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP \fIprefix\fR/bin/yaz\-iconv .PP \fIprefix\fR/include/yaz/yaz\-iconv\&.h .SH "SEE ALSO" .PP yaz(7) iconv(1) .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 MARC8 .RS 4 \%https://www.loc.gov/marc/specifications/speccharmarc8.html .RE .IP " 2." 4 Danmarc (in danish) .RS 4 \%http://www.kat-format.dk/danMARC2/Danmarc2.4.htm .RE yaz-5.34.4/doc/common/0000775000175000017500000000000014754707607010233 5yaz-5.34.4/doc/common/id.man.xsl0000664000175000017500000000031314631643672012041 yaz-5.34.4/doc/common/print.dsl.in0000664000175000017500000000107214631643672012413 ]> (define preferred-mediaobject-notations (list "PDF" "JPG" "JPEG" "PNG" "linespecific")) (define preferred-mediaobject-extensions (list "pdf" "jpg" "jpeg" "png")) yaz-5.34.4/doc/common/Makefile.am0000664000175000017500000000044614631643672012206 commondir=$(datadir)/doc/$(PACKAGE)$(PACKAGE_SUFFIX)/common common_DATA = style1.css id.png SUPPORTFILES = \ xml.dcl \ common.ent \ id.eps \ ref2dbinc.xsl \ stripref.xsl \ print.dsl.in \ id.htmlhelp.xsl \ id.man.xsl \ id.tkl.xsl EXTRA_DIST = $(SUPPORTFILES) $(common_DATA) README yaz-5.34.4/doc/common/style1.css0000664000175000017500000000152014631643672012077 .table table { border-collapse: collapse; border: 1px solid black; border-spacing: 0; width: 94%; margin-left: auto; margin-right: 0; } .author { font-style: italic; } .TITLEPAGE, .LOT, .TOC { font-family: sans-serif; } .TITLEPAGE .abstract { margin: 0 150px 1em 0; font-style: oblique; } .TITLEPAGE .inlinemediaobject { position: absolute; top: 60px; right: 0; width: 140px; } .table th { padding: 3px 6px; border: 1px solid black; } .table td { text-align: left; padding: 3px 6px; } h1, h3, h4 { font-family: sans-serif; } h2 { font-style: italic; font-family: sans-serif; } .figure b, .table b, .example b { font-style: italic; } .example , .figure { margin-left: 3%; } .screen, .synopsis, .programlisting { margin-left: 6%; padding: 4px; border-style: solid; border-width: 1px; border-color: #bbbbbb; } yaz-5.34.4/doc/common/common.ent0000664000175000017500000002636614753417070012157 Anders Sønderberg"> Adam Dickmeiss"> Heikki Levanto"> Marc Cromme"> Mike Taylor"> Sebastian Hammer"> Index Data ApS"> Metaproxy"> YAZ"> YazPP"> Yazproxy"> Zebra"> Zebra 1.3"> Zebra 2.0"> ANSI"> API"> APT"> BIB-1"> CQL"> DOM"> Explain"> EXSLT"> GET"> GRS-1"> IDXPATH"> MARC"> MARCXML"> MARC21"> OAI"> PHP"> POST"> PQF"> PQN"> REST"> RPN"> SGML"> SOAP"> SRU"> SRW"> SUTRS"> USMARC"> XML"> XPATH"> XSLT"> Z39.50"> ZOOM"> ZeeReX"> ZOOM.NET"> yaz-5.34.4/doc/common/id.png0000664000175000017500000006147314631643672011263 ‰PNG  IHDRxð+´sRGB®Îé pHYsgŸÒRtIMEÙ±Þ— IDATxÚì½i°l[RöeæZ{ïª:ÓÞ½ož»ûu7tÓØÉ2 a…ÀÈÈÈV ÛüÃ’-ý1G¶C¿›PØa›  ‡$!,‹ Œ›¦^7Ý@Oožî}÷Ý{Ï=S {¯µ2Ó?Ö®sê¯qóóùUœ¨S§Î®ª]¹ÖÊÌõ}_æ&wÇÿç›#+ÅÎj xîEüÄ÷O~÷SÏéÊÒ@ƇÀ+¹h¿½Ó¹ößý=ßþ_þWß1™!F ÊJЛk ¾5~ áw£¯ÓÐèW2 “Ÿú_¾ú·þöy±ó—½uý*c0¦jèè`' s7 †´¿5Ù¯ÞjÛægþÁßûÞï},´ ¤€žw!Ÿz×У¡³bò‹ÿÇ õ¯þ- h!-©¾žÑÑÁ§/ ‰-ëQÓuaµÚoÚü ¿ð?÷_|î‘{‚¹¼c Í_ÿñq1ÇOþ÷ÿãöì"Ðu[(tLMà.p¤ ƒ4A"‡È!25"1ëââùG'íÎju²3»$<ýß~æçníC˜¡(†¼ ü§6ôñqŸ>ûìÁ#@ýw¿3¿;£ÿ„¹¶Ô]ïï|ûŒöÍ)웯w~wFoZ•¿Ö¿ª­ý4²…õ|ç»bææx8Þ †o·NmGgœ^ÏeÀ힉[ {v–h¬§w }›•iÃ-ÐúÉu¾Qÿ;Zá¶1©íN—Cëqr¼ƒo_Ÿ¡É«e Pr#¸8œ °o ÀÝœŒÜn_Êã`¶f@Aïd[ýÁÇÐZ hà#ì&@Cè€\ ði™‚8Ôá˜Z!Ϥ…B07‚ÅÆŒû]CêH)1¼d¬šš·›±Uƒ(P@Êq¢+K ÙÝ>çf†ùÖ´mš¢XBÁÝgÁ;5›þú íÄnæ š†s·í( ep6NNƒÑ`<€2À^ÐÆs 9:¹¦X6¼5_§4lmmÙ)ÐAìöÎ …Š`Ø÷xôÉ=n\².Ë!Ð`PÀaYÍüÌ0ru"ä´C^2šé}ð¾ïo|6i/]¼Ð4PŠ… wsâw7,€v‰øÎïùæ¡\L °:wqv°ƒÄ êm Sa  ËãåóÕ¾3ôþ»þ܃qÁf5Z AÞõÑg·Ù ÿéßü÷?t_hàæÁÍ€ òŠÕœA aìœËÂl^ü á2ëZÇ<—ƒ‡<÷Ã?ü׺ Üဈpè]Picg²XâÏþ™'~ögzÖÉlº½µ½‡²„&h)´¸«{ ÈÀóç™ižì­¦]8®}è#ÿʯþ܇¾i‚9ˆÀLx'¹fÆ_9»F©~úï?û‡ôÜÍý[ïÃä äx;óƒÃ·vwwc "ýÞ¿ôÝßû}Ï8 '‹²»¸3Ãaêè]C0©½‡9àëMÆ){M ?Êüv¤ƒÖG2Õ?ílmùí›ùÿŸgkÓdñm†€(Du³Ñ§›ôÛ¸ -½£Y¬?•¡Þ®ç5þ¼‰ZÜfJ!¯ðs5ä)Ëå·ÛœÖÏ󻆾ÃU3PÖÞo(h ݹÀ‚1tÃÊw ›·wðìþú Mëí5$ 8uʣʀÇp@xC±Áw‚ãýæ0¼3mý§˜ÑÕ åN?Ko“ zMÜgÁŽÏLy ¥ž-‘w]Ns M€ Øm{9Â:wf§H§x¿‡{ä‰wŒÇ;ÝM CßËcà° 6ƒñš§Ñ©½FN– à ÷}^Dϯ'µAÒ6ÇÂ^S ôµiÊOƒ4ï¨*Eɧ/Òõ‡óøF¬Fé♤n_÷ºf¿C¬8 i1 \ B€šéÛá³ïF¨©ßñn·²´<Ð:*úY®í0»B”ŒÐÀ‰r‹; F#Òzúu.;6â@ì•o'7ÃìŒéqWí0ȫà €¢¹1z˜˜ÀÙ ê`d‚,€8œ×¼‘ãõ9ªÁ t¾¦þïih¡”Ä¡•@N©s€\˜œœêãñtǹ\…d8•T/QMOº¶•Ôñ†»‘ PæXG+ĺ*\] Quët‘ÇLqƒóÒfcJY¡,­§3Bkf’G- Ø+ƒIÄ@€(Œu@Rß?–õ”©ìÄYxqAV6&f˜©®‰JVóö{rO¨babÜ ­gG0#Ü>_˜Áw8Ô;×õøwñ1òzªÙè”È™‰@›y.¤‘|Ð:ÜkcÂX7E§câ€mø‡SÓЩò»Îø4<(ãŽ-.Öþ…YÓú›!Î㌦²Nwã½¾´ÈZ¢XO#ek"ÿ‰ÐÒ™Iýk·¹¯æ»"€ŽÙ‹ŠÁ ´wù9¾#Ô ÷Ú‚å̾¶áOÏ| [Gm6Ô2>£° ¯ÍâÆÇÕcÒ†ë§ÃÆ(@Ïh7޼W0$Y¬Ðµ÷#f0ÃÛ¦ v½ ì´^°›{ÅÑÐr8Á«‚РÀ3zƒæp9œ!§‹ïš^¾ahŒöl i#Š®Ï×hã_õµuðx#Eõ—„ʯ-[)[;ÁÊ:AtNG?ãà{ú'~âWŸýýϹ3œ‰H$º“™‘WÏ\œŒŽ@ÖeP9=+'Àeý5mýÍÎõ$ *5’W²TJvî>þo}èáox É2sRÊf94M.0;¼ ùí»Fe&ëH×ÁGPˆ¯%O•i·oM0'(Nb @Jp²×)"†àF•ÆÈ<~®={²Ý¸¼º(|þsoý³_yV 3S%fæ %3Z£ÂÈFÊ0Cd› $PÕ16£1?­§ <ÌÀ@Èábd`Es‚Kýò¡ö#Oɪ—3 ©_ˆ…,1Ln¼öîgªÂ,ÕúŽÂ‚S£àÆXFC›Â2ÃàF¶^a À` eq%ed°ÄYÍŠÀÈ‚#*‚û¸þª¿ªy­£UPê(v´e<™zÀÛd¼£©!žÅØÚ»!Ä-+ì ^1 €±G`ˆ€Â30TçOÎÕ ëÐWç{]I‘<0"P Ü×a]Aáç¶[üV™{c¡…‹/µ¯Su!lú(Ó»‹‘²÷ÊhŠã°NJ¬H)ìÊvšà‘3;ŒÆ7 ÊÀ}`Ä¡„!ÀÉZµ` 5€ì¥ñž€¶€,£eƒb‹AŽz&b÷ΤƒºC‚R1Ãk eÇd–l–‰Xœ‹BD¸yŒï^׳¸ûe@"vew$ _ÞÄÝb쬞瓞섆lê—ÇÐH}ò·~ÛÇ¿ÿ¾#§“_þÅ_ûÌ'¯8„Ð: (ƒð0 8RñØ“ýÈò׺Žoüæoüîoýúo϶wÿÒ÷ýÅ?óíÿêW^øéÿ饹9!›ÁrÐ!hš¸·&±ÐÍÖc{÷íðtu2o§“›áÖ›7Žû¸Ý…fÚ«¦`€,Ä\ŒŒœƒ4‘ÎñÎùÉìéG#œŒ´Àê¹kÏïÌsô'.RÜÜCãa—\sÔ Wyüþ§ãs_øò¯ïðv×MÓý»ç÷yü­Å­«ýQD”ÅÆd‰„ÅЖêO°Ö±‹æƒ—»zõêÕ”&¾Ç†%Œq¬ÞûÙÄÜ[>óþ§ÿÆ´¾ð…/~ú“/5³U€4ò)0Mƒ™Wyé—~îŸÜXôd‚!ƒ î¤EJ‰¦*´ç?Äïx¾½œaöÄŧö/~eÿ…—o¼iÙÃ,ªYaÀM‚•*U(N…B”K{—Â#K† „Ð…­ C1‡Iˆ­»©ZKaÖÌ–É Ø%4¼õ$·Gí·¯¿b»Ûó7>ò4creØ‚dLnbìµèÌXªgÈ.,Qd&Ó§ñdß.¯·$¸‰ÛXV›÷.ð‰båÙÙ@0"Ã]‘0 ƒ¼êB©¨u+‚±¥”a ,» ´ 6ø¶oýÀG?òÄoÿ?Ÿ™NÕ „E E- &`q ˜ee_ ¶ÜΦ¿ü⯠Ë~ø‘‡žÚ~êñ ï;ârcu´$/ÄIL+Øâ,n¢±€^sIÅè->yáކy’Ôwùļ;)^4i %0ÑÀ‰T°5›ÍSþÒ•—{h÷™Ù^Ø>Þß¿ñ¾ïA\úíùçß¼u.ÎTG` î„}]™S'¤:(›»oaM¬8„Åüžt>¿Ö^‹ÁˆAŒ(ÙWÇë€ÇÌá%Ú7”O>.?ôüåV iAˆˆÂh Ubl"H,Ã@|a›Ø;ü•+/¿0¼ö¶·Ê0ˆ»¸‰Ì̩(›²5QˆÀ¢_-ûÕ¼_õšÏÉsï9£xqòBÂ@JÁéxµøÒÍ×nâäãßû¡ ?=yèåáÕ—Þx­ÛΗ‹cÍÌÉŒàä^Q¬ HZ4‚Õ´2DŒQøî{‚t ¬f‡„DÐâè‹.8 ià¾p¬b“×uàQó¦£Y@£)›‚ Ïþþ§ø¿üÏ<ñÌÉ~/†€vµ€c’ ÆYhî…J­ÚÈe~ý-?Âù¨\?x“‘/‡½-ø´¤YIÓ’§%OJn-·šÅó"$̇€rÝ{î»ü±ÇŸúØcO¼ÿâ¥û$JßsêYœ[h£¹)Ú˜†,ÁrÜiÞ;7}G¿{ü‡Ï`ï;/¾7aþå+ÏaJ“VmEœ•“rrNÆÉi|`œ!…¢ æè… (ƒmtªwýðXÞCv;âbÄÊ0³’3RÀÂLdU¥OÈZöˆs”•ºFoRòþ/~ý÷?ûâÖ~ìÇþóÝ-q9Ú&¶1*z0AZ≹ 9gM 3'C8wá¼™‘ÃÃÄ4CGnäFîâÆnÁ-ØøÃ̱ ÌpOtßîKN.D'6ml„x†>/!à ‹Å‚Ó¦2_ö‹“åÜ‘fh®] !0ó­ýýsۻêg¸“+»±™òX}Sòs"MLpv5MÁï"ç «0ÁÝÝAÑÕàpg3$w‰m‹Ršbd†•À:Á”0c´F}Á‰H›áÜuÈF_yîÊÏþܯ*áûÿÊ'ž~¦°ä°Zæk-+€g™J; ``ÛͲg3=J{“Ý“9Ê aY’H¡PZ1 6  3'.d×qý‹¯é7¿úÉϼüù×÷÷ 5fðÖ ØÐ…¨Ãà ³f' ¦•ˆ¨?„É'îïüE}ó½»ÏÜ7ݳy¾´{yukµ-31"˜”` œ@p‰.‘ÛÅ0í¢€§Ô‘É™_Ýøa–î(b¢8¤Ò·±ëÚY°š£kv»¸•´b'3x†eXB2,€>ëwVhĶþå¯}êù¯”Ðàñ'àN)÷­„b+,!MäVРXN'¹,³&¦wÐH¯»ÍìáËø¦ÝR✉¹0)±;± Ç>•!gn±üdX-†!eu«¾Ý„Ð5M˱_ö«!u;[«œæóùSx ~æä>ûÆó·püäÅ'Îmïï4±Uu÷¨gT¯i–yR)…b4p&·âV§±òöÖœPhM®IKrÏny£æ’ú¡ŽHIªÙÚÐjÐK  L$…¥Æˆ|Ö5R€„aÊç^üÊ«¿úK¿‘ØÛÛs iÎkn ˜Î`î® â\œ[’+réW“¶Úö¡Ë—éîÑ¿õÖ["âe¡0’`YÐÌ&`¯c_à`âJ8ñB7 ªñšÜݵ¢¶m{öJa<úè£ïíž¾†·^¾yõÊbÿK‡/u˜>óÐû¶§³0íW¿+Sfw'ò¦¦ì@o/† MÓHìŒ[¶€ˆ`."}^dÃÔ!}I v!îÉK|ay² `¹@û"îÿþÞÏß÷ÿ…'߇Հ“c´ínÖ#…! n0°zPBH!âø£|LG)ˆ*ìÕþµkû×e§³†o£ÍœŒó~Œgm#[Ø}Ï…gôí+¸º\–ż7‡"µRO54Ñ£/Ó*v“KÍòçÞø£^”¶ÛWn\i÷¦»¸¼}~÷Æþ5jV›‰ŒÂ×q¾:À"‘Aoá`ÐÄÊo‹Í‡”I‹C]Ý׈«SFkH¿òþæ«WßДþð Ï4„© µÇD0„­…Ë´¹0O·>ùé/ýÐôÓªþ©O~Þå¡×oÿ‡?üß>ôèÞª`q¢7n,M‹8È,€ƒÔX3奧7ß*ÄÇœú’”²Z,—˹lµ³½­ƒaÉ6TNF Á7 ƒJ²WŽß¸ÙÜ´âTÈ»¸ìÅrE·Ýˆ8†\4õe6Ý‚€½†«WN^Yت˜NÚ.‹}õÚ+“ûOöûãe^mµÓ;Êj020Š„èðãÅñ+xm¹Z([6ópo['[#ç4Ò9V«ªh®\ßý_ürÌB{¾(¡¤‘UàÊ䨉M èŠù?ýÇÿšT “Ø\üO1<›sQ„I(€ Œl À•ÈÁ^Hýp9_Þ¼:Le>,Z â”–‹B3›œ ‹Z>.>òTlˆ%$æàä7Nn*¢4Ì\ȇc[Y ]ôyð’c$Ì,yH^TKRò«G×ÓÁâòÎNe¾Zì̶ŽòòÕ×ãÎd2iSî­÷ßkñÛœš 9€UY^=( +B};ÅDHX‚V¤‚êA,-ჱ#0œa¹ØÅ1mF(žÊèÍ XÔâÍQÙVGY·BØV/ cPKÎ! (™‘¹š¨]èÕ^JKDI$t,¢ä‹~»¶Æ%ÄHÁ wOšX ’+‰yg+$!ÎLDª9ÄVš )¹šw¦°;9Ñ~gÒYòžri©(B@CayÒS”‘‘[#ãNîav7¥OYˆ\äkô >¶¯FáF¸q ˜EÌ,ª­`Ù˜š@Óbš‘”+¼ÒÚ ú›¥\–>å­¤i˜ß’­KšVÈvO³©’W戃)u¡É% CADD$Nœ”œ¨ˆ“³ÇVJ?”’"KÖ""¡mœÎªÆk8"‚8†œ„yÊÈÁªÅ¡‹¦CJ}ÝÈ5MÃD}Ÿ<˜gÕ­í•–å°Úšn÷'‹cÓÉv7ï{‰¼µ=],—ƒ{Ó6nzÊÃݦd.9Qlµì'ÓÛɭ·üíÇÿ÷€©%iK&QÝ™¸€ ;& €T$^$™·òlÇ.ýƒŸø¥ÏýÃÏAΧR±‘=;a‹€Xb J©Š/wƒ÷%E„œ—p'g/®Ô6æœ#I°âCj@¼¦ŒÍ´ ù”oÓõ$¯,¢r”lª®# (0‚{&f&TC—Rˆƒ2ëd‘ršˆxß·QŒ°@â–ÍM–ýŒ8”6H“Ê”úºîFDVJ²wûFñ]†¾&Ï]ko0E’®08Dƒ*2q9›,L^˜²`pWxÛЮiZÄ› h"HÁ.ÈUÛ±F°6eÑVaZr!¯Uù¬4VdUšj3—:}`§”Ç„µÀé´¸Üïd”k¡ØZlL0B´Qåëieƒ¡öka%K›Ü?;2¯u-ÝwÝÎ4:þyoC Å“‘[va¨ÁƒSœ)Âj×?c@Ù]äTL,Á àFTšÌi€góÂÀ”¼nô®t&]¯ º ¬™„‘ýVÚ`Ó7V®Ü“k¯Úœµ­yãe|ª#Yÿ§þ%kÖ‘…Íâp@ ¶~Ÿõb ÊÎì¸Þs³Sšøm}´ eÌ%š ±E‰¨¦)@,N WKÌØë¶§NßZü 3+ZÄAk-V¥œn×S;Ó=h€èš·>5­÷ !£S+ûm\øéýÚÜ·Á’§d¸2UN1ø:Õª(seÄ‹œ}¨ÝKÐâ#T;ÿ¨½Ñ{,‚M‘cÇ¥#xt²à`°Âën2ÂZXK(ŒØZ76b±€BTY AjÞ†fýå8;»£Š¦NÕ½f¾FÄÁëDÂ0åõú¥MʊשUe:6㺌èt®Í=ÎD´.Æ8U˜È‚D\&öJŒ‘#9œQ˜*ËF¾Vx¬O #Þì`G­p·{ª/ïœÑÚŠFƒV""%cR7Ø•Ac>鯿¢€ƒ‰¥î&!(ŠÇu£5¦Ú¬êÒnçýÈA0v9¡¨fÊwöMÙОÊn›¹›‚¿«QUBc\æÌtF¨ãv_ïóQ©÷vï¶yþ§Ç3ùÛ²‡hª2ÈÆÏa'ÐYPeÄ0#Í …—DÉP\$$F!!¹6ux£IØÐY‰Än·Ù¨ñE!Pt‚”}œ}õÛ­9ÿê%«Ç¨TKTðF²Û#/ÆÖ|*—b‡2avD3qDß¼¢ô9ÊØ´ÌO]Æéú0Å ´n!¿ÛKÝ!Û…»×Ö•Npsªj´èdp'ÏÁÐ$(àÁ+ª SdõÕ-k¥ZõX¼Eæ0r¸‡µ¯ÿ NpΠ,>o·³õ|áÓv5 8Ö3ÚFì4æºäg…äÊJ£*•¬ú2€ÝŒ@Ž"€›Ä=ؘ„ؽ8¨Í9«<¶å 6ŒÂ(q>] d 6¿k‘± Yà„¤¸I AU‰:÷)hË¢¨õ1wœSœ¬Â–SŒƒ[P0˜AÑÑ®Ð%t ›ŽŠP+±Ç*cÑP„2TC3…+B n‹‹JÏ’ƒÉÉ$‹à}Ë=SH‘¨º:)qý©VG«ˆÆÒvK³ÂÞkj(úà$—à²rIl½PæàFž]¬Ù‚f±hÖªE³AƒØ îbÜ’ˆ65 ” ­"¤<éš¹”ë'ÄMV2y)%P„‘“°zöˆ½j–%¨Q©È+¶¹±")3/RðF ì&õëŽôy¨̸5ú„›¬Ú&9‹,†I¶ ¿xùá²:hºm“-r'ccr!F ’ÉBF4‰& ‘q}ldÅkÿž†U›Ö¸³ØPìâÄsA2¬UÊÈj9LDBhê¬g·ZÊêdˆq^ RÈ“•¤Ù´"žTLì,Ïѵd‰Sí¹gÛžl§“UK1PH}ªd“#Àà®f¡Æß*qû·¶&3™ö‹Cn95ÁÔ.Ѭ-qe‹Ìy£öÆÜNÚ!ÍË©9S¦eB²:>^lµÓù°¼ùÖkÍì¾Ü¯`yTéùZÜíND­Ñ–uS¶&RYÙ`ÅÐ2™+i"ùÆÆ$v{ØVÅõýÃvk2 H‹a›ÚFx&È­€¡kq«-†ÖúX‰ Ô©lw;ûÃb¡\sTwµµòÞ×WWÓÉ@s'u ì#„³âƒªYus0yJÞA.†ß½þ…iØBû?à“á•£—, IDATWÁàwˆùLÓÌŸyÿCÿñX㇕0,Ð4€c9ÿ·ÿÑ?ü­¿ûwòdÙ›AÍórd‹ÑÖJwsB=ƒÇ ùN° —’i¯©Vbܵ‰1S%å~ Ì]¼øÒsztüäå‡>€÷yû…+ó›Ùµnw$6­—Í:;2°;Âåvï)ÌÈÙÝKP÷Žì EÕ%’)bÁüqÜÿêÖ•ý7¯t±á”/6{ló¿ÿÌ?û®ïøáæ}Ï<Á G†+HÇò„µ0°nnA)D=Ë‚mÉVºv§IªnÆ*@±ŽQ,íÔÛöN¾rðÜþ¯=òßöžoÙÁÞï½öÇ/ͯ­hÛ˜LÕÃf¬JÒŽ¯ÞºvýðÍGèþ§»'ÿàÊç:`º-%ÌW)£ Ì·ë ‘3œ‘5‚XYBDä®`ÒµÖ¿.ú Ü*åc‚ß\_ö¿içf™ÛÂS´€i.D5$øÈŸùZ]ƒ‡±.ïÀ·–ó—ñÚǦœ¹ ‰ö6 ‰ˆŒ“Žé¥$C‰RJóùŽ®ëš¦<ç ©§1v aff®§åð¦;´}ç·±ÍÌ"b÷¨¨wƒ¥”cιë:U=°)¥@¬ª)%!jÛ–™K)ªo{‚Bë¨÷}of1F5K‚̈†F!ëŽ`†û†þà¹/­°úÀÓïÅP×s®çÆÌ1F3 RÓ;re8;ªÈÄêÓøåן?ÿÈî3ïyzž—“öœ×]çi5÷Gm7mšF­"8)a nÒ~øCp|´º~ã&S¬Ç¤YoïBàW^ûì+|+ô«=ñ²r3™æ~AÎcJ‹šŒÀ;»SOf'ÃÃ?ùhûÄþòè8®¾ù‰¿qãxÑïSôÐ…¡_r;‰F¾m¨È6e7Q#ž(HpÖ”]¹¨êVÐÀfXWò2sBYŠë,-ôƒ H»7 i5äv‚UòìÇ÷]Šøð?õ¿þÔåËpÇW¾zå«_yykk ôi,›÷ÖW?õâï¤Ü÷¾Ë´Y†ʪo¨é…œá›…S&î@Yq^"±Á’ Aꮚ2ÃmAWÆò‹$( ¤°!ê"æ/¾ùÂ!–÷?ö@[w‘Âê&bfîî„À6â,Z)/¸±Õ ¤–öûã°_¸öÒÞóGðÄx]ÙØ¡µÖj$' z@c˜–ýÍÿìGð¯ühÛàÂÅ•×ñßü×?©ÎÇ'‡Mœ%ê¨z£Z­6ø4ÚÞ…YÃÝjê^LYB±tJ²8ay¹¤óÝì›/ô2.?{ô×í9=»øÜ‡gyâòƒÃõåæBŒu"f.nêÆÎa3U]t&[D=A*LÞ`znzpóèÅþsÝà ~Z`z†xÖ²Þé´,ª“’&ì^À¤Eßã—á•ÿ±ÿbÙ{-zLy!»3õkÞBÔT¿¡„¹8¹ûñK8Æê«xéÕ¯ŸÆÙ¤C?k¬ú÷vÒM±µÃ篿Öî´ñK×^¸øÔ¥-éöövGsg5ײ»µ7¤ÅFE¡óØÍËFßÄÑÔÑúb®ˆkrG NfÌJeˆlŽpšíf²×¾zôÖ¸¹Ù‰/IØL‰"ƒ‘ÂiH+ˆ0SùW×~¯ 4”Õñ±ºçço¾ößjf[ް.â»-2•åaú+¿ò[_øüúÖdg²êspõý~>yv.Ì^Ĺês@lã·rÊlÿòÆïte¿ä&ri©DÛ[»K/®ùÔ¡C Giõ¹ùVËÔ‡ìçiÙNå3×>îüîA´,)ve(­ÌNfäõzÁ(o¼5¿h«c¯Åö@ààfmí5 c‰/`Ê\Ø®^_ÙïÝ@^ Kk²Pþµ¯þß=pùRq38T•Ü& $«ãBAcžØD‡ «ÕâÅó{;D¦“Æœ¯Ý:œˆG8¡J9ÆË%(Èh2ñAo‹?¾Q2nŽ0A)m{.¢› Ü„¶›¿)çîW?˜Ø7.tüå~¿mBAi,¶¥I–0˜Qš9AÖÕ–8¶K·ç篗¡\?L©…†œW©_!ŒÕ†ëÚiƒo '7Râ g§ CTÆ"º¢Ö‚Q+Ìâ~ìmØšµê.l/Þºuuq«'ƒŒ¸Fm=%"E5€¨ïŒõ7' [Ý<õ±COúå¤Û:wéüáÁbä0ªvÇx9È;/Õæ¸)Wª¨Åø£x§ê&wС§…ÚãÑHZ9Ÿª$èöÀ»n44žÁ™Îâô8òÊ`õ"•s£mK:@ækÙͺl}ÝÎh-%P"1°¡Ëu;ÆpB’‘g¯ŽÁ°æïÚyÞÙp¤2c£‚b\°Ææð57F%Â=úüœ¶ªDøØÆGj> `Fím%8éúÁë$y%Y6¹×5aXçãiòsJæn63¹­èÌad#›N&ë‹ôÜñBÚàúhCµc>J“·Iú+W™dœGööý>CáZsFM™ÃÈxÌš]!^‹uéí¥ÖõªAÕËŒm$ ¯ßºqŒjS/!‚qOÅk7õñH6{í#åvÚGȹÊVlÔk8sfª +ß!:X3Ògàªøiƒ­Ñ¼§öº cZÛ½&6QI×ìx’Ѳ…aã)„,È@f0 E»çŒö*êJm2ìp‡¸ÛÚãÒ8‡ìîºÄ·AÕ±„â°^ŸÍ»mÔf:îëMv-îe÷Ó6oä›=YÈ*|çg»MKÕ&`}­4³…S^ÝGmmVñÛZãTF¿Jd`¨Ø¿VÐÈ ÑѽÔï¤|ç•iî4ô4cša‚¢ 3!)¢£%(Û'ÿ“:ÿ¬/TŸTð0¨ŽmxéTy±ÖÙX £JHªT@Ê>6¦²õ|dØ ÓiŒ­w6£ xÏmmÄê‘õ6Í8¨ì·Iù´v1€ñ¦bäTÂŽ˜)Ľ¼2©,ÌÛ´e,sÕù¬†>„&±¦3& €UÇçªêîfV 3kˆ”"e6fR’ád9›ÍB Á³;†e‘ŒÀ¹ýÚm§r´þÍŒŠ5Þôý-B?è¢SŠ1÷²²å„÷V©’sF7ƒ/¬$-·6éZfh¶\òD¶-3±oM&ðCÓ4âºq[]ç´)ï,Å„xÖti1,'¤mbñ³¶g§i;’û!5MÓ¶lÚ˜•Žc¯Î!ó%é2µ»Ñ˜=€¬ÜÖŠ`Äì˜5Sv.É‚pŸMÝÈ&a¯TQE¢E¤®¹°­´Lž)Ö(쑨µpŽgñ„W'±a{ZL©¨‘ÓmÅg%¸ÝÎ}ýñõ T²€ÓlÒ-W7<çØÜ¿#[«@ ¢Ãx…¶%ˆ™Ã$÷žsÖ‚N&¤ê)u³N‡Dª³¶+jê™}뤺Z`1ãYב„ì5ÈZ¹¾@ €íéäx¹š÷ƒ7–i‚V’¥Rš­ÜQž5m³3[¦U¡ä͆ýÔ³Gå¶·NiµXJÛ bhc AVei̵ܳª‚* îŸÃ–8ixΜ˜ÆÛ%|ÏÃßü(.øé9\éÖÕÒa>YøpWdeýñ!bCy¸xßö‹¯ý<''h:„y…ç>oÿó} ²âÍt+EÇâjÎÞÐv Ú&>òàÄ3/¦Ïíï;ÙÉj~þÁGoŸz¯]=ººÌ«2?ÝF«£ë&>OË“ùNœ~üòǾðú…F1]è:L‹ÃyœtMŒpÞ[ßúà7=€ '˜ÿ«7þ Òîlû‘K—£ËÏÞøBï«”{ DîU÷_­Ü(¶Þ7½ü¯ï}Ãm@8F>ÀÉ o¾ôÜ /54«hDL•ç¯õÌ#LIŽè MáF¹…LÑ,pôêÁ‹7Wo݇Ýãü'>qù›ÁÅO¯0;VüUö»yhÖ\n{‹ް\aH`2+fiyˆå ¦mÁÝ-—~ÑÞ:xsÿÚU¼ñ¡æ™óÖ¬®t%<ÖÞß‚‹ãÕ|U C§{Ô­ÃÕ"B4ÙÆd“bLÎt[Àæ(q •FýñÈÛˆ—pþÒÖyQ¢^gÔ>€ rpŽÒT%6bb\Û‘Åä{˜ 8~yÿ…«G¯î`òÑ>øû³-‰™•Rª‰+£""áÊ.]ï½¶•dyTb šÿ·²7µ,»Îû¾µÖÞg¸÷¾±Æ®žçæÐÔ$E‘VhG¢&;4dYŽÉ14À`eÁ‘(q,8‘dv"ØŽ-;r€0¶$ÃN+‰)Š¢„ÑTìf³«YÝ]óðÆ;aï½VþØç¾÷ªYEÈ…F£Ð¨®÷Þ¾çì½×Zß÷ûÞm¯½~íbp]?öÀƒ=ùÑGžýÝÝ—ñõWÚ<£aZöûEñ 8DÅßÿ{¿òá`:5.ÎÇùxÚ(PPQ[ßñ¤ÔtÖš- óñº¯j ñöõ;í g>óÜÙÇiO=tî¶¾Ò¼5ß›z'É,ÝG~£xTV© sÌz„’½ZŠÙ„b'[#p ¾í:ÑíÉæ¸Ä(£~¡On>:].g»ûÖW›´ª¢®*Ä q(޲tzáh ~içêå+W[¦óæç6NŸ-ίmmÏ–·û¾ÏÇ`>ðhØJ BnRXN|:·~3-ß¼z%¢}Ü?$w5ò 8Ѻ.*·µ˜MIÀŒ²BÛÌSìv÷vövï(¼¯¬ŸÕD÷÷‚ˆˆ—û®_¨¦„~ÙÌ߸óÚþñ<þ‡ê³s,®\» 8]Qî œ 'Z!N@±OH´Žõ1F±wucVéJHFEY\h—(¢D5Åô¥w^:sç7ÏŒ”7¨¨@#)U5f¼Áªu''.é\ø%â;»ÖlUoܺxûà¶«íq1r&82hBJɦ¥1„{h"Kï(ÂÆÐ3\õl;ºt§G˹^;¸þͧDÄ‘‹JŸŒhiÔ‚&ˆ1ÁÕ•eáô÷ý©ïùžïüîd%’|ñÿºüÃ?öõ©­×·šé"p>D3ª¤XKmTsL~ìòáÞùÚóÛO]ÇÎk—_Y ™&c%zÑÊÌ’ "6uâ´·Ò•‚W§ºb´£{G"(É¥E;*Ç úkw–Sgï|lôüaw±8l'•ëgKÞs¬)N¬ \'K4˜!ts{1m«²\«oÞ¾s7ÏáìÛÍ¥‘«LѦP”EÓ…²®¸ÈâuµÕNŒ 5àº@ò-†Ô™Z¤vLïÍp¢¢|€1»Aˆ“Qí}9™H쳟’ }3½SÖ0Á9céBÛu®šùu]è‰í§÷0u¨Æã13×ãœä³ˆWË# ‰%]¤Ž™H"(œ÷ù²a|2¹<¿}Ú„I  ±¢•¿µsg‰ùóϼ¯3´¬<;ic0°‚óÍVwJQ”$}«!ê…6G£ $r:Hn5Tá Æj`•¡ìåhð€"Á¬êh”ô”+KÃÓ“­²?¬msŸšPÐGùÙŸùùÿê¯þmȤ’3…žQŒêz³éS»Œ)%Pß{q¡÷]šðöûÞ÷±€ôû7ß|ìüOžztgq{o>·1÷ÐÄ(ÓÐ#Ž<ÈØ˜Yƒ*‰ =zu©S¦û)ª,*1ÐÅ®C ­…°8¼væÖû6Ù^m‘zM!%¹¨FPQäö ‹‘S.•+ÐzòûMwö·Š-”W°É’æ% £ $ö ‰F«4ÒÜNÐÈ|tïpÔ§ÇÏ_Ø^;½ƒƒDv$•¯×`øz\`”ÈP8:{执žüÀSO>ûð£­m¬3¹¦Y‚ˆ¨ÆÊì˜`˜QQT§OŸ~TùƒƒWß<¸új{ñ ¶äa!‹)e›K(Òqy€bVF¤<ô༷޳;, b!EÒ” µœZJïÞººDØZ?­ ¡ mQJHÄ—èˆÈlÚhHÔ–oõL½öGŸ:‹­½~/¤d«7@u˜l¸QÐB5-D좥F#ßÝÜþðO@ _mc{ŠðÚλ‘7”õ¸?­š)b¨c|ÿ÷}÷w}×w÷a\¾¨?öcÿáµÝƒØ4 Ú%Ä9Ô¤ãÐÖDÞarîÔù§ÜsïâÖ¥+ó‘¾~û³l¬’.†;˽ËéÚåÉÊ•7C]žÃ$f²£dS Ê gâQÍ“ÑYœz£Kñí;{‘DˆÉŒ’¦ÜrÆ”ò¸‚R:ŠïâÎRøú,ê€t7nïí¿µsN•Y±NDw;­PÔ2.ªÑ믃%…FÄC9G‡‹¶ ± T­UxU3cr޽©–X¾~íµÞ÷mì•[¯?wîÉ ¥NbD‡  jaa¤i» ©×dwW’|¬A³%UCê)ÞÁAƒ8ÓV N°¯Ý¾R?P8p/Z:¿Ð»Zu–ï-DѲ]Ƕ=9áîàðöüê¥+oOÇAK¢”ç fY]ææšA`g³`ÖŠýî­×G(c ç¢m[¾8µÖ Š€”2È4“„¼.S×_|÷«ÿö÷ÿhÛÍ&1I›šª\“0Ù9°6®OÏÛ; ,ÅF¤ôUc1z0?|Í]íIÀ²*öfÓo½º¶±.D^._S°!rö˜"Ì M—g×C‘ß³+ÂÌS‚“Ò»{×ʲ\j/®h¯[¾|ý<·–ôÈžK 0G\ïw®¼ØåÆdiº···Áe¹]v©£Â…ÔŒ™Á`b5sS'y2FN-P[ŠWºöÔÆæ<$ Ý„ËT"HŒf&z/’?Á4u3Ÿg/_¾nH…”!ExYLgW‚JÑÏ÷÷ÈÕ—(KµBˆ®gâ8i{ë`¶¹yaÿöþödk1ŸŽ6Æ{‡ûýöf ,F?Q^F&8,)6¤Ê²×ìõL²UvY» Ê;/}좩ffYŒ.Â&DpAI$8$‹¼Qî IÄó2$fô2ìfFȞδé‹©‚EU»>M”S ‚YAL …€d¦<Ð'5Se©&K,ùj´šb³ÒÐԞ穱µ²ê…òçÛ Áѱ‰ÌYšß¦ â0û¼ÊGÆÛ“u>X(„À€”NÉ%8qóØø’:Õ!Ï`S¶ãÉMÖ­'Fc‰ Œ$è9õ ª –bäÄAŒ4™Â@ ç²,²eg€ê”EeC”#õÝ5-4~¯;×2]xe_Íü@GqöGR`3¤0(Qd˜eXdãÈN‘ÇèJGþU‚)ƒ3áp„Á¨p2fÌ@ Íl¿MœíкòP jµ ¥D9)Æ¢XŽ>€”܉ï9¿v£H£@ÊÄ.CLÀ§ÃèI'È+°ãXêŒ:¥tŒŠT俢3(¬ð@–1è ÑÞ0„U"P„¥fÃÔnÅÓÈ’ ÊR•ÈÃÈ# Np‚Às"²E³–ãÄ¢ŸlH '«©>ŽFœ Ðñã!ºÒÄÐ1ƒ²ƒE4Q¿CA÷Nq’µì'„yôk'@ùèu:¨Õì=_`ã¤\‘V:s†9­²Mâ×…‰¨‘T¢‰1e/ ]ñJ"ÑýFà¶ÜËÊ÷%½ïÓŽ#çìîÆ”Ò]¨‚̶«™øXr¥dœcâV?«Ë™ –Å Ø=¹Æ.2'b6e5¦¬%Kdi%ÉB£*dA4f#ûÑàÙ˜à Ð,R1øã™iÎÊ‚c¨Ú‘ÄéDLððžª!È)à (ù4(²"CWy|bNyì8¼‹¢|bß8Îz/y‚ÌøÄMÕ)Ó,2å¡+3ÈŒA”ùzÔA#¬®G) |Ý`¥…5AG+1W¾¦ë@â:Yæ¯uú^G6ñRZŽ>UÎ ={/ƒö.ñJ¦–ˆux„”9^)ñ :ùJæ'ÿY6MÕNÓýbí¾.ÄãÈVä ¶#¯=ñÝ* … <fKDDÆF‰LyH­¸¯#1¡èøá"F Å dÑ8$BpF¦‰õn@/+eI9ŸØ¢âjC'„‘ìXLföæ ÕnIèGÂÊY%d3Í÷h5ÄwS¦îÖ|½æä$À¼ÚŒ‡×b%š5€GÇÏÊE:í$â,\Ê)ÛyNÖ;mܰó)•îÚ£Oìcjeͱ I…V²  èÌ‘‚4DÍó#¨’îÍ­~¦¸zƆ$ö´r¦ã[Gþ{LpÌT2î<9é!Ã>“‚za>Àé*óGñn e$ÿ·á[%gɺåØ0ß­i"ã!>Ó‘Èò¡žØVŠÕ¼ÖƒÛE¡ Ö¼•åg )'F¤¼{Ùý$sœ_ Q” “>­uVF#Cï©)dæ©"ñb ¤…8QQ/êÈÉŽ‚Z ªá X* $ï¥d7Œ IDATE™3P4] ÀŠBáa%«g-r{Ìœö¤|BAPÏÁ´‡çÀ‰‹deR†%†!ÿ„A*§Öšhôè…1 u×ý™7ò`§‘cô`‹)?nÚöÎdäkRòRXjeoDdì¹K ”÷F*ˆ…¦ÂB™’ÓÔ§(u™’‰/#C q],ºÄj–_l£UV’'‚Š©S:àêc²hJÎû¢EM)µmK'XBlyÔLq)ãµñf´ÎbðÐïµ0©Ï&d „Éöy´ýÉ”N‚RîГvÙ9Ï•çÂk ùàUb€%§B¬6%ӮªžPé£F탋ñä«À¬Œdjy㋚qá¼”U0L—ÍbÞôMï]YTu2íº.Æ^a]è‡!úPdjþ‘5ö!4m×…”¬¿UOî7«wG7Íœœ“ùRdVùBƒR€!$"~<Ö¶K#SUõÐ:‚y–š™(Çãõår™Òª\k»4o¥Ce}ïÆ§æû‹QO=¨7à¼ÿt™±àÀÒEÒÄ%3÷É„N§»:ìL\,--=DÜöÒqχÖG‡ˆ^¬˜)%"ï k{íR+ÚyQæ1•ë“ éS›ºÐ/4Šz}<6BŠIwÿÄÙ;Î<‹7Ú¨×G®`ë“¥¾oS³Gæž´Ýe MCÅU$.(±3Òˆ>%J]š·‹r½2ò,Köµ„–hUÒÂÁ‹ëâ} ¡ífeµÑµ‡õ£{Í>IKpQœ>Ûã:VÇãqµf,"¬ìC4O&NØkLN†þF:îã)‹xôT›km'±.}EÞzuòz1ÕD¥0“cR3#´]'DäD˜¤6ö}ë|4b*Ö•cÓx°?CèE„‹RI wíDIZµ¦ñ½‡æäJa-ØQ£1ò=áU¤zº5Ô`("Wm:[­}Í«•­ö7mw¦¡e™r€ãp°1k¶˜ž=?yò©³ä—7níÞ±ƒé\q볟ý£aêCzâ÷^}%r… ýí[(Í8©GìºÚºˆ÷J4tùjlDÃD#Q éŸ~ì±§ð8ÚC/áê\tÚîæÏH•Ã…·^€¢mÛ¿ûwÿ³j ]ÀÿÐ_þýß»ø=ßûÇþößüÇ„ÏþÒï½ü¢p™Ü©³׎.X–/0êA¤)8r?{Í_yyzÕæÄIŠ£tìÆ¤\ª¼ýñ åWñ΋/µ]Ú¬ª÷Ÿ~TœÛYÞYéŒXL(È4Ï’¼]Vªsaî¶7P2æ{åé+˜·ÀY·6‚[ï%0E…0#%¨¡ë@ìªZzZëå *Azãæ;Óƒ .œœùøäùÉ•—/5067·CÛ€4£4ó?œåw£\ÙÀ®-ÞýÚ|§ñ)-RïS&1ݲœ±.dXNg| —ÚÐ7ݲí—mWzŸ¥J&ê†ÐOñ´éþù/ÿÚ~÷RøSúü­¿óŸ?ð`þÑ/üoWÞy§k;ò('Çr€üQåE'-Š¢]´„¦ïÚ E•e±Jôni³ª²q@œãÐ#=0Þ^›lΗmjAÑ+•Ü)®Ê^Ų›DhàM0(‚À0gÔ]3þ‰ÿ«žqþ<¾ïÏ|ª*ñÎÛÍOÿµŸY¶©®Ï©ið;P^‚à%¨‹±UµÀ$YY–I5¥ÄÌ‘˜Þ ‡u®€ó ÄÃØ_Ù½ýLýl¿ìÖë ŠBQÏ]Òª(BÛÅ’RÅ–´O!Hu¹°ÚÑU ³Óã¿6»|“s\oMÖà bË ÅÄà#¯sU4Ñ¡;-õi+N©?Ç㺠,ôu}¥\_žè/®T—!E‡j[Ï>óþozæãO?ôÜÆÖ¶ñI–:ÑÀ]9q\ˆÇõöWß|ûŸüâo\WÂÏýÜßdv Ú5-€¨=DŽ›n©€† ™'Òöxc¼Ÿ«#hšÏç5ªhúîîí}4/<ðAÌ:h£)˜šÙ^Qó,”"¼÷ŽàkI—ž4öžnïî0âC[gšåR)²ÈNø5!ƶ f|þOèãO|ò±óOnŸ>u?c‹ñʪ8:"£sh+™B¯böêþÕ×ìúEì\ÓeSKbe€Ì­>’l›ˆÝ|O“–(w›Ý÷?ý¾Ï}î3M“éøþ?ý½Û‘+ÅÙd} háW›9 ¦ÌFvDD¹ÀÉ T–eÊ÷{ú÷ cNÛöFš¿…âüc£í20çya–T‚– ’´o»6ô}êµïâ®"qF•ó%¸`1¤®oº®•‘¦Wë½ Ž‹nìg 7íÖK³w^Á•¯è­=éï»GŸè±ádÄjb$Ðý;·¯~åk/]}÷àp/¥¸2‰0!7¹m˜ç» fÐŒHþ›¿ñ×67qãjóê+×`øìgßÿ#?òçË’bjæÓË£r‚ùš¹¼ÌçW¤(ŠºmSHËʦH‰ŽJ'ûp±,=Ð¥ÒȽsps·>öè󈪈Î9‰šRJ>Z öľôn\ø²ðà R¤ U›Ê¦ï÷.œ= ¸vêK¿XÌNÚdŽÝËЙÁMÛååë×.^þÚå«ïN§Óû)¸9ðq GNáT-ôïï%ÚN|6ÊZ—¼œ®Õ„%ÛŒKDÕ0Tügþìw|òÓ§Aø¥öÿÄÿô| þƒÿGϜݥ¬—Ý~yêìêq®†zÇ*µ2‡@E êEÁ$ÄófiLùÜ?2EYp—}—XX9NBûíü­;_[Çd}´€’jß«já|vоïÍ1 —X%™Gtè'MÜ\Ä­þÐÃO<\=xûoMo™ÓÂKb$0¯p ŸP\4ESE;SŽÎr}*ºQoî~mÒ¬ÄQ:ÂÁƒ9ï}D¬Q=ýÔ“$¬À®Mßݹv`‡šù‡–7VÂÜx}{1ßSÌþëŸùsëë¸t ¿ô?ÿú;ïÜü_ÿå~ðÏ~ò©§ðWþò_ùsñÇIÄIÝíÝÁÚ±Éj5Ü‚QŠ®ô=ûÊ/Sc¬Ü8©á$5û(Äjä‚Yãµ²Ùkµ ÛÓýKgn<‰Ç#š¬«f_¹ÐõMLªe»@g­¸ZÇú‡Ÿy__z™;Ø}éàµ4PTEµì{¥¼¯*­žhœ÷…wŠxzm›ÖÆbB?µæË·ßºÖ˜ßÓÉÕJc¬mÈi¿ÀrA½óŒ8ôè@kJh ðbzÉOêçþäÅ‹!½Õ¾ø¥×^þòþúOÿüž}!Íüdtê…~úÅ?øý¢ÚŠTí [¦Ê9"_^ÆõÝù¡÷>„EYVÐ!˜óä‰mÙ±\HgüÜ M6ïd.ñ‹7ßÔók7±×Š9çM£šÍœ&ÂzY³1bÏUÑJq³ ÌÇåÆªëØo½=»>³êÌFè‡Ó}©k»Ç¬@gÍb]ê)–§°¹…É!f‚‘Ý?‡…þ‹þó7îÜŽÎRI]êEÄ%r‘Š^(h%år¹$’&ãMç»(Jꪰuªì—þúÿñÕ_|——ä"¨a‡´(Ê¢ïPû‡bŒÁn3é¸.Öæ}n}$”K\˜}î§þÄÃß9>,n°£l„v& )ZÞŠk‹nÙN;ÝÞ©SgöçRŒ  bXÎ닱Õ,6)Òr-EI¶ˆ•• BSšú5 ]oÞ/œe‰e#†^­*JŠÀa{¦+êˆfÙ8}©ÝåÍŠ5ílcT¥”(+÷WwZݵ<7qma%I*ÝA»Ø˜Œ§Ý"­Qdýúësªb1Øh5,Q#Ó¬À!u:’üÈ÷ÖH$ aí¢°9o¨"÷DqL(ɨ7ƒ÷mC wAI?‰¹} ö` r6&Behc"õ$Á© §…›¥BS keÝ-æeÁi•I2é `¶¸&N,̪9i, ×[oFÑ3RŠä¼ÂItÉb#Bª8rìÙÔO´¯ú¨°mÙცô‘ƒ™JŽ©Éúë•䎇˜òï*ZÔ%R«Ç`-ÆÆÝË·íV&ÿãìœË8ЋFF}9òÎÐÁG»~v?ÆQšá#²^Õ ”g*Çå\¨̧œœ7ïÌ'væle‡EÖ šÈ”3xäxÞ¨^qvóÜÊ)ÚKbîaŽcM¦‰ôhò«9ÞD=çÂ}Ŧ‰té}²=i’]‘ýèëÝ~YLÒñÑ„ÚiÎ9¾_jÅ`Î\´ÕbކX&–‡ÊG¶tI°û‚‰I\åPy‘Qš%ËJZ fØ´0XP`”]oð~K.T_ê‚*ˆˆY1ƲÀ'¤m•Äd'½Þ:$,O™MÈ@èP•¡Ñ¦C¥bIr8‹2›D%d©ù‰í5w÷Né¬ÊzJ°ÁëŠÃ3ÈqDÌ «õ úÑvŸŒ§!—c{¨‚S4˜ !ôÜÃS¸¿•”!ÝPé©ÅèE;AJ¯€RôŸE‡~c¤4H¦¤°H%¯3”[1z\ÁĈÁ<ä5ÉMF"Rã0èE±Dʇ•üC‰³:ÔÀ'Âr@CV‚“£Øœ—0Eø˜äF‰†µ>®¨ï|8 $±x¼ƒè ÓpS$!Â|9 U‹µp±1¸[}a0NÐDspFá­4VÀõ(ã ;½qUôÜuqé]𥷸ÐådL+¬E–àøò~ô¯HÔå$˜ËÞ>…7cåĹim*VÀf+OÊ€Ý>«•2‹Œsp•Á× L¤Œ™°JRBõ2”"'اo°u|}wé(táHw²Š53q f}´;{æc–T×q³5•Æ( sÇ ÍŒSÏÞåÀ22²4 gž74ïÐ%1QŽMZ2¼³Ûñ4¢v—¬k•c¡«†8œZþÿÄ †Z ¬ßeõ¥IlÇ b‡¸ÉJ-ÈClžÉ1_„T³’x "«LؼÂÁâ×Qy†™!ß“b«'h6Jj†ü 3÷°¤´T´©ìžùæ3Ï}艊65$)7ƽ`ÌZ“ºŒÈ‰Ñ)È”=¤æÝ´ß#{°|\vc7TGõn¾ é1–‡‡Dt”£Ï2ÿR1*€˜ç5LJdŒ@`#N³ìã1‚1óJJ@tdUC2Ä<ÌFR¦£÷(¿ G 5…å)¡(Æ«%ìï=aɰ'¾˜C«Yb†‘ÙpLsê¢wT¸±Yj»¾¨=qÚïÈX”£q£†þ€-`…(¥Ü…‘ÄèÙR¡êTI)‚"×uˆ!ÆXÔŸX㨫o l´¢Ì0¯¸=ùÎÛ+ƒrZ"5X&Ö ƒ$&ƒpF”8§])`]f<©#²a:ˆ³ ¾Êƒ^L3• £˜á¦k Œ9ÓýåQjBDf1%bÊÌÏ’TŹzå,ALcW†ž×-!¥J$è•{°bdJÄYÂ7̙̈‘Ž‘!Š%¶˜™pÞ•ª.v* q9éöfkk)yß·] ±ª*6¤”|ábŒ™ˆ~Œä1˜ ¾ KsÖhWÖ¥†Þ£°¨¥”b¢&‰Š6†HZ—œZ«‹²‹èz-«µd¤±÷RÇÐ7Жł†jì5„˜zGãAaG‡!‚‚Åñb±¨j‰)ˆpLí¨,ÛESø{¯µ;Ñ—ZñF d<6‰8hð®ÐÀÃñhƒ<8域@Hù:F9UëøªÇfÒ¶ï< È9Ï8Fo›ÐQbGR:rÔ#©EÕØ´(Jw†Á 1ŽŒÉèøŒâ)¥¹Rpœ@AC—’*’ðåÈXºÔ{Õa$ðè8’p(bÓµžQx_x¶¾ïÚ%œl®¯·S;' éjÔƒRØØ‚uÜõMá|HS_ìÞsGÐŒ›ÍÊ>^e&Å£©¯‹  o]ŠèØÅDÑ­Ä«¼šåæÑƒËA/8*ªKbä@‘U`‹EB,Ê·)ij=Ç”lc¼®„Xó~s‡ˆFã}ß#WõrÙ’1{«[í-.„ ΗEiNèC» 5.&^*À‘I]#bãÔ·ÍÈ l¤=u½Í,ï®j¾¤Q=F§m虉ÁÃÞÎî¨ÜÐ}&ƒ¯’”‘úú>´‹¶®ëIáÖÆåt¶0c|¢ôûº'úÄÓÇ00öe¯f¾iŒë ìmaË•tquÙ%Í÷\çÌKÎñ«œÏ4S¨X+Ì‘ ˆEb2afƒ¦°ì•Öû.ö]¿6•ošÅ¢YÔã(]¿uys}Ë@šõ)–¿"‘²K–·©òÅ(ã ’ÆMMª’Èw!…>Á/}0ö\j]9Çj¤fd>8Zj3í¨¨+ñ¤…jéÚŒtxÓ™äš6ªÚ”}±Y»Q·˜¶M[~TtñÞ‹;9…öeG› ©hÛa¬mÒ&X忬[Áv²`›WDW–Äl ÆJ®¨Ê½qP¯vL ºL˜“ÑzÝl¬û:I˜pÃ#çK•´LÅÈÛØŽÉ1¤¬J&Fð“:4sßÛmú®öVšQ›–~´ltÞõsöc"D>%/ÎF!„¦m¬Oä’VVNdÃu¥D· WG‡íAÐ~¯ÙYÛ J5¿º!*RcÇk~[:¿A뱟z×,öç2½WÞ½K+°Šž ‹áÜ©s]fó¹Ázl¶l$ï„;n'ïéœ7¥•ñvÐhÆ>¥co_ÏÆ„(&dHF,¬dª*ÆÖQš»×¾xÅ-Æãº:8Ü+Ætá‰ó§ÏnwnÙ†…Jç=”³íOÙ(c ø§?ýk¸ØÀרšÿ…öï•oxÛ~I†ŽÐp²Q½†pC_ù•w¾ú?}7=äAX‰2wððüßü¸œªcÙ%í`Dêaó0©$‰ó¢æÓð[¯~éŸünîƒû¾íÃ?ú“?À›-\ï'Y«DJIÞ8üÚg6>õÄúüÌì±S*L^»ó%Â`•¼{Ã!%3VUg™®Ôæ¹[à³îXssªæBÕÝÂAF\oÔ[د1åñ¹ Ûç6ÛÑòÎí5¼~ýÅË¿½¸>÷¾6QÌbØ#Èpmãl“·ÓTæWZ¼³?ÙÀþ»—_ºùÄÖFq¾°0WflFâ ^“Ηˢ(77Ï<úè“{ߤgúG^ÿWW0~pÝ?ùØÁèÒxkmoyUJ$V6–”mÐPrJäjïu†K/ÞÂFyÍÞWv{Ìë‚»‚:HªüÑŸúåri™ŸH‰Ø:²$Ò´ŠŸàçiÙlXõìæ³¿Ó½z¥ÝW3ŸD‘/¶yÂD2@¾ 9BÎXTÄàL½’O´ˆbÁÅ( dèAdV‡ /ïØ[¿~3¤³œü¥Ÿûw·?3zà#½õò>vüÎ?ôo~ Îõ.k¢doìûÀä&åòNnöè¯þƒÿ}ñîõG?õéÃ+W`탫ßùÇ?½Ç7hdÖ9Sðˆ#)‚#FÚqרòô§>úÙ}˧¾å7ÿûÁ¹cüƒ?õo½ð½ï;t·\¡FQ%Å.MÒØ'gˆ(¹õ1XX/êÛoì|ñç¿€Åø}ßþÑÛï P·Q>ó­fv¬ J…ëB¨Gkm8eƈÁÁ˜”¢hpÔ„xíê­xó[|á<ö‰íµ+7¯/bcflšû·FJdÊÖ.9òëäEWòÊ9"URÁV$¢ÈE¡B”L#‘r)̬MÂt7Ö{ûÕåÉsöø'Î~Ó'_@ÐúËðZbSND™ÕX”DÑÏš3å™t·_¼ öŸúôÇ¿éÓß‚yœ¾5ûÚ®lÓ)i؃E¤KD(Yt][4‹j:í,ê=¸>†z:+îÌd'º…°rb"WU£‘sÞ,Ƹl›>ÆBFýn¸úÊ ô#Þ<ÿCß÷ýhvè­/Ý8¼¹ð(44ZŒQU˲äžR¤\Š3bƒØ°µ¾Ñ.–7nÞ iwwWíöh-¦Ù}ñ‡øe¤zìMË}"*¸pæHã–Kóã²Â¤jm²™’ŽÆüôÆ8Bgû³CÒR´v©s¢pšJíF½nÇz»]û½ñEÜPœ}ú‰Çß÷üG¾Õ»Y¼ñ[W6Û ÕrÝGqF̙䲞ŒØ\&÷—=¼÷…ó…Ž=”b»¥öm˜7ûËjRVUUiQ-Æ›‡¼ò«qcöÑgŸ}èìùg?ô­°Çg_<Ø¿ØnðùQÚóÆˆ«Š}èšÐÍÙlؾ²èÞ ¬æbêO­¯=üÐc»Xìcñ؃Oœ_ÛŠ»Ó£q:­~}ÃEÎ}‰»t\9tj¹l,qÍ£±›ˆ¹ÔƦiÐ5¡‰Îæ(Ô½séMè ¾l`ÂZJOŒH‰4¹Dã4±yñ·^æê%üæoþÆ×._„0úòâ+·ö®tÖ,¬cW¯ã•WIIô(£V¡ ÂᢟgK™IYÖ£²®Ê‘YLÖ'bSvÑü‚oõ¯í© ŸÿçŸ×xn8ÀW¾p1ì2- ,„zùÚ“¢ó Q¨Pt0gê{L kìŸ~øÑþý[¯CðÓÏ>ÿðãý¥ù®…ø‡{#€&õ@pÉOž HÂF¥pÞ×Ü£:EOÌéòWv.}õmh ×<ýü“ffêId >D‚KÎ[­}õÖ«—»[¦Åÿï_ücL¶1;€?·{ãð¥WÞ~ÿÃD,B3-bÑ.{¿² gG*'œªÎq JAÉ҆̕vTWä}H<[Db;3.Î…Ñ/ÿËßÄA‡5ÿú—~ýõ·ôÒbùΗ/‡½o?pnæ9à‘™XéÙy#!4©F ªŒkå [§Ocû’^½ÖšC…ëOáôçÎv×è„ïAÜk×zÁ686Ø(åÇÛU.¥c$bƒ)…Ʀè§;Wäþ»z½÷æ—_Ç+»8µuþ3yì¹nÛ5+qëœ&€à¼oüêÿò+èfXëÛÜï#17õ‹ÿãÿ‹ezå•7žûŽÇF§Æ]ê*+´³”N¸-mÈJ±¸ª[«'™&‹m !ED²Èe%ÆÌÌÚ]¿våÕÿçwÀÅú|îS/´ãE·ñìWîÜd¶ ÞüCíÔÇ*=EÏé²Yz/¾,hŒ…TN1iAñK¿øyœeH¶<ýmÏ÷|Ûœw£³ìñK1ס lÅ¥×/÷¯ëãÍ=úÉy?m/coõrûÅßøu´»o_|ûÍçN=Ëmq0šŒBL5j"9Õˆ©‘Eé°ÞÂ4Mš¡ï]M"»¸QŸÖ(3Wõ.dîàpúÚKo€x¤zè3kß÷Ÿü±tKçÅíßi^zù—á–o\|í©>Rl±Š)“2Øe°ËE /NŒýëíŃÃù6¼V(ëAXþÞí—677ÌåüüÆ«œ›G ¶ã•ÇÉú¦ï*àô#g>ñ'¿y g§M?ÚúŽû£Z¾å#/”k´_ìö>(3ælÏ…’‡ ‚ñþ{ªåäéço¶æ‡z}­õÚ~ïùßx·Ï·Î›…Æœ‹lD#U“‘qŒ®ûÄ_úP>Åãíz¿›ÁØ9ÒÚŒ4uírT®MÖ×ýFñÂO|®®ÖûÄö;Ý›ûºWUëë;ýM?ù]Ëfºuvc´Yô®3xIÆŠD?iŸß½y»´ä„ p’Rª’Ü3G¦DpеÞº(b¸Ÿ ÷~"cÒ‰£q0ÊÆ)Hod’|ÕO6çg],;ßE×z2uŠÄ©-º^¢R26½?„qçE‹ž…ÓZÙžQâ®ÜKÒˆ:0©IDATQ‘T*YWªtd0¸€1@Œ ÊýêHt•ýÚæüÏêi[Ì’kŒ’ȈÔi’ÎÀÐ  [úD>l*\çCp]ïZÀœJ‹ª±q\ß»†A†:ŒT ‘3JFQ²‚r*œ Ðc^-ò_{•sæ}þ·‘!qÊY@JjˆÁ5óêP”»b™¤eË46ÒÞÅD k‘ÙNá bFÔ™h/!°|âUdФÞ̓ÉPI%L”(q3êÉ«'ÀQBSÌ ®Ilp6æã;÷p²ËÑ2$+J ²¯DŠB bH»¢‰"@u‰5JLœ@ìœé‘­,­txFˆÃc«9*§¿é¿æ:Ÿðª¯èù£M †RP²Þ*çd%™˜bËööÌ’Ð죘™"‰D >8vÅAdND¢ìS!*¹(QØàѾœ«èQúä‘]$}[ÎŽÒÅUîŸb§†räS²Õ‰´/æ€JrEb‰.Z°¢ë’u9¶P9ëk€ó *Ü+˜˜3Çò*K>RN$yodÍòž§'ƒ]Þ³‰d¤½ëØVÀ2ÿä9 :ÀïáqÏ,–}]Q¹S™J:±ª&bž`ÊÄB2…ù\4aÚ0J½ëŒ q”®8h rRž@BLÍXY/.‰S!ãHš$(Ep29h9?®Ž*ªËRRÙ Š1Y†7%%bá ¿AYˆÁxÇ‹›ñædÈùȦ{qaDVw žˆ"S2ÒD:$ÝgG"ê”ÊE‚K^“R"ÄlQ%o ¡±=³aØÍŽ$ ‰]gR¦yĬ0Rp0k)ÊC ã”Șá2$¥‚CDeÅÈðÞHæ˜þÿîÓüü©bhIEND®B`‚yaz-5.34.4/doc/common/id.eps0000664000175000017500000004137714631643672011267 %!PS-Adobe-3.0 EPSF-3.0 %%Creator: GIMP PostScript file plugin V 1.12 by Peter Kirchgessner %%Title: /home/adam/ID.eps %%CreationDate: Wed May 1 13:27:33 2002 %%DocumentData: Clean7Bit %%LanguageLevel: 2 %%Pages: 1 %%BoundingBox: 14 14 135 172 %%EndComments %%BeginProlog % Use own dictionary to avoid conflicts 10 dict begin %%EndProlog %%Page: 1 1 % Translate for offset 14.173228 14.173228 translate % Translate to begin of first scanline 0.000000 157.000000 translate 120.000000 -157.000000 scale % Image geometry 120 157 8 % Transformation matrix [ 120 0 0 157 0 0 ] % Strings to hold RGB-samples per scanline /rstr 120 string def /gstr 120 string def /bstr 120 string def {currentfile /ASCII85Decode filter /RunLengthDecode filter rstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter gstr readstring pop} {currentfile /ASCII85Decode filter /RunLengthDecode filter bstr readstring pop} true 3 %%BeginData: 16148 ASCII Bytes colorimage mf*=@B(7YXB%aEgJ,~> mf*=\g%!8eg%DTLJ,~> mf*=IN:CK\N8h)AJ,~> n,EBom5"aKZ2]=~> n,ECSmE>RsZ2]=~> n,EC-m:H@ nG`OP5j^?.5j,HQJ,~> nG`OacgApWchOgGJ,~> nG`OVE:%6 nG`KIlSAO"ZN#F~> nG`LJlc]@gZN#F~> nG`KflXg-rZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K#lSANQZN#F~> nG`LAlc]@^ZN#F~> nG`KIlXg-UZN#F~> nG`K=lSANkZN#F~> nG`LGlc]@dZN#F~> nG`K\lXg-hZN#F~> nG`L4lSAObZN#F~> nG`LZlc]A"ZN#F~> nG`LAlXg.MZN#F~> n,EB n,ECFmE>RfZ2]=~> n,EB[m:H?jZ2]=~> mf*9TmkXs3YlB4~> mf*:Ln&tdoYlB4~> mf*9nmq)R+YlB4~> mJd4X^[mio^[eT.J,~> mJd4bn+5ZBn,0BhJ,~> mJd4[ch"IDch4LAJ,~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> M>r)~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> pAk3,oDel[rk8OC!%5LpAGcH*1B= pAk3,oDel[rk8OH!%5LpAGcH*bQ-o,ncA4:o$%%&!9s4$!n-Z+rQG?-o$[0S!oNS"pWS-~> pG;floJ6KNrlYI,1K2K?KD[P'AcTLCf`BEknn.gQ!5/#;!dWJ=rFQ,Dfm34%!h\.upL\p~> pAk3moDem*rr3.P!!*'!JG]EF1C)/(bfoYXk?7F5!WV?^bQ+O51C(\pN&*82s1e.]!h'(#pG7=~> pAk3moDem*rr3.P!!*'!JG]EFbQm_=o()_Ypt#)]!WVronc7qIbQmV:iloX%s6oR'!p9O9pWS-~> pG;gKoJ6Kjrr3.i1Gf(2RJ\l=Ad@#hg"H&um=Y%C!WVQdf`8\XAd?Z^WFfb.s3L:K!jhocpL\p~> pAk3moDem*rr3/b$3:,+JG]EF1BG`"r\FV7s6'#1!WSSX1C$29nl\]Xk pAk3moDem*rr3/s%flY0JG]EFbQ7;7rlbH's7l61!WV pG;gKoJ6Kjrr3/h4#?p:RJ\l=Ac^Tbral52s6]Gj!WTLrAd<;Jon.P_m;VZ/!jhocpL\p~> pAk3moDem*rVm"N!<<(LquHXN!R1TB1BOo_JFt]!s-`@4"_Refbl;;G1BO!EB(n*3~> pAk3moDem*rVm"N!<<(LquHZ=!V69hbQ@/2ht>1os5rgp"kiqKo)ID6bQ?r,g%W^@~> pG;gKoJ6KjrVm"g1]RKCr%n7_!SRMOAcg!PTCldss0M3,"cWK@g&I$%Acf==N;$q7~> pAk3moDf33s1[Cjk6h7hJG]EF1BG`"rA+Les-`O9!WV?^bQ(f;1BXNSs-`C5!h'(#pG7=~> pAk3moDf33s1[Cjp^dE)JG]EFbQ7;7rQG>rs5s!u!WVronc784bQI,0s5rjq!p9O9pWS-~> pG;gKoJ6fss3'R)m5t@JRJ\l=Ac^TbrFQ+is0MB1!WVQdf`6ZrAco^Gs0M6-!jhocpL\p~> pAk3moDf33s1W%Ds+(.LJG]EF1BG`"rA+Les-`O9!WV?^bQ(f;1BX'Fs-`C5!h'(#pG7=~> pAk3moDf33s1W%Ds+(.LJG]EFbQ7;7rQG>rs5s!u!WVronc784bQI#-s5rjq!p9O9pWS-~> pG;gKoJ6fss3$&ps-`oeRJ\l=Ac^TbrFQ+is0MB1!WVQdf`6ZrAcoC>s0M6-!jhocpL\p~> pAk3moDf33s1SKjs6'F^JG]EF1BG`"rA+Lrs-`O9!WSSW1Bgq]bif"/nhU?8s(;!]J,~> pAk3moDf33s1SKjs7lWoJG]EFbQ7;7rQG>us5s!u!WV pG;gKoJ6fss3!4\s6]jdRJ\l=Ac^TbrFQ+ss0MB1!WTLqAd*heg$Sflnn%s0s,?\aJ,~> pAk3moDf$.s5*ferVlkJquHXN!R1TB1BQ80=nOQOs-`C5#=.JC9kOFg5k?c5RK$mn1Oo~> pAk3moDf$.s5*ferVlkJquHZ=!V69hbQ@J;f(I5fs5rjq#LE2Cdb4Zqch#?^k5X-/b^]~> pG;gKoJ6Wns5l+irVlkcr%n7_!SRMOAcgulKCrgWs0M6-#B9)'H&VdjE:[ZCZi?!YAq0~> pAk3moDf'/s8N'!huR!WTM*AcQ!,1C(8dN&*8es/,BD!h'(#pG7=~> pAk3moDf'/s8N'!hu pG;gKoJ6Zos8Ol2k5PA\RJ\l=Ad@#hN/XCgs2O\C!WU1=Mu\M'Ad??UWFfbTs1Ir8!jhocpL\p~> pAk3moDf'/s8N'!AH)T/JG]EF1B>YtrrM\Yo/$=E!6k-m!d"Ccr\FXAg&H-c1BO!EB(n*3~> pAk3moDf'/s8N'!AH)T/JG]EFbQ.54rrN&[o?@.4!:oj-!o3hHrlbJjp&Eh>bQ?r,g%W^@~> pG;gKoJ6Zos8Ol2KDtlNRJ\l=AcUN_rrMf!o4Iq#!87'X!g`l>ral7Oir>>:Acf==N;$q7~> pAk1ZoDeq?6:1YOr^$T4quHXN!*T;5!*ShJr+5q3p+lbQAjH;N!_m90oJ6PCAjH)HJ,~> pAk1ZoDeq?6:1YOr^$T4quHZ=!7q/&!7p\ar7M)$p<3Thg!BW@!n,cQoZRBbg!BE:J,~> pG;e]oJ6PIB4q3"rau40r%n7_!/(90!/'fRr/:W.p1=AYN,\`-!dT`WoO\/MN,\N'J,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> fDr35J,~> fDr5$J,~> fJBgFJ,~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> qD/DFs7/E21M6ZTr%n6N!5AF3!oKGWq>gCK!1Ecb!+tp\!iH!cr\FUYs4R!"s31'j!h')4r\FUf s(;*`J,~> qTK6-s8:3ebh<$Yr65'=!5AF3!oKGWq>gE:!9X4Z!87(i!pTaIrlbGps7Q!-s75d*!p9ORrlbGs s4R7mJ,~> qIU#>s7L>CArQbrr+>j_!6b?@!p6\=qD8"\!42V'!0$V`!keQ>ral4as5NW^s4R!U!jhp[ral4j s,?edJ,~> qD/DFs8SKC1M6ZTr%n6N!5A=0!1Ncbq_J;As0M]m!) qTK6-s8V6*bh<$Yr65'=!5A=0!1Ncbqof-(s6TaI!7LSb#g`;Gf$)A2s46ecs75d*#j20ehos qIU#>s8TE;ArQbrr+>j_!6b6=!3c8Uqdoo9s2P&E!."9M#]T22K4\`Ts+BoTs4R!U#daR2T4V\o s,?edJ,~> qD/DFs75_G1M6ZTr%n6N"ht$:6:..?rr?U-!;ePRRK$mh1BqIkfg)G7N:Je)bk!UrRK)I51G`YC B)4<6~> qTK6-s8;f@bh<$Yr65'="ht$:6:..?rr?U-!;jtAk5X-)bQcc#p!;n&ipt=no(1'2k5Y5Obfnc? g%rpC~> qIU#>s7Q&(ArQbrr+>j_"j?rGB4nFIrr@]L1](bcZi?!SAd44oic)R1WUa[$g%/e]ZiBF[AnI#% N;@.:~> qD/DFs-`nn1M6ZTr%n6N!l"^7rW!%Ns8Th2!;ePRRK$mg1Ba-Gbl>oW1]P\j1C0EKJH)#nB)cK> 1Oo~> qTK6-s5s@Jbh<$Yr65'=!l"^7rW!%Ns8Th2!;jtAk5X-(bQR).o)J:Nbl@8*bR!A2huDi_g&Kb% b^]~> qIU#>s0MaFArQbrr+>j_!mCWDr\FYEs8U:?1](bcZi?!RAd#I?g&KaqB)gQUAdGaCTDu60N;nk5 Aq0~> qD/DFs(8V;9kOEnr%n6N!l"^7rW!$es8Th2!;ePRRK(t>bjmOlg&LV.nMC3ho.pZ?s"i@!5\C%. qD3X~> qTK6-s4Qc=db4Z_r65'=!l"^7rW!$es8Th2!;jtAk5Y,Ro((!,p&Fs9n]_%(o?7L&s3106ce8?O qTOH~> qIU#>s,=ttH&Vd0r+>j_!mCWDr\FXhs8U:?1](bcZiB%ag%&_WirA[jnRhgSo4A97s(:9`E/agU qIY6~> qD/DFs(5"*b\$mCr%n6N!l"^7rW!$es8Th2!;ePRRK(t>bk!Un5k=sTB(7\Wbk!UrRK#'Ts-[L! B)4<6~> qTK6-s4Pj#o%F'*r65'=!l"^7rW!$es8Th2!;jtAk5Y,Ro(1'.ci!hCg%!;do(1'2k5WZYs5r#7 g%rpC~> qIU#>s,;7'fo5s;r+>j_!mCWDr\FXhs8U:?1](bcZiB%ag%/eYE:s82N:CN[g%/e]Zi=Wrs0I[a N;@.:~> qD/DFs(4'Ts-`nTr%n6N!l"^7rW!%Ns8Th2!;ePRRK$mg1BkPnN;r'+nh^ qTK6-s4PWYs5s@Dr65'=!l"^7rW!%Ns8Th2!;jtAk5X-(bQ[J8irAf"o$%.)o?7L&s3/^Xs53k0 qTOH~> qIU#>s,:Qrs0Ma3r+>j_!mCWDr\FYEs8U:?1](bcZi?!RAd-N\WW2@)nn.pTo4A97s(5lrs.B=M qIY6~> qD/DFs(4&Po()gKr%n6N"ht$:!%3 qTK6-s4PWBr;?TWr65'="ht$:!%3 qIU#>s,:Q/p%A?kr+>j_"j?rG1K0_@rr@]L1](bcZi?!SAd577]OnMMcgk]Jg%/e]Zi=WLH2m:3 N;@.:~> qD/DFs(4&CRK*;Tr%n6N!5A=0!1Ncbq_J;As0M]m!) qTK6-s4PW?k5YJDr65'=!5A=0!1Ncbqof-(s6TaI!7LSb#hJqKccjW+s53Fls75d*!TsF]bQI53 s4R7mJ,~> qIU#>s,:Q%ZiC'3r+>j_!6b6=!3c8Uqdoo9s2P&E!."9M#_Vg;E+W_As.Amps4R!U!OMh*Acp'Q s,?edJ,~> qD/2@s(;6d!pBTOr%n6N!5AC2!PW+@!;ePPRJd'bB(e"^g&G[`1BUABnkJa4s31'j!L`ue1BTo5 s(;*`J,~> qTK$'s4RCq!r2fXr65'=!5AC2!PW+@!;jt?k5>5Zg%NVkp&E_EbQH;kr6k5]s75d*!TsF]bQH2h s4R7mJ,~> qITf8s,?qh!q$#or+>j_!6bOom-1As4R!U!OMh*Acm#F s,?edJ,~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> qD/,>rVloOJGM)!!!'b1rr@TH!;nVSg&G[`1BP>kF7_6iB)e:j1]RITRJnuCbl@Am!6kEA!SMPh 1Oo~> qTJs%rVlokhtkRo!!'b1rr@TH!;t%Bp&E_EbQ@85h"8elg&L4+bl@\Ck5NR*o)JF-!:p*g!VP7C b^]~> qIT`6rVloXTDE0s1B>VqrrAJa1]1hdir=u:AcgN!TKF? Aq0~> qD/AEs,;#ekPqmc1]%.P^AIp1JGT?E1C%(_kVo; VYN#u~> qTK3,s5Mhrq#B^XbkhA?^AIp1JGT?EbQl`!ps71>s6oR'!nmV9o?@46"ObN qITu=s/DRJSf qD/DFs(4&C5hZ0fr%n3M"2=g86MCKW1Brg<^J4:^5k?c5B)e:j1C*sCs0FL;bl@Am!R1TC1BTo* s&o1SJ,~> qTK6-s4PW?ch7=qr65$<"2=g86MCKWbQd),n'_./ch#?^g&L4+bQn1Cs6RtRo)JF-!V69ibQH2d s47%jJ,~> qIU#>s,:Q%E8pnir+>g^"3^`EBD44ZAd577c[#3NE:[ZCN;p6UAdAA's2JY_g&LbX!SRMPAcm#> s+C/[J,~> qD/2@s(;6d!_r^0r%n3M"2=g8AH"mq$Msi"1Bbr%kPo/b1BM1gRI`3>s3.hL=Yn;%p+l`ns8=_T F8r-61Oo~> qTK$'s4RCq!n.,;r65$<"2=g8AH"mq&,QA'bQRM:q#B% qITf8s,?qh!dXglr+>g^"3^`EKDoK`48Ui1Ad$femJi.9AcdqkZh%c6s4PElK4`g:p1=?Ys8?O2 QN+VoAq0~> qD/2@s(;3c!WUCA1]%.P^AIp16MgcZ1BUAOs/, qTK$'s4R@p!WV`gbkhA?^AIp16MgcZbQH;ns69't!nmV9o?7I>o$[I,bjtf-bQ7;7rQG>hs76$1 J,~> qITf8s,?ng!WUjNB)=@abPV;>BDXL]Acm>Ys1Il6!f[/co4A7-fm38DB%d4XAc^TbrFQ+Ms4R6\ J,~> qD/2@s(;3c!WUCA1]%.S^An5jrk8@[qZ-IK"I];inj)b%!bVJ#o.pXObVP[eB$C;K1BG`"rA+L? s31 qTK$'s4R@p!WV`gbkhAB^An5jrk8@[qZ-K:"Qoaar6OrX!nmV9o?7I>o$$7rg%,1:bQ7;7rQG>h s76$1J,~> qITf8s,?ng!WUjNB)=@dbQ%V)rlY:?q_S(\"LJ..ol0J6!f[/co4A7-fk.SjN7n7)Ac^TbrFQ+M s4R6\J,~> qD/2@s(;6d!a5Q0r%n3M"2=g86MCKW1Bgq]b`)S:nhU>Zs-`I7#QN"(5k qTK$'s4RCq!nRD qITf8s,?qh!e^Nmr+>g^"3^`EBD44ZAd*hefr>"tnn%r^s0M qD/DFs(4&C5hZ0Lr%n3M"2=g8AH"mq-i3oA1C$2.nkCpas,?P*!bVJ#o.pOLbVM&6rr;[J!R1TC 1BUeNs%W>GJ,~> qTK6-s4PW?ch7=kr65$<"2=g8AH"mq-i3oAbQlJhr6ig[s5NXo!nmV9o?7@;o$#>;rr;]9!V69i bQHGos3gbfJ,~> qIU#>s,:Q%E8pnVr+>g^"3^`EKDoK`;u8BKAd<;Bom(0&s/GU%!f[/co4A.*fk+iqrr;\(!SRMP Acm\Ys*=HQJ,~> qD/AEs0J-;o)H&n1]%.P^AIp1JGT?E1C1>eN&*7ao(#rU1BM1gRI`38s31Hu!pBU`p+lrts-]b. s8RWF1Oo~> qTK3,s6Sn=r;Z-\bkhA?^AIp1JGT?EbR!S8iloWpr;>. qITu=s2MCup&E&/B)=@abPV;>RJSf qD/,>rr3&D^LmYurrUEN B)"04~> qTJs%rr3&jn(IQ]qZ$W1qu6YHqZ-T=!o3hHrQG>us7Q$.!nmV9o?778o)?i7h#IEJbQ.55rrVcX g%`dA~> qIT`6rr3&Qc]%^4q_J5qqu6Yaq_S1_!g`l>rFQ+ss5NZ_!f[/co4A%'g&>RbQN.!YAcUN`rrUln N;."8~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> q(i"9r+5q'q_S-M#q&&+-NF,o6:*'t!;SDO9kNuQ!^L@0rA+Id:%gCAAcPQr1B9] q9/ibr7M(uqons<#q&&+-NF,o6:*'t!;Xh>db469!mfQQrQG;qde:o`f`9IkbQ,uef`9Irb^]~> q.9VGr/:W$qe#a^#ubJL;_p4.B4k0@1\kV`H&V?,!cX*WrFQ(hH1kkKMu\.oAcQfJMu\/!Aq0~> q(i"_r;Qbbq_S-M$%W'UhZ*Z6s8PF`!;SDORK)k7"(qT5B)XRes-`R:r;Qf\B(RkZB)MZ/RJAXh~> q9/ilr;QcZqons<$%W'UhZ*Z6s8PF`!;Xh>k5Y%s"53_Sg&B1rs5s%!r;Qfmg% q.9Vcr;Qc'qe#a^$(:hnjtegUs8Qa01\kV`ZiBW/"-!9[N;dDis0ME2r;QfbN:^]^N;W\UZh\3`~> q(i(as0M]:!)<>HqZ$lYs8QV?s8Th1!;SDORK)k7"(qT5g& q9/ons6Tak5Y%s"53_Sp& q.9\es2P%s!."HRq_JK>s8R_(s8U:>1\kV`ZiBW/"-!9[ir3Njs0ME2#QMf&N3i3WQM"hkN;omV Mu\/!Aq0~> q(i(as-`U;qZ$jfs8V!6s5td,!;SDORK)k7#\O+\s*um]s-`R:!WSSe1BL_ZkOgV4B)cK91Oo~> q9/ons5s("qZ$jfs8V!6s7du=!;Xh>k5Y%s#hf7Ks52&Es5s%!!WV<]bQ?Aqq";i4g&Kaub^]~> q.9\es0MH3q_JIis8V6Ds6Wb^1\kV`ZiBW/#`Sf:s. q(i(as0M]:!'pE;q>^N0rVlkJq>g=I!L`uZ1C.UmB'8>51]Nm:1BINDrA+M]s(:s\!bVIkratp] J,~> q9/ons6Ta^N0rVlkJq>g?8!TsFRbQuo%g%b?dbl?i!bQ7b+rQG?0s4R+i!nmV5rn7(j J,~> q.9\es2P%s!-%gIqD/,prVlkcqD7qZ!OMgtAdF@qN:$"EB)f42Ac_q q(i"_r;Qb/q_S'K!%7aFq#L4H!L`uZ1C.UmAq9oL1]Nm:1BINDrA+MCs(:s\!+u0/pbRF~> q9/ilr;QcMqonm:!%7aFq#L67!TsFRbQuo%g#)hlbl?i!bQ7b+rQG?*s4R+i!87;Mprn6~> q.9Vcr;QbUqe#[\!)rjrq(qhY!OMgtAdF@qN1^-VB)f42Ac_q q(i(as0M]:!'pE;q>^N0rVlkJq>g=I!L`uZ1C.UmAi%[%5l[8G1BINDrA+MCs(:s\!bVIkratp] J,~> q9/ons6Ta^N0rVlkJq>g?8!TsFRbQuo%g!'$bci q.9\es2P%s!-%gIqD/,prVlkcqD7qZ!OMgtAdF@qN+Uc9E q(i(as-`U;qZ$^bs8V!Urr=GD!;SDORK)k7#\O*K1M6Zas-`R:!WSSd1BQ805kZu8B)cK91Oo~> q9/ons5s("qZ$^bs8V!Urr=GD!;Xh>k5Y%s#hf72bh<$\s5s%!!WV<\bQ@J;ch>Qag&Kaub^]~> q.9\es0MH3q_J=es8V6\rr?!p1\kV`ZiBW/#`SeBArQc&s0ME2!WTM)AcgulE;!lFN;nk0Aq0~> q(i(as-`U;qu@!0huE^CRfEE%qZ-FJ!L`uZ1C.UmAhu6Xs8SM\1C*rJ1G_;&s0MAS!bVIEoeV*~> q9/ons5s("qu@!5huE^CRfEE%qZ-H9!TsFRbQuo%g!%\/s8V6TbQn11bfnE"s6TF&!nmV,ouqp~> q.9\es0MH3r%eU?k5YHoYQ+XGq_S%[!OMgtAdF@qN+Q\Js8TG!AdA@BAnH#%s2O_D!f[/ q(i(as6'C*!.ar&qu?nhs8Te5-iX,G6MpiZ1BEpDo.pYas(4&C:&k6]p+lsRkKM0Ms3*b$1BM1g g&B1qJGD!O~> q9/ons7lTa!8m[tqu?nhs8Te5-iX,G6MpiZbQ6l+o?7Kns4PW?df9@0p<3dAq"""Us74M/bQ?Jt p&=L^htbKH~> q.9\es6]g=!2'.#r%eM[s8U7u;uZdsBDaR]Ac]7 q(i"Rr6,.kq_S0N!"/_>"t'BNAA5dHquHOK!J&Dc1BL_'=oL2YREU3T1]>MuVK;>b!*T6D!.al$ J,~> q9/iir:0jFqoo!=!"](C"t'BNAA5dHquHQ:!T3J>bQ?Adf)Ekpk47F'bl.)5l.kmS!7q)=!8mUr J,~> q.9VZr7M(Bqe#d_!'C2'##d<6K?MHAr%n.\!MA':AcdV lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> lne#/Z87"~> m*+hsZHRh~> lt5W@Z=\U~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> qD/2'R8*Z:!^N0(j>-c\r#,S\0(Uk!0)cah0(^q",PrAZ,P3bl0)cah0).5Q~> qTK#uk0j7Q!mg#djNIU^r+?%g\F[oE\Gg+@\FduFMu.,eMtG3n\Gg+@\G49u~> qITf$Z[)O^!cYK qD/1os31Hu!l+bcj>-cSqZ$X()Y>fc)ZB^:%.l=U%/U#)%.l=U)ZB^:%/;W/~> qTK#rs7605!q60HjNIU:qZ$X-BCsCJBDql21%`Zi1&CqN1%`ZiBDql21&/tC~> qITeps4RB`!mgn=jCSBdq_J77:%W#t:&ZpK5P/Of5Pm5:5P/Of:&ZpK5PSi@~> q(i5is,8aTs1dSM"W@@@"q1_8!!!r11B7XX!!"YE1C"U&"onW-$l&=i!!`B%!&"('J,~> q90'3s5M8Xs6o!l"_Rf8)DN00!!$[)bQ&R[!!'P%bQh!")?9aU0i@Se!#ke9!4_jKJ,~> q.9iWs/BUrs3K_;"\gd/3BoP'1B:/BAcOji1B:kVAd:gj3AWHO5=b?X!'1!6!+G\8J,~> q(i4?kPo/bk q90&hq#B%Fps8!E$"j5 q.9hMmJi. pbMn^rr2t1i\LZT!!!r:1BRsa!&""%"r%%;/cYkUo.pIe!!!r/1BnNn!%n6O#5L'*~> pri`krr2uOilhL;!!$[2bQA@U!4_dI##P@#\,ZLIo?7;L!!$['bQ^oE!4W"/)YqU-~> pgsMbrr2tWiar9e1G_c)Ack+N1L^#i#"LI*@5B]"o4A)!1G_bsAd1a]1LW'q3Vd9;~> pG2m(s6&>s!u_.>)ZDMp$ig8PpbN1.!!!]h,6.]goJ6Rf!!!r01C,T5!#.46!!"8?1Oo~> pWN^3s7kQs"(qT6BE$*W0`V33prj#R!!#m?MZ pLXKds6\cW"&1R-:&\`,5;P)rpgse?1G_O5<\lO4oO\2"1G_btAdDg$1Il%X1G`).Aq0~> pbN&@s6'EMi\LZT!!!r:1BRg]!&"%&![@[FrXAf,!#5&]!u_.>)Y>fe,6.`C%0$;-'`'V9~> prim's7lWVilhL;!!$[2bQAa`!4_gJ!fI$Yr\=EQ!)`C4"(qT6BCsCLMZSLe~> pgsZ8s6]imiar9e1G_c)Ack%L1L^&j!`h*5r]gE=!(ZZn"&1R-:%W$!<\lQ25Q8,?hJ~> q(i4Xs4K[#s(::I#oWdD)Da/f!!!5t1B7XU!!*EZoeQ[g!!!r01B7XU!!*EZq_Na~> q90&os7O_5s4QGV$"j5 q.9h`s5J"bs,>uM#u*339kJ!31G_&cAcOjf1BBRGok";#1G_btAcOjf1BBRGqdt?~> qD/CBkOMb3B)h$Zj>-rX!!!33#6"T&)Yc)j/cYkUrYbkI!!"8:1BSNq!#kMd""jQR#6#MC$ig8P q_Na~> qTK5kq#&^eg&LinjNId?!!!ol)ZB^:BDB[Q\,ZLIrau qIU"PmIc*DN;r9ajCSQi1G_$U3W:f7:&&<&@5B]"r_3JZ1G`))Acka`1JROS"( qD/2Zs,?q5!h')'j>-cSqZ$X()YZ#i'EA+Or\FX$!!!5r1BSNq!#kMd!u(_8)ZDMp,6.]Jq_Na~> qTK$-s5O%%!p9OOjNIU:qZ$X-BD9UP;#gT/rlbJ&!!!r1bQDJX!,(uK"&T$uBE$*WMZ<_qqojQ~> qITfKs/H!0!jhpQjCSBdq_J77:%r6%7l)qqral751G_&aAcka`1JROS"%P.':&\`,<\lNlqdt?~> q_J:=R>h&"s-WjPjYHl]r#,S\0(q(',8qIQr\FO,rYkGc"!\^&,P qof,fk2Q<_s5j=-jid^_r+?%g\G",KMe?\4rlbAPrb(oJ",gf)MtP9rMe?\4rlbAPrb),PJ,~> qdonKZ`3k7s0D]Ej^nKnr(R2m@J4:8<_Z:sral.=r_<&t"'/,j M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> M)0Y~> M9LJ~> M.V8~> %%EndData showpage %%Trailer end %%EOF yaz-5.34.4/doc/common/id.htmlhelp.xsl0000664000175000017500000000124614631643672013111 0 1 1 3 3 1 yaz-5.34.4/doc/common/stripref.xsl0000664000175000017500000000047214631643672012537 Generated by stripref.xsl . Do not edit yaz-5.34.4/doc/common/ref2dbinc.xsl0000664000175000017500000000141114631643672012531 Generated by stripref.xsl . Do not edit
<xsl:value-of select="refmeta/refentrytitle"/>
yaz-5.34.4/doc/common/README0000664000175000017500000000012214631643672011021 This directory contains various common files for our Docbook based documentation. yaz-5.34.4/doc/common/xml.dcl0000664000175000017500000001522114631643672011433 " PIC "?>" SHORTREF NONE NAMES SGMLREF QUANTITY NONE ENTITIES "amp" 38 "lt" 60 "gt" 62 "quot" 34 "apos" 39 FEATURES MINIMIZE DATATAG NO OMITTAG NO RANK NO SHORTTAG STARTTAG EMPTY NO UNCLOSED NO NETENABL IMMEDNET ENDTAG EMPTY NO UNCLOSED NO ATTRIB DEFAULT YES OMITNAME NO VALUE NO EMPTYNRM YES IMPLYDEF ATTLIST NO DOCTYPE NO ELEMENT NO ENTITY NO NOTATION NO LINK SIMPLE NO IMPLICIT NO EXPLICIT NO OTHER CONCUR NO SUBDOC NO FORMAL NO URN NO KEEPRSRE YES VALIDITY TYPE ENTITIES REF ANY INTEGRAL YES APPINFO NONE SEEALSO "ISO 8879:1986//NOTATION Extensible Markup Language (XML) 1.0//EN" > yaz-5.34.4/doc/common/Makefile.in0000664000175000017500000003666014754707577012241 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc/common ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_icu.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/yaz.m4 $(top_srcdir)/m4/yaz_libxml2.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = print.dsl CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(commondir)" DATA = $(common_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/print.dsl.in README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HIREDIS_LIBS = @HIREDIS_LIBS@ HTML_COMPILE = @HTML_COMPILE@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_CONFIG = @ICU_CONFIG@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ MEMCACHED_LIBS = @MEMCACHED_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ TCLSH = @TCLSH@ TCPD_LIBS = @TCPD_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YACC = @YACC@ YAZ_CONFIG_CFLAGS = @YAZ_CONFIG_CFLAGS@ YAZ_CONF_CFLAGS = @YAZ_CONF_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigpath = @pkgconfigpath@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ commondir = $(datadir)/doc/$(PACKAGE)$(PACKAGE_SUFFIX)/common common_DATA = style1.css id.png SUPPORTFILES = \ xml.dcl \ common.ent \ id.eps \ ref2dbinc.xsl \ stripref.xsl \ print.dsl.in \ id.htmlhelp.xsl \ id.man.xsl \ id.tkl.xsl EXTRA_DIST = $(SUPPORTFILES) $(common_DATA) README all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/common/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): print.dsl: $(top_builddir)/config.status $(srcdir)/print.dsl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-commonDATA: $(common_DATA) @$(NORMAL_INSTALL) @list='$(common_DATA)'; test -n "$(commondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(commondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(commondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(commondir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(commondir)" || exit $$?; \ done uninstall-commonDATA: @$(NORMAL_UNINSTALL) @list='$(common_DATA)'; test -n "$(commondir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(commondir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(commondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-commonDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-commonDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-commonDATA install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-commonDATA .PRECIOUS: Makefile # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: yaz-5.34.4/doc/common/id.tkl.xsl0000664000175000017500000000260714631643672012070 1 .tkl 0 <xsl:apply-templates select="." mode="object.title.markup"/> 1 yaz-5.34.4/doc/bib1-attr.70000664000175000017500000001431314754707606010541 '\" t .\" Title: Bib-1 Attribute Set .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Conventions and miscellaneous .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "BIB\-1 ATTRIBUTE SET" "7" "02/17/2025" "YAZ 5.34.4" "Conventions and miscellaneous" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" bib1-attr \- Bib\-1 Attribute Set .SH "DESCRIPTION" .PP This reference entry lists the Bib\-1 attribute set types and values\&. .SH "TYPES" .PP The Bib\-1 attribute set defines six attribute types: Use (1), Relation (2), Position (3), Structure (4), Truncation (5) and Completeness (6)\&. .SH "USE (1)" .PP .if n \{\ .RS 4 .\} .nf 1 Personal\-name 2 Corporate\-name 3 Conference\-name 4 Title 5 Title\-series 6 Title\-uniform 7 ISBN 8 ISSN 9 LC\-card\-number 10 BNB\-card\-number 11 BGF\-number 12 Local\-number 13 Dewey\-classification 14 UDC\-classification 15 Bliss\-classification 16 LC\-call\-number 17 NLM\-call\-number 18 NAL\-call\-number 19 MOS\-call\-number 20 Local\-classification 21 Subject\-heading 22 Subject\-Rameau 23 BDI\-index\-subject 24 INSPEC\-subject 25 MESH\-subject 26 PA\-subject 27 LC\-subject\-heading 28 RVM\-subject\-heading 29 Local\-subject\-index 30 Date 31 Date\-of\-publication 32 Date\-of\-acquisition 33 Title\-key 34 Title\-collective 35 Title\-parallel 36 Title\-cover 37 Title\-added\-title\-page 38 Title\-caption 39 Title\-running 40 Title\-spine 41 Title\-other\-variant 42 Title\-former 43 Title\-abbreviated 44 Title\-expanded 45 Subject\-precis 46 Subject\-rswk 47 Subject\-subdivision 48 Number\-natl\-biblio 49 Number\-legal\-deposit 50 Number\-govt\-pub 51 Number\-music\-publisher 52 Number\-db 53 Number\-local\-call 54 Code\-language 55 Code\-geographic 56 Code\-institution 57 Name\-and\-title 58 Name\-geographic 59 Place\-publication 60 CODEN 61 Microform\-generation 62 Abstract 63 Note 1000 Author\-title 1001 Record\-type 1002 Name 1003 Author 1004 Author\-name\-personal 1005 Author\-name\-corporate 1006 Author\-name\-conference 1007 Identifier\-standard 1008 Subject\-LC\-childrens 1009 Subject\-name\-personal 1010 Body\-of\-text 1011 Date/time\-added\-to\-db 1012 Date/time\-last\-modified 1013 Authority/format\-id 1014 Concept\-text 1015 Concept\-reference 1016 Any 1017 Server\-choice 1018 Publisher 1019 Record\-source 1020 Editor 1021 Bib\-level 1022 Geographic\-class 1023 Indexed\-by 1024 Map\-scale 1025 Music\-key 1026 Related\-periodical 1027 Report\-number 1028 Stock\-number 1030 Thematic\-number 1031 Material\-type 1032 Doc\-id 1033 Host\-item 1034 Content\-type 1035 Anywhere 1036 Author\-Title\-Subject .fi .if n \{\ .RE .\} .sp .SH "RELATION (2)" .PP .if n \{\ .RS 4 .\} .nf 1 Less than 2 Less than or equal 3 Equal 4 Greater or equal 5 Greater than 6 Not equal 100 Phonetic 101 Stem 102 Relevance 103 AlwaysMatches .fi .if n \{\ .RE .\} .sp .SH "POSITION (3)" .PP .if n \{\ .RS 4 .\} .nf 1 First in field 2 First in subfield 3 Any position in field .fi .if n \{\ .RE .\} .sp .SH "STRUCTURE (4)" .PP .if n \{\ .RS 4 .\} .nf 1 Phrase 2 Word 3 Key 4 Year 5 Date (normalized) 6 Word list 100 Date (un\-normalized) 101 Name (normalized) 102 Name (un\-normalized) 103 Structure 104 Urx 105 Free\-form\-text 106 Document\-text 107 Local\-number 108 String 109 Numeric\-string .fi .if n \{\ .RE .\} .sp .SH "TRUNCATION (5)" .PP .if n \{\ .RS 4 .\} .nf 1 Right truncation 2 Left truncation 3 Left and right truncation 100 Do not truncate 101 Process # in search term \&. regular #=\&.* 102 RegExpr\-1 103 RegExpr\-2 104 Process # ?n \&. regular: #=\&., ?n=\&.{0,n} or ?=\&.* Z39\&.58 .fi .if n \{\ .RE .\} .PP The 105\-106 truncation attributes below are only supported by Index Data\*(Aqs Zebra server\&. .sp .if n \{\ .RS 4 .\} .nf 105 Process * ! regular: *=\&.*, !=\&. and right truncate 106 Process * ! regular: *=\&.*, !=\&. .fi .if n \{\ .RE .\} .sp .SH "COMPLETENESS (6)" .PP .if n \{\ .RS 4 .\} .nf 1 Incomplete subfield 2 Complete subfield 3 Complete field .fi .if n \{\ .RE .\} .sp .SH "SORTING (7)" .PP .if n \{\ .RS 4 .\} .nf 1 ascending 2 descending .fi .if n \{\ .RE .\} .PP Type 7 is an Index Data extension to RPN queries that allows embedding a sort critieria into a query\&. .SH "SEE ALSO" .PP \m[blue]\fBBib\-1 Attribute Set\fR\m[]\&\s-2\u[1]\d\s+2 .PP \m[blue]\fBAttribute Set Bib\-1 Semantics\fR\m[]\&\s-2\u[2]\d\s+2\&. .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 Bib-1 Attribute Set .RS 4 \%https://www.loc.gov/z3950/agency/defns/bib1.html .RE .IP " 2." 4 Attribute Set Bib-1 Semantics .RS 4 \%http://www.loc.gov/z3950/agency/bib1.html .RE yaz-5.34.4/doc/zoom.options.html0000664000175000017500000000516714754707607012240 8. Options

8. Options

Most ZOOM objects provide a way to specify options to change behavior. From an implementation point of view, a set of options is just like an associative array / hash.

     ZOOM_options ZOOM_options_create(void);

     ZOOM_options ZOOM_options_create_with_parent(ZOOM_options parent);

     void ZOOM_options_destroy(ZOOM_options opt);
   
     const char *ZOOM_options_get(ZOOM_options opt, const char *name);

     void ZOOM_options_set(ZOOM_options opt, const char *name,
                           const char *v);
   
     typedef const char *(*ZOOM_options_callback)
                            (void *handle, const char *name);

     ZOOM_options_callback
             ZOOM_options_set_callback(ZOOM_options opt,
                                       ZOOM_options_callback c,
                                       void *handle);
   
yaz-5.34.4/doc/yaz-config.10000664000175000017500000000477114754707605011022 '\" t .\" Title: yaz-config .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-CONFIG" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-config \- Script to get information about YAZ\&. .SH "SYNOPSIS" .HP \w'\fByaz\-config\fR\ 'u \fByaz\-config\fR [\fB\-\-prefix[=\fR\fB\fIDIR\fR\fR\fB]\fR] [\fB\-\-version\fR] [\fB\-\-libs\fR] [\fB\-\-lalibs\fR] [\fB\-\-cflags\fR] [\fB\-\-include\fR] [\fB\-\-comp\fR] [\fB\-V\fR] [libraries...] .SH "DESCRIPTION" .PP \fByaz\-config\fR is a script that returns information that your own software should use to build software that uses YAZ\&. .PP The following libraries are supported: .PP threads .RS 4 Use the threaded version of YAZ\&. .RE .SH "OPTIONS" .PP \-\-prefix[=\fIDIR\fR] .RS 4 Returns prefix of YAZ or assume a different one if DIR is specified\&. .RE .PP \-\-version .RS 4 Returns version of YAZ\&. .RE .PP \-\-libs .RS 4 Library specification be used when using YAZ\&. .RE .PP \-\-lalibs .RS 4 Return library specification\&. .RE .PP \-\-cflags .RS 4 Return C Compiler flags\&. .RE .PP \-\-include .RS 4 Return C compiler includes for YAZ header files (\-Ipath)\&. .RE .PP \-\-comp .RS 4 Returns full path to YAZ\*(Aq ASN\&.1 compiler: yaz\-asncomp\&. .RE .PP \-V .RS 4 Returns YAZ SHA1 ID (from Git) and version\&. .RE .SH "FILES" .PP /usr/bin/yaz\-config .PP /usr/lib/libyaz*\&.a .PP /usr/include/yaz/*\&.h .SH "SEE ALSO" .PP yaz(7) .PP Section "How to make apps using YAZ on UNIX" in the YAZ manual\&. .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/yaz-illclient.10000664000175000017500000000426114754707605011526 '\" t .\" Title: yaz-illclient .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-ILLCLIENT" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-illclient \- ILL client .SH "SYNOPSIS" .HP \w'\fByaz\-illclient\fR\ 'u \fByaz\-illclient\fR [\fB\-f\ \fR\fB\fIfilename\fR\fR] [\fB\-v\ \fR\fB\fIloglevel\fR\fR] [\fB\-D\fR\ \fIname=value\fR...] [\fB\-o\fR] [\fB\-u\ \fR\fB\fIuser\fR\fR] [\fB\-p\ \fR\fB\fIpassword\fR\fR] [\fB\-V\fR] [server\-addr] .SH "DESCRIPTION" .PP \fByaz\-illclient\fR is a client which sends an ISO ILL request to a remote server and decodes the response from it\&. Exactly one server address ( \fIserver\-addr\fR ) must be specified\&. .SH "OPTIONS" .PP \-f \fIfilename\fR] .RS 4 Specify filename\&. .RE .PP \-v \fIloglevel\fR] .RS 4 Specify the log level\&. .RE .PP \-D \fIname=value\fR] .RS 4 Defines name & value pair\&. .RE .PP \-o .RS 4 Enable OCLC authentication\&. .RE .PP \-u \fIuser\fR] .RS 4 Specify user\&. .RE .PP \-p \fIpassword\fR] .RS 4 Specify password\&. .RE .PP \-V .RS 4 Show yaz\-illclient version\&. .RE .SH "EXAMPLES" .PP None yet\&. .SH "FILES" .PP None yet\&. .SH "SEE ALSO" .PP yaz(7) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/tools.retrieval.html0000664000175000017500000005050514754707607012712 6. Retrieval Facility

6. Retrieval Facility

YAZ version 2.1.20 or later includes a Retrieval facility tool which allows a SRU/Z39.50 to describe itself and perform record conversions. The idea is the following:

  • An SRU/Z39.50 client sends a retrieval request which includes a combination of the following parameters: syntax (format), schema (or element set name).

  • The retrieval facility is invoked with parameters in a server/proxy. The retrieval facility matches the parameters a set of "supported" retrieval types. If there is no match, the retrieval signals an error (syntax and / or schema not supported).

  • For a successful match, the backend is invoked with the same or altered retrieval parameters (syntax, schema). If a record is received from the backend, it is converted to the frontend name / syntax.

  • The resulting record is sent back the client and tagged with the frontend syntax / schema.

The Retrieval facility is driven by an XML configuration. The configuration is neither Z39.50 ZeeRex or SRU ZeeRex. But it should be easy to generate both of them from the XML configuration. (Unfortunately the two versions of ZeeRex differ substantially in this regard.)

6.1. Retrieval XML format

All elements should be covered by namespace http://indexdata.com/yaz . The root element node must be retrievalinfo.

The retrievalinfo must include one or more retrieval elements. Each retrieval defines specific combination of syntax, name and identifier supported by this retrieval service.

The retrieval element may include any of the following attributes:

syntax (REQUIRED)

Defines the record syntax. Possible values is any of the names defined in YAZ' OID database or a raw OID in (n.n ... n).

name (OPTIONAL)

Defines the name of the retrieval format. This can be any string. For SRU, the value is equivalent to schema (short-hand); for Z39.50 it's equivalent to simple element set name. For YAZ 3.0.24 and later this name may be specified as a glob expression with operators * and ?.

identifier (OPTIONAL)

Defines the URI schema name of the retrieval format. This can be any string. For SRU, the value is equivalent to URI schema. For Z39.50, there is no equivalent.

The retrieval may include one backend element. If a backend element is given, it specifies how the records are retrieved by some backend and how the records are converted from the backend to the "frontend".

The attributes, name and syntax may be specified for the backend element. The semantics of these attributes is equivalent to those for the retrieval. However, these values are passed to the "backend".

The backend element may include one or more conversion instructions (as children elements). The supported conversions are:

marc

The marc element specifies a conversion to - and from ISO2709 encoded MARC and MARCXML/MarcXchange. The following attributes may be specified:

inputformat (REQUIRED)

Format of input. Supported values are marc (for ISO2709), xml (MARCXML/MarcXchange) and json (MARC-in-JSON).

outputformat (REQUIRED)

Format of output. Supported values are line (MARC line format); marcxml (for MARCXML), marc (ISO2709), turbomarc, marcxchange (for MarcXchange), or json (MARC-in-JSON ).

inputcharset (OPTIONAL)

Encoding of input. For XML input formats, this need not be given, but for ISO2709 based input formats, this should be set to the encoding used. For MARC21 records, a common inputcharset value would be marc-8.

Note

If inputformat is marc and inputcharset is marc-8, then effective inputcharset is UTF-8 if leader position has value 'a' (MARC21 rule).

outputcharset (OPTIONAL)

Encoding of output. If outputformat is XML based, it is strongly recommended to use utf-8.

leaderspec (OPTIONAL)

Specifies a modification to the leader for the resulting output record. The leaderspec is a comma separated list of pos=value pairs, where pos is an integer offset (0 - 23) for leader. Value is either a quoted string or an integer (character value in decimal). For example, to set leader at offset 9 to a, use 9='a'. This has same effect as -l for yaz-marcdump(1).

select

The select selects one or more text nodes and decodes them as XML. The following attributes may be specified:

path (REQUIRED)

X-Path expression for selecting text nodes.

This conversion is available in YAZ 5.8.0 and later.

solrmarc

The solrmarc decodes solrmarc records. It assumes that the input is pure solrmarc text (no escaping) and will convert all sequences of the form #XX; to a single character of the hexadecimal value as given by XX. The output, presumably, is a valid ISO2709 buffer.

This conversion is available in YAZ 5.0.21 and later.

xslt

The xslt element specifies a conversion via XSLT. The following attributes may be specified:

stylesheet (REQUIRED)

Stylesheet file.

In addition, the element can be configured as follows:

param (OPTIONAL)

A param tag configures a parameter to be passed to the XSLT stylesheet. Multiple param tags may be defined.

rdf-lookup

The rdf-lookup element looks up BIBFRAME elements in some suitable service, for example http://id.loc.gov/authorities/names and replaces the URIs for specified elements with URIs it finds at that service. Its configuration consists of

debug (OPTIONAL)

Attribute to the rdf-lookup tag to enable debug output. A value of "1" makes the filter to add a XML comment next to each key it tried to look up, showing the URL, the result, and timing. This is useful for debugging the configuration. The default is not to add any comments.

timeout (OPTIONAL)

Attribute of the rdf-lookup tag which defines timeout in seconds for the HTTP based rdf-lookup.

namespace (OPTIONAL)

A namespace tag declares a namespace to be used in the xpath below. The tag requires two attributes: prefix and href.

lookup (REQUIRED)

A section that defines one tag to be looked up, for example an author.The xpath attribute (REQUIRED) specifies the path to the element(s).

key (REQUIRED)

A tag withing the lookup tag specifies the value to be used in the lookup, for example a name or an ID. It is a relative Xpath starting from the tag specified in the lookup.

server (OPTIONAL)

Specifies the URL for server to use for the lookup. A %s is replaced by the key value to be looked up. If not specified, defaults to the same as the previous lookup section, or lacking one, to http://id.loc.gov/authorities/names/label/%s . The method attribute can be used to specify the HTTP method to be used in this lookup. The default is GET, and the useful alternative is HEAD.

See the example below.

This conversion is available in YAZ 5.19.0 and later.

6.2. Retrieval Facility Examples

Example 7.19. MARC21 backend

A typical way to use the retrieval facility is to enable XML for servers that only supports ISO2709 encoded MARC21 records.

     <retrievalinfo>
       <retrieval syntax="usmarc" name="F"/>
       <retrieval syntax="usmarc" name="B"/>
       <retrieval syntax="xml" name="marcxml"
		  identifier="info:srw/schema/1/marcxml-v1.1">
         <backend syntax="usmarc" name="F">
	   <marc inputformat="marc" outputformat="marcxml"
		 inputcharset="marc-8"/>
	 </backend>
       </retrieval>
       <retrieval syntax="xml" name="dc">
         <backend syntax="usmarc" name="F">
	   <marc inputformat="marc" outputformat="marcxml"
		 inputcharset="marc-8"/>
           <xslt stylesheet="MARC21slim2DC.xsl"/>
	 </backend>
       </retrieval>
     </retrievalinfo>

     

This means that our frontend supports:

  • MARC21 F(ull) records.

  • MARC21 B(rief) records.

  • MARCXML records.

  • Dublin core records.


Example 7.20. MARCXML backend

SRW/SRU and Solr backends return records in XML. If they return MARCXML or MarcXchange, the retrieval module can convert those into ISO2709 formats, most commonly USMARC (AKA MARC21). In this example, the backend returns MARCXML for schema="marcxml".

     <retrievalinfo>
       <retrieval syntax="usmarc">
         <backend syntax="xml" name="marcxml">
	   <marc inputformat="xml" outputformat="marc"
		 outputcharset="marc-8"/>
	 </backend>
       </retrieval>
       <retrieval syntax="xml" name="marcxml"
		  identifier="info:srw/schema/1/marcxml-v1.1"/>
       <retrieval syntax="xml" name="dc">
         <backend syntax="xml" name="marcxml">
           <xslt stylesheet="MARC21slim2DC.xsl"/>
	 </backend>
       </retrieval>
     </retrievalinfo>

     

This means that our frontend supports:

  • MARC21 records (any element set name) in MARC-8 encoding.

  • MARCXML records for element-set=marcxml

  • Dublin core records for element-set=dc.


Example 7.21. RDF-lookup backend

This is a minimal example of the backend configuration for the rdf-lookup. It could well be used with some heavy xslt transforms that make BIBFRAME records out of MarxXml.

        <backend syntax="xml" name="rdf-lookup">
          <rdf-lookup debug="1" timeout="10">
            <namespace prefix="bf" href="http://id.loc.gov/ontologies/bibframe/" />
            <namespace prefix="bflc" href="http://id.loc.gov/ontologies/bibframe/lc-extensions/"/>
            <lookup xpath="//bf:contribution/bf:Contribution/bf:agent/bf:Agent">
              <key field="bflc:name00MatchKey"/>
              <key field="bflc:name01MatchKey"/>
              <key field="bflc:name11MatchKey"/>
              <server url="http://id.loc.gov/authorities/names/label/%s" method="HEAD"/>
            </lookup>
          </rdf-lookup>
        </backend>

     

The debug=1 attribute tells the filter to add XML comments to the key nodes that indicate what lookup it tried to do, how it went, and how long it took.

The namespace prefix bf: is defined in the namespace tags. These namespaces are used in the xpath expressions in the lookup sections.

The lookup tag specifies one tag to be looked up. The xpath attribute defines which node to modify. It may make use of the namespace definitions above.

The server tag gives the URL to be used for the lookup. A %s in the string will get replaced by the key value. If there is no server tag, the one from the preceding lookup section is used, and if there is no previous section, the id.loc.gov address is used as a default. The default is to make a GET request, this example uses HEAD


6.3. API

It should be easy to use the retrieval systems from applications. Refer to the headers yaz/retrieval.h and yaz/record_conv.h.

yaz-5.34.4/doc/yaz-marcdump.html0000664000175000017500000002272714754707607012174 yaz-marcdump

Name

yaz-marcdump — MARC record dump utility

Synopsis

yaz-marcdump [-i format] [-o format] [-f from] [-t to] [-l spec] [-c cfile] [-s prefix] [-C size] [-O offset] [-L limit] [-n] [-p] [-r] [-v] [-V] [file...]

DESCRIPTION

yaz-marcdump reads MARC records from one or more files. It parses each record and supports output in line-format, ISO2709, MARCXML, MARC-in-JSON, MarcXchange as well as Hex output.

This utility parses records ISO2709(raw MARC), line format, MARC-in-JSON format as well as XML if that is structured as MARCXML/MarcXchange.

MARC-in-JSON encoding/decoding is supported in YAZ 5.0.5 and later.

Note

As of YAZ 2.1.18, OAI-MARC is no longer supported. OAI-MARC is deprecated. Use MARCXML instead.

By default, each record is written to standard output in a line format with newline for each field, $x for each sub-field x. The output format may be changed with option -o,

yaz-marcdump can also be requested to perform character set conversion of each record.

OPTIONS

-i format

Specifies input format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON).

-o format

Specifies output format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON).

-f from

Specify the character set of the input MARC record. Should be used in conjunction with option -t. Refer to the yaz-iconv man page for supported character sets.

-t to

Specify the character set of the output. Should be used in conjunction with option -f. Refer to the yaz-iconv man page for supported character sets.

-l leaderspec

Specify a simple modification string for MARC leader. The leaderspec is a list of pos=value pairs, where pos is an integer offset (0 - 23) for leader. Value is either a quoted string or an integer (character value in decimal). Pairs are comma separated. For example, to set leader at offset 9 to a, use 9='a'.

-s prefix

Writes a chunk of records to a separate file with prefix given, i.e. splits a record batch into files with only at most "chunk" ISO2709 records per file. By default chunk is 1 (one record per file). See option -C.

-C chunksize

Specifies chunk size; to be used conjunction with option -s.

-O offset

Integer offset for at what position records whould be written. 0=first record, 1=second, .. With -L option, this allows a specific range of records to be processed.

-L limit

Integer limit for how many records should at most be written. With -O option, this allows a specific range of records to be processed.

-p

Makes yaz-marcdump print record number and input file offset of each record read.

-n

MARC output is omitted so that MARC input is only checked.

-r

Writes to stderr a summary about number of records read by yaz-marcdump.

-v

Writes more information about the parsing process. Useful if you have ill-formatted ISO2709 records as input.

-V

Prints YAZ version.

EXAMPLES

The following command converts MARC21/USMARC in MARC-8 encoding to MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'. Both input and output records are ISO2709 encoded.

    yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw
   

The same records may be converted to MARCXML instead in UTF-8:

    yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml
   

Turbo MARC is a compact XML notation with same semantics as MARCXML, but which allows for faster processing via XSLT. In order to generate Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one could use:

    yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml
   

FILES

prefix/bin/yaz-marcdump

prefix/include/yaz/marcdisp.h

SEE ALSO

yaz(7)

yaz-iconv(1)

yaz-5.34.4/doc/yaz-icu.html0000664000175000017500000002013314754707607011131 yaz-icu

Name

yaz-icu — YAZ ICU utility

Synopsis

yaz-icu [-c config] [-p opt] [-s] [-x] [infile]

DESCRIPTION

yaz-icu is a utility which demonstrates the ICU chain module of yaz. (yaz/icu.h).

The utility can be used in two ways. It may read some text using an XML configuration for configuring ICU and show text analysis. This mode is triggered by option -c which specifies the configuration to be used. The input file is read from standard input or from a file if infile is specified.

The utility may also show ICU information. This is triggered by option -p.

OPTIONS

-c config

Specifies the file containing ICU chain configuration which is XML based.

-p type

Specifies extra information to be printed about the ICU system. If type is c then ICU converters are printed. If type is l, then available locales are printed. If type is t, then available transliterators are printed.

-s

Specifies that output should include sort key as well. Note that sort key differs between ICU versions.

-x

Specifies that output should be XML based rather than "text" based.

ICU chain configuration

The ICU chain configuration specifies one or more rules to convert text data into tokens. The configuration format is XML based.

The toplevel element must be named icu_chain. The icu_chain element has one required attribute locale which specifies the ICU locale to be used in the conversion steps.

The icu_chain element must include elements where each element specifies a conversion step. The conversion is performed in the order in which the conversion steps are specified. Each conversion element takes one attribute: rule which serves as argument to the conversion step.

The following conversion elements are available:

casemap

Converts case (and rule specifies how):

l

Lower case using ICU function u_strToLower.

u

Upper case using ICU function u_strToUpper.

t

To title using ICU function u_strToTitle.

f

Fold case using ICU function u_strFoldCase.

display

This is a meta step which specifies that a term/token is to be displayed. This term is retrieved in an application using function icu_chain_token_display (yaz/icu.h).

transform

Specifies an ICU transform rule using a transliterator Identifier. The rule attribute is the transliterator Identifier. See ICU Transforms for more information.

transliterate

Specifies a rule-based transliterator. The rule attribute is the custom transformation rule to be used. See ICU Transforms for more information.

tokenize

Breaks / tokenizes a string into components using ICU functions ubrk_open, ubrk_setText, .. . The rule is one of:

l

Line. ICU: UBRK_LINE.

s

Sentence. ICU: UBRK_SENTENCE.

w

Word. ICU: UBRK_WORD.

c

Character. ICU: UBRK_CHARACTER.

t

Title. ICU: UBRK_TITLE.

join

Joins tokens into one string. The rule attribute is the joining string, which may be empty. The join conversion element was added in YAZ 4.2.49.

EXAMPLES

The following command analyzes text in file text using ICU chain configuration chain.xml:

    cat text | yaz-icu -c chain.xml
   

The chain.xml might look as follows:

<icu_chain locale="en">
  <transform rule="[:Control:] Any-Remove"/>
  <tokenize rule="w"/>
  <transform rule="[[:WhiteSpace:][:Punctuation:]] Remove"/>
  <transliterate rule="xy > z;"/>
  <display/>
  <casemap rule="l"/>
</icu_chain>

   

SEE ALSO

yaz(7)

ICU Home

ICU Transforms

yaz-5.34.4/doc/installation.unix.html0000664000175000017500000005553514754707607013251 2. UNIX/macOS

2. UNIX/macOS

We provide Debian GNU/Linux (i386 and amd64), Ubuntu (i386 and amd64) and CentOS (amd64 only) packages for YAZ. You should be able to create packages for other CPUs by building them from the source package.

YAZ is also part of several packages repositories. Some of them are

2.1. Compiling from source on Unix

You can choose to compile YAZ from official tar releases from http://ftp.indexdata.com/pub/yaz/ or clone it via GitHub https://github.com/indexdata/yaz.git.

If you wish to use character set conversion facilities in YAZ or if you are compiling YAZ for use with Zebra, it is a good idea to ensure that the iconv library is installed. Some Unixes today already have it - if not, we suggest GNU libiconv.

YAZ 3.0.16 and later includes a wrapper for the ICU (International Components for Unicode). In order to use this, the developer version of the ICU library must be available. ICU support is recommended for applications such as Pazpar2 and Zebra.

The libxslt, libxml2 libraries are required if YAZ is to support SRU/Solr. These libraries are very portable and should compile out-of-the box on virtually all Unix platforms. It is available in binary forms for Linux and others.

The GNU tools Autoconf, Automake and Libtool are used to generate Makefiles and configure YAZ for the system. You do not need these tools unless you're using the Git version of YAZ.

The CQL parser for YAZ is built using GNU Bison. This tool is only needed if you're using the Git version of YAZ.

YAZ includes a tiny ASN.1 compiler. This compiler is written in Tcl. But as for Bison you do not need it unless you're using Git version of YAZ or you're using the compiler to build your own codecs for private ASN.1.

If you are checking out from Git, run:

      ./buildconf.sh
     

This will create the configure script and Makefiles.

The next step is always:

     ./configure
    

The configure script attempts to use use the C compiler specified by the CC environment variable. If not set, GNU C will be used if it is available. The CFLAGS environment variable holds options to be passed to the C compiler. If you're using Bourne-compatible shell, you may pass something like this to use a particular C compiler with optimization enabled:

     CC=/opt/ccs/bin/cc CFLAGS=-O ./configure
    

To customize YAZ, the configure script also accepts a set of options. The most important are:

--prefix=prefix

Specifies installation prefix for YAZ. This is only needed if you run make install later to perform a "system" installation. The prefix is /usr/local if not specified.

--enable-tcpd

The front end server will be built using Wietse's TCP wrapper library. It allows you to allow/deny clients depending on IP number. The TCP wrapper library is often used in GNU/Linux and BSD distributions. See hosts_access(5) and tcpd(8).

--enable-threads

YAZ will be built using POSIX threads. Specifically, _REENTRANT will be defined during compilation.

--disable-shared

The make process will not create shared libraries (also known as shared objects .so). By default, shared libraries are created - equivalent to --enable-shared.

--disable-shared

The make process will not create static libraries (.a). By default, static libraries are created - equivalent to --enable-static.

--with-iconv[=prefix]

Compile YAZ with iconv library in directory prefix. By default configure will search for iconv on the system. Use this option if it doesn't find iconv. Alternatively, --without-iconv, can be used to force YAZ not to use iconv.

--with-xslt[=prefix]

Compile YAZ with libxslt in directory prefix. Use this option if you want XSLT and XML support. By default, configure will search for libxslt on the system. Use this option if libxslt is not found automatically. Alternatively, --without-xslt, can be used to force YAZ not to use libxslt.

--with-xml2[=prefix]

Compile YAZ with libxml2 in directory prefix. Use this option if you want YAZ to use XML and support SRU/Solr. By default, configure will search for libxml2 on the system. Use this option if libxml2 is not found automatically. Alternatively, --without-xml2, can be used to force YAZ not to use libxml2.

Note that option --with-xslt also enables libxml2.

--with-gnutls[=prefix]

YAZ will be linked with the GNU TLS libraries and an SSL COMSTACK will be provided. By default configure enables SSL support for YAZ if the GNU TLS development libraries are found on the system.

--with-icu[=prefix]

YAZ will be linked the ICU library in the prefix if given. If prefix is not given, the libraries exposed by the script icu-config will be used if found.

--with-memcached

YAZ will be linked with libMemcached to allow for result-set caching for ZOOM. The prefix can not be given. Note that 0.40 of libmemcached is required.

--with-redis

YAZ will be linked with the hiredis C library to allow for result-set caching for ZOOM on a redis server. The prefix can not be given.

When configured, build the software by typing:

      make
     

The following files are generated by the make process:

src/libyaz.la

Main YAZ library. This is no ordinary library. It's a Libtool archive. By default, YAZ creates a static library in lib/.libs/libyaz.a.

src/libyaz_server.la

Generic Frontend server. This is an add-on for libyaz.la. Code in this library uses POSIX threads functions - if POSIX threads are available on the platform.

src/libyaz_icu.la

Functions that wrap the ICU library.

ztest/yaz-ztest

Test Z39.50 server.

client/yaz-client

Z39.50 client for testing the protocol. See chapter YAZ client for more information.

util/yaz-config

A Bourne-shell script, generated by configure, that specifies how external applications should compile - and link with YAZ.

util/yaz-asncomp

The ASN.1 compiler for YAZ. Requires the Tcl Shell, tclsh, in PATH to operate.

util/yaz-iconv

This program converts data in one character set to another. This command exercises the YAZ character set conversion API.

util/yaz-marcdump

This program parses ISO2709 encoded MARC records and prints them in line-format or XML.

util/yaz-icu

This program exposes the ICU wrapper library if that is enabled for YAZ. Only if ICU is available this program is useful.

util/yaz-url

This program is a simple HTTP page fetcher ala wget or curl.

zoom/zoomsh

A simple shell implemented on top of the ZOOM functions. The shell is a command line application that allows you to enter simple commands to perform ZOOM operations.

zoom/zoomtst1, zoom/zoomtst2, ..

Several small applications that demonstrate the ZOOM API.

If you wish to install YAZ in system directories /usr/local/bin, /usr/local/lib .. etc, you can type:

     make install
    

You probably need to have root access in order to perform this. You must specify the --prefix option for configure if you wish to install YAZ in other directories than the default /usr/local/.

If you wish to perform an un-installation of YAZ, use:

     make uninstall
    

This will only work if you haven't reconfigured YAZ (and therefore changed installation prefix). Note that uninstall will not remove directories created by make install, e.g. /usr/local/include/yaz.

2.2. Compiling from source on macOS

Install Apple's Xcode Command Line Tools package from Apple Developer which provides necessary tools for building C/C++ programs on macOS. This is sufficient for compiling basic YAZ (e.g no ICU) from a source distribution tarball as XCLT includes libxml2 and libxslt development headers.

If you are compiling YAZ from a Git checkout, at the time of writing the latest version of XCLT is 15.4 and includes a very old GNU Bison which is insufficient to generate YAZ sources. You can use e.g. Homebrew to install a more recent version:

         brew install bison
       

After installation make sure to put it on the path:

         export PATH="/opt/homebrew/opt/bison/bin:$PATH"
       

Note: XCLT 15.4 fails to make gm4 available as m4 which can cause a silent Bison failure, one way to fix it is:

         sudo ln -s /Library/Developer/CommandLineTools/usr/bin/gm4 \
           /Library/Developer/CommandLineTools/usr/bin/m4
       

Additionally, you will need to install DocBook stylesheets to generate documentation:

         brew install docbook docbook-xsl
       

per the caveats section (brew info docbook), for the compilation to find them, add:

         export XML_CATALOG_FILES="/opt/homebrew/etc/xml/catalog"
       

If you want to compile YAZ with ICU you must install it with Homebrew as XCLT does not ship with ICU headers:

         brew install icu4c
       

and make sure to add compiler flags before the configure stage, per the caveats section (brew info icu4c):

         export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib"
         export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include"
         export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig"
       

If you want to also compile with more recent version of libxml2 and libxslt, install them with Homebrew:

         brew install libxml2 libxslt
       

and again make sure to add compiler flags, per the caveats section (brew info libxml2):

         export PATH="/opt/homebrew/opt/bison/bin:\
         /opt/homebrew/opt/libxml2/bin:\
         /opt/homebrew/opt/libxslt/bin:\
         $PATH"
         export LDFLAGS="-L/opt/homebrew/opt/libxml2/lib \
         -L/opt/homebrew/opt/libxslt/lib \
         -L/opt/homebrew/opt/icu4c/lib"
         export CPPFLAGS="-I/opt/homebrew/opt/libxml2/include \
         -I/opt/homebrew/opt/libxslt/include \
         -I/opt/homebrew/opt/icu4c/include"
         export PKG_CONFIG_PATH="/opt/homebrew/opt/libxml2/lib/pkgconfig:\
         /opt/homebrew/opt/libxslt/lib/pkgconfig:\
         /opt/homebrew/opt/icu4c/lib/pkgconfig"
       

Then configure and conpile with:

         ./configure
         make
       

2.3. How to make apps using YAZ on UNIX

This section describes how to compile - and link your own applications using the YAZ toolkit. If you're used to Makefiles this shouldn't be hard. As for other libraries you have used before, you need to set a proper include path for your C/C++ compiler and specify the location of YAZ libraries. You can do it by hand, but generally we suggest you use the yaz-config that is generated by configure. This is especially important if you're using the threaded version of YAZ which require you to pass more options to your linker/compiler.

The yaz-config script accepts command line options that makes the yaz-config script print options that you should use in your make process. The most important ones are: --cflags, --libs which prints C compiler flags, and linker flags respectively.

A small and complete Makefile for a C application consisting of one source file, myprog.c, may look like this:

      YAZCONFIG=/usr/local/bin/yaz-config
      CFLAGS=`$(YAZCONFIG) --cflags`
      LIBS=`$(YAZCONFIG) --libs`
      myprog: myprog.o
         $(CC) $(CFLAGS) -o myprog myprog.o $(LIBS)
      

The CFLAGS variable consists of a C compiler directive that will set the include path to the parent directory of yaz. That is, if YAZ header files were installed in /usr/local/include/yaz, then include path is set to /usr/local/include. Therefore, in your applications you should use

      #include <yaz/proto.h>
     

and not

      #include <proto.h>
     

For Libtool users, the yaz-config script provides a different variant of option --libs, called --lalibs that returns the name of the Libtool archive(s) for YAZ rather than the ordinary ones.

For applications using the threaded version of YAZ, specify threads after the other options. When threads is given, more flags and linker flags will be printed by yaz-config. If our previous example was using threads, you'd have to modify the lines that set CFLAGS and LIBS as follows:

      CFLAGS=`$(YAZCONFIG) --cflags threads`
      LIBS=`$(YAZCONFIG) --libs threads`
     

There is no need specify POSIX thread libraries in your Makefile. The LIBS variable includes that as well.

yaz-5.34.4/doc/yaz-log.html0000664000175000017500000002633414754707607011143 yaz-log

Name

yaz-log — Log handling in all yaz-based programs

Synopsis

yaz-XXXX [-v loglevel,...] [-l logfile]

DESCRIPTION

All YAZ-based programs use a common log subsystem, and should support common command line options for controlling it. This man page documents those.

OPTIONS

-l logfile

Specify the file where the log is to be written. If none is specified, stderr is used. The log is appended to this file. If the file grows overly large, it is silently rotated: It is renamed to logfile.1, logfile.2, .., 9 (old such file is deleted), and a new file is opened. The limit defaults to 1GB, but can be set by the program. The rotating limit can be specified with option -r for the YAZ frontend server (yaz-ztest).

Rotation can also be implicitly enabled by using a filename which gets changed for a given date, due to substitutions as given by the strftime(3) function.

-v loglevel

Specify the logging level. The argument is a set of log level names, separated by commas (no whitespace!), optionally preceded by a '-' to negate that level. Most programs have their own default, often containing fatal,warn,log, and some application-specific values. The default list can be cleared with the word none, or individual bits can be removed by prefixing them with a dash '-'.

LOG LEVELS TO CONTROL LOGGING

Some of the log levels control the way the log is written.

flush causes the log to be flushed after every write. This can have serious implications to performance, and should not be used in production. On the other hand, when debugging a program crash, this can be extremely useful. The option debug implies flush as well.

notime prevents the writing of time stamps. This is intended for automatic test scripts, which should produce predictable log files that are easy to compare.

GENERAL LOG LEVELS IN YAZ ITSELF

YAZ itself uses the following log levels:

fatal for fatal errors, that prevent further execution of the program.

warn for warnings about things that should be corrected.

debug for debugging. This flag may be used temporarily when developing or debugging yaz, or a program that uses yaz. It is practically deprecated, you should be defining and using your own log levels (see below).

all turns on almost all hard-coded log levels.

loglevel logs information about the log levels used by the program. Every time the log level is changed, lists all bits that are on. Every time a module asks for its log bits, this is logged. This can be used for getting an idea of what log levels are available in any program that uses yaz-log. Start the program with -v none,loglevel, and do some common operations with it. Another way is to grep for yaz_log_module_level in the source code, as in

      find . -name '*.[ch]' -print |
         xargs grep yaz_log_module_level |
         grep '"' |
         cut -d'"' -f2 |
         sort -u
   

eventl, malloc, nmem, odr are used internally for debugging yaz.

LOG LEVELS FOR CLIENTS

zoom logs the calls to the zoom API, which may be useful in debugging client applications.

LOG LEVELS FOR SERVERS

server logs the server functions on a high level, starting up, listening on a port, etc.

session logs individual sessions (connections).

request logs a one-liner for each request (init, search, etc.).

requestdetail logs the details of every request, before it is passed to the back-end, and the results received from it.

Each server program (zebra, etc.) is supposed to define its own log levels in addition to these. As they depend on the server in question, they can not be described here. See above how to find out about them.

LOGGING EXAMPLES

See what log levels yaz-ztest is using:

    yaz-ztest -1 -v none,loglevel
    14:43:29-23/11 [loglevel] Setting log level to 4096 = 0x00001000
    14:43:29-23/11 [loglevel] Static  log bit 00000001 'fatal' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000002 'debug' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000004 'warn' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000008 'log' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000080 'malloc' is off
    14:43:29-23/11 [loglevel] Static  log bit 00000800 'flush' is off
    14:43:29-23/11 [loglevel] Static  log bit 00001000 'loglevel' is ON
    14:43:29-23/11 [loglevel] Static  log bit 00002000 'server' is off
    14:43:29-23/11 [loglevel] Dynamic log bit 00004000 'session' is off
    14:43:29-23/11 [loglevel] Dynamic log bit 00008000 'request' is off
    14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session'
    14:44:13-23/11 yaz-ztest [loglevel] returning log bit 0x2000 for 'server'
    14:44:13-23/11 yaz-ztest [loglevel] returning NO log bit for 'eventl'
    14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x4000 for 'session'
    14:44:20-23/11 yaz-ztest [loglevel] returning log bit 0x8000 for 'request'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'requestdetail'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'odr'
    14:44:20-23/11 yaz-ztest [loglevel] returning NO log bit for 'ztest'
   

See the details of the requests for yaz-ztest

   ./yaz-ztest -1 -v requestdetail
   14:45:35-23/11 yaz-ztest [server] Adding static Z3950 listener on tcp:@:9999
   14:45:35-23/11 yaz-ztest [server] Starting server ./yaz-ztest pid=32200
   14:45:38-23/11 yaz-ztest [session] Starting session from tcp:127.0.0.1 (pid=32200)
   14:45:38-23/11 yaz-ztest [requestdetail] Got initRequest
   14:45:38-23/11 yaz-ztest [requestdetail] Id:        81
   14:45:38-23/11 yaz-ztest [requestdetail] Name:      YAZ
   14:45:38-23/11 yaz-ztest [requestdetail] Version:   2.0.28
   14:45:38-23/11 yaz-ztest [requestdetail] Negotiated to v3: srch prst del extendedServices namedresults scan sort
   14:45:38-23/11 yaz-ztest [request] Init from 'YAZ' (81) (ver 2.0.28) OK
   14:45:39-23/11 yaz-ztest [requestdetail] Got SearchRequest.
   14:45:39-23/11 yaz-ztest [requestdetail] ResultSet '1'
   14:45:39-23/11 yaz-ztest [requestdetail] Database 'Default'
   14:45:39-23/11 yaz-ztest [requestdetail] RPN query. Type: Bib-1
   14:45:39-23/11 yaz-ztest [requestdetail]  term 'foo' (general)
   14:45:39-23/11 yaz-ztest [requestdetail] resultCount: 7
   14:45:39-23/11 yaz-ztest [request] Search Z: @attrset Bib-1 foo  OK:7 hits
   14:45:41-23/11 yaz-ztest [requestdetail] Got PresentRequest.
   14:45:41-23/11 yaz-ztest [requestdetail] Request to pack 1+1 1
   14:45:41-23/11 yaz-ztest [requestdetail] pms=1048576, mrs=1048576
   14:45:41-23/11 yaz-ztest [request] Present: [1] 1+1  OK 1 records returned
   

LOG FILENAME EXAMPLES

A file with format my_YYYYMMDD.log (where Y, M, D is year, month, and day digits) is given as follows: -l my_%Y%m%d.log . And since the filename is depending on day, rotation will occur on midnight.

A weekly log could be specified as -l my_%Y%U.log.

FILES

prefix/include/yaz/log.h prefix/src/log.c

SEE ALSO

yaz(7) yaz-ztest(8) yaz-client(1) strftime(3)

yaz-5.34.4/doc/yaz-config.html0000664000175000017500000000771414754707607011630 yaz-config

Name

yaz-config — Script to get information about YAZ.

Synopsis

yaz-config [--prefix[=DIR]] [--version] [--libs] [--lalibs] [--cflags] [--include] [--comp] [-V] [libraries...]

DESCRIPTION

yaz-config is a script that returns information that your own software should use to build software that uses YAZ.

The following libraries are supported:

threads

Use the threaded version of YAZ.

OPTIONS

--prefix[=DIR]

Returns prefix of YAZ or assume a different one if DIR is specified.

--version

Returns version of YAZ.

--libs

Library specification be used when using YAZ.

--lalibs

Return library specification.

--cflags

Return C Compiler flags.

--include

Return C compiler includes for YAZ header files (-Ipath).

--comp

Returns full path to YAZ' ASN.1 compiler: yaz-asncomp.

-V

Returns YAZ SHA1 ID (from Git) and version.

FILES

/usr/bin/yaz-config

/usr/lib/libyaz*.a

/usr/include/yaz/*.h

SEE ALSO

yaz(7)

Section "How to make apps using YAZ on UNIX" in the YAZ manual.

yaz-5.34.4/doc/comstack.addresses.html0000664000175000017500000001047114754707607013334 6. Addresses

6. Addresses

The low-level format of the addresses are different depending on the mode of communication you have chosen. A function is provided by each of the lower layers to map a user-friendly string-form address to the binary form required by the lower layers.

    void *cs_straddr(COMSTACK handle, const char *str);
   

The format for TCP/IP and SSL addresses is:

    <host> [ ':' <portnum> ]
   

The hostname can be either a domain name or an IP address. The port number, if omitted, defaults to 210.

For TCP/IP and SSL, the special hostnames @, maps to IN6ADDR_ANY_INIT with IPV4 binding as well (bindv6only=0), The special hostname @4 binds to INADDR_ANY (IPV4 only listener). The special hostname @6 binds to IN6ADDR_ANY_INIT with bindv6only=1 (IPV6 only listener).

For UNIX sockets, the format of an address is the socket filename.

When a connection has been established, you can use

    const char *cs_addrstr(COMSTACK h);
   

to retrieve the host name of the peer system. The function returns a pointer to a static area, which is overwritten on the next call to the function.

A fairly recent addition to the COMSTACK module is the utility function

    COMSTACK cs_create_host (const char *str, int blocking, void **vp);
   

which is just a wrapper for cs_create and cs_straddr. The str is similar to that described for cs_straddr but with a prefix denoting the COMSTACK type. Prefixes supported are tcp: and unix: and ssl: for TCP/IP and UNIX and SSL respectively. If no prefix is given, then TCP/IP is used. The blocking is passed to function cs_create. The third parameter vp is a pointer to COMSTACK stack type specific values. Parameter vp is reserved for future use. Set it to NULL.

yaz-5.34.4/doc/asn.external.html0000664000175000017500000001554314754707607012163 3. EXTERNAL Data

3. EXTERNAL Data

In order to achieve extensibility and adaptability to different application domains, the new version of the protocol defines many structures outside of the main ASN.1 specification, referencing them through ASN.1 EXTERNAL constructs. To simplify the construction and access to the externally referenced data, the Z39.50 ASN.1 module defines a specialized version of the EXTERNAL construct, called Z_External.It is defined thus:

typedef struct Z_External
{
    Odr_oid *direct_reference;
    int *indirect_reference;
    char *descriptor;
    enum
    {
        /* Generic types */
        Z_External_single = 0,
        Z_External_octet,
        Z_External_arbitrary,

        /* Specific types */
        Z_External_SUTRS,
        Z_External_explainRecord,
        Z_External_resourceReport1,
        Z_External_resourceReport2

    ...

    } which;
    union
    {
        /* Generic types */
        Odr_any *single_ASN1_type;
        Odr_oct *octet_aligned;
        Odr_bitmask *arbitrary;

        /* Specific types */
        Z_SUTRS *sutrs;
        Z_ExplainRecord *explainRecord;
        Z_ResourceReport1 *resourceReport1;
        Z_ResourceReport2 *resourceReport2;

        ...

    } u;
} Z_External;
   

When decoding, the Z39.50 ASN.1 module will attempt to determine which syntax describes the data by looking at the reference fields (currently only the direct-reference). For ASN.1 structured data, you need only consult the which field to determine the type of data. You can the access the data directly through the union. When constructing data for encoding, you set the union pointer to point to the data, and set the which field accordingly. Remember also to set the direct (or indirect) reference to the correct OID for the data type. For non-ASN.1 data such as MARC records, use the octet_aligned arm of the union.

Some servers return ASN.1 structured data values (e.g. database records) as BER-encoded records placed in the octet-aligned branch of the EXTERNAL CHOICE. The ASN-module will not automatically decode these records. To help you decode the records in the application, the function

   Z_ext_typeent *z_ext_gettypebyref(const oid *oid);
   

can be used to retrieve information about the known, external data types. The function returns a pointer to a static area, or NULL, if no match for the given direct reference is found. The Z_ext_typeent is defined as:

typedef struct Z_ext_typeent
{
    int oid[OID_SIZE]; /* the direct-reference OID. */
    int what;          /* discriminator value for the external CHOICE */
    Odr_fun fun;       /* decoder function */
} Z_ext_typeent;
   

The what member contains the Z_External union discriminator value for the given type: For the SUTRS record syntax, the value would be Z_External_sutrs. The fun member contains a pointer to the function which encodes/decodes the given type. Again, for the SUTRS record syntax, the value of fun would be z_SUTRS (a function pointer).

If you receive an EXTERNAL which contains an octet-string value that you suspect of being an ASN.1-structured data value, you can use z_ext_gettypebyref to look for the provided direct-reference. If the return value is different from NULL, you can use the provided function to decode the BER string (see Section 2, “Using ODR” ).

If you want to send EXTERNALs containing ASN.1-structured values in the octet-aligned branch of the CHOICE, this is possible too. However, on the encoding phase, it requires a somewhat involved juggling around of the various buffers involved.

If you need to add new, externally defined data types, you must update the struct above, in the source file prt-ext.h, as well as the encoder/decoder in the file prt-ext.c. When changing the latter, remember to update both the arm array and the list type_table, which drives the CHOICE biasing that is necessary to tell the different, structured types apart on decoding.

Note

Eventually, the EXTERNAL processing will most likely automatically insert the correct OIDs or indirect-refs. First, however, we need to determine how application-context management (specifically the presentation-context-list) should fit into the various modules.

yaz-5.34.4/doc/introduction.html0000664000175000017500000002030614754707607012273 Chapter 1. Introduction

Chapter 1. Introduction

YAZ is a C/C++ library for information retrieval applications using the Z39.50/SRU/Solr protocols for information retrieval.

Properties of YAZ:

  • Complete Z39.50 version 3 support. Amendments and Z39.50-2002 revision is supported.

  • Supports SRU GET/POST/SOAP version 1.1, 1.2 and 2.0 (over HTTP and HTTPS).

  • Includes BER encoders/decoders for the ISO ILL protocol.

  • Supports Apache Solr Web Service version 1.4.x (client side only)

  • Supports the following transports: BER over TCP/IP (RFC1729), BER over Unix local socket, and HTTP 1.1.

  • Secure Socket Layer support using GnuTLS. If enabled, YAZ uses HTTPS transport (for SOAP) or "Secure BER" (for Z39.50).

  • Offers ZOOM C API implementing Z39.50, SRU and Solr Web Service.

  • The YAZ library offers a set of useful utilities related to the protocols, such as MARC (ISO2709) parser, CCL (ISO8777) parser, CQL parser, memory management routines, character set conversion.

  • Portable code. YAZ compiles out-of-the box on most Unixes and on Windows using Microsoft Visual C++.

  • Fast operation. The C based BER encoders/decoders as well as the server component of YAZ is very fast.

  • Liberal license that allows for commercial use of YAZ.

1. Reading this Manual

Most implementors only need to read a fraction of the material in this manual, so a quick walk-through of the chapters is in order.

  • Chapter 2, Compilation and Installation contains installation instructions for YAZ. You don't need to read this if you expect to download YAZ binaries. However, the chapter contains information about how to make your application link with YAZ.

  • Chapter 3, ZOOM describes the ZOOM API of YAZ. This is definitely worth reading if you wish to develop a Z39.50/SRU client.

  • Chapter 4, Generic server describes the generic front-end server and explains how to develop server Z39.50/SRU applications for YAZ. Obviously worth reading if you're to develop a server.

  • yaz-client(1) describes how to use the YAZ Z39.50 client. If you're a developer and wish to test your server or a server from another party, you might find this chapter useful.

  • Chapter 5, The Z39.50 ASN.1 Module documents the most commonly used Z39.50 C data structures offered by the YAZ API. Client developers using ZOOM and non-Z39.50 implementors may skip this.

  • Chapter 6, SOAP and SRU describes how SRU and SOAP is used in YAZ. Only if you're developing SRU applications this section is a must.

  • Chapter 7, Supporting Tools contains sections for the various tools offered by YAZ. Scan through the material quickly and see what's relevant to you! SRU implementors might find the CQL section particularly useful.

  • Chapter 8, The ODR Module goes through the details of the ODR module which is the work horse that encodes and decodes BER packages. Implementors using ZOOM only, do not need to read this. Most other Z39.50 implementors only need to read the first two sections (Section 1, “Introduction” and Section 2, “Using ODR”).

  • Chapter 9, The COMSTACK Module describes the network layer module COMSTACK. Implementors using ZOOM or the generic front-end server may skip this. Others, presumably, handling client/server communication on their own should read this.

yaz-5.34.4/doc/yaz-json-parse.html0000664000175000017500000000552214754707607012437 yaz-json-parse

Name

yaz-json-parse — YAZ JSON parser

Synopsis

yaz-json-parse [-p]

DESCRIPTION

yaz-json-parse is a utility which demonstrates the JSON API of YAZ. (yaz/json.h).

The program attempts to parse a JSON from standard input (stdin). It will return exit code 1 if parsing fails and the parsing error message will be printed to standard error (stderr). The program returns exit code 0 if parsing succeeds, and returns no output unless -p is given (see below).

OPTIONS

-p

Makes the JSON parser echo the JSON result string to standard output, if parsing from stdin was successful. If -p is given twice, then the output is a multi-line output with indentation (pretty print).

SEE ALSO

yaz(7)

yaz-5.34.4/doc/installation.html0000664000175000017500000001227614754707607012262 Chapter 2. Compilation and Installation

Chapter 2. Compilation and Installation

1. Introduction

The latest version of the software will generally be found at:

http://ftp.indexdata.com/pub/yaz/

We have tried our best to keep the software portable, and on many platforms, you should be able to compile everything with little or no changes.

The software is regularly tested on Debian GNU/Linux, CentOS, Ubuntu Linux, FreeBSD (i386), MAC OSX, Windows 10.

Some versions have be known to work on Windows XP, Solaris, HP/UX, DEC Unix, NetBSD, OpenBSD, IBM AIX, Data General DG/UX (with some CFLAGS tinkering), SGI/IRIX, DDE Supermax, Apple Macintosh (using the Codewarrior programming environment and the GUSI socket libraries), IBM AS/400 .

If you move the software to other platforms, we'd be grateful if you'd let us know about it. If you run into difficulties, we will try to help if we can, and if you solve the problems, we would be happy to include your fixes in the next release. So far, we have mostly avoided #ifdefs for individual platforms, and we'd like to keep it that way as far as it makes sense.

We maintain a mailing-list for the purpose of announcing new releases and bug-fixes, as well as general discussion. Subscribe by filling-in the form here. General questions and problems can be directed at mailto:info@indexdata.com, or the address given at the top of this document.

yaz-5.34.4/doc/zoomsh.html0000664000175000017500000001420314754707607011070 zoomsh

Name

zoomsh — ZOOM shell

Synopsis

zoomsh [-a apdufile] [-e] [-v loglevel] [commands...]

DESCRIPTION

zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets.

You may pass one or more commands to zoomsh. These commands are invoked first.

OPTIONS

-a apdufile

Logs protocol packages into apdufile (APDU log).

-e

Makes zoomsh stop processing commands as soon as an error occur. The exit code of zoomsh is 1 if error occurs; 0 otherwise.

-v loglevel

Sets YAZ log level to loglevel.

EXAMPLES

If you start the yaz-ztest in one console you can use the ZOOM shell as follows:

$ zoomsh
ZOOM>connect localhost:9999
ZOOM>search computer
localhost:9999: 7 hits
ZOOM>show 0 1
1 Default USmarc
001    11224466
003 DLC
005 00000000000000.0
008 910710c19910701nju           00010 eng
010    $a    11224466
040    $a DLC $c DLC
050 00 $a 123-xyz
100 10 $a Jack Collins
245 10 $a How to program a computer
260 1  $a Penguin
263    $a 8710
300    $a p. cm.
ZOOM>quit

    

You can also achieve the same result by passing the commands as arguments on a single command line:

$ zoomsh "connect localhost:9999" "search computer" "show 0 1" quit

COMMANDS

connect zurl

Connects to the target given by zurl.

close [zurl]

Closes connection to target given by zurl or all targets if zurl was omitted.

show [start [count]]

Displays count records starting at offset given by start. First records has offset 0 (unlike the Z39.50 protocol).

quit

Quits zoomsh.

set name [value]

Sets option name to value.

get name

Prints value of option name.

help

Prints list of available commands.

SEE ALSO

yaz(7), yaz-ztest(8),

Section "Building clients with ZOOM" in the YAZ manual.

ZOOM home page.

yaz-5.34.4/doc/zoom.events.html0000664000175000017500000000777614754707607012061 10. Events

10. Events

If you're developing non-blocking applications, you have to deal with events.

    int ZOOM_event(int no, ZOOM_connection *cs);
   

The ZOOM_event executes pending events for a number of connections. Supply the number of connections in no and an array of connections in cs (cs[0] ... cs[no-1]). A pending event could be sending a search, receiving a response, etc. When an event has occurred for one of the connections, this function returns a positive integer n denoting that an event occurred for connection cs[n-1]. When no events are pending for the connections, a value of zero is returned. To ensure that all outstanding requests are performed, call this function repeatedly until zero is returned.

If ZOOM_event returns, and returns non-zero, the last event that occurred can be expected.

    int ZOOM_connection_last_event(ZOOM_connection cs);
   

ZOOM_connection_last_event returns an event type (integer) for the last event.

Table 3.13. ZOOM Event IDs

EventDescription
ZOOM_EVENT_NONENo event has occurred
ZOOM_EVENT_CONNECTTCP/IP connect has initiated
ZOOM_EVENT_SEND_DATAData has been transmitted (sending)
ZOOM_EVENT_RECV_DATAData has been received
ZOOM_EVENT_TIMEOUTTimeout
ZOOM_EVENT_UNKNOWNUnknown event
ZOOM_EVENT_SEND_APDUAn APDU has been transmitted (sending)
ZOOM_EVENT_RECV_APDUAn APDU has been received
ZOOM_EVENT_RECV_RECORDA result-set record has been received
ZOOM_EVENT_RECV_SEARCHA search result has been received

yaz-5.34.4/doc/local.ent0000664000175000017500000000003314754707602010454 yaz-5.34.4/doc/yaz-asncomp-man.xml0000664000175000017500000002241414631643521012406 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-asncomp 1 Commands yaz-asncomp YAZ ASN.1 compiler yaz-asncomp filename DESCRIPTION yaz-asncomp is an ASN.1 compiler that reads an ASN.1 specification in filename and produces C/C++ definitions and BER encoders/decoders for it. The produced C/C++ code and header files uses the ODR module of YAZ which is a library that encodes/decodes/prints BER packages. yaz-asncomp allows you to specify name of resulting source via options. Alternatively, you can specify a DEFINITIONS file, which provides customized output to many output files - if the ASN.1 specification file consists of many modules. This utility is written in Tcl. Any version of Tcl should work. OPTIONS -v Makes the ASN.1 compiler print more verbose about the various stages of operations. -c cfile Specifies the name of the C/C++ file with encoders/decoders. -h hfile Specifies the name of header file with definitions. -p pfile Specifies the name of the a private header file with definitions. By default all definitions are put in header file (option -h). -d dfile Specifies the name of a definitions file. -I iout Specifies first part of directory in which header files are written. -i idir Specifies second part of directory in which header files are written. -m module Specifies that ASN.1 compiler should only process the module given. If this option is not specified, all modules in the ASN.1 file are processed. DEFINITIONS FILE The definitions file is really a Tcl script but follows traditional rules for Shell like configuration files. That is # denotes the beginning of a comment. Definitions are line oriented. The definitions files usually consist of a series of variable assignments of the form: set name value Available variables are: default-prefix Sets prefix for names in the produced output. The value consists of three tokens: C function prefix, C typedef prefix and preprocessor prefix respectively. prefix(module) This value sets prefix values for module module. The value has same form as default-prefix. filename(module) Specifies filename for C/header file for module module. init(module,h) Code fragment to be put in first part of public header for module module. body(module,h) Code fragment to be put in last part of public header for module module (trailer). init(module,c) Code fragment to be put in first part of C based encoder/decoder for module module. body(module,c) Code fragment to be put in last part of C based encoder/decoder for module module (trailer). map(module,name) Maps ASN.1 type in module module of name to value. membermap(module,name,member) Maps member member in SEQUENCE/CHOICE of name in module module to value. The value consists of one or two tokens. First token is name of C preprocessor part. Second token is resulting C member name. If second token is omitted the value (one token) is both preprocessor part and C struct,union. unionmap(module,name,member) Maps member member in CHOICE of name in module module to value. Value consists of two or three tokens. The first token is name of the integer in the union that is used as selector for the union itself. The second token is name of the union. The third token overrides the name of the CHOICE member; if omitted the member name is used. FILES /usr/share/yaz/z39.50/z.tcl /usr/share/yaz/z39.50/*.asn SEE ALSO yaz 7 Section "The ODR Module" in the YAZ manual. yaz-5.34.4/doc/comstack.summary.html0000664000175000017500000000531414754707607013054 9. Summary and Synopsis

9. Summary and Synopsis

    #include <yaz/comstack.h>

    #include <yaz/tcpip.h>  /* this is for TCP/IP and SSL support */
    #include <yaz/unix.h>   /* this is for UNIX socket support */

    COMSTACK cs_create(CS_TYPE type, int blocking, int protocol);

    COMSTACK cs_createbysocket(int s, CS_TYPE type, int blocking,
                               int protocol);
    COMSTACK cs_create_host(const char *str, int blocking,
                            void **vp);

    int cs_bind(COMSTACK handle, int mode);

    int cs_connect(COMSTACK handle, void *address);

    int cs_rcvconnect(COMSTACK handle);

    int cs_listen(COMSTACK handle);

    COMSTACK cs_accept(COMSTACK handle);

    int cs_put(COMSTACK handle, char *buf, int len);

    int cs_get(COMSTACK handle, char **buf, int *size);

    int cs_more(COMSTACK handle);

    void cs_close(COMSTACK handle);

    int cs_look(COMSTACK handle);

    void *cs_straddr(COMSTACK handle, const char *str);

    const char *cs_addrstr(COMSTACK h);

   
yaz-5.34.4/doc/tools.nmem.html0000664000175000017500000001043714754707607011651 3. Nibble Memory

3. Nibble Memory

Sometimes when you need to allocate and construct a large, interconnected complex of structures, it can be a bit of a pain to release the associated memory again. For the structures describing the Z39.50 PDUs and related structures, it is convenient to use the memory-management system of the ODR subsystem (see Section 2, “Using ODR”). However, in some circumstances where you might otherwise benefit from using a simple nibble-memory management system, it may be impractical to use odr_malloc() and odr_reset(). For this purpose, the memory manager which also supports the ODR streams is made available in the NMEM module. The external interface to this module is given in the nmem.h file.

The following prototypes are given:

    NMEM nmem_create(void);
    void nmem_destroy(NMEM n);
    void *nmem_malloc(NMEM n, size_t size);
    void nmem_reset(NMEM n);
    size_t nmem_total(NMEM n);
    void nmem_init(void);
    void nmem_exit(void);
   

The nmem_create() function returns a pointer to a memory control handle, which can be released again by nmem_destroy() when no longer needed. The function nmem_malloc() allocates a block of memory of the requested size. A call to nmem_reset() or nmem_destroy() will release all memory allocated on the handle since it was created (or since the last call to nmem_reset(). The function nmem_total() returns the number of bytes currently allocated on the handle.

The nibble-memory pool is shared amongst threads. POSIX mutexes and WIN32 Critical sections are introduced to keep the module thread safe. Function nmem_init() initializes the nibble-memory library and it is called automatically the first time the YAZ.DLL is loaded. YAZ uses function DllMain to achieve this. You should not call nmem_init or nmem_exit unless you're absolute sure what you're doing. Note that in previous YAZ versions you'd have to call nmem_init yourself.

yaz-5.34.4/doc/bib1-diagnostics.html0000664000175000017500000003574014754707607012704 Appendix B. Bib-1 diagnostics

Appendix B. Bib-1 diagnostics

List of Bib-1 diagnostics that are known to YAZ.

CodeText
1 Permanent system error
2 Temporary system error
3 Unsupported search
4 Terms only exclusion (stop) words
5 Too many argument words
6 Too many boolean operators
7 Too many truncated words
8 Too many incomplete subfields
9 Truncated words too short
10 Invalid format for record number (search term)
11 Too many characters in search statement
12 Too many records retrieved
13 Present request out of range
14 System error in presenting records
15 Record no authorized to be sent intersystem
16 Record exceeds Preferred-message-size
17 Record exceeds Maximum-record-size
18 Result set not supported as a search term
19 Only single result set as search term supported
20 Only ANDing of a single result set as search term supported
21 Result set exists and replace indicator off
22 Result set naming not supported
23 Combination of specified databases not supported
24 Element set names not supported
25 Specified element set name not valid for specified database
26 Only a single element set name supported
27 Result set no longer exists - unilaterally deleted by target
28 Result set is in use
29 One of the specified databases is locked
30 Specified result set does not exist
31 Resources exhausted - no results available
32 Resources exhausted - unpredictable partial results available
33 Resources exhausted - valid subset of results available
100 Unspecified error
101 Access-control failure
102 Security challenge required but could not be issued - request terminated
103 Security challenge required but could not be issued - record not included
104 Security challenge failed - record not included
105 Terminated by negative continue response
106 No abstract syntaxes agreed to for this record
107 Query type not supported
108 Malformed query
109 Database unavailable
110 Operator unsupported
111 Too many databases specified
112 Too many result sets created
113 Unsupported attribute type
114 Unsupported Use attribute
115 Unsupported value for Use attribute
116 Use attribute required but not supplied
117 Unsupported Relation attribute
118 Unsupported Structure attribute
119 Unsupported Position attribute
120 Unsupported Truncation attribute
121 Unsupported Attribute Set
122 Unsupported Completeness attribute
123 Unsupported attribute combination
124 Unsupported coded value for term
125 Malformed search term
126 Illegal term value for attribute
127 Unparsable format for un-normalized value
128 Illegal result set name
129 Proximity search of sets not supported
130 Illegal result set in proximity search
131 Unsupported proximity relation
132 Unsupported proximity unit code
201 Proximity not supported with this attribute combination
202 Unsupported distance for proximity
203 Ordered flag not supported for proximity
205 Only zero step size supported for Scan
206 Specified step size not supported for Scan
207 Cannot sort according to sequence
208 No result set name supplied on Sort
209 Generic sort not supported (database-specific sort only supported)
210 Database specific sort not supported
211 Too many sort keys
212 Duplicate sort keys
213 Unsupported missing data action
214 Illegal sort relation
215 Illegal case value
216 Illegal missing data action
217 Segmentation: Cannot guarantee records will fit in specified segments
218 ES: Package name already in use
219 ES: no such package, on modify/delete
220 ES: quota exceeded
221 ES: extended service type not supported
222 ES: permission denied on ES - id not authorized
223 ES: permission denied on ES - cannot modify or delete
224 ES: immediate execution failed
225 ES: immediate execution not supported for this service
226 ES: immediate execution not supported for these parameters
227 No data available in requested record syntax
228 Scan: malformed scan
229 Term type not supported
230 Sort: too many input results
231 Sort: incompatible record formats
232 Scan: term list not supported
233 Scan: unsupported value of position-in-response
234 Too many index terms processed
235 Database does not exist
236 Access to specified database denied
237 Sort: illegal sort
238 Record not available in requested syntax
239 Record syntax not supported
240 Scan: Resources exhausted looking for satisfying terms
241 Scan: Beginning or end of term list
242 Segmentation: max-segment-size too small to segment record
243 Present: additional-ranges parameter not supported
244 Present: comp-spec parameter not supported
245 Type-1 query: restriction ('resultAttr') operand not supported
246 Type-1 query: 'complex' attributeValue not supported
247 Type-1 query: 'attributeSet' as part of AttributeElement not supported
1001 Malformed APDU
1002 ES: EXTERNAL form of Item Order request not supported
1003 ES: Result set item form of Item Order request not supported
1004 ES: Extended services not supported unless access control is in effect
1005 Response records in Search response not supported
1006 Response records in Search response not possible for specified database (or database combination)
1007 No Explain server. Addinfo: pointers to servers that have a surrogate Explain database for this server
1008 ES: missing mandatory parameter for specified function. Addinfo: parameter
1009 ES: Item Order, unsupported OID in itemRequest. Addinfo: OID
1010 Init/AC: Bad Userid
1011 Init/AC: Bad Userid and/or Password
1012 Init/AC: No searches remaining (pre-purchased searches exhausted)
1013 Init/AC: Incorrect interface type (specified id valid only when used with a particular access method or client)
1014 Init/AC: Authentication System error
1015 Init/AC: Maximum number of simultaneous sessions for Userid
1016 Init/AC: Blocked network address
1017 Init/AC: No databases available for specified userId
1018 Init/AC: System temporarily out of resources
1019 Init/AC: System not available due to maintenance
1020 Init/AC: System temporarily unavailable (Addinfo: when it's expected back up)
1021 Init/AC: Account has expired
1022 Init/AC: Password has expired so a new one must be supplied
1023 Init/AC: Password has been changed by an administrator so a new one must be supplied
1024 Unsupported Attribute
1025 Service not supported for this database
1026 Record cannot be opened because it is locked
1027 SQL error
1028 Record deleted
1029 Scan: too many terms requested. Addinfo: max terms supported
1040 ES: Invalid function
1041 ES: Error in retention time
1042 ES: Permissions data not understood
1043 ES: Invalid OID for task specific parameters
1044 ES: Invalid action
1045 ES: Unknown schema
1046 ES: Too many records in package
1047 ES: Invalid wait action
1048 ES: Cannot create task package -- exceeds maximum permissible size
1049 ES: Cannot return task package -- exceeds maximum permissible size
1050 ES: Extended services request too large
1051 Scan: Attribute set id required -- not supplied
1052 ES: Cannot process task package record -- exceeds maximum permissible record size for ES
1053 ES: Cannot return task package record -- exceeds maximum permissible record size for ES response
1054 Init: Required negotiation record not included
1055 Init: negotiation option required
1056 Attribute not supported for database
1057 ES: Unsupported value of task package parameter
1058 Duplicate Detection: Cannot dedup on requested record portion
1059 Duplicate Detection: Requested detection criterion not supported
1060 Duplicate Detection: Requested level of match not supported
1061 Duplicate Detection: Requested regular expression not supported
1062 Duplicate Detection: Cannot do clustering
1063 Duplicate Detection: Retention criterion not supported
1064 Duplicate Detection: Requested number (or percentage) of entries
1065 Duplicate Detection: Requested sort criterion not supported
1066 CompSpec: Unknown schema, or schema not supported.
1067 Encapsulation: Encapsulated sequence of PDUs not supported
1068 Encapsulation: Base operation (and encapsulated PDUs) not executed based on pre-screening analysis
1069 No syntaxes available for this request
1070 user not authorized to receive record(s) in requested syntax
1071 preferredRecordSyntax not supplied
1072 Query term includes characters that do not translate into the target character set
1073 Database records do not contain data associated with access point
1074 Proxy failure
yaz-5.34.4/doc/yaz-url.10000664000175000017500000000544014754707606010352 '\" t .\" Title: yaz-url .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-URL" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-url \- YAZ URL fetch utility .SH "SYNOPSIS" .HP \w'\fByaz\-url\fR\ 'u \fByaz\-url\fR [\-H\ \fIname:value\fR] [\-m\ \fImethod\fR] [\-O\ \fIfname\fR] [\-p\ \fIfname\fR] [\-R\ \fInum\fR] [\-u\ \fIuser/password\fR] [\-v] [\-x\ \fIproxy\fR] [url...] .SH "DESCRIPTION" .PP \fByaz\-url\fR is utility to get web content\&. It is very limited in functionality compared to programs such as curl, wget\&. .PP The options must precede the URL given on the command line, to take effect\&. .PP Fetched HTTP content is written to stdout, unless option \-O is given\&. .SH "OPTIONS" .PP \-H \fIname:value\fR .RS 4 Specifies HTTP header content with name and value\&. This option can be given multiple times (for different names, of course)\&. .RE .PP \-m \fImethod\fR .RS 4 Specifies the HTTP method to be used for the next URL\&. Default is method "GET"\&. However, option \-p sets it to "POST"\&. .RE .PP \-O \fIfname\fR .RS 4 Sets output filename for HTTP content\&. .RE .PP \-p \fIfname\fR .RS 4 Sets a file to be POSTed in the following URL\&. .RE .PP \-R \fInum\fR .RS 4 Sets maximum number of HTTP redirects to be followed\&. A value of zero disables follow of HTTP redirects\&. .RE .PP \-u \fIuser/password\fR .RS 4 Specifies a user and a password to be used in HTTP basic authentication in the following URL fetch\&. The user and password must be separated by a slash (thus it is not possible to specify a user with a slash in it)\&. .RE .PP \-v .RS 4 Makes yaz\-url dump each HTTP request/response to stdout\&. .RE .PP \-x \fIproxy\fR .RS 4 Specifies a proxy to be used for URL fetch\&. .RE .SH "SEE ALSO" .PP \fByaz\fR(7) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/server.backendfunctions.html0000664000175000017500000005176114754707607014410 5. The Backend Functions

5. The Backend Functions

For each service of the protocol, the backend interface declares one or two functions. You are required to provide implementations of the functions representing the services that you wish to implement.

5.1. Init

bend_initresult (*bend_init)(bend_initrequest *r);
    

This handler is called once for each new connection request, after a new process/thread has been created, and an Initialize Request has been received from the client. The pointer to the bend_init handler is passed in the call to statserv_start.

This handler is also called when operating in SRU mode - when a connection has been made (even though SRU does not offer this service).

Unlike previous versions of YAZ, the bend_init also serves as a handler that defines the Z39.50 services that the backend intends to support. Pointers to all service handlers, including search - and fetch must be specified here in this handler.

The request - and result structures are defined as

typedef struct bend_initrequest
{
    /** \brief user/name/password to be read */
    Z_IdAuthentication *auth;
    /** \brief encoding stream (for results) */
    ODR stream;
    /** \brief printing stream */
    ODR print;
    /** \brief decoding stream (use stream for results) */
    ODR decode;
    /** \brief reference ID */
    Z_ReferenceId *referenceId;
    /** \brief peer address of client */
    char *peer_name;

    /** \brief character set and language negotiation

    see include/yaz/z-charneg.h
    */
    Z_CharSetandLanguageNegotiation *charneg_request;

    /** \brief character negotiation response */
    Z_External *charneg_response;

    /** \brief character set (encoding) for query terms

    This is NULL by default. It should be set to the native character
    set that the backend assumes for query terms */
    char *query_charset;

    /** \brief whether query_charset also applies to records

    Is 0 (No) by default. Set to 1 (yes) if records is in the same
    character set as queries. If in doubt, use 0 (No).
    */
    int records_in_same_charset;

    char *implementation_id;
    char *implementation_name;
    char *implementation_version;

    /** \brief Z39.50 sort handler */
    int (*bend_sort)(void *handle, bend_sort_rr *rr);
    /** \brief SRU/Z39.50 search handler */
    int (*bend_search)(void *handle, bend_search_rr *rr);
    /** \brief SRU/Z39.50 fetch handler */
    int (*bend_fetch)(void *handle, bend_fetch_rr *rr);
    /** \brief SRU/Z39.50 present handler */
    int (*bend_present)(void *handle, bend_present_rr *rr);
    /** \brief Z39.50 extended services handler */
    int (*bend_esrequest) (void *handle, bend_esrequest_rr *rr);
    /** \brief Z39.50 delete result set handler */
    int (*bend_delete)(void *handle, bend_delete_rr *rr);
    /** \brief Z39.50 scan handler */
    int (*bend_scan)(void *handle, bend_scan_rr *rr);
    /** \brief Z39.50 segment facility handler */
    int (*bend_segment)(void *handle, bend_segment_rr *rr);
    /** \brief SRU explain handler */
    int (*bend_explain)(void *handle, bend_explain_rr *rr);
    /** \brief SRU scan handler */
    int (*bend_srw_scan)(void *handle, bend_scan_rr *rr);
    /** \brief SRU record update handler */
    int (*bend_srw_update)(void *handle, bend_update_rr *rr);

    /** \brief whether named result sets are supported (0=disable, 1=enable) */
    int named_result_sets;
} bend_initrequest;

typedef struct bend_initresult
{
    int errcode;               /* 0==OK */
    char *errstring;           /* system error string or NULL */
    void *handle;              /* private handle to the backend module */
} bend_initresult;
    

In general, the server frontend expects that the bend_*result pointer that you return is valid at least until the next call to a bend_* function. This applies to all of the functions described herein. The parameter structure passed to you in the call belongs to the server frontend, and you should not make assumptions about its contents after the current function call has completed. In other words, if you want to retain any of the contents of a request structure, you should copy them.

The errcode should be zero if the initialization of the backend went well. Any other value will be interpreted as an error. The errstring isn't used in the current version, but one option would be to stick it in the initResponse as a VisibleString. The handle is the most important parameter. It should be set to some value that uniquely identifies the current session to the backend implementation. It is used by the frontend server in any future calls to a backend function. The typical use is to set it to point to a dynamically allocated state structure that is private to your backend module.

The auth member holds the authentication information part of the Z39.50 Initialize Request. Interpret this if your server requires authentication.

The members peer_name, implementation_id, implementation_name and implementation_version holds DNS of client, ID of implementor, name of client (Z39.50) implementation - and version.

The bend_ - members are set to NULL when bend_init is called. Modify the pointers by setting them to point to backend functions.

5.2. Search and Retrieve

We now describe the handlers that are required to support search - and retrieve. You must support two functions - one for search - and one for fetch (retrieval of one record). If desirable you can provide a third handler which is called when a present request is received which allows you to optimize retrieval of multiple-records.

int (*bend_search) (void *handle, bend_search_rr *rr);

typedef struct {
    char *setname;             /* name to give to this set */
    int replace_set;           /* replace set, if it already exists */
    int num_bases;             /* number of databases in list */
    char **basenames;          /* databases to search */
    Z_ReferenceId *referenceId;/* reference ID */
    Z_Query *query;            /* query structure */
    ODR stream;                /* encode stream */
    ODR decode;                /* decode stream */
    ODR print;                 /* print stream */

    bend_request request;
    bend_association association;
    int *fd;
    int hits;                  /* number of hits */
    int errcode;               /* 0==OK */
    char *errstring;           /* system error string or NULL */
    Z_OtherInformation *search_info; /* additional search info */
    char *srw_sortKeys;        /* holds SRU/SRW sortKeys info */
    char *srw_setname;         /* holds SRU/SRW generated resultsetID */
    int *srw_setnameIdleTime;  /* holds SRU/SRW life-time */
    int estimated_hit_count;   /* if hit count is estimated */
    int partial_resultset;     /* if result set is partial */
} bend_search_rr;
    

The bend_search handler is a fairly close approximation of a protocol Z39.50 Search Request - and Response PDUs. The setname is the resultSetName from the protocol. You are required to establish a mapping between the set name and whatever your backend database likes to use. Similarly, the replace_set is a boolean value corresponding to the resultSetIndicator field in the protocol. num_bases/basenames is a length of/array of character pointers to the database names provided by the client. The query is the full query structure as defined in the protocol ASN.1 specification. It can be either of the possible query types, and it's up to you to determine if you can handle the provided query type. Rather than reproduce the C interface here, we'll refer you to the structure definitions in the file include/yaz/z-core.h. If you want to look at the attributeSetId OID of the RPN query, you can either match it against your own internal tables, or you can use the OID tools.

The structure contains a number of hits, and an errcode/errstring pair. If an error occurs during the search, or if you're unhappy with the request, you should set the errcode to a value from the BIB-1 diagnostic set. The value will then be returned to the user in a nonsurrogate diagnostic record in the response. The errstring, if provided, will go in the addinfo field. Look at the protocol definition for the defined error codes, and the suggested uses of the addinfo field.

The bend_search handler is also called when the frontend server receives a SRU SearchRetrieveRequest. For SRU, a CQL query is usually provided by the client. The CQL query is available as part of Z_Query structure (note that CQL is now part of Z39.50 via an external). To support CQL in existing implementations that only do Type-1, we refer to the CQL-to-PQF tool described here.

To maintain backwards compatibility, the frontend server of yaz always assume that error codes are BIB-1 diagnostics. For SRU operation, a Bib-1 diagnostic code is mapped to SRU diagnostic.

int (*bend_fetch) (void *handle, bend_fetch_rr *rr);

typedef struct bend_fetch_rr {
    char *setname;             /* set name */
    int number;                /* record number */
    Z_ReferenceId *referenceId;/* reference ID */
    Odr_oid *request_format;   /* format, transfer syntax (OID) */
    Z_RecordComposition *comp; /* Formatting instructions */
    ODR stream;                /* encoding stream - memory source if req */
    ODR print;                 /* printing stream */

    char *basename;            /* name of database that provided record */
    int len;                   /* length of record or -1 if structured */
    char *record;              /* record */
    int last_in_set;           /* is it?  */
    Odr_oid *output_format;    /* response format/syntax (OID) */
    int errcode;               /* 0==success */
    char *errstring;           /* system error string or NULL */
    int surrogate_flag;        /* surrogate diagnostic */
    char *schema;              /* string record schema input/output */
} bend_fetch_rr;
    

The frontend server calls the bend_fetch handler when it needs database records to fulfill a Z39.50 Search Request, a Z39.50 Present Request or a SRU SearchRetrieveRequest. The setname is simply the name of the result set that holds the reference to the desired record. The number is the offset into the set (with 1 being the first record in the set). The format field is the record format requested by the client (See Section 2, “Object Identifiers”). A value of NULL for format indicates that the client did not request a specific format. The stream argument is an ODR stream which should be used for allocating space for structured data records. The stream will be reset when all records have been assembled, and the response package has been transmitted. For unstructured data, the backend is responsible for maintaining a static or dynamic buffer for the record between calls.

If a SRU SearchRetrieveRequest is received by the frontend server, the referenceId is NULL and the format (transfer syntax) is the OID for XML. The schema for SRU is stored in both the Z_RecordComposition structure and schema (simple string).

In the structure, the basename is the name of the database that holds the record. len is the length of the record returned, in bytes, and record is a pointer to the record. last_in_set should be nonzero only if the record returned is the last one in the given result set. errcode and errstring, if given, will be interpreted as a global error pertaining to the set, and will be returned in a non-surrogate-diagnostic. If you wish to return the error as a surrogate-diagnostic (local error) you can do this by setting surrogate_flag to 1 also.

If the len field has the value -1, then record is assumed to point to a constructed data type. The format field will be used to determine which encoder should be used to serialize the data.

Note

If your backend generates structured records, it should use odr_malloc() on the provided stream for allocating data: This allows the frontend server to keep track of the record sizes.

The format field is mapped to an object identifier in the direct reference of the resulting EXTERNAL representation of the record.

Note

The current version of YAZ only supports the direct reference mode.

int (*bend_present) (void *handle, bend_present_rr *rr);

typedef struct {
    char *setname;             /* set name */
    int start;
    int number;                /* record number */
    Odr_oid *format;           /* format, transfer syntax (OID) */
    Z_ReferenceId *referenceId;/* reference ID */
    Z_RecordComposition *comp; /* Formatting instructions */
    ODR stream;                /* encoding stream - memory source if required */
    ODR print;                 /* printing stream */
    bend_request request;
    bend_association association;

    int hits;                  /* number of hits */
    int errcode;               /* 0==OK */
    char *errstring;           /* system error string or NULL */
} bend_present_rr;
    

The bend_present handler is called when the server receives a Z39.50 Present Request. The setname, start and number is the name of the result set - start position - and number of records to be retrieved respectively. format and comp is the preferred transfer syntax and element specifications of the present request.

Note that this is handler serves as a supplement for bend_fetch and need not to be defined in order to support search - and retrieve.

5.3. Delete

For back-ends that supports delete of a result set, only one handler must be defined.

int (*bend_delete)(void *handle, bend_delete_rr *rr);

typedef struct bend_delete_rr {
    int function;
    int num_setnames;
    char **setnames;
    Z_ReferenceId *referenceId;
    int delete_status;      /* status for the whole operation */
    int *statuses;          /* status each set - indexed as setnames */
    ODR stream;
    ODR print;
} bend_delete_rr;
    

Note

The delete set function definition is rather primitive, mostly because we have had no practical need for it as of yet. If someone wants to provide a full delete service, we'd be happy to add the extra parameters that are required. Are there clients out there that will actually delete sets they no longer need?

5.4. Scan

For servers that wish to offer the scan service one handler must be defined.

int (*bend_scan)(void *handle, bend_scan_rr *rr);

typedef enum {
    BEND_SCAN_SUCCESS,  /* ok */
    BEND_SCAN_PARTIAL   /* not all entries could be found */
} bend_scan_status;

typedef struct bend_scan_rr {
    int num_bases;      /* number of elements in databaselist */
    char **basenames;   /* databases to search */
    Odr_oid *attributeset;
    Z_ReferenceId *referenceId; /* reference ID */
    Z_AttributesPlusTerm *term;
    ODR stream;         /* encoding stream - memory source if required */
    ODR print;          /* printing stream */

    int *step_size;     /* step size */
    int term_position;  /* desired index of term in result list/returned */
    int num_entries;    /* number of entries requested/returned */

    /* scan term entries. The called handler does not have
       to allocate this. Size of entries is num_entries (see above) */
    struct scan_entry *entries;
    bend_scan_status status;
    int errcode;
    char *errstring;
    char *scanClause;   /* CQL scan clause */
    char *setname;      /* Scan in result set (NULL if omitted) */
} bend_scan_rr;
    

This backend server handles both Z39.50 scan and SRU scan. In order for a handler to distinguish between SRU (CQL) scan Z39.50 Scan, it must check for a non-NULL value of scanClause.

Note

If designed today, it would be a choice using a union or similar, but that would break binary compatibility with existing servers.

yaz-5.34.4/doc/zoomsh-man.xml0000664000175000017500000001257214631643521011470 %local; %entities; %idcommon; ]> YAZ &version; Index Data zoomsh 1 Commands zoomsh ZOOM shell zoomsh commands DESCRIPTION zoomsh is a ZOOM client with a simple command line interface. The client demonstrates the ZOOM API and is useful for testing targets. You may pass one or more commands to zoomsh. These commands are invoked first. OPTIONS -a apdufile Logs protocol packages into apdufile (APDU log). -e Makes zoomsh stop processing commands as soon as an error occur. The exit code of zoomsh is 1 if error occurs; 0 otherwise. -v loglevel Sets YAZ log level to loglevel. EXAMPLES If you start the yaz-ztest in one console you can use the ZOOM shell as follows: connect localhost:9999 ZOOM>search computer localhost:9999: 7 hits ZOOM>show 0 1 1 Default USmarc 001 11224466 003 DLC 005 00000000000000.0 008 910710c19910701nju 00010 eng 010 $a 11224466 040 $a DLC $c DLC 050 00 $a 123-xyz 100 10 $a Jack Collins 245 10 $a How to program a computer 260 1 $a Penguin 263 $a 8710 300 $a p. cm. ZOOM>quit ]]> You can also achieve the same result by passing the commands as arguments on a single command line: $ zoomsh "connect localhost:9999" "search computer" "show 0 1" quit COMMANDS connect zurl Connects to the target given by zurl. close [zurl] Closes connection to target given by zurl or all targets if zurl was omitted. show [start [count]] Displays count records starting at offset given by start. First records has offset 0 (unlike the Z39.50 protocol). quit Quits zoomsh. set name [value] Sets option name to value. get name Prints value of option name. help Prints list of available commands. SEE ALSO yaz 7 , yaz-ztest 8 , Section "Building clients with ZOOM" in the YAZ manual. ZOOM home page. yaz-5.34.4/doc/yaz-marcdump-man.xml0000664000175000017500000002136214753417062012563 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-marcdump 1 Commands yaz-marcdump MARC record dump utility yaz-marcdump file DESCRIPTION yaz-marcdump reads MARC records from one or more files. It parses each record and supports output in line-format, ISO2709, MARCXML, MARC-in-JSON, MarcXchange as well as Hex output. This utility parses records ISO2709(raw MARC), line format, MARC-in-JSON format as well as XML if that is structured as MARCXML/MarcXchange. MARC-in-JSON encoding/decoding is supported in YAZ 5.0.5 and later. As of YAZ 2.1.18, OAI-MARC is no longer supported. OAI-MARC is deprecated. Use MARCXML instead. By default, each record is written to standard output in a line format with newline for each field, $x for each sub-field x. The output format may be changed with option -o, yaz-marcdump can also be requested to perform character set conversion of each record. OPTIONS -i format Specifies input format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON). -o format Specifies output format. Must be one of marcxml, marc (ISO2709), marcxchange (ISO25577), line (line mode MARC), turbomarc (Turbo MARC), or json (MARC-in-JSON). -f from Specify the character set of the input MARC record. Should be used in conjunction with option -t. Refer to the yaz-iconv man page for supported character sets. -t to Specify the character set of the output. Should be used in conjunction with option -f. Refer to the yaz-iconv man page for supported character sets. -l leaderspec Specify a simple modification string for MARC leader. The leaderspec is a list of pos=value pairs, where pos is an integer offset (0 - 23) for leader. Value is either a quoted string or an integer (character value in decimal). Pairs are comma separated. For example, to set leader at offset 9 to a, use 9='a'. -s prefix Writes a chunk of records to a separate file with prefix given, i.e. splits a record batch into files with only at most "chunk" ISO2709 records per file. By default chunk is 1 (one record per file). See option -C. -C chunksize Specifies chunk size; to be used conjunction with option -s. -O offset Integer offset for at what position records whould be written. 0=first record, 1=second, .. With -L option, this allows a specific range of records to be processed. -L limit Integer limit for how many records should at most be written. With -O option, this allows a specific range of records to be processed. -p Makes yaz-marcdump print record number and input file offset of each record read. -n MARC output is omitted so that MARC input is only checked. -r Writes to stderr a summary about number of records read by yaz-marcdump. -v Writes more information about the parsing process. Useful if you have ill-formatted ISO2709 records as input. -V Prints YAZ version. EXAMPLES The following command converts MARC21/USMARC in MARC-8 encoding to MARC21/USMARC in UTF-8 encoding. Leader offset 9 is set to 'a'. Both input and output records are ISO2709 encoded. yaz-marcdump -f MARC-8 -t UTF-8 -o marc -l 9=97 marc21.raw >marc21.utf8.raw The same records may be converted to MARCXML instead in UTF-8: yaz-marcdump -f MARC-8 -t UTF-8 -o marcxml marc21.raw >marcxml.xml Turbo MARC is a compact XML notation with same semantics as MARCXML, but which allows for faster processing via XSLT. In order to generate Turbo MARC records encoded in UTF-8 from MARC21 (ISO), one could use: yaz-marcdump -f MARC8 -t UTF8 -o turbomarc -i marc marc21.raw >out.xml FILES prefix/bin/yaz-marcdump prefix/include/yaz/marcdisp.h SEE ALSO yaz 7 yaz-iconv 1 yaz-5.34.4/doc/yaz-record-iconv.html0000664000175000017500000001010414754707607012740 yaz-record-iconv

Name

yaz-record-conv — YAZ Record Conversion Utility

Synopsis

yaz-record-conv [ -v loglevel ] [config] [fname...]

DESCRIPTION

yaz-record-conv is a program that exercises the record conversion sub system. Refer to record_conv.h header.

OPTIONS

-v level
Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none.

EXAMPLES

The following backend configuration converts MARC records (ISO2709) to Dublin-Core XML.

    <backend name="F" syntax="usmarc">
      <marc inputcharset="marc-8" inputformat="marc" outputformat="marcxml"/>
      <xslt stylesheet="../etc/MARC21slim2DC.xsl"/>
    </backend>
    
 

We can convert one of the sample records from YAZ' test directory with:

$ ../util/yaz-record-conv record-conv-conf.xml marc6.marc
<?xml version="1.0"?>
<dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/">
  <dc:title>How to program a computer</dc:title>
  <dc:creator>
    Jack Collins
  </dc:creator>
  <dc:type>text</dc:type>
  <dc:publisher>Penguin</dc:publisher>
  <dc:language>eng</dc:language>
</dc:dc>

 

FILES

record_conv.h

SEE ALSO

yaz(7)

yaz-5.34.4/doc/book.xml0000664000175000017500000134716114753417062010344 %local; %entities; %idcommon; ]> YAZ User's Guide and Reference SebastianHammer AdamDickmeiss MikeTaylor HeikkiLevanto DennisSchafroth JakubSkoczen &version; ©right-year; Index Data This document is the programmer's guide and reference to the &yaz; package version &version;. &yaz; is a compact toolkit that provides access to the Z39.50 and SRU/Solr protocols, as well as a set of higher-level tools for implementing the server and client roles, respectively. The documentation can be used on its own, or as a reference when looking at the example applications provided with the package. Introduction &yaz; is a C/C++ library for information retrieval applications using the Z39.50/SRU/Solr protocols for information retrieval. Properties of &yaz;: Complete Z39.50 version 3 support. Amendments and Z39.50-2002 revision is supported. Supports SRU GET/POST/SOAP version 1.1, 1.2 and 2.0 (over HTTP and HTTPS). Includes BER encoders/decoders for the ISO ILL protocol. Supports Apache Solr Web Service version 1.4.x (client side only) Supports the following transports: BER over TCP/IP (RFC1729), BER over Unix local socket, and HTTP 1.1. Secure Socket Layer support using GnuTLS. If enabled, &yaz; uses HTTPS transport (for SOAP) or "Secure BER" (for Z39.50). Offers ZOOM C API implementing Z39.50, SRU and Solr Web Service. The &yaz; library offers a set of useful utilities related to the protocols, such as MARC (ISO2709) parser, CCL (ISO8777) parser, CQL parser, memory management routines, character set conversion. Portable code. &yaz; compiles out-of-the box on most Unixes and on Windows using Microsoft Visual C++. Fast operation. The C based BER encoders/decoders as well as the server component of &yaz; is very fast. Liberal license that allows for commercial use of &yaz;. Reading this Manual Most implementors only need to read a fraction of the material in this manual, so a quick walk-through of the chapters is in order. contains installation instructions for &yaz;. You don't need to read this if you expect to download &yaz; binaries. However, the chapter contains information about how to make your application link with &yaz;. describes the ZOOM API of &yaz;. This is definitely worth reading if you wish to develop a Z39.50/SRU client. describes the generic front-end server and explains how to develop server Z39.50/SRU applications for &yaz;. Obviously worth reading if you're to develop a server. describes how to use the &yaz; Z39.50 client. If you're a developer and wish to test your server or a server from another party, you might find this chapter useful. documents the most commonly used Z39.50 C data structures offered by the &yaz; API. Client developers using ZOOM and non-Z39.50 implementors may skip this. describes how SRU and SOAP is used in &yaz;. Only if you're developing SRU applications this section is a must. contains sections for the various tools offered by &yaz;. Scan through the material quickly and see what's relevant to you! SRU implementors might find the CQL section particularly useful. goes through the details of the ODR module which is the work horse that encodes and decodes BER packages. Implementors using ZOOM only, do not need to read this. Most other Z39.50 implementors only need to read the first two sections ( and ). describes the network layer module COMSTACK. Implementors using ZOOM or the generic front-end server may skip this. Others, presumably, handling client/server communication on their own should read this. The API The &yaz; toolkit offers several different levels of access to the ISO23950/Z39.50, ILL and SRU protocols. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement. If you're developing a client application you should consider the ZOOM API. It is, by far, the easiest way to develop clients in C. Server implementors should consider the generic front-end server. None of those high-level APIs support the whole protocol, but they do include most facilities used in existing Z39.50 applications. If you're using 'exotic' functionality (meaning anything not included in the high-level APIs), developing non-standard extensions to Z39.50 or you're going to develop an ILL application, you'll have to learn the lower level APIs of &yaz;. The YAZ toolkit modules are shown in figure .
YAZ layers
There are four layers. A client or server application (or both). This layer includes ZOOM and the generic front-end server. The second layer provides a C representation of the protocol units (packages) for Z39.50 ASN.1, ILL ASN.1, SRU. The third layer encodes and decodes protocol data units to simple packages (buffer with certain length). The &odr; module encodes and decodes BER whereas the HTTP modules encodes and decodes HTTP requests/responses. The lowest layer is &comstack; which exchanges the encoded packages with a peer process over a network. The &asn; module represents the ASN.1 definition of the Z39.50 protocol. It establishes a set of type and structure definitions, with one structure for each of the top-level PDUs, and one structure or type for each of the contained ASN.1 types. For primitive types, or other types that are defined by the ASN.1 standard itself (such as the EXTERNAL type), the C representation is provided by the &odr; (Open Data Representation) subsystem. &odr; is a basic mechanism for representing an ASN.1 type in the C programming language, and for implementing BER encoders and decoders for values of that type. The types defined in the &asn; module generally have the prefix Z_, and a suffix corresponding to the name of the type in the ASN.1 specification of the protocol (generally Z39.50-1995). In the case of base types (those originating in the ASN.1 standard itself), the prefix Odr_ is sometimes seen. Either way, look for the actual definition in either z-core.h (for the types from the protocol), odr.h (for the primitive ASN.1 types). The &asn; library also provides functions (which are, in turn, defined using &odr; primitives) for encoding and decoding data values. Their general form is int z_xxx ODR o Z_xxx **p int optional const char *name (note the lower-case "z" in the function name) If you are using the premade definitions of the &asn; module, and you are not adding a new protocol of your own, the only parts of &odr; that you need to worry about are documented in . When you have created a BER-encoded buffer, you can use the &comstack; subsystem to transmit (or receive) data over the network. The &comstack; module provides simple functions for establishing a connection (passively or actively, depending on the role of your application), and for exchanging BER-encoded PDUs over that connection. When you create a connection endpoint, you need to specify what transport to use (TCP/IP, SSL or UNIX sockets). For the remainder of the connection's lifetime, you don't have to worry about the underlying transport protocol at all - the &comstack; will ensure that the correct mechanism is used. We call the combined interfaces to &odr;, &asn;, and &comstack; the service level API. It's the API that most closely models the Z39.50 service/protocol definition, and it provides unlimited access to all fields and facilities of the protocol definitions. The reason that the &yaz; service-level API is a conglomerate of the APIs from three different sub-modules is twofold. First, we wanted to allow the user a choice of different options for each major task. For instance, if you don't like the protocol API provided by &odr;/&asn;, you can use SNACC or BERUtils instead, and still have the benefits of the transparent transport approach of the &comstack; module. Secondly, we realize that you may have to fit the toolkit into an existing event-processing structure, in a way that is incompatible with the &comstack; interface or some other part of &yaz;.
Compilation and Installation Introduction The latest version of the software will generally be found at: We have tried our best to keep the software portable, and on many platforms, you should be able to compile everything with little or no changes. The software is regularly tested on Debian GNU/Linux, CentOS, Ubuntu Linux, FreeBSD (i386), MAC OSX, Windows 10. Some versions have be known to work on Windows XP, Solaris, HP/UX, DEC Unix, NetBSD, OpenBSD, IBM AIX, Data General DG/UX (with some CFLAGS tinkering), SGI/IRIX, DDE Supermax, Apple Macintosh (using the Codewarrior programming environment and the GUSI socket libraries), IBM AS/400 . If you move the software to other platforms, we'd be grateful if you'd let us know about it. If you run into difficulties, we will try to help if we can, and if you solve the problems, we would be happy to include your fixes in the next release. So far, we have mostly avoided #ifdefs for individual platforms, and we'd like to keep it that way as far as it makes sense. We maintain a mailing-list for the purpose of announcing new releases and bug-fixes, as well as general discussion. Subscribe by filling-in the form here. General questions and problems can be directed at , or the address given at the top of this document. UNIX/macOS We provide Debian GNU/Linux (i386 and amd64), Ubuntu (i386 and amd64) and CentOS (amd64 only) packages for &yaz;. You should be able to create packages for other CPUs by building them from the source package. YAZ is also part of several packages repositories. Some of them are Solaris CSW: Solaris: FreeBSD: Debian: Ubuntu: NetBSD: Compiling from source on Unix You can choose to compile YAZ from official tar releases from or clone it via GitHub . If you wish to use character set conversion facilities in &yaz; or if you are compiling &yaz; for use with Zebra, it is a good idea to ensure that the iconv library is installed. Some Unixes today already have it - if not, we suggest GNU libiconv. YAZ 3.0.16 and later includes a wrapper for the ICU (International Components for Unicode). In order to use this, the developer version of the ICU library must be available. ICU support is recommended for applications such as Pazpar2 and Zebra. The libxslt, libxml2 libraries are required if &yaz; is to support SRU/Solr. These libraries are very portable and should compile out-of-the box on virtually all Unix platforms. It is available in binary forms for Linux and others. The GNU tools Autoconf, Automake and Libtool are used to generate Makefiles and configure &yaz; for the system. You do not need these tools unless you're using the Git version of &yaz;. The CQL parser for &yaz; is built using GNU Bison. This tool is only needed if you're using the Git version of &yaz;. &yaz; includes a tiny ASN.1 compiler. This compiler is written in Tcl. But as for Bison you do not need it unless you're using Git version of &yaz; or you're using the compiler to build your own codecs for private ASN.1. If you are checking out from Git, run: ./buildconf.sh This will create the configure script and Makefiles. The next step is always: ./configure The configure script attempts to use use the C compiler specified by the CC environment variable. If not set, GNU C will be used if it is available. The CFLAGS environment variable holds options to be passed to the C compiler. If you're using Bourne-compatible shell, you may pass something like this to use a particular C compiler with optimization enabled: CC=/opt/ccs/bin/cc CFLAGS=-O ./configure To customize &yaz;, the configure script also accepts a set of options. The most important are: --prefix=prefix Specifies installation prefix for &yaz;. This is only needed if you run make install later to perform a "system" installation. The prefix is /usr/local if not specified. --enable-tcpd The front end server will be built using Wietse's TCP wrapper library. It allows you to allow/deny clients depending on IP number. The TCP wrapper library is often used in GNU/Linux and BSD distributions. See hosts_access 5 and tcpd 8 . --enable-threads &yaz; will be built using POSIX threads. Specifically, _REENTRANT will be defined during compilation. --disable-shared The make process will not create shared libraries (also known as shared objects .so). By default, shared libraries are created - equivalent to --enable-shared. --disable-shared The make process will not create static libraries (.a). By default, static libraries are created - equivalent to --enable-static. --with-iconv[=prefix] Compile &yaz; with iconv library in directory prefix. By default configure will search for iconv on the system. Use this option if it doesn't find iconv. Alternatively, --without-iconv, can be used to force &yaz; not to use iconv. --with-xslt[=prefix] Compile &yaz; with libxslt in directory prefix. Use this option if you want XSLT and XML support. By default, configure will search for libxslt on the system. Use this option if libxslt is not found automatically. Alternatively, --without-xslt, can be used to force &yaz; not to use libxslt. --with-xml2[=prefix] Compile &yaz; with libxml2 in directory prefix. Use this option if you want &yaz; to use XML and support SRU/Solr. By default, configure will search for libxml2 on the system. Use this option if libxml2 is not found automatically. Alternatively, --without-xml2, can be used to force &yaz; not to use libxml2. Note that option --with-xslt also enables libxml2. --with-gnutls[=prefix] &yaz; will be linked with the GNU TLS libraries and an SSL COMSTACK will be provided. By default configure enables SSL support for YAZ if the GNU TLS development libraries are found on the system. --with-icu[=prefix] &yaz; will be linked the ICU library in the prefix if given. If prefix is not given, the libraries exposed by the script icu-config will be used if found. --with-memcached &yaz; will be linked with libMemcached to allow for result-set caching for ZOOM. The prefix can not be given. Note that 0.40 of libmemcached is required. --with-redis &yaz; will be linked with the hiredis C library to allow for result-set caching for ZOOM on a redis server. The prefix can not be given. When configured, build the software by typing: make The following files are generated by the make process: src/libyaz.la Main &yaz; library. This is no ordinary library. It's a Libtool archive. By default, &yaz; creates a static library in lib/.libs/libyaz.a. src/libyaz_server.la Generic Frontend server. This is an add-on for libyaz.la. Code in this library uses POSIX threads functions - if POSIX threads are available on the platform. src/libyaz_icu.la Functions that wrap the ICU library. ztest/yaz-ztest Test Z39.50 server. client/yaz-client Z39.50 client for testing the protocol. See chapter YAZ client for more information. util/yaz-config A Bourne-shell script, generated by configure, that specifies how external applications should compile - and link with &yaz;. util/yaz-asncomp The ASN.1 compiler for &yaz;. Requires the Tcl Shell, tclsh, in PATH to operate. util/yaz-iconv This program converts data in one character set to another. This command exercises the YAZ character set conversion API. util/yaz-marcdump This program parses ISO2709 encoded MARC records and prints them in line-format or XML. util/yaz-icu This program exposes the ICU wrapper library if that is enabled for YAZ. Only if ICU is available this program is useful. util/yaz-url This program is a simple HTTP page fetcher ala wget or curl. zoom/zoomsh A simple shell implemented on top of the ZOOM functions. The shell is a command line application that allows you to enter simple commands to perform ZOOM operations. zoom/zoomtst1, zoom/zoomtst2, .. Several small applications that demonstrate the ZOOM API. If you wish to install &yaz; in system directories /usr/local/bin, /usr/local/lib .. etc, you can type: make install You probably need to have root access in order to perform this. You must specify the --prefix option for configure if you wish to install &yaz; in other directories than the default /usr/local/. If you wish to perform an un-installation of &yaz;, use: make uninstall This will only work if you haven't reconfigured &yaz; (and therefore changed installation prefix). Note that uninstall will not remove directories created by make install, e.g. /usr/local/include/yaz. Compiling from source on macOS Install Apple's Xcode Command Line Tools package from Apple Developer which provides necessary tools for building C/C++ programs on macOS. This is sufficient for compiling basic &yaz; (e.g no ICU) from a source distribution tarball as XCLT includes libxml2 and libxslt development headers. If you are compiling &yaz; from a Git checkout, at the time of writing the latest version of XCLT is 15.4 and includes a very old GNU Bison which is insufficient to generate &yaz; sources. You can use e.g. Homebrew to install a more recent version: brew install bison After installation make sure to put it on the path: export PATH="/opt/homebrew/opt/bison/bin:$PATH" Note: XCLT 15.4 fails to make gm4 available as m4 which can cause a silent Bison failure, one way to fix it is: sudo ln -s /Library/Developer/CommandLineTools/usr/bin/gm4 \ /Library/Developer/CommandLineTools/usr/bin/m4 Additionally, you will need to install DocBook stylesheets to generate documentation: brew install docbook docbook-xsl per the caveats section (brew info docbook), for the compilation to find them, add: export XML_CATALOG_FILES="/opt/homebrew/etc/xml/catalog" If you want to compile &yaz; with ICU you must install it with Homebrew as XCLT does not ship with ICU headers: brew install icu4c and make sure to add compiler flags before the configure stage, per the caveats section (brew info icu4c): export LDFLAGS="-L/opt/homebrew/opt/icu4c/lib" export CPPFLAGS="-I/opt/homebrew/opt/icu4c/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig" If you want to also compile with more recent version of libxml2 and libxslt, install them with Homebrew: brew install libxml2 libxslt and again make sure to add compiler flags, per the caveats section (brew info libxml2): export PATH="/opt/homebrew/opt/bison/bin:\ /opt/homebrew/opt/libxml2/bin:\ /opt/homebrew/opt/libxslt/bin:\ $PATH" export LDFLAGS="-L/opt/homebrew/opt/libxml2/lib \ -L/opt/homebrew/opt/libxslt/lib \ -L/opt/homebrew/opt/icu4c/lib" export CPPFLAGS="-I/opt/homebrew/opt/libxml2/include \ -I/opt/homebrew/opt/libxslt/include \ -I/opt/homebrew/opt/icu4c/include" export PKG_CONFIG_PATH="/opt/homebrew/opt/libxml2/lib/pkgconfig:\ /opt/homebrew/opt/libxslt/lib/pkgconfig:\ /opt/homebrew/opt/icu4c/lib/pkgconfig" Then configure and conpile with: ./configure make How to make apps using YAZ on UNIX This section describes how to compile - and link your own applications using the &yaz; toolkit. If you're used to Makefiles this shouldn't be hard. As for other libraries you have used before, you need to set a proper include path for your C/C++ compiler and specify the location of &yaz; libraries. You can do it by hand, but generally we suggest you use the yaz-config that is generated by configure. This is especially important if you're using the threaded version of &yaz; which require you to pass more options to your linker/compiler. The yaz-config script accepts command line options that makes the yaz-config script print options that you should use in your make process. The most important ones are: --cflags, --libs which prints C compiler flags, and linker flags respectively. A small and complete Makefile for a C application consisting of one source file, myprog.c, may look like this: YAZCONFIG=/usr/local/bin/yaz-config CFLAGS=`$(YAZCONFIG) --cflags` LIBS=`$(YAZCONFIG) --libs` myprog: myprog.o $(CC) $(CFLAGS) -o myprog myprog.o $(LIBS) The CFLAGS variable consists of a C compiler directive that will set the include path to the parent directory of yaz. That is, if &yaz; header files were installed in /usr/local/include/yaz, then include path is set to /usr/local/include. Therefore, in your applications you should use #include <yaz/proto.h> and not #include <proto.h> For Libtool users, the yaz-config script provides a different variant of option --libs, called --lalibs that returns the name of the Libtool archive(s) for &yaz; rather than the ordinary ones. For applications using the threaded version of &yaz;, specify threads after the other options. When threads is given, more flags and linker flags will be printed by yaz-config. If our previous example was using threads, you'd have to modify the lines that set CFLAGS and LIBS as follows: CFLAGS=`$(YAZCONFIG) --cflags threads` LIBS=`$(YAZCONFIG) --libs threads` There is no need specify POSIX thread libraries in your Makefile. The LIBS variable includes that as well. Windows The easiest way to install YAZ on Windows is by downloading an installer from Index Data's Windows support area . The installer comes with source too - in case you wish to compile YAZ with different compiler options, etc. Compiling from Source on Windows &yaz; is shipped with "makefiles" for the NMAKE tool that comes with Microsoft Visual Studio. It has been tested with Microsoft Visual Studio 2017 and 2019. Start a command prompt and switch the sub directory WIN where the file makefile is located. Customize the installation by editing the makefile file (for example by using notepad). The following summarizes the most important settings in that file: DEBUG If set to 1, the software is compiled with debugging libraries (code generation is multi-threaded debug DLL). If set to 0, the software is compiled with release libraries (code generation is multi-threaded DLL). HAVE_TCL, TCL If HAVE_TCL is set to 1, nmake will use the ASN.1 compiler (Tcl based). You must set TCL to the full path of the Tcl interpreter. A Windows version of Tcl is part of Git for Windows. If you do not have Tcl installed, set HAVE_TCL to 0. HAVE_BISON, BISON If GNU Bison is present, you might set HAVE_BISON to 1 and specify the Bison executable in BISON. Bison is only required if you use the Git version of YAZ or if you modify the grammar for CQL (cql.y). A Windows version of GNU Bison can be fetched from here: Index Data's Windows support area . HAVE_ICONV, ICONV_DIR If HAVE_ICONV is set to 1, YAZ is compiled with iconv support. In this configuration, set ICONV_DIR to the iconv source directory. HAVE_LIBXML2, LIBXML2_DIR If HAVE_LIBXML2 is set to 1, YAZ is compiled with SRU support. In this configuration, set LIBXML2_DIR to the libxml2 source directory. You can get pre-compiled Libxml2+Libxslt DLLs and headers from here. Should you with to compile those libraries yourself, refer to to HAVE_LIBXSLT, LIBXSLT_DIR If HAVE_LIBXSLT is set to 1, YAZ is compiled with XSLT support. In this configuration, set LIBXSLT_DIR to the libxslt source directory. libxslt depends on libxml2. HAVE_ICU, ICU_DIR If HAVE_ICU is set to 1, YAZ is compiled with ICU support. In this configuration, set ICU_DIR to the ICU source directory. Pre-compiled ICU libraries for various versions of Visual Studio can be found here or from Index Data's Windows support site. When satisfied with the settings in the makefile, type nmake If the nmake command is not found on your system you probably haven't defined the environment variables required to use that tool. To fix that, find and run the batch file vcvarsall.bat. You need to run it from within the command prompt or set the environment variables "globally"; otherwise it doesn't work. If you wish to recompile &yaz; - for example if you modify settings in the makefile you can delete object files, etc by running. nmake clean The following files are generated upon successful compilation: bin/yaz&soversion;.dll / bin/yaz&soversion;d.dll &yaz; Release/Debug DLL. lib/yaz&soversion;.lib / lib/yaz&soversion;d.lib Import library for yaz&soversion;.dll / yaz&soversion;d.dll. bin/yaz_cond&soversion;.dll / bin/yaz_cond&soversion;d.dll Release/Debug DLL for condition variable utilities (condvar.c). lib/yaz_cond&soversion;.lib / lib/yaz_cond&soversion;d.lib Import library for yaz_cond&soversion;.dll / yaz_cond&soversion;d.dll. bin/yaz_icu&soversion;.dll / bin/yaz_icu&soversion;d.dll Release/Debug DLL for the ICU wrapper utility. Only build if HAVE_ICU is 1. lib/yaz_icu&soversion;.lib / lib/yaz_icu&soversion;d.lib Import library for yaz_icu&soversion;.dll / yaz_icu&soversion;d.dll. bin/yaz-ztest.exe Z39.50 multi-threaded test/example server. It's a WIN32 console application. bin/yaz-client.exe &yaz; Z39.50 client application. It's a WIN32 console application. See chapter YAZ client for more information. bin/yaz-icu.exe This program exposes the ICU wrapper library if that is enabled for YAZ. Only if ICU is available this program is built. bin/zoomsh.exe Simple console application implemented on top of the ZOOM functions. The application is a command line shell that allows you to enter simple commands to perform ZOOM operations. bin/zoomtst1.exe, bin/zoomtst2.exe, .. Several small applications that demonstrate the ZOOM API. How to make apps using YAZ on Windows This section will go though the process of linking your Windows applications with &yaz;. Some people are confused by the fact that we use the nmake tool to build &yaz;. They think they have to do that too - in order to make their Windows applications work with &yaz;. The good news is that you don't have to. You can use the integrated environment of Visual Studio if desired for your own application. When setting up a project or Makefile you have to set the following: include path Set it to the include directory of &yaz;. import library yaz&soversion;.lib You must link with this library. It's located in the sub directory lib of &yaz;. If you want to link with the debug version of &yaz;, you must link against yaz&soversion;d.lib instead. dynamic link library yaz&soversion;.dll This DLL must be in your execution path when you invoke your application. Specifically, you should distribute this DLL with your application. Compiling Libxml2 and Libxslt on windows Download libxml2 and Libxslt source and unpack it. In the example below we install Libxml2 2.9.2 and Libxslt 1.1.28 for 32-bit, so we use the destination directories libxml2.2.9.2.win32 and libxslt-1.1.28.win32 to reflect both version and architecture. cd win32 cscript configure.js prefix=c:\libxml2-2.9.2.win32 iconv=no nmake nmake install There's an error in configure.js for Libxml2 2.9.2. Line 17 should be assigned to configure.ac rather than configure.in. For Libxslt it is similar. We must ensure that compilation of Libxslt links against the already installed libxml2. cd win32 cscript configure.js prefix=c:\libxslt-1.1.28.win32 iconv=no \ lib=c:\libxml2-2.9.2.win32\lib \ include=c:\libxml2-2.9.2.win32\include\libxml2 nmake nmake install ZOOM &zoom; is an acronym for 'Z39.50 Object-Orientation Model' and is an initiative started by Mike Taylor (Mike is from the UK, which explains the peculiar name of the model). The goal of &zoom; is to provide a common Z39.50 client API not bound to a particular programming language or toolkit. From YAZ version 2.1.12, SRU is supported. You can make SRU ZOOM connections by specifying scheme http:// for the hostname for a connection. The dialect of SRU used is specified by the value of the connection's sru option, which may be SRU over HTTP GET (get), SRU over HTTP POST (post), (SRU over SOAP) (soap) or solr (Solr Web Service). Using the facility for embedding options in target strings, a connection can be forced to use SRU rather the SRW (the default) by prefixing the target string with sru=get,, like this: sru=get,http://sru.miketaylor.org.uk:80/sru.pl Solr protocol support was added to YAZ in version 4.1.0, as a dialect of a SRU protocol, since both are HTTP based protocols. The lack of a simple Z39.50 client API for &yaz; has become more and more apparent over time. So when the first &zoom; specification became available, an implementation for &yaz; was quickly developed. For the first time, it is now as easy (or easier!) to develop clients as it is to develop servers with &yaz;. This chapter describes the &zoom; C binding. Before going further, please reconsider whether C is the right programming language for the job. There are other language bindings available for &yaz;, and still more are in active development. See the ZOOM web-site for more information. In order to fully understand this chapter you should read and try the example programs zoomtst1.c, zoomtst2.c, .. in the zoom directory. The C language misses features found in object oriented languages such as C++, Java, etc. For example, you'll have to manually, destroy all objects you create, even though you may think of them as temporary. Most objects have a _create - and a _destroy variant. All objects are in fact pointers to internal stuff, but you don't see that because of typedefs. All destroy methods should gracefully ignore a NULL pointer. In each of the sections below you'll find a sub section called protocol behavior, that describes how the API maps to the Z39.50 protocol. Connections The Connection object is a session with a target. #include <yaz/zoom.h> ZOOM_connection ZOOM_connection_new(const char *host, int portnum); ZOOM_connection ZOOM_connection_create(ZOOM_options options); void ZOOM_connection_connect(ZOOM_connection c, const char *host, int portnum); void ZOOM_connection_destroy(ZOOM_connection c); Connection objects are created with either function ZOOM_connection_new or ZOOM_connection_create. The former creates and automatically attempts to establish a network connection with the target. The latter doesn't establish a connection immediately, thus allowing you to specify options before establishing network connection using the function ZOOM_connection_connect. If the port number, portnum, is zero, the host is consulted for a port specification. If no port is given, 210 is used. A colon denotes the beginning of a port number in the host string. If the host string includes a slash, the following part specifies a database for the connection. You can prefix the host with a scheme followed by colon. The default scheme is tcp (Z39.50 protocol). The scheme http selects SRU/SOAP over HTTP by default, but can be changed with option sru. You can prefix the scheme-qualified host-string with one or more comma-separated key=value sequences, each of which represents an option to be set into the connection structure before the protocol-level connection is forged and the initialization handshake takes place. This facility can be used to provide authentication credentials, as in host-strings such as: user=admin,password=halfAm4n,tcp:localhost:8017/db Connection objects should be destroyed using the function ZOOM_connection_destroy. void ZOOM_connection_option_set(ZOOM_connection c, const char *key, const char *val); void ZOOM_connection_option_setl(ZOOM_connection c, const char *key, const char *val, int len); const char *ZOOM_connection_option_get(ZOOM_connection c, const char *key); const char *ZOOM_connection_option_getl(ZOOM_connection c, const char *key, int *lenp); The functions ZOOM_connection_option_set and ZOOM_connection_option_setl allows you to set an option given by key to the value value for the connection. For ZOOM_connection_option_set, the value is assumed to be a 0-terminated string. Function ZOOM_connection_option_setl specifies a value of a certain size (len). Functions ZOOM_connection_option_get and ZOOM_connection_option_getl returns the value for an option given by key. ZOOM Connection Options Option Description Default implementationNameName of your client none userAuthentication user name none groupAuthentication group name none passwordAuthentication password. none authenticationModeHow authentication is encoded. basic hostTarget host. This setting is "read-only". It's automatically set internally when connecting to a target. none proxyProxy host. If set, the logical host is encoded in the otherInfo area of the Z39.50 Init PDU with OID 1.2.840.10003.10.1000.81.1. none clientIPClient IP. If set, is encoded in the otherInfo area of a Z39.50 PDU with OID 1.2.840.10003.10.1000.81.3. Holds the original IP addresses of a client. Is used if ZOOM is used in a gateway of some sort. none timeoutIdle timeout which specifies how long ZOOM will wait for network I/O before giving up. Thus, the actual waiting time might be longer than this value if the target makes a chunked response and the time between each chunk arrive is less this value. For the connect+init, this is the time ZOOM will wait until receiving first byte from Init response. 30 asyncIf true (1) the connection operates in asynchronous operation which means that all calls are non-blocking except ZOOM_event. 0 maximumRecordSize Maximum size of single record. 1 MB preferredMessageSize Maximum size of multiple records. 1 MB lang Language for negotiation. none charset Character set for negotiation. nonerpnCharset Client-side character conversion for RPN queries and scan terms. The input terms are converted from UTF-8 to the character set of rpnCharset. none (no conversion) serverImplementationId Implementation ID of server. (The old targetImplementationId option is also supported for the benefit of old applications.) none targetImplementationName Implementation Name of server. (The old targetImplementationName option is also supported for the benefit of old applications.) none serverImplementationVersion Implementation Version of server. (The old targetImplementationVersion option is also supported for the benefit of old applications.) none databaseNameOne or more database names separated by character plus (+), which is to be used by subsequent search requests on this Connection. Default piggybackTrue (1) if piggyback should be used in searches; false (0) if not. 1 smallSetUpperBoundIf hits is less than or equal to this value, then target will return all records using small element set name 0 largeSetLowerBoundIf hits is greater than this value, the target will return no records. 1 mediumSetPresentNumberThis value represents the number of records to be returned as part of a search when hits is less than or equal to large set lower bound and if hits is greater than small set upper bound. 0 smallSetElementSetName The element set name to be used for small result sets. none mediumSetElementSetName The element set name to be used for medium-sized result sets. none init_opt_search, init_opt_present, init_opt_delSet, etc. After a successful Init, these options may be interrogated to discover whether the server claims to support the specified operations. none sru SRU/Solr transport type. Must be either soap, get, post, or solr. soap if scheme is already http; ignored otherwise sru_version SRU/SRW version. Should be 1.1, or 1.2. This is, prior to connect, the version to offer (highest version). And following connect (in fact first operation), holds the negotiated version with the server (same or lower version). 1.2 extraArgs Extra arguments for SRU/Solr URLs. The value must be URL encoded already. facets Requested or recommended facets may be given before a search is sent. The value of this setting is described in For inspection of the facets returned, refer to the functions described in . none apdulog If set to a true value such as "1", a log of low-level protocol packets is emitted on standard error stream. This can be very useful for debugging. 0 saveAPDU If set to a true value such as "1", a log of low-level protocol packets is saved. The log can be retrieved by reading option APDU. Setting saveAPDU always has the side effect of resetting the currently saved log. This setting is write-only. If read, NULL will be returned. It is only recognized in ZOOM_connection_option_set. 0 APDU Returns the log of protocol packets. Will be empty if logging is not enabled (see saveAPDU above). This setting is read-only. It is only recognized if used in call to ZOOM_connection_option_get or ZOOM_connection_option_getl. memcached If given and non-empty, libMemcached will be configured for the connection. This option is inspected by ZOOM when a connection is established. If the memcached option is given and YAZ is compiled without libMemcached support, an internal diagnostic (10018) will be thrown. libMemcached support is available for YAZ 5.0.13 or later. If this option is supplied for an earlier version of YAZ, it is ignored. The value of this option is a list options - each is of the form --name=value. Option --server=host[:port] specifies a memcached server. It may be repeated for multiple memcached servers. Option --expire=seconds sets expiry time in seconds for how long result sets are to be cached. none redis If given and non-empty, a redis context will be created for the connection. This option is inspected by ZOOM when a connection is established. If the redis option is given and YAZ is compiled without redis support, an internal diagnostic (10018) will be thrown. redis support is available for YAZ 5.2.0 or later. If this option is supplied for an earlier version of YAZ, it is ignored. The value of this option is a set of options, similar to that of the memcached setting. At this stage only --server=host[:port] and --expire=seconds are supported. none
If either option lang or charset is set, then Character Set and Language Negotiation is in effect. int ZOOM_connection_error(ZOOM_connection c, const char **cp, const char **addinfo); int ZOOM_connection_error_x(ZOOM_connection c, const char **cp, const char **addinfo, const char **dset); Function ZOOM_connection_error checks for errors for the last operation(s) performed. The function returns zero if no errors occurred; non-zero otherwise indicating the error. Pointers cp and addinfo holds messages for the error and additional-info if passed as non-NULL. Function ZOOM_connection_error_x is an extended version of ZOOM_connection_error that is capable of returning name of diagnostic set in dset. Z39.50 Protocol behavior The calls ZOOM_connection_new and ZOOM_connection_connect establishes a TCP/IP connection and sends an Initialize Request to the target if possible. In addition, the calls wait for an Initialize Response from the target and the result is inspected (OK or rejected). If proxy is set then the client will establish a TCP/IP connection with the peer as specified by the proxy host and the hostname as part of the connect calls will be set as part of the Initialize Request. The proxy server will then "forward" the PDUs transparently to the target behind the proxy. For the authentication parameters, if option user is set and both options group and pass are unset, then Open style authentication is used (Version 2/3) in which case the username is usually followed by a slash, then by a password. If either group or pass is set then idPass authentication (Version 3 only) is used. If none of the options are set, no authentication parameters are set as part of the Initialize Request (obviously). When option async is 1, it really means that all network operations are postponed (and queued) until the function ZOOM_event is invoked. When doing so it doesn't make sense to check for errors after ZOOM_connection_new is called since that operation "connecting - and init" is still incomplete and the API cannot tell the outcome (yet). SRU/Solr Protocol behavior The HTTP based protocols (SRU, SRW, Solr) do not feature an Inititialize Request, so the connection phase merely establishes a TCP/IP connection with the HTTP server. Most of the ZOOM connection options do not affect SRU/Solr and they are ignored. However, future versions of &yaz; might honor implementationName and put that as part of User-Agent header for HTTP requests. The charset is used in the Content-Type header of HTTP requests. Setting authentcationMode specifies how authentication parameters are encoded for HTTP. The default is "basic" where user and password are encoded by using HTTP basic authentication. If authentcationMode is "url", then user and password are encoded in the URL by parameters x-username and x-password as given by the SRU standard.
Queries Query objects represents queries. ZOOM_query ZOOM_query_create(void); void ZOOM_query_destroy(ZOOM_query q); int ZOOM_query_prefix(ZOOM_query q, const char *str); int ZOOM_query_cql(ZOOM_query s, const char *str); int ZOOM_query_sortby(ZOOM_query q, const char *criteria); int ZOOM_query_sortby2(ZOOM_query q, const char *strategy, const char *criteria); Create query objects using ZOOM_query_create and destroy them by calling ZOOM_query_destroy. RPN-queries can be specified in PQF notation by using the function ZOOM_query_prefix. The ZOOM_query_cql specifies a CQL query to be sent to the server/target. More query types will be added in future versions of &yaz;, such as CCL to RPN-mapping, native CCL query, etc. In addition to a search, a sort criteria may be set. Function ZOOM_query_sortby enables Z39.50 sorting and it takes sort criteria using the same string notation as yaz-client's sort command. ZOOM_query_sortby2 is similar to ZOOM_query_sortby but allows a strategy for sorting. The reason for the strategy parameter is that some protocols offer multiple ways of performing sorting. For example, Z39.50 has the standard sort, which is performed after search on an existing result set. It's also possible to use CQL in Z39.50 as the query type and use CQL's SORTBY keyword. Finally, Index Data's Zebra server also allows sorting to be specified as part of RPN (Type 7). ZOOM sort strategy Name Description z39.50Z39.50 resultset sort type7Sorting embedded in RPN(Type-7) cqlCQL SORTBY sru11SRU sortKeys parameter solrSolr sort embedtype7 for Z39.50, cql for SRU, solr for Solr protocol
Result sets The result set object is a container for records returned from a target. ZOOM_resultset ZOOM_connection_search(ZOOM_connection, ZOOM_query q); ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c, const char *q); void ZOOM_resultset_destroy(ZOOM_resultset r); Function ZOOM_connection_search creates a result set, given a connection and query. Destroy a result set by calling ZOOM_resultset_destroy. Simple clients using PQF only, may use the function ZOOM_connection_search_pqf in which case creating query objects is not necessary. void ZOOM_resultset_option_set(ZOOM_resultset r, const char *key, const char *val); const char *ZOOM_resultset_option_get(ZOOM_resultset r, const char *key); size_t ZOOM_resultset_size(ZOOM_resultset r); Functions ZOOM_resultset_options_set and ZOOM_resultset_get sets and gets an option for a result set similar to ZOOM_connection_option_get and ZOOM_connection_option_set. The number of hits, also called result-count, is returned by function ZOOM_resultset_size. ZOOM Result set Options Option Description Default startOffset of first record to be retrieved from target. First record has offset 0 unlike the protocol specifications where first record has position 1. This option affects ZOOM_resultset_search and ZOOM_resultset_search_pqf and must be set before any of these functions are invoked. If a range of records must be fetched manually after search, function ZOOM_resultset_records should be used. 0 countNumber of records to be retrieved. This option affects ZOOM_resultset_search and ZOOM_resultset_search_pqf and must be set before any of these functions are invoked. 0 presentChunkThe number of records to be requested from the server in each chunk (present request). The value 0 means to request all the records in a single chunk. (The old step option is also supported for the benefit of old applications.) 0 elementSetNameElement-Set name of records. Most targets should honor element set name B and F for brief and full respectively. none preferredRecordSyntaxPreferred Syntax, such as USMARC, SUTRS, etc. none schemaSchema for retrieval, such as Gils-schema, Geo-schema, etc. none setnameName of Result Set (Result Set ID). If this option isn't set, the ZOOM module will automatically allocate a result set name. default rpnCharsetCharacter set for RPN terms. If this is set, ZOOM C will assume that the ZOOM application is running UTF-8. Terms in RPN queries are then converted to the rpnCharset. If this is unset, ZOOM C will not assume any encoding of RPN terms and no conversion is performed. none
For servers that support Search Info report, the following options may be read using ZOOM_resultset_get. This detailed information is read after a successful search has completed. This information is a list of of items, where each item is information about a term or subquery. All items in the list are prefixed by SearchResult.no where no presents the item number (0=first, 1=second). Read searchresult.size to determine the number of items. Search Info Report Options Option Description searchresult.size number of search result entries. This option is non-existent if no entries are returned by the server. searchresult.no.id sub query ID searchresult.no.count result count for item (number of hits) searchresult.no.subquery.term subquery term searchresult.no.interpretation.term interpretation term searchresult.no.recommendation.term recommendation term
Z39.50 Result-set Sort void ZOOM_resultset_sort(ZOOM_resultset r, const char *sort_type, const char *sort_spec); int ZOOM_resultset_sort1(ZOOM_resultset r, const char *sort_type, const char *sort_spec); ZOOM_resultset_sort and ZOOM_resultset_sort1 both sort an existing result-set. The sort_type parameter is not used. Set it to "yaz". The sort_spec is same notation as ZOOM_query_sortby and identical to that offered by yaz-client's sort command. These functions only work for Z39.50. Use the more generic utility ZOOM_query_sortby2 for other protocols (and even Z39.50). Z39.50 Protocol behavior The creation of a result set involves at least a SearchRequest - SearchResponse protocol handshake. Following that, if a sort criteria was specified as part of the query, a SortRequest - SortResponse handshake takes place. Note that it is necessary to perform sorting before any retrieval takes place, so no records will be returned from the target as part of the SearchResponse because these would be unsorted. Hence, piggyback is disabled when sort criteria are set. Following Search - and a possible sort - Retrieval takes place - as one or more Present Requests/Response pairs being transferred. The API allows for two different modes for retrieval. A high level mode which is somewhat more powerful and a low level one. The low level is enabled when searching on a Connection object for which the settings smallSetUpperBound, mediumSetPresentNumber and largeSetLowerBound are set. The low level mode thus allows you to precisely set how records are returned as part of a search response as offered by the Z39.50 protocol. Since the client may be retrieving records as part of the search response, this mode doesn't work well if sorting is used. The high-level mode allows you to fetch a range of records from the result set with a given start offset. When you use this mode the client will automatically use piggyback if that is possible with the target, and perform one or more present requests as needed. Even if the target returns fewer records as part of a present response because of a record size limit, etc. the client will repeat sending present requests. As an example, if option start is 0 (default) and count is 4, and piggyback is 1 (default) and no sorting criteria is specified, then the client will attempt to retrieve the 4 records as part the search response (using piggyback). On the other hand, if either start is positive or if a sorting criteria is set, or if piggyback is 0, then the client will not perform piggyback but send Present Requests instead. If either of the options mediumSetElementSetName and smallSetElementSetName are unset, the value of option elementSetName is used for piggyback searches. This means that for the high-level mode you only have to specify one elementSetName option rather than three. SRU Protocol behavior Current version of &yaz; does not take advantage of a result set id returned by the SRU server. Future versions might do, however. Since the ZOOM driver does not save result set IDs, any present (retrieval) is transformed to a SRU SearchRetrieveRequest with same query but, possibly, different offsets. Option schema specifies SRU schema for retrieval. However, options elementSetName and preferredRecordSyntax are ignored. Options start and count are supported by SRU. The remaining options piggyback, smallSetUpperBound, largeSetLowerBound, mediumSetPresentNumber, mediumSetElementSetName, smallSetElementSetName are unsupported. SRU supports CQL queries, not PQF. If PQF is used, however, the PQF query is transferred anyway using non-standard element pQuery in SRU SearchRetrieveRequest. Solr queries need to be done in Solr query format. Unfortunately, SRU and Solr do not define a database setting. Hence, databaseName is unsupported and ignored. However, the path part in host parameter for functions ZOOM_connecton_new and ZOOM_connection_connect acts as a database (at least for the &yaz; SRU server).
Records A record object is a retrieval record on the client side - created from result sets. void ZOOM_resultset_records(ZOOM_resultset r, ZOOM_record *recs, size_t start, size_t count); ZOOM_record ZOOM_resultset_record(ZOOM_resultset s, size_t pos); const char *ZOOM_record_get(ZOOM_record rec, const char *type, size_t *len); int ZOOM_record_error(ZOOM_record rec, const char **msg, const char **addinfo, const char **diagset); ZOOM_record ZOOM_record_clone(ZOOM_record rec); void ZOOM_record_destroy(ZOOM_record rec); References to temporary records are returned by functions ZOOM_resultset_records or ZOOM_resultset_record. If a persistent reference to a record is desired ZOOM_record_clone should be used. It returns a record reference that should be destroyed by a call to ZOOM_record_destroy. A single record is returned by function ZOOM_resultset_record that takes a position as argument. First record has position zero. If no record could be obtained NULL is returned. Error information for a record can be checked with ZOOM_record_error which returns non-zero (error code) if record is in error, called Surrogate Diagnostics in Z39.50. Function ZOOM_resultset_records retrieves a number of records from a result set. Parameter start and count specifies the range of records to be returned. Upon completion, the array recs[0], ..recs[count-1] holds record objects for the records. The array of records recs should be allocated prior the call ZOOM_resultset_records. Note that for those records that couldn't be retrieved from the target, recs[ ..] is set to NULL. In order to extract information about a single record, ZOOM_record_get is provided. The function returns a pointer to certain record information. The nature (type) of the pointer depends on the parameter, type. The type is a string of the format: format[;charset=from[/opacfrom][,to]][;format=v][;base64=xpath] If charset is given, then from specifies the character set of the record in its original form (as returned by the server), to specifies the output (returned) character set encoding. If to is omitted, then UTF-8 is assumed. If charset is not given, then no character set conversion takes place. OPAC records may be returned in a different set from the bibliographic MARC record. If this is this the case, opacfrom should be set to the character set of the OPAC record part. The format is generic but can only be used to specify XML indentation when the value v is 1 (format=1). The base64 allows a full record to be extracted from base64-encoded string in an XML document. Specifying the OPAC record character set requires YAZ 4.1.5 or later. Specifying the base64 parameter requires YAZ 4.2.35 or later. The format argument controls whether record data should be XML pretty-printed (post process operation). It is enabled only if format value v is 1 and the record content is XML well-formed. In addition, for certain types, the length len passed will be set to the size in bytes of the returned information. The following are the supported values for form. database The Database of the record is returned as a C null-terminated string. Return type const char *. syntax The transfer syntax of the record is returned as a C null-terminated string containing the symbolic name of the record syntax, e.g. Usmarc. Return type is const char *. schema The schema of the record is returned as a C null-terminated string. Return type is const char *. render The record is returned in a display friendly format. Upon completion, buffer is returned (type const char *) and length is stored in *len. raw The record is returned in the internal YAZ specific format. For GRS-1, Explain, and others, the raw data is returned as type Z_External * which is just the type for the member retrievalRecord in type NamePlusRecord. For SUTRS and octet aligned record (including all MARCs) the octet buffer is returned and the length of the buffer. xml The record is returned in XML if possible. SRU, Solr and Z39.50 records with transfer syntax XML are returned verbatim. MARC records are returned in MARCXML (converted from ISO2709 to MARCXML by YAZ). OPAC records are also converted to XML and the bibliographic record is converted to MARCXML (when possible). GRS-1 records are not supported for this form. Upon completion, the XML buffer is returned (type const char *) and length is stored in *len. opac OPAC information for record is returned in XML if an OPAC record is present at the position given. If no OPAC record is present, a NULL pointer is returned. txml The record is returned in TurboMARC if possible. SRU and Z39.50 records with transfer syntax XML are returned verbatim. MARC records are returned in TurboMARC (converted from ISO2709 to TurboMARC by YAZ). Upon completion, the XML buffer is returned (type const char *) and length is stored in *len. json Like xml, but MARC records are converted to MARC-in-JSON. Most MARC21 records uses the MARC-8 character set encoding. An application that wishes to display in Latin-1 would use render; charset=marc8,iso-8859-1 Z39.50 Protocol behavior The functions ZOOM_resultset_record and ZOOM_resultset_records inspects the client-side record cache. Records not found in cache are fetched using Present. The functions may block (and perform network I/O) - even though option async is 1, because they return records objects. (And there's no way to return records objects without retrieving them!) There is a trick, however, in the usage of function ZOOM_resultset_records that allows for delayed retrieval (and makes it non-blocking). By using a null pointer for recs you're indicating you're not interested in getting records objects now. SRU/Solr Protocol behavior The ZOOM driver for SRU/Solr treats records returned by a SRU/Solr server as if they where Z39.50 records with transfer syntax XML and no element set name or database name. ZOOM Facets Facets are only supported for a few Z39.50 targets. It is a relatively new non-standard Z39.50 extension (see facets.asn in the YAZ source). However, facets are usually supported for Solr and SRU 2.0 targets. Facets may be specified by the facets option before a search is sent. See for the notation. For inspection of the returned facets, the following functions are available: ZOOM_facet_field *ZOOM_resultset_facets(ZOOM_resultset r); size_t ZOOM_resultset_facets_size(ZOOM_resultset r); ZOOM_facet_field ZOOM_resultset_get_facet_field(ZOOM_resultset r, const char *facet_name); ZOOM_facet_field ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r, int pos); const char *ZOOM_facet_field_name(ZOOM_facet_field facet_field); size_t ZOOM_facet_field_term_count(ZOOM_facet_field facet_field); const char *ZOOM_facet_field_get_term(ZOOM_facet_field facet_field, size_t idx, int *freq); References to temporary structures are returned by all functions. They are only valid as long the Result set is valid. All facet fields may be returned by a call to ZOOM_resultset_facets. The length of the array is given by ZOOM_resultset_facets_size. The array is zero-based and the last entry will be at ZOOM_resultset_facets_size(result_set)-1. Facet fields can also be fetched via its name using ZOOM_resultset_get_facet_field. Or by its index (starting from 0) by a call to ZOOM_resultset_get_facet_field_by_index. Both of these functions return NULL if name is not found or index is out of bounds. Function ZOOM_facet_field_name gets the request facet name from a returned facet field. Function ZOOM_facet_field_get_term returns the idx'th term and term count for a facet field. Idx must between 0 and ZOOM_facet_field_term_count-1, otherwise the returned reference will be NULL. On a valid idx, the value of the freq reference will be the term count. The freq parameter must be valid pointer to integer. Scan This section describes an interface for Scan. Scan is not an official part of the ZOOM model yet. The result of a scan operation is the ZOOM_scanset which is a set of terms returned by a target. The Scan interface is supported for both Z39.50, SRU and Solr. ZOOM_scanset ZOOM_connection_scan(ZOOM_connection c, const char *startpqf); ZOOM_scanset ZOOM_connection_scan1(ZOOM_connection c, ZOOM_query q); size_t ZOOM_scanset_size(ZOOM_scanset scan); const char *ZOOM_scanset_term(ZOOM_scanset scan, size_t pos, size_t *occ, size_t *len); const char *ZOOM_scanset_display_term(ZOOM_scanset scan, size_t pos, size_t *occ, size_t *len); void ZOOM_scanset_destroy(ZOOM_scanset scan); const char *ZOOM_scanset_option_get(ZOOM_scanset scan, const char *key); void ZOOM_scanset_option_set(ZOOM_scanset scan, const char *key, const char *val); The scan set is created by function ZOOM_connection_scan which performs a scan operation on the connection using the specified startpqf. If the operation was successful, the size of the scan set can be retrieved by a call to ZOOM_scanset_size. Like result sets, the items are numbered 0..size-1. To obtain information about a particular scan term, call function ZOOM_scanset_term. This function takes a scan set offset pos and returns a pointer to a raw term or NULL if non-present. If present, the occ and len are set to the number of occurrences and the length of the actual term respectively. ZOOM_scanset_display_term is similar to ZOOM_scanset_term except that it returns the display term rather than the raw term. In a few cases, the term is different from display term. Always use the display term for display and the raw term for subsequent scan operations (to get more terms, next scan result, etc). A scan set may be freed by a call to function ZOOM_scanset_destroy. Functions ZOOM_scanset_option_get and ZOOM_scanset_option_set retrieves and sets an option respectively. The startpqf is a subset of PQF, namely the Attributes+Term part. Multiple @attr can be used. For example to scan in title (complete) phrases: @attr 1=4 @attr 6=2 "science o" The ZOOM_connecton_scan1 is a newer and more generic alternative to ZOOM_connection_scan which allows to use both CQL and PQF for Scan. ZOOM Scan Set Options Option Description Default numberNumber of Scan Terms requested in next scan. After scan it holds the actual number of terms returned. 20 positionPreferred Position of term in response in next scan; actual position after completion of scan. 1 stepSizeStep Size 0 scanStatusAn integer indicating the Scan Status of last scan. 0 rpnCharsetCharacter set for RPN terms. If this is set, ZOOM C will assume that the ZOOM application is running UTF-8. Terms in RPN queries are then converted to the rpnCharset. If this is unset, ZOOM C will not assume any encoding of RPN terms and no conversion is performed. none
Extended Services ZOOM offers an interface to a subset of the Z39.50 extended services as well as a few privately defined ones: Z39.50 Item Order (ILL). See . Record Update. This allows a client to insert, modify or delete records. See . Database Create. This a non-standard feature. Allows a client to create a database. See . Database Drop. This a non-standard feature. Allows a client to delete/drop a database. See . Commit operation. This a non-standard feature. Allows a client to commit operations. See . To create an extended service operation, a ZOOM_package must be created. The operation is a five step operation. The package is created, package is configured by means of options, the package is sent, result is inspected (by means of options), the package is destroyed. ZOOM_package ZOOM_connection_package(ZOOM_connection c, ZOOM_options options); const char *ZOOM_package_option_get(ZOOM_package p, const char *key); void ZOOM_package_option_set(ZOOM_package p, const char *key, const char *val); void ZOOM_package_send(ZOOM_package p, const char *type); void ZOOM_package_destroy(ZOOM_package p); The ZOOM_connection_package creates a package for the connection given using the options specified. Functions ZOOM_package_option_get and ZOOM_package_option_set gets and sets options. ZOOM_package_send sends the package the via connection specified in ZOOM_connection_package. The type specifies the actual extended service package type to be sent. Extended Service Type Type Description itemorderItem Order updateRecord Update createDatabase Create dropDatabase Drop commitCommit Operation
Extended Service Common Options Option Description Default package-name Extended Service Request package name. Must be specified as part of a request. none user-id User ID of Extended Service Package. Is a request option. none function Function of package - one of create, delete, modify. Is a request option. create waitAction Wait action for package. Possible values: wait, waitIfPossible, dontWait or dontReturnPackage. waitIfPossible operationStatus Read after response. One of: done, accepted or failure. Inspect with ZOOM_pacakage_option_get. none targetReference Target Reference. This is part of the response as returned by the target. Read it after a successful operation. Inspect with ZOOM_pacakage_option_get. none taskStatus Read after response: One of: pending, active, complete, aborted. none esError Read after response: is set to diagnostic code for response. none esAddinfo Read after response: is set to additional info for response. none
Item Order For Item Order, type must be set to itemorder in ZOOM_package_send. Item Order Options Option Description Default contact-name ILL contact name none contact-phone ILL contact phone none contact-email ILL contact email none itemorder-setname Name of result set for record default itemorder-item Position for item (record) requested. An integer 1
There are two variants of item order: ILL-variant and XML document variant. In order to use the XML variant the setting doc must hold the XML item order document. If that setting is unset, the ILL-variant is used. ILL Request Options Option protocol-version-numtransaction-id,initial-requester-id,person-or-institution-symbol,persontransaction-id,initial-requester-id,person-or-institution-symbol,institutiontransaction-id,initial-requester-id,name-of-person-or-institution,name-of-persontransaction-id,initial-requester-id,name-of-person-or-institution,name-of-institutiontransaction-id,transaction-group-qualifiertransaction-id,transaction-qualifiertransaction-id,sub-transaction-qualifierservice-date-time,this,dateservice-date-time,this,timeservice-date-time,original,dateservice-date-time,original,timerequester-id,person-or-institution-symbol,personrequester-id,person-or-institution-symbol,institutionrequester-id,name-of-person-or-institution,name-of-personrequester-id,name-of-person-or-institution,name-of-institutionresponder-id,person-or-institution-symbol,personresponder-id,person-or-institution-symbol,institutionresponder-id,name-of-person-or-institution,name-of-personresponder-id,name-of-person-or-institution,name-of-institutiontransaction-typedelivery-address,postal-address,name-of-person-or-institution,name-of-persondelivery-address,postal-address,name-of-person-or-institution,name-of-institutiondelivery-address,postal-address,extended-postal-delivery-addressdelivery-address,postal-address,street-and-numberdelivery-address,postal-address,post-office-boxdelivery-address,postal-address,citydelivery-address,postal-address,regiondelivery-address,postal-address,countrydelivery-address,postal-address,postal-codedelivery-address,electronic-address,telecom-service-identifierdelivery-address,electronic-address,telecom-service-addreessbilling-address,postal-address,name-of-person-or-institution,name-of-personbilling-address,postal-address,name-of-person-or-institution,name-of-institutionbilling-address,postal-address,extended-postal-delivery-addressbilling-address,postal-address,street-and-numberbilling-address,postal-address,post-office-boxbilling-address,postal-address,citybilling-address,postal-address,regionbilling-address,postal-address,countrybilling-address,postal-address,postal-codebilling-address,electronic-address,telecom-service-identifierbilling-address,electronic-address,telecom-service-addreessill-service-typerequester-optional-messages,can-send-RECEIVEDrequester-optional-messages,can-send-RETURNEDrequester-optional-messages,requester-SHIPPEDrequester-optional-messages,requester-CHECKED-INsearch-type,level-of-servicesearch-type,need-before-datesearch-type,expiry-datesearch-type,expiry-flagplace-on-holdclient-id,client-nameclient-id,client-statusclient-id,client-identifieritem-id,item-typeitem-id,call-numberitem-id,authoritem-id,titleitem-id,sub-titleitem-id,sponsoring-bodyitem-id,place-of-publicationitem-id,publisheritem-id,series-title-numberitem-id,volume-issueitem-id,editionitem-id,publication-dateitem-id,publication-date-of-componentitem-id,author-of-articleitem-id,title-of-articleitem-id,paginationitem-id,ISBNitem-id,ISSNitem-id,additional-no-lettersitem-id,verification-reference-sourcecopyright-complicanceretry-flagforward-flagrequester-noteforward-note
Record Update For Record Update, type must be set to update in ZOOM_package_send. Record Update Options Option Description Default action The update action. One of specialUpdate, recordInsert, recordReplace, recordDelete, elementUpdate. specialUpdate (recordInsert for updateVersion=1 which does not support specialUpdate) recordIdOpaque Opaque Record ID none recordIdNumber Record ID number none recordIdString Record ID string none record The record itself none recordOpaque Specifies an opaque record which is encoded as an ASN.1 ANY type with the OID as given by option syntax (see below). Option recordOpaque is an alternative to record - and record option (above) is ignored if recordOpaque is set. This option is only available in YAZ 3.0.35 and later, and is meant to facilitate Updates with servers from OCLC. none syntax The record syntax (transfer syntax). Is a string that is a known record syntax. no syntax databaseName Database from connection object Default correlationInfo.note Correlation Info Note (string) none correlationInfo.id Correlation Info ID (integer) none elementSetName Element Set for Record none updateVersion Record Update version which holds one of the values 1, 2 or 3. Each version has a distinct OID: 1.2.840.10003.9.5 (first version) , 1.2.840.10003.9.5.1 (second version) and 1.2.840.10003.9.5.1.1 (third and newest version). 3
Database Create For Database Create, type must be set to create in ZOOM_package_send. Database Create Options Option Description Default databaseName Database from connection object Default
Database Drop For Database Drop, type must be set to drop in ZOOM_package_send. Database Drop Options Option Description Default databaseName Database from connection object Default
Commit Operation For Commit, type must be set to commit in ZOOM_package_send. Protocol behavior All the extended services are Z39.50-only. The database create, drop, and commit services are privately defined operations. Refer to esadmin.asn in YAZ for the ASN.1 definitions.
Options Most &zoom; objects provide a way to specify options to change behavior. From an implementation point of view, a set of options is just like an associative array / hash. ZOOM_options ZOOM_options_create(void); ZOOM_options ZOOM_options_create_with_parent(ZOOM_options parent); void ZOOM_options_destroy(ZOOM_options opt); const char *ZOOM_options_get(ZOOM_options opt, const char *name); void ZOOM_options_set(ZOOM_options opt, const char *name, const char *v); typedef const char *(*ZOOM_options_callback) (void *handle, const char *name); ZOOM_options_callback ZOOM_options_set_callback(ZOOM_options opt, ZOOM_options_callback c, void *handle); Query conversions int ZOOM_query_cql2rpn(ZOOM_query s, const char *cql_str, ZOOM_connection conn); int ZOOM_query_ccl2rpn(ZOOM_query s, const char *ccl_str, const char *config, int *ccl_error, const char **error_string, int *error_pos); ZOOM_query_cql2rpn translates the CQL string, client-side, into RPN which may be passed to the server. This is useful for servers that don't themselves support CQL, for which ZOOM_query_cql is useless. 'conn' is used only as a place to stash diagnostics if compilation fails; if this information is not needed, a null pointer may be used. The CQL conversion is driven by option cqlfile from connection conn. This specifies a conversion file (e.g. pqf.properties) which must be present. ZOOM_query_ccl2rpn translates the CCL string, client-side, into RPN which may be passed to the server. The conversion is driven by the specification given by config. Upon completion 0 is returned on success; -1 is returned on failure. On failure error_string and error_pos hold the error message and position of first error in original CCL string. Events If you're developing non-blocking applications, you have to deal with events. int ZOOM_event(int no, ZOOM_connection *cs); The ZOOM_event executes pending events for a number of connections. Supply the number of connections in no and an array of connections in cs (cs[0] ... cs[no-1]). A pending event could be sending a search, receiving a response, etc. When an event has occurred for one of the connections, this function returns a positive integer n denoting that an event occurred for connection cs[n-1]. When no events are pending for the connections, a value of zero is returned. To ensure that all outstanding requests are performed, call this function repeatedly until zero is returned. If ZOOM_event returns, and returns non-zero, the last event that occurred can be expected. int ZOOM_connection_last_event(ZOOM_connection cs); ZOOM_connection_last_event returns an event type (integer) for the last event. ZOOM Event IDs Event Description ZOOM_EVENT_NONE No event has occurred ZOOM_EVENT_CONNECT TCP/IP connect has initiated ZOOM_EVENT_SEND_DATA Data has been transmitted (sending) ZOOM_EVENT_RECV_DATA Data has been received ZOOM_EVENT_TIMEOUT Timeout ZOOM_EVENT_UNKNOWN Unknown event ZOOM_EVENT_SEND_APDU An APDU has been transmitted (sending) ZOOM_EVENT_RECV_APDU An APDU has been received ZOOM_EVENT_RECV_RECORD A result-set record has been received ZOOM_EVENT_RECV_SEARCH A search result has been received
Generic server Introduction If you aren't into documentation, a good way to learn how the back end interface works is to look at the backend.h file. Then, look at the small dummy-server in ztest/ztest.c. The backend.h file also makes a good reference, once you've chewed your way through the prose of this file. If you have a database system that you would like to make available by means of Z39.50 or SRU, &yaz; basically offers two options. You can use the APIs provided by the &asn;, &odr;, and &comstack; modules to create and decode PDUs, and exchange them with a client. Using this low-level interface gives you access to all fields and options of the protocol, and you can construct your server as close to your existing database as you like. It is also a fairly involved process, requiring you to set up an event-handling mechanism, protocol state machine, etc. To simplify server implementation, we have implemented a compact and simple, but reasonably full-functioned server-frontend that will handle most of the protocol mechanics, while leaving you to concentrate on your database interface. The backend interface was designed in anticipation of a specific integration task, while still attempting to achieve some degree of generality. We realize fully that there are points where the interface can be improved significantly. If you have specific functions or parameters that you think could be useful, send us a mail (or better, sign on to the mailing list referred to in the top-level README file). We will try to fit good suggestions into future releases, to the extent that it can be done without requiring too many structural changes in existing applications. The &yaz; server does not support XCQL. The Database Frontend We refer to this software as a generic database frontend. Your database system is the backend database, and the interface between the two is called the backend API. The backend API consists of a small number of function handlers and structure definitions. You are required to provide the main() routine for the server (which can be quite simple), as well as a set of handlers to match each of the prototypes. The interface functions that you write can use any mechanism you like to communicate with your database system: You might link the whole thing together with your database application and access it by function calls; you might use IPC to talk to a database server somewhere; or you might link with third-party software that handles the communication for you (like a commercial database client library). At any rate, the handlers will perform the tasks of: Initialization. Searching. Fetching records. Scanning the database index (optional - if you wish to implement SCAN). Extended Services (optional). Result-Set Delete (optional). Result-Set Sort (optional). Return Explain for SRU (optional). (more functions will be added in time to support as much of Z39.50-1995 as possible). The Backend API The header file that you need to use the interface are in the include/yaz directory. It's called backend.h. It will include other files from the include/yaz directory, so you'll probably want to use the -I option of your compiler to tell it where to find the files. When you run make in the top-level &yaz; directory, everything you need to create your server is to link with the lib/libyaz.la library. Your main() Routine As mentioned, your main() routine can be quite brief. If you want to initialize global parameters, or read global configuration tables, this is the place to do it. At the end of the routine, you should call the function int statserv_main(int argc, char **argv, bend_initresult *(*bend_init)(bend_initrequest *r), void (*bend_close)(void *handle)); The third and fourth arguments are pointers to handlers. Handler bend_init is called whenever the server receives an Initialize Request, so it serves as a Z39.50 session initializer. The bend_close handler is called when the session is closed. statserv_main will establish listening sockets according to the parameters given. When connection requests are received, the event handler will typically fork() and create a sub-process to handle a new connection. Alternatively the server may be setup to create threads for each connection. If you do use global variables and forking, you should be aware, then, that these cannot be shared between associations, unless you explicitly disable forking by command line parameters. The server provides a mechanism for controlling some of its behavior without using command-line options. The function statserv_options_block *statserv_getcontrol(void); will return a pointer to a struct statserv_options_block describing the current default settings of the server. The structure contains these elements: int dynamic A boolean value, which determines whether the server will fork on each incoming request (TRUE), or not (FALSE). Default is TRUE. This flag is only read by UNIX-based servers (WIN32-based servers do not fork). int threads A boolean value, which determines whether the server will create a thread on each incoming request (TRUE), or not (FALSE). Default is FALSE. This flag is only read by UNIX-based servers that offer POSIX Threads support. WIN32-based servers always operate in threaded mode. int inetd A boolean value, which determines whether the server will operate under a UNIX INET daemon (inetd). Default is FALSE. char logfile[ODR_MAXNAME+1] File for diagnostic output ("": stderr). char apdufile[ODR_MAXNAME+1] Name of file for logging incoming and outgoing APDUs ("": don't log APDUs, "-": stderr). char default_listen[1024] Same form as the command-line specification of listener address. "": no default listener address. Default is to listen at "tcp:@:9999". You can only specify one default listener address in this fashion. enum oid_proto default_proto; Either PROTO_Z3950 or PROTO_SR. Default is PROTO_Z39_50. int idle_timeout; Maximum session idle-time, in minutes. Zero indicates no (infinite) timeout. Default is 15 minutes. int maxrecordsize; Maximum permissible record (message) size. Default is 64 MB. This amount of memory will only be allocated if a client requests a very large amount of records in one operation (or a big record). Set it to a lower number if you are worried about resource consumption on your host system. char configname[ODR_MAXNAME+1] Passed to the backend when a new connection is received. char setuid[ODR_MAXNAME+1] Set user id to the user specified, after binding the listener addresses. void (*bend_start)(struct statserv_options_block *p) Pointer to function which is called after the command line options have been parsed - but before the server starts listening. For forked UNIX servers, this handler is called in the mother process; for threaded servers, this handler is called in the main thread. The default value of this pointer is NULL in which case it isn't invoked by the frontend server. When the server operates as an NT service, this handler is called whenever the service is started. void (*bend_stop)(struct statserv_options_block *p) Pointer to function which is called whenever the server has stopped listening for incoming connections. This function pointer has a default value of NULL in which case it isn't called. When the server operates as an NT service, this handler is called whenever the service is stopped. void *handle User defined pointer (default value NULL). This is a per-server handle that can be used to specify "user-data". Do not confuse this with the session-handle as returned by bend_init. The pointer returned by statserv_getcontrol points to a static area. You are allowed to change the contents of the structure, but the changes will not take effect until you call void statserv_setcontrol(statserv_options_block *block); You should generally update this structure before calling statserv_main(). The Backend Functions For each service of the protocol, the backend interface declares one or two functions. You are required to provide implementations of the functions representing the services that you wish to implement. Init bend_initresult (*bend_init)(bend_initrequest *r); This handler is called once for each new connection request, after a new process/thread has been created, and an Initialize Request has been received from the client. The pointer to the bend_init handler is passed in the call to statserv_start. This handler is also called when operating in SRU mode - when a connection has been made (even though SRU does not offer this service). Unlike previous versions of YAZ, the bend_init also serves as a handler that defines the Z39.50 services that the backend intends to support. Pointers to all service handlers, including search - and fetch must be specified here in this handler. The request - and result structures are defined as typedef struct bend_initrequest { /** \brief user/name/password to be read */ Z_IdAuthentication *auth; /** \brief encoding stream (for results) */ ODR stream; /** \brief printing stream */ ODR print; /** \brief decoding stream (use stream for results) */ ODR decode; /** \brief reference ID */ Z_ReferenceId *referenceId; /** \brief peer address of client */ char *peer_name; /** \brief character set and language negotiation see include/yaz/z-charneg.h */ Z_CharSetandLanguageNegotiation *charneg_request; /** \brief character negotiation response */ Z_External *charneg_response; /** \brief character set (encoding) for query terms This is NULL by default. It should be set to the native character set that the backend assumes for query terms */ char *query_charset; /** \brief whether query_charset also applies to records Is 0 (No) by default. Set to 1 (yes) if records is in the same character set as queries. If in doubt, use 0 (No). */ int records_in_same_charset; char *implementation_id; char *implementation_name; char *implementation_version; /** \brief Z39.50 sort handler */ int (*bend_sort)(void *handle, bend_sort_rr *rr); /** \brief SRU/Z39.50 search handler */ int (*bend_search)(void *handle, bend_search_rr *rr); /** \brief SRU/Z39.50 fetch handler */ int (*bend_fetch)(void *handle, bend_fetch_rr *rr); /** \brief SRU/Z39.50 present handler */ int (*bend_present)(void *handle, bend_present_rr *rr); /** \brief Z39.50 extended services handler */ int (*bend_esrequest) (void *handle, bend_esrequest_rr *rr); /** \brief Z39.50 delete result set handler */ int (*bend_delete)(void *handle, bend_delete_rr *rr); /** \brief Z39.50 scan handler */ int (*bend_scan)(void *handle, bend_scan_rr *rr); /** \brief Z39.50 segment facility handler */ int (*bend_segment)(void *handle, bend_segment_rr *rr); /** \brief SRU explain handler */ int (*bend_explain)(void *handle, bend_explain_rr *rr); /** \brief SRU scan handler */ int (*bend_srw_scan)(void *handle, bend_scan_rr *rr); /** \brief SRU record update handler */ int (*bend_srw_update)(void *handle, bend_update_rr *rr); /** \brief whether named result sets are supported (0=disable, 1=enable) */ int named_result_sets; } bend_initrequest; typedef struct bend_initresult { int errcode; /* 0==OK */ char *errstring; /* system error string or NULL */ void *handle; /* private handle to the backend module */ } bend_initresult; In general, the server frontend expects that the bend_*result pointer that you return is valid at least until the next call to a bend_* function. This applies to all of the functions described herein. The parameter structure passed to you in the call belongs to the server frontend, and you should not make assumptions about its contents after the current function call has completed. In other words, if you want to retain any of the contents of a request structure, you should copy them. The errcode should be zero if the initialization of the backend went well. Any other value will be interpreted as an error. The errstring isn't used in the current version, but one option would be to stick it in the initResponse as a VisibleString. The handle is the most important parameter. It should be set to some value that uniquely identifies the current session to the backend implementation. It is used by the frontend server in any future calls to a backend function. The typical use is to set it to point to a dynamically allocated state structure that is private to your backend module. The auth member holds the authentication information part of the Z39.50 Initialize Request. Interpret this if your server requires authentication. The members peer_name, implementation_id, implementation_name and implementation_version holds DNS of client, ID of implementor, name of client (Z39.50) implementation - and version. The bend_ - members are set to NULL when bend_init is called. Modify the pointers by setting them to point to backend functions. Search and Retrieve We now describe the handlers that are required to support search - and retrieve. You must support two functions - one for search - and one for fetch (retrieval of one record). If desirable you can provide a third handler which is called when a present request is received which allows you to optimize retrieval of multiple-records. int (*bend_search) (void *handle, bend_search_rr *rr); typedef struct { char *setname; /* name to give to this set */ int replace_set; /* replace set, if it already exists */ int num_bases; /* number of databases in list */ char **basenames; /* databases to search */ Z_ReferenceId *referenceId;/* reference ID */ Z_Query *query; /* query structure */ ODR stream; /* encode stream */ ODR decode; /* decode stream */ ODR print; /* print stream */ bend_request request; bend_association association; int *fd; int hits; /* number of hits */ int errcode; /* 0==OK */ char *errstring; /* system error string or NULL */ Z_OtherInformation *search_info; /* additional search info */ char *srw_sortKeys; /* holds SRU/SRW sortKeys info */ char *srw_setname; /* holds SRU/SRW generated resultsetID */ int *srw_setnameIdleTime; /* holds SRU/SRW life-time */ int estimated_hit_count; /* if hit count is estimated */ int partial_resultset; /* if result set is partial */ } bend_search_rr; The bend_search handler is a fairly close approximation of a protocol Z39.50 Search Request - and Response PDUs. The setname is the resultSetName from the protocol. You are required to establish a mapping between the set name and whatever your backend database likes to use. Similarly, the replace_set is a boolean value corresponding to the resultSetIndicator field in the protocol. num_bases/basenames is a length of/array of character pointers to the database names provided by the client. The query is the full query structure as defined in the protocol ASN.1 specification. It can be either of the possible query types, and it's up to you to determine if you can handle the provided query type. Rather than reproduce the C interface here, we'll refer you to the structure definitions in the file include/yaz/z-core.h. If you want to look at the attributeSetId OID of the RPN query, you can either match it against your own internal tables, or you can use the OID tools. The structure contains a number of hits, and an errcode/errstring pair. If an error occurs during the search, or if you're unhappy with the request, you should set the errcode to a value from the BIB-1 diagnostic set. The value will then be returned to the user in a nonsurrogate diagnostic record in the response. The errstring, if provided, will go in the addinfo field. Look at the protocol definition for the defined error codes, and the suggested uses of the addinfo field. The bend_search handler is also called when the frontend server receives a SRU SearchRetrieveRequest. For SRU, a CQL query is usually provided by the client. The CQL query is available as part of Z_Query structure (note that CQL is now part of Z39.50 via an external). To support CQL in existing implementations that only do Type-1, we refer to the CQL-to-PQF tool described here. To maintain backwards compatibility, the frontend server of yaz always assume that error codes are BIB-1 diagnostics. For SRU operation, a Bib-1 diagnostic code is mapped to SRU diagnostic. int (*bend_fetch) (void *handle, bend_fetch_rr *rr); typedef struct bend_fetch_rr { char *setname; /* set name */ int number; /* record number */ Z_ReferenceId *referenceId;/* reference ID */ Odr_oid *request_format; /* format, transfer syntax (OID) */ Z_RecordComposition *comp; /* Formatting instructions */ ODR stream; /* encoding stream - memory source if req */ ODR print; /* printing stream */ char *basename; /* name of database that provided record */ int len; /* length of record or -1 if structured */ char *record; /* record */ int last_in_set; /* is it? */ Odr_oid *output_format; /* response format/syntax (OID) */ int errcode; /* 0==success */ char *errstring; /* system error string or NULL */ int surrogate_flag; /* surrogate diagnostic */ char *schema; /* string record schema input/output */ } bend_fetch_rr; The frontend server calls the bend_fetch handler when it needs database records to fulfill a Z39.50 Search Request, a Z39.50 Present Request or a SRU SearchRetrieveRequest. The setname is simply the name of the result set that holds the reference to the desired record. The number is the offset into the set (with 1 being the first record in the set). The format field is the record format requested by the client (See ). A value of NULL for format indicates that the client did not request a specific format. The stream argument is an &odr; stream which should be used for allocating space for structured data records. The stream will be reset when all records have been assembled, and the response package has been transmitted. For unstructured data, the backend is responsible for maintaining a static or dynamic buffer for the record between calls. If a SRU SearchRetrieveRequest is received by the frontend server, the referenceId is NULL and the format (transfer syntax) is the OID for XML. The schema for SRU is stored in both the Z_RecordComposition structure and schema (simple string). In the structure, the basename is the name of the database that holds the record. len is the length of the record returned, in bytes, and record is a pointer to the record. last_in_set should be nonzero only if the record returned is the last one in the given result set. errcode and errstring, if given, will be interpreted as a global error pertaining to the set, and will be returned in a non-surrogate-diagnostic. If you wish to return the error as a surrogate-diagnostic (local error) you can do this by setting surrogate_flag to 1 also. If the len field has the value -1, then record is assumed to point to a constructed data type. The format field will be used to determine which encoder should be used to serialize the data. If your backend generates structured records, it should use odr_malloc() on the provided stream for allocating data: This allows the frontend server to keep track of the record sizes. The format field is mapped to an object identifier in the direct reference of the resulting EXTERNAL representation of the record. The current version of &yaz; only supports the direct reference mode. int (*bend_present) (void *handle, bend_present_rr *rr); typedef struct { char *setname; /* set name */ int start; int number; /* record number */ Odr_oid *format; /* format, transfer syntax (OID) */ Z_ReferenceId *referenceId;/* reference ID */ Z_RecordComposition *comp; /* Formatting instructions */ ODR stream; /* encoding stream - memory source if required */ ODR print; /* printing stream */ bend_request request; bend_association association; int hits; /* number of hits */ int errcode; /* 0==OK */ char *errstring; /* system error string or NULL */ } bend_present_rr; The bend_present handler is called when the server receives a Z39.50 Present Request. The setname, start and number is the name of the result set - start position - and number of records to be retrieved respectively. format and comp is the preferred transfer syntax and element specifications of the present request. Note that this is handler serves as a supplement for bend_fetch and need not to be defined in order to support search - and retrieve. Delete For back-ends that supports delete of a result set, only one handler must be defined. int (*bend_delete)(void *handle, bend_delete_rr *rr); typedef struct bend_delete_rr { int function; int num_setnames; char **setnames; Z_ReferenceId *referenceId; int delete_status; /* status for the whole operation */ int *statuses; /* status each set - indexed as setnames */ ODR stream; ODR print; } bend_delete_rr; The delete set function definition is rather primitive, mostly because we have had no practical need for it as of yet. If someone wants to provide a full delete service, we'd be happy to add the extra parameters that are required. Are there clients out there that will actually delete sets they no longer need? Scan For servers that wish to offer the scan service one handler must be defined. int (*bend_scan)(void *handle, bend_scan_rr *rr); typedef enum { BEND_SCAN_SUCCESS, /* ok */ BEND_SCAN_PARTIAL /* not all entries could be found */ } bend_scan_status; typedef struct bend_scan_rr { int num_bases; /* number of elements in databaselist */ char **basenames; /* databases to search */ Odr_oid *attributeset; Z_ReferenceId *referenceId; /* reference ID */ Z_AttributesPlusTerm *term; ODR stream; /* encoding stream - memory source if required */ ODR print; /* printing stream */ int *step_size; /* step size */ int term_position; /* desired index of term in result list/returned */ int num_entries; /* number of entries requested/returned */ /* scan term entries. The called handler does not have to allocate this. Size of entries is num_entries (see above) */ struct scan_entry *entries; bend_scan_status status; int errcode; char *errstring; char *scanClause; /* CQL scan clause */ char *setname; /* Scan in result set (NULL if omitted) */ } bend_scan_rr; This backend server handles both Z39.50 scan and SRU scan. In order for a handler to distinguish between SRU (CQL) scan Z39.50 Scan, it must check for a non-NULL value of scanClause. If designed today, it would be a choice using a union or similar, but that would break binary compatibility with existing servers. Application Invocation The finished application has the following invocation syntax (by way of statserv_main()): &gfs-synopsis; The options are: &gfs-options; A listener specification consists of a transport mode followed by a colon (:) followed by a listener address. The transport mode is either tcp, unix: or ssl. For TCP and SSL, an address has the form hostname | IP-number [: portnumber] The port number defaults to 210 (standard Z39.50 port). For UNIX, the address is the filename of socket. For TCP/IP and SSL, the special hostnames @, maps to IN6ADDR_ANY_INIT with IPV4 binding as well (bindv6only=0), The special hostname @4 binds to INADDR_ANY (IPV4 only listener). The special hostname @6 binds to IN6ADDR_ANY_INIT with bindv6only=1 (IPV6 only listener). Running the GFS on Unix Assuming the server application appname is started as root, the following will make it listen on port 210. The server will change identity to nobody and write its log to /var/log/app.log. application -l /var/log/app.log -u nobody tcp:@:210 The server will accept Z39.50 requests and offer SRU service on port 210. Setting up Apache as SRU Frontend If you use Apache as your public web server and want to offer HTTP port 80 access to the YAZ server on 210, you can use the ProxyPass directive. If you have virtual host srw.mydomain you can use the following directives in Apache's httpd.conf: <VirtualHost *> ErrorLog /home/srw/logs/error_log TransferLog /home/srw/logs/access_log ProxyPass / http://srw.mydomain:210/ </VirtualHost> The above is for the Apache 1.3 series. Running a server with local access only A server that is only being accessed from the local host should listen on UNIX file socket rather than an Internet socket. To listen on /tmp/mysocket start the server as follows: application unix:/tmp/mysocket GFS Configuration and Virtual Hosts &gfs-virtual; The Z39.50 ASN.1 Module Introduction The &asn; module provides you with a set of C struct definitions for the various PDUs of the Z39.50 protocol, as well as for the complex types appearing within the PDUs. For the primitive data types, the C representation often takes the form of an ordinary C language type, such as Odr_int which is equivalent to an integral C integer. For ASN.1 constructs that have no direct representation in C, such as general octet strings and bit strings, the &odr; module (see section The ODR Module) provides auxiliary definitions. The &asn; module is located in sub directory z39.50. There you'll find C files that implement encoders and decoders for the Z39.50 types. You'll also find the protocol definitions: z3950v3.asn, esupdate.asn, and others. Preparing PDUs A structure representing a complex ASN.1 type doesn't in itself contain the members of that type. Instead, the structure contains pointers to the members of the type. This is necessary, in part, to allow a mechanism for specifying which of the optional structure (SEQUENCE) members are present, and which are not. It follows that you will need to somehow provide space for the individual members of the structure, and set the pointers to refer to the members. The conversion routines don't care how you allocate and maintain your C structures - they just follow the pointers that you provide. Depending on the complexity of your application, and your personal taste, there are at least three different approaches that you may take when you allocate the structures. You can use static or automatic local variables in the function that prepares the PDU. This is a simple approach, and it provides the most efficient form of memory management. While it works well for flat PDUs like the InitRequest, it will generally not be sufficient for say, the generation of an arbitrarily complex RPN query structure. You can individually create the structure and its members using the malloc(2) function. If you want to ensure that the data is freed when it is no longer needed, you will have to define a function that individually releases each member of a structure before freeing the structure itself. You can use the odr_malloc() function (see for details). When you use odr_malloc(), you can release all of the allocated data in a single operation, independent of any pointers and relations between the data. The odr_malloc() function is based on a "nibble-memory" scheme, in which large portions of memory are allocated, and then gradually handed out with each call to odr_malloc(). The next time you call odr_reset(), all of the memory allocated since the last call is recycled for future use (actually, it is placed on a free-list). You can combine all of the methods described here. This will often be the most practical approach. For instance, you might use odr_malloc() to allocate an entire structure and some of its elements, while you leave other elements pointing to global or per-session default variables. The &asn; module provides an important aid in creating new PDUs. For each of the PDU types (say, Z_InitRequest), a function is provided that allocates and initializes an instance of that PDU type for you. In the case of the InitRequest, the function is simply named zget_InitRequest(), and it sets up reasonable default value for all of the mandatory members. The optional members are generally initialized to null pointers. This last aspect is very important: it ensures that if the PDU definitions are extended after you finish your implementation (to accommodate new versions of the protocol, say), you won't get into trouble with uninitialized pointers in your structures. The functions use odr_malloc() to allocate the PDUs and its members, so you can free everything again with a single call to odr_reset(). We strongly recommend that you use the zget_* functions whenever you are preparing a PDU (in a C++ API, the zget_ functions would probably be promoted to constructors for the individual types). The prototype for the individual PDU types generally look like this: Z_<type> *zget_<type>(ODR o); e.g.: Z_InitRequest *zget_InitRequest(ODR o); The &odr; handle should generally be your encoding stream, but it needn't be. As well as the individual PDU functions, a function zget_APDU() is provided, which allocates a top-level Z-APDU of the type requested: Z_APDU *zget_APDU(ODR o, int which); The which parameter is (of course) the discriminator belonging to the Z_APDU CHOICE type. All of the interface described here is provided by the &asn; module, and you access it through the proto.h header file. EXTERNAL Data In order to achieve extensibility and adaptability to different application domains, the new version of the protocol defines many structures outside of the main ASN.1 specification, referencing them through ASN.1 EXTERNAL constructs. To simplify the construction and access to the externally referenced data, the &asn; module defines a specialized version of the EXTERNAL construct, called Z_External.It is defined thus: typedef struct Z_External { Odr_oid *direct_reference; int *indirect_reference; char *descriptor; enum { /* Generic types */ Z_External_single = 0, Z_External_octet, Z_External_arbitrary, /* Specific types */ Z_External_SUTRS, Z_External_explainRecord, Z_External_resourceReport1, Z_External_resourceReport2 ... } which; union { /* Generic types */ Odr_any *single_ASN1_type; Odr_oct *octet_aligned; Odr_bitmask *arbitrary; /* Specific types */ Z_SUTRS *sutrs; Z_ExplainRecord *explainRecord; Z_ResourceReport1 *resourceReport1; Z_ResourceReport2 *resourceReport2; ... } u; } Z_External; When decoding, the &asn; module will attempt to determine which syntax describes the data by looking at the reference fields (currently only the direct-reference). For ASN.1 structured data, you need only consult the which field to determine the type of data. You can the access the data directly through the union. When constructing data for encoding, you set the union pointer to point to the data, and set the which field accordingly. Remember also to set the direct (or indirect) reference to the correct OID for the data type. For non-ASN.1 data such as MARC records, use the octet_aligned arm of the union. Some servers return ASN.1 structured data values (e.g. database records) as BER-encoded records placed in the octet-aligned branch of the EXTERNAL CHOICE. The ASN-module will not automatically decode these records. To help you decode the records in the application, the function Z_ext_typeent *z_ext_gettypebyref(const oid *oid); can be used to retrieve information about the known, external data types. The function returns a pointer to a static area, or NULL, if no match for the given direct reference is found. The Z_ext_typeent is defined as: typedef struct Z_ext_typeent { int oid[OID_SIZE]; /* the direct-reference OID. */ int what; /* discriminator value for the external CHOICE */ Odr_fun fun; /* decoder function */ } Z_ext_typeent; The what member contains the Z_External union discriminator value for the given type: For the SUTRS record syntax, the value would be Z_External_sutrs. The fun member contains a pointer to the function which encodes/decodes the given type. Again, for the SUTRS record syntax, the value of fun would be z_SUTRS (a function pointer). If you receive an EXTERNAL which contains an octet-string value that you suspect of being an ASN.1-structured data value, you can use z_ext_gettypebyref to look for the provided direct-reference. If the return value is different from NULL, you can use the provided function to decode the BER string (see ). If you want to send EXTERNALs containing ASN.1-structured values in the octet-aligned branch of the CHOICE, this is possible too. However, on the encoding phase, it requires a somewhat involved juggling around of the various buffers involved. If you need to add new, externally defined data types, you must update the struct above, in the source file prt-ext.h, as well as the encoder/decoder in the file prt-ext.c. When changing the latter, remember to update both the arm array and the list type_table, which drives the CHOICE biasing that is necessary to tell the different, structured types apart on decoding. Eventually, the EXTERNAL processing will most likely automatically insert the correct OIDs or indirect-refs. First, however, we need to determine how application-context management (specifically the presentation-context-list) should fit into the various modules. PDU Contents Table We include, for reference, a listing of the fields of each top-level PDU, as well as their default settings. Default settings for PDU Initialize Request Field Type Default Value referenceIdZ_ReferenceIdNULL protocolVersionOdr_bitmaskEmpty bitmask optionsOdr_bitmaskEmpty bitmask preferredMessageSizeOdr_int30*1024 maximumRecordSizeOdr_int30*1024 idAuthenticationZ_IdAuthenticationNULL implementationIdchar*"81" implementationNamechar*"YAZ" implementationVersionchar*YAZ_VERSION userInformationFieldZ_UserInformationNULL otherInfoZ_OtherInformationNULL
Default settings for PDU Initialize Response Field Type Default Value referenceIdZ_ReferenceIdNULL protocolVersionOdr_bitmaskEmpty bitmask optionsOdr_bitmaskEmpty bitmask preferredMessageSizeOdr_int30*1024 maximumRecordSizeOdr_int30*1024 resultOdr_boolTRUE implementationIdchar*"id)" implementationNamechar*"YAZ" implementationVersionchar*YAZ_VERSION userInformationFieldZ_UserInformationNULL otherInfoZ_OtherInformationNULL
Default settings for PDU Search Request Field Type Default Value referenceIdZ_ReferenceIdNULL smallSetUpperBoundOdr_int0 largeSetLowerBoundOdr_int1 mediumSetPresentNumberOdr_int0 replaceIndicatorOdr_boolTRUE resultSetNamechar *"default" num_databaseNamesOdr_int0 databaseNameschar **NULL smallSetElementSetNamesZ_ElementSetNames NULL mediumSetElementSetNamesZ_ElementSetNames NULL preferredRecordSyntaxOdr_oidNULL queryZ_QueryNULL additionalSearchInfoZ_OtherInformation NULL otherInfoZ_OtherInformationNULL
Default settings for PDU Search Response Field Type Default Value referenceIdZ_ReferenceIdNULL resultCountOdr_int0 numberOfRecordsReturnedOdr_int0 nextResultSetPositionOdr_int0 searchStatusOdr_boolTRUE resultSetStatusOdr_intNULL presentStatusOdr_intNULL recordsZ_RecordsNULL additionalSearchInfo Z_OtherInformationNULL otherInfoZ_OtherInformationNULL
Default settings for PDU Present Request Field Type Default Value referenceIdZ_ReferenceIdNULL resultSetIdchar*"default" resultSetStartPointOdr_int1 numberOfRecordsRequestedOdr_int10 num_rangesOdr_int0 additionalRangesZ_RangeNULL recordCompositionZ_RecordCompositionNULL preferredRecordSyntaxOdr_oidNULL maxSegmentCountOdr_intNULL maxRecordSizeOdr_intNULL maxSegmentSizeOdr_intNULL otherInfoZ_OtherInformationNULL
Default settings for PDU Present Response Field Type Default Value referenceIdZ_ReferenceIdNULL numberOfRecordsReturnedOdr_int0 nextResultSetPositionOdr_int0 presentStatusOdr_intZ_PresentStatus_success recordsZ_RecordsNULL otherInfoZ_OtherInformationNULL
Default settings for Delete Result Set Request Field Type Default Value referenceId Z_ReferenceIdNULL deleteFunctionOdr_intZ_DeleteResultSetRequest_list num_idsOdr_int0 resultSetListchar**NULL otherInfoZ_OtherInformationNULL
Default settings for Delete Result Set Response Field Type Default Value referenceIdZ_ReferenceIdNULL deleteOperationStatusOdr_int Z_DeleteStatus_success num_statusesOdr_int0 deleteListStatusesZ_ListStatus**NULL numberNotDeletedOdr_intNULL num_bulkStatusesOdr_int0 bulkStatusesZ_ListStatusNULL deleteMessagechar*NULL otherInfoZ_OtherInformationNULL
Default settings for Scan Request Field Type Default Value referenceIdZ_ReferenceIdNULL num_databaseNamesOdr_int0 databaseNameschar**NULL attributeSetOdr_oidNULL termListAndStartPointZ_AttributesPlus... NULL stepSizeOdr_intNULL numberOfTermsRequestedOdr_int20 preferredPositionInResponseOdr_intNULL otherInfoZ_OtherInformationNULL
Default settings for Scan Response Field Type Default Value referenceIdZ_ReferenceIdNULL stepSizeOdr_intNULL scanStatusOdr_intZ_Scan_success numberOfEntriesReturnedOdr_int0 positionOfTermOdr_intNULL entriesZ_ListEntriesNULL attributeSetOdr_oidNULL otherInfoZ_OtherInformationNULL
Default settings for Trigger Resource Control Request Field Type Default Value referenceIdZ_ReferenceIdNULL requestedActionOdr_int Z_TriggerResourceCtrl_resou.. prefResourceReportFormatOdr_oidNULL resultSetWantedOdr_boolNULL otherInfoZ_OtherInformationNULL
Default settings for Resource Control Request Field Type Default Value referenceIdZ_ReferenceIdNULL suspendedFlagOdr_boolNULL resourceReportZ_ExternalNULL partialResultsAvailableOdr_intNULL responseRequiredOdr_boolFALSE triggeredRequestFlagOdr_boolNULL otherInfoZ_OtherInformationNULL
Default settings for Resource Control Response Field Type Default Value referenceIdZ_ReferenceIdNULL continueFlagbool_tTRUE resultSetWantedbool_tNULL otherInfoZ_OtherInformationNULL
Default settings for Access Control Request Field Type Default Value referenceIdZ_ReferenceIdNULL whichenumZ_AccessRequest_simpleForm; uunionNULL otherInfoZ_OtherInformationNULL
Default settings for Access Control Response Field Type Default Value referenceIdZ_ReferenceIdNULL whichenumZ_AccessResponse_simpleForm uunionNULL diagnosticZ_DiagRecNULL otherInfoZ_OtherInformationNULL
Default settings for Segment Field Type Default Value referenceIdZ_ReferenceIdNULL numberOfRecordsReturnedOdr_intvalue=0 num_segmentRecordsOdr_int0 segmentRecordsZ_NamePlusRecordNULL otherInfoZ_OtherInformationNULL
Default settings for Close Field Type Default Value referenceIdZ_ReferenceIdNULL closeReasonOdr_intZ_Close_finished diagnosticInformationchar*NULL resourceReportFormatOdr_oidNULL resourceFormatZ_ExternalNULL otherInfoZ_OtherInformationNULL
SOAP and SRU Introduction &yaz; uses a very simple implementation of SOAP that only (currently) supports what is sufficient to offer SRU SOAP functionality. The implementation uses the tree API of libxml2 to encode and decode SOAP packages. Like the Z39.50 ASN.1 module, the &yaz; SRU implementation uses simple C structs to represent SOAP packages as well as HTTP packages. HTTP &yaz; only offers HTTP as transport carrier for SOAP, but it is relatively easy to change that. The following definition of Z_GDU (Generic Data Unit) allows for both HTTP and Z39.50 in one packet. #include <yaz/zgdu.h> #define Z_GDU_Z3950 1 #define Z_GDU_HTTP_Request 2 #define Z_GDU_HTTP_Response 3 typedef struct { int which; union { Z_APDU *z3950; Z_HTTP_Request *HTTP_Request; Z_HTTP_Response *HTTP_Response; } u; } Z_GDU ; The corresponding Z_GDU encoder/decoder is z_GDU. The z3950 is any of the known BER encoded Z39.50 APDUs. HTTP_Request and HTTP_Response is the HTTP Request and Response respectively. SOAP Packages Every SOAP package in &yaz; is represented as follows: #include <yaz/soap.h> typedef struct { char *fault_code; char *fault_string; char *details; } Z_SOAP_Fault; typedef struct { int no; char *ns; void *p; } Z_SOAP_Generic; #define Z_SOAP_fault 1 #define Z_SOAP_generic 2 #define Z_SOAP_error 3 typedef struct { int which; union { Z_SOAP_Fault *fault; Z_SOAP_Generic *generic; Z_SOAP_Fault *soap_error; } u; const char *ns; } Z_SOAP; The fault and soap_error arms both represent a SOAP fault - struct Z_SOAP_Fault. Any other generic (valid) package is represented by Z_SOAP_Generic. The ns as part of Z_SOAP is the namespace for SOAP itself and reflects the SOAP version. For version 1.1 it is http://schemas.xmlsoap.org/soap/envelope/, for version 1.2 it is http://www.w3.org/2001/06/soap-envelope. int z_soap_codec(ODR o, Z_SOAP **pp, char **content_buf, int *content_len, Z_SOAP_Handler *handlers); The content_buf and content_len is XML buffer and length of buffer respectively. The handlers is a list of SOAP codec handlers - one handler for each service namespace. For SRU SOAP, the namespace would be http://www.loc.gov/zing/srw/v1.0/. When decoding, the z_soap_codec inspects the XML content and tries to match one of the services namespaces of the supplied handlers. If there is a match. a handler function is invoked which decodes that particular SOAP package. If successful, the returned Z_SOAP package will be of type Z_SOAP_Generic. Member no is set the offset of the handler that matched; ns is set to namespace of the matching handler; the void pointer p is set to the C data structure associated with the handler. When a NULL namespace is met (member ns below), that specifies end-of-list. Each handler is defined as follows: typedef struct { char *ns; void *client_data; Z_SOAP_fun f; } Z_SOAP_Handler; The ns is the namespace of the service associated with handler f. The client_data is user-defined data which is passed to the handler. The prototype for a SOAP service handler is: int handler(ODR o, void * ptr, void **handler_data, void *client_data, const char *ns); The o specifies the mode (decode/encode) as usual. The second argument, ptr, is a libxml2 tree node pointer (xmlNodePtr) and is a pointer to the Body element of the SOAP package. The handler_data is an opaque pointer to C definitions associated with the SOAP service. The client_data is the pointer which was set as part of the Z_SOAP_handler. Finally, ns is the service namespace. SRU SRU SOAP is just one implementation of a SOAP handler as described in the previous section. The encoder/decoder handler for SRU is defined as follows: #include <yaz/srw.h> int yaz_srw_codec(ODR o, void * pptr, Z_SRW_GDU **handler_data, void *client_data, const char *ns); Here, Z_SRW_GDU is either searchRetrieveRequest or a searchRetrieveResponse. The xQuery and xSortKeys are not handled yet by the SRW implementation of &yaz;. Explain is also missing. Future versions of &yaz; will include these features. The definition of searchRetrieveRequest is: typedef struct { #define Z_SRW_query_type_cql 1 #define Z_SRW_query_type_xcql 2 #define Z_SRW_query_type_pqf 3 int query_type; union { char *cql; char *xcql; char *pqf; } query; #define Z_SRW_sort_type_none 1 #define Z_SRW_sort_type_sort 2 #define Z_SRW_sort_type_xSort 3 int sort_type; union { char *none; char *sortKeys; char *xSortKeys; } sort; int *startRecord; int *maximumRecords; char *recordSchema; char *recordPacking; char *database; } Z_SRW_searchRetrieveRequest; Please observe that data of type xsd:string is represented as a char pointer (char *). A null pointer means that the element is absent. Data of type xsd:integer is represented as a pointer to an int (int *). Again, a null pointer is used for absent elements. The SearchRetrieveResponse has the following definition. typedef struct { int * numberOfRecords; char * resultSetId; int * resultSetIdleTime; Z_SRW_record *records; int num_records; Z_SRW_diagnostic *diagnostics; int num_diagnostics; int *nextRecordPosition; } Z_SRW_searchRetrieveResponse; The num_records and num_diagnostics is number of returned records and diagnostics respectively, and also correspond to the "size of" arrays records and diagnostics. A retrieval record is defined as follows: typedef struct { char *recordSchema; char *recordData_buf; int recordData_len; int *recordPosition; } Z_SRW_record; The record data is defined as a buffer of some length so that data can be of any type. SRW 1.0 currently doesn't allow for this (only XML), but future versions might do. And, a diagnostic as: typedef struct { int *code; char *details; } Z_SRW_diagnostic; Supporting Tools In support of the service API - primarily the ASN module, which provides the programmatic interface to the Z39.50 APDUs, &yaz; contains a collection of tools that support the development of applications. Query Syntax Parsers Since the type-1 (RPN) query structure has no direct, useful string representation, every origin application needs to provide some form of mapping from a local query notation or representation to a Z_RPNQuery structure. Some programmers will prefer to construct the query manually, perhaps using odr_malloc() to simplify memory management. The &yaz; distribution includes three separate, query-generating tools that may be of use to you. Prefix Query Format Since RPN or reverse polish notation is really just a fancy way of describing a suffix notation format (operator follows operands), it would seem that the confusion is total when we now introduce a prefix notation for RPN. The reason is one of simple laziness - it's somewhat simpler to interpret a prefix format, and this utility was designed for maximum simplicity, to provide a baseline representation for use in simple test applications and scripting environments (like Tcl). The demonstration client included with YAZ uses the PQF. The PQF has been adopted by other parties developing Z39.50 software. It is often referred to as Prefix Query Notation - PQN. The PQF is defined by the pquery module in the YAZ library. There are two sets of functions that have similar behavior. First set operates on a PQF parser handle, second set doesn't. First set of functions are more flexible than the second set. Second set is obsolete and is only provided to ensure backwards compatibility. First set of functions all operate on a PQF parser handle: #include <yaz/pquery.h> YAZ_PQF_Parser yaz_pqf_create(void); void yaz_pqf_destroy(YAZ_PQF_Parser p); Z_RPNQuery *yaz_pqf_parse(YAZ_PQF_Parser p, ODR o, const char *qbuf); Z_AttributesPlusTerm *yaz_pqf_scan(YAZ_PQF_Parser p, ODR o, Odr_oid **attributeSetId, const char *qbuf); int yaz_pqf_error(YAZ_PQF_Parser p, const char **msg, size_t *off); A PQF parser is created and destructed by functions yaz_pqf_create and yaz_pqf_destroy respectively. Function yaz_pqf_parse parses the query given by string qbuf. If parsing was successful, a Z39.50 RPN Query is returned which is created using ODR stream o. If parsing failed, a NULL pointer is returned. Function yaz_pqf_scan takes a scan query in qbuf. If parsing was successful, the function returns attributes plus term pointer and modifies attributeSetId to hold attribute set for the scan request - both allocated using ODR stream o. If parsing failed, yaz_pqf_scan returns a NULL pointer. Error information for bad queries can be obtained by a call to yaz_pqf_error which returns an error code and modifies *msg to point to an error description, and modifies *off to the offset within the last query where parsing failed. The second set of functions are declared as follows: #include <yaz/pquery.h> Z_RPNQuery *p_query_rpn(ODR o, oid_proto proto, const char *qbuf); Z_AttributesPlusTerm *p_query_scan(ODR o, oid_proto proto, Odr_oid **attributeSetP, const char *qbuf); int p_query_attset(const char *arg); The function p_query_rpn() takes as arguments an &odr; stream (see section The ODR Module) to provide a memory source (the structure created is released on the next call to odr_reset() on the stream), a protocol identifier (one of the constants PROTO_Z3950 and PROTO_SR), an attribute set reference, and finally a null-terminated string holding the query string. If the parse went well, p_query_rpn() returns a pointer to a Z_RPNQuery structure which can be placed directly into a Z_SearchRequest. If parsing failed, due to syntax error, a NULL pointer is returned. The p_query_attset specifies which attribute set to use if the query doesn't specify one by the @attrset operator. The p_query_attset returns 0 if the argument is a valid attribute set specifier; otherwise the function returns -1. The grammar of the PQF is as follows: query ::= top-set query-struct. top-set ::= [ '@attrset' string ] query-struct ::= attr-spec | simple | complex | '@term' term-type query attr-spec ::= '@attr' [ string ] string query-struct complex ::= operator query-struct query-struct. operator ::= '@and' | '@or' | '@not' | '@prox' proximity. simple ::= result-set | term. result-set ::= '@set' string. term ::= string. proximity ::= exclusion distance ordered relation which-code unit-code. exclusion ::= '1' | '0' | 'void'. distance ::= integer. ordered ::= '1' | '0'. relation ::= integer. which-code ::= 'known' | 'private' | integer. unit-code ::= integer. term-type ::= 'general' | 'numeric' | 'string' | 'oid' | 'datetime' | 'null'. You will note that the syntax above is a fairly faithful representation of RPN, except for the Attribute, which has been moved a step away from the term, allowing you to associate one or more attributes with an entire query structure. The parser will automatically apply the given attributes to each term as required. The @attr operator is followed by an attribute specification (attr-spec above). The specification consists of an optional attribute set, an attribute type-value pair and a sub-query. The attribute type-value pair is packed in one string: an attribute type, an equals sign, and an attribute value, like this: @attr 1=1003. The type is always an integer, but the value may be either an integer or a string (if it doesn't start with a digit character). A string attribute-value is encoded as a Type-1 "complex" attribute with the list of values containing the single string specified, and including no semantic indicators. Version 3 of the Z39.50 specification defines various encoding of terms. Use @term type string, where type is one of: general, numeric or string (for InternationalString). If no term type has been given, the general form is used. This is the only encoding allowed in both versions 2 and 3 of the Z39.50 standard. Using Proximity Operators with PQF This is an advanced topic, describing how to construct queries that make very specific requirements on the relative location of their operands. You may wish to skip this section and go straight to the example PQF queries. Most Z39.50 servers do not support proximity searching, or support only a small subset of the full functionality that can be expressed using the PQF proximity operator. Be aware that the ability to express a query in PQF is no guarantee that any given server will be able to execute it. The proximity operator @prox is a special and more restrictive version of the conjunction operator @and. Its semantics are described in section 3.7.2 (Proximity) of Z39.50 the standard itself, which can be read on-line at In PQF, the proximity operation is represented by a sequence of the form @prox exclusion distance ordered relation which-code unit-code in which the meanings of the parameters are as described in the standard, and they can take the following values: exclusion 0 = false (i.e. the proximity condition specified by the remaining parameters must be satisfied) or 1 = true (the proximity condition specified by the remaining parameters must not be satisfied). distance An integer specifying the difference between the locations of the operands: e.g. two adjacent words would have distance=1 since their locations differ by one unit. ordered 1 = ordered (the operands must occur in the order the query specifies them) or 0 = unordered (they may appear in either order). relation Recognised values are 1 (lessThan), 2 (lessThanOrEqual), 3 (equal), 4 (greaterThanOrEqual), 5 (greaterThan) and 6 (notEqual). which-code known or k (the unit-code parameter is taken from the well-known list of alternatives described below) or private or p (the unit-code parameter has semantics specific to an out-of-band agreement such as a profile). unit-code If the which-code parameter is known then the recognised values are 1 (character), 2 (word), 3 (sentence), 4 (paragraph), 5 (section), 6 (chapter), 7 (document), 8 (element), 9 (subelement), 10 (elementType) and 11 (byte). If which-code is private then the acceptable values are determined by the profile. (The numeric values of the relation and well-known unit-code parameters are taken straight from the ASN.1 of the proximity structure in the standard.) PQF queries PQF queries using simple terms dylan "bob dylan" PQF boolean operators @or "dylan" "zimmerman" @and @or dylan zimmerman when @and when @or dylan zimmerman PQF references to result sets @set Result-1 @and @set seta @set setb Attributes for terms @attr 1=4 computer @attr 1=4 @attr 4=1 "self portrait" @attrset exp1 @attr 1=1 CategoryList @attr gils 1=2008 Copenhagen @attr 1=/book/title computer PQF Proximity queries @prox 0 3 1 2 k 2 dylan zimmerman Here the parameters 0, 3, 1, 2, k and 2 represent exclusion, distance, ordered, relation, which-code and unit-code, in that order. So: exclusion = 0: the proximity condition must hold distance = 3: the terms must be three units apart ordered = 1: they must occur in the order they are specified relation = 2: lessThanOrEqual (to the distance of 3 units) which-code is "known", so the standard unit-codes are used unit-code = 2: word. So the whole proximity query means that the words dylan and zimmerman must both occur in the record, in that order, differing in position by three or fewer words (i.e. with two or fewer words between them.) The query would find "Bob Dylan, aka. Robert Zimmerman", but not "Bob Dylan, born as Robert Zimmerman" since the distance in this case is four. PQF specification of search term type @term string "a UTF-8 string, maybe?" PQF mixed queries @or @and bob dylan @set Result-1 @attr 4=1 @and @attr 1=1 "bob dylan" @attr 1=4 "slow train coming" @and @attr 2=4 @attr gils 1=2038 -114 @attr 2=2 @attr gils 1=2039 -109 The last of these examples is a spatial search: in the GILS attribute set, access point 2038 indicates West Bounding Coordinate and 2030 indicates East Bounding Coordinate, so the query is for areas extending from -114 degrees longitude to no more than -109 degrees longitude. CCL Not all users enjoy typing in prefix query structures and numerical attribute values, even in a minimalistic test client. In the library world, the more intuitive Common Command Language - CCL (ISO 8777) has enjoyed some popularity - especially before the widespread availability of graphical interfaces. It is still useful in applications where you for some reason or other need to provide a symbolic language for expressing boolean query structures. CCL Syntax The CCL parser obeys the following grammar for the FIND argument. The syntax is annotated using lines prefixed by --. CCL-Find ::= CCL-Find Op Elements | Elements. Op ::= "and" | "or" | "not" -- The above means that Elements are separated by boolean operators. Elements ::= '(' CCL-Find ')' | Set | Terms | Qualifiers Relation Terms | Qualifiers Relation '(' CCL-Find ')' | Qualifiers '=' string '-' string -- Elements is either a recursive definition, a result set reference, a -- list of terms, qualifiers followed by terms, qualifiers followed -- by a recursive definition or qualifiers in a range (lower - upper). Set ::= 'set' = string -- Reference to a result set Terms ::= Terms Prox Term | Term -- Proximity of terms. Term ::= Term string | string -- This basically means that a term may include a blank Qualifiers ::= Qualifiers ',' string | string -- Qualifiers is a list of strings separated by comma Relation ::= '=' | '>=' | '<=' | '<>' | '>' | '<' -- Relational operators. This really doesn't follow the ISO8777 -- standard. Prox ::= '%' | '!' -- Proximity operator CCL queries The following queries are all valid: dylan "bob dylan" dylan or zimmerman set=1 (dylan and bob) or set=1 righttrunc? "notrunc?" singlechar#mask Assuming that the qualifiers ti and au and date are defined, we may use: ti=self portrait au=(bob dylan and slow train coming) date>1980 and (ti=((self portrait))) CCL Qualifiers Qualifiers are used to direct the search to a particular searchable index, such as title (ti) and author indexes (au). The CCL standard itself doesn't specify a particular set of qualifiers, but it does suggest a few short-hand notations. You can customize the CCL parser to support a particular set of qualifiers to reflect the current target profile. Traditionally, a qualifier would map to a particular use-attribute within the BIB-1 attribute set. It is also possible to set other attributes, such as the structure attribute. A CCL profile is a set of predefined CCL qualifiers that may be read from a file or set in the CCL API. The YAZ client reads its CCL qualifiers from a file named default.bib. There are four types of lines in a CCL profile: qualifier specification, qualifier alias, comments and directives. Qualifier specification A qualifier specification is of the form: qualifier-name [attributeset,]type=val [attributeset,]type=val ... where qualifier-name is the name of the qualifier to be used (e.g. ti), type is attribute type in the attribute set (Bib-1 is used if no attribute set is given) and val is attribute value. The type can be specified as an integer, or as a single-letter: u for use, r for relation, p for position, s for structure,t for truncation, or c for completeness. The attributes for the special qualifier name term are used when no CCL qualifier is given in a query. Common Bib-1 attributes Type Description u=value Use attribute (1). Common use attributes are 1 Personal-name, 4 Title, 7 ISBN, 8 ISSN, 30 Date, 62 Subject, 1003 Author, 1016 Any. Specify value as an integer. r=value Relation attribute (2). Common values are 1 <, 2 <=, 3 =, 4 >=, 5 >, 6 <>, 100 phonetic, 101 stem, 102 relevance, 103 always matches. p=value Position attribute (3). Values: 1 first in field, 2 first in any subfield, 3 any position in field. s=value Structure attribute (4). Values: 1 phrase, 2 word, 3 key, 4 year, 5 date, 6 word list, 100 date (un), 101 name (norm), 102 name (un), 103 structure, 104 urx, 105 free-form-text, 106 document-text, 107 local-number, 108 string, 109 numeric string. t=value Truncation attribute (5). Values: 1 right, 2 left, 3 left and right, 100 none, 101 process #, 102 regular-1, 103 regular-2, 104 CCL. c=value Completeness attribute (6). Values: 1 incomplete subfield, 2 complete subfield, 3 complete field.
Refer to or the complete list of Bib-1 attributes It is also possible to specify non-numeric attribute values, which are used in combination with certain types. The special combinations are: Special attribute combos Name Description s=pw The structure is set to either word or phrase depending on the number of tokens in a term (phrase-word). s=al Each token in the term is ANDed (and-list). This does not set the structure at all. s=ol Each token in the term is ORed (or-list). This does not set the structure at all. s=ag Tokens that appears as phrases (with blank in them) gets structure phrase attached (4=1). Tokens that appear to be words gets structure word attached (4=2). Phrases and words are ANDed. This is a variant of s=al and s=pw, with the main difference that words are not split (with operator AND) but instead kept in one RPN token. This facility appeared in YAZ 4.2.38. s=sl Tokens are split into sub-phrases of all combinations - in order. This facility appeared in YAZ 5.14.0. r=o Allows ranges and the operators greater-than, less-than, ... equals. This sets Bib-1 relation attribute accordingly (relation ordered). A query construct is only treated as a range if dash is used and that is surrounded by white-space. So -1980 is treated as term "-1980" not <= 1980. If - 1980 is used, however, that is treated as a range. r=r Similar to r=o but assumes that terms are non-negative (not prefixed with -). Thus, a dash will always be treated as a range. The construct 1980-1990 is treated as a range with r=r but as a single term "1980-1990" with r=o. The special attribute r=r is available in YAZ 2.0.24 or later. r=omiteq This will omit relation=equals (@attr 2=3) when r=o / r=r is used. This is useful for servers that somehow break when an explicit relation=equals is used. Omitting the relation is usually safe because "equals" is the default behavior. This tweak was added in YAZ version 5.1.2. t=l Allows term to be left-truncated. If term is of the form ?x, the resulting Type-1 term is x and truncation is left. t=r Allows term to be right-truncated. If term is of the form x?, the resulting Type-1 term is x and truncation is right. t=n If term is does not include ?, the truncation attribute is set to none (100). t=b Allows term to be both left-and-right truncated. If term is of the form ?x?, the resulting term is x and truncation is set to both left and right. t=x Allows masking anywhere in a term, thus fully supporting # (mask one character) and ? (zero or more of any). If masking is used, truncation is set to 102 (regexp-1 in term) and the term is converted accordingly to a regular expression. t=z Allows masking anywhere in a term, thus fully supporting # (mask one character) and ? (zero or more of any). If masking is used, truncation is set to 104 (Z39.58 in term) and the term is converted accordingly to Z39.58 masking term - actually the same truncation as CCL itself.
CCL profile Consider the following definition: ti u=4 s=1 au u=1 s=1 term s=105 ranked r=102 date u=30 r=o ti and au both set structure attribute to phrase (s=1). ti sets the use-attribute to 4. au sets the use-attribute to 1. When no qualifiers are used in the query, the structure-attribute is set to free-form-text (105) (rule for term). The date sets the relation attribute to the relation used in the CCL query and sets the use attribute to 30 (Bib-1 Date). You can combine attributes. To Search for "ranked title" you can do ti,ranked=knuth computer which will set relation=ranked, use=title, structure=phrase. Query date > 1980 is a valid query. But ti > 1980 is invalid.
Qualifier alias A qualifier alias is of the form: q q1 q2 .. which declares q to be an alias for q1, q2... such that the CCL query q=x is equivalent to q1=x or q2=x or .... Comments Lines with white space or lines that begin with character # are treated as comments. Directives Directive specifications takes the form @directive value CCL directives Name Description Default truncation Truncation character ? mask Masking character. Requires YAZ 4.2.58 or later # field Specifies how multiple fields are to be combined. There are two modes: or: multiple qualifier fields are ORed, merge: attributes for the qualifier fields are merged and assigned to one term. merge case Specifies if CCL operators and qualifiers should be compared with case sensitivity or not. Specify 1 for case sensitive; 0 for case insensitive. 1 and Specifies token for CCL operator AND. and or Specifies token for CCL operator OR. or not Specifies token for CCL operator NOT. not set Specifies token for CCL operator SET. set
CCL API All public definitions can be found in the header file ccl.h. A profile identifier is of type CCL_bibset. A profile must be created with the call to the function ccl_qual_mk which returns a profile handle of type CCL_bibset. To read a file containing qualifier definitions the function ccl_qual_file may be convenient. This function takes an already opened FILE handle pointer as argument along with a CCL_bibset handle. To parse a simple string with a FIND query use the function struct ccl_rpn_node *ccl_find_str(CCL_bibset bibset, const char *str, int *error, int *pos); which takes the CCL profile (bibset) and query (str) as input. Upon successful completion the RPN tree is returned. If an error occurs, such as a syntax error, the integer pointed to by error holds the error code and pos holds the offset inside query string in which the parsing failed. An English representation of the error may be obtained by calling the ccl_err_msg function. The error codes are listed in ccl.h. To convert the CCL RPN tree (type struct ccl_rpn_node *) to the Z_RPNQuery of YAZ the function ccl_rpn_query must be used. This function which is part of YAZ is implemented in yaz-ccl.c. After calling this function the CCL RPN tree is probably no longer needed. The ccl_rpn_delete destroys the CCL RPN tree. A CCL profile may be destroyed by calling the ccl_qual_rm function. The token names for the CCL operators may be changed by setting the globals (all type char *) ccl_token_and, ccl_token_or, ccl_token_not and ccl_token_set. An operator may have aliases, i.e. there may be more than one name for the operator. To do this, separate each alias with a space character.
CQL CQL - Common Query Language - was defined for the SRU protocol. In many ways CQL has a similar syntax to CCL. The objective of CQL is different. Where CCL aims to be an end-user language, CQL is the protocol query language for SRU. If you are new to CQL, read the Gentle Introduction. The CQL parser in &yaz; provides the following: It parses and validates a CQL query. It generates a C structure that allows you to convert a CQL query to some other query language, such as SQL. The parser converts a valid CQL query to PQF, thus providing a way to use CQL for both SRU servers and Z39.50 targets at the same time. The parser converts CQL to XCQL. XCQL is an XML representation of CQL. XCQL is part of the SRU specification. However, since SRU supports CQL only, we don't expect XCQL to be widely used. Furthermore, CQL has the advantage over XCQL that it is easy to read. CQL parsing A CQL parser is represented by the CQL_parser handle. Its contents should be considered &yaz; internal (private). #include <yaz/cql.h> typedef struct cql_parser *CQL_parser; CQL_parser cql_parser_create(void); void cql_parser_destroy(CQL_parser cp); A parser is created by cql_parser_create and is destroyed by cql_parser_destroy. To parse a CQL query string, the following function is provided: int cql_parser_string(CQL_parser cp, const char *str); A CQL query is parsed by the cql_parser_string which takes a query str. If the query was valid (no syntax errors), then zero is returned; otherwise -1 is returned to indicate a syntax error. int cql_parser_stream(CQL_parser cp, int (*getbyte)(void *client_data), void (*ungetbyte)(int b, void *client_data), void *client_data); int cql_parser_stdio(CQL_parser cp, FILE *f); The functions cql_parser_stream and cql_parser_stdio parse a CQL query - just like cql_parser_string. The only difference is that the CQL query can be fed to the parser in different ways. The cql_parser_stream uses a generic byte stream as input. The cql_parser_stdio uses a FILE handle which is opened for reading. CQL tree If the query string is valid, the CQL parser generates a tree representing the structure of the CQL query. struct cql_node *cql_parser_result(CQL_parser cp); cql_parser_result returns a pointer to the root node of the resulting tree. Each node in a CQL tree is represented by a struct cql_node. It is defined as follows: #define CQL_NODE_ST 1 #define CQL_NODE_BOOL 2 #define CQL_NODE_SORT 3 struct cql_node { int which; union { struct { char *index; char *index_uri; char *term; char *relation; char *relation_uri; struct cql_node *modifiers; } st; struct { char *value; struct cql_node *left; struct cql_node *right; struct cql_node *modifiers; } boolean; struct { char *index; struct cql_node *next; struct cql_node *modifiers; struct cql_node *search; } sort; } u; }; There are three node types: search term (ST), boolean (BOOL) and sortby (SORT). A modifier is treated as a search term too. The search term node has five members: index: index for search term. If an index is unspecified for a search term, index will be NULL. index_uri: index URI for search term or NULL if none could be resolved for the index. term: the search term itself. relation: relation for search term. relation_uri: relation URI for search term. modifiers: relation modifiers for search term. The modifiers list itself of cql_nodes each of type ST. The boolean node represents and, or, not + proximity. left and right: left - and right operand respectively. modifiers: proximity arguments. The sort node represents both the SORTBY clause. CQL to PQF conversion Conversion to PQF (and Z39.50 RPN) is tricky by the fact that the resulting RPN depends on the Z39.50 target capabilities (combinations of supported attributes). In addition, the CQL and SRU operates on index prefixes (URI or strings), whereas the RPN uses Object Identifiers for attribute sets. The CQL library of &yaz; defines a cql_transform_t type. It represents a particular mapping between CQL and RPN. This handle is created and destroyed by the functions: cql_transform_t cql_transform_open_FILE (FILE *f); cql_transform_t cql_transform_open_fname(const char *fname); void cql_transform_close(cql_transform_t ct); The first two functions create a transformation handle from either an already open FILE or from a filename respectively. The handle is destroyed by cql_transform_close in which case no further reference of the handle is allowed. When a cql_transform_t handle has been created you can convert to RPN. int cql_transform_buf(cql_transform_t ct, struct cql_node *cn, char *out, int max); This function converts the CQL tree cn using handle ct. For the resulting PQF, you supply a buffer out which must be able to hold at at least max characters. If conversion failed, cql_transform_buf returns a non-zero SRU error code; otherwise zero is returned (conversion successful). The meanings of the numeric error codes are listed in the SRU specification somewhere (no direct link anymore). If conversion fails, more information can be obtained by calling int cql_transform_error(cql_transform_t ct, char **addinfop); This function returns the most recently returned numeric error-code and sets the string-pointer at *addinfop to point to a string containing additional information about the error that occurred: for example, if the error code is 15 ("Illegal or unsupported context set"), the additional information is the name of the requested context set that was not recognised. The SRU error-codes may be translated into brief human-readable error messages using const char *cql_strerror(int code); If you wish to be able to produce a PQF result in a different way, there are two alternatives. void cql_transform_pr(cql_transform_t ct, struct cql_node *cn, void (*pr)(const char *buf, void *client_data), void *client_data); int cql_transform_FILE(cql_transform_t ct, struct cql_node *cn, FILE *f); The former function produces output to a user-defined output stream. The latter writes the result to an already open FILE. Specification of CQL to RPN mappings The file supplied to functions cql_transform_open_FILE, cql_transform_open_fname follows a structure found in many Unix utilities. It consists of mapping specifications - one per line. Lines starting with # are ignored (comments). Each line is of the form CQL pattern = RPN equivalent An RPN pattern is a simple attribute list. Each attribute pair takes the form: [set] type=value The attribute set is optional. The type is the attribute type, value the attribute value. The character * (asterisk) has special meaning when used in the RPN pattern. Each occurrence of * is substituted with the CQL matching name (index, relation, qualifier etc). This facility can be used to copy a CQL name verbatim to the RPN result. The following CQL patterns are recognized: index.set.name This pattern is invoked when a CQL index, such as dc.title is converted. set and name are the context set and index name respectively. Typically, the RPN specifies an equivalent use attribute. For terms not bound by an index, the pattern index.cql.serverChoice is used. Here, the prefix cql is defined as http://www.loc.gov/zing/cql/cql-indexes/v1.0/. If this pattern is not defined, the mapping will fail. The pattern, index.set.* is used when no other index pattern is matched. qualifier.set.name (DEPRECATED) For backwards compatibility, this is recognised as a synonym of index.set.name relation.relation This pattern specifies how a CQL relation is mapped to RPN. The pattern is name of relation operator. Since = is used as separator between CQL pattern and RPN, CQL relations including = cannot be used directly. To avoid a conflict, the names ge, eq, le, must be used for CQL operators, greater-than-or-equal, equal, less-than-or-equal respectively. The RPN pattern is supposed to include a relation attribute. For terms not bound by a relation, the pattern relation.scr is used. If the pattern is not defined, the mapping will fail. The special pattern, relation.* is used when no other relation pattern is matched. relationModifier.mod This pattern specifies how a CQL relation modifier is mapped to RPN. The RPN pattern is usually a relation attribute. structure.type This pattern specifies how a CQL structure is mapped to RPN. Note that this CQL pattern is somewhat similar to CQL pattern relation. The type is a CQL relation. The pattern, structure.* is used when no other structure pattern is matched. Usually, the RPN equivalent specifies a structure attribute. position.type This pattern specifies how the anchor (position) of CQL is mapped to RPN. The type is one of first, any, last, firstAndLast. The pattern, position.* is used when no other position pattern is matched. set.prefix This specification defines a CQL context set for a given prefix. The value on the right hand side is the URI for the set - not RPN. All prefixes used in index patterns must be defined this way. set This specification defines a default CQL context set for index names. The value on the right hand side is the URI for the set. CQL to RPN mapping file This simple file defines two context sets, three indexes and three relations, a position pattern and a default structure. With the mappings above, the CQL query computer is converted to the PQF: @attr 1=1016 @attr 2=3 @attr 4=1 @attr 3=3 @attr 6=1 "computer" by rules index.cql.serverChoice, relation.scr, structure.*, position.any. CQL query computer^ is rejected, since position.right is undefined. CQL query >my = "http://www.loc.gov/zing/cql/dc-indexes/v1.0/" my.title = x is converted to @attr 1=4 @attr 2=3 @attr 4=1 @attr 3=3 @attr 6=1 "x" CQL to RPN string attributes In this example we allow any index to be passed to RPN as a use attribute. The http://bogus/rpn context set is also the default so we can make queries such as title = a which is converted to @attr 2=3 @attr 4=1 @attr 3=3 @attr 1=title "a" CQL to RPN using Bath Profile The file etc/pqf.properties has mappings from the Bath Profile and Dublin Core to RPN. If YAZ is installed as a package it's usually located in /usr/share/yaz/etc and part of the development package, such as libyaz-dev. CQL to XCQL conversion Conversion from CQL to XCQL is trivial and does not require a mapping to be defined. There are three functions to choose from depending on the way you wish to store the resulting output (XML buffer containing XCQL). int cql_to_xml_buf(struct cql_node *cn, char *out, int max); void cql_to_xml(struct cql_node *cn, void (*pr)(const char *buf, void *client_data), void *client_data); void cql_to_xml_stdio(struct cql_node *cn, FILE *f); Function cql_to_xml_buf converts to XCQL and stores the result in a user-supplied buffer of a given max size. cql_to_xml writes the result in a user-defined output stream. cql_to_xml_stdio writes to a a file. PQF to CQL conversion Conversion from PQF to CQL is offered by the two functions shown below. The former uses a generic stream for result. The latter puts result in a WRBUF (string container). #include <yaz/rpn2cql.h> int cql_transform_rpn2cql_stream(cql_transform_t ct, void (*pr)(const char *buf, void *client_data), void *client_data, Z_RPNQuery *q); int cql_transform_rpn2cql_wrbuf(cql_transform_t ct, WRBUF w, Z_RPNQuery *q); The configuration is the same as used in CQL to PQF conversions.
Object Identifiers The basic YAZ representation of an OID is an array of integers, terminated with the value -1. This integer is of type Odr_oid. Fundamental OID operations and the type Odr_oid are defined in yaz/oid_util.h. An OID can either be declared as a automatic variable or it can be allocated using the memory utilities or ODR/NMEM. It's guaranteed that an OID can fit in OID_SIZE integers. Create OID on stack We can create an OID for the Bib-1 attribute set with: Odr_oid bib1[OID_SIZE]; bib1[0] = 1; bib1[1] = 2; bib1[2] = 840; bib1[3] = 10003; bib1[4] = 3; bib1[5] = 1; bib1[6] = -1; And OID may also be filled from a string-based representation using dots (.). This is achieved by the function int oid_dotstring_to_oid(const char *name, Odr_oid *oid); This functions returns 0 if name could be converted; -1 otherwise. Using oid_oiddotstring_to_oid We can fill the Bib-1 attribute set OID more easily with: Odr_oid bib1[OID_SIZE]; oid_oiddotstring_to_oid("1.2.840.10003.3.1", bib1); We can also allocate an OID dynamically on an ODR stream with: Odr_oid *odr_getoidbystr(ODR o, const char *str); This creates an OID from a string-based representation using dots. This function take an &odr; stream as parameter. This stream is used to allocate memory for the data elements, which is released on a subsequent call to odr_reset() on that stream. Using odr_getoidbystr We can create an OID for the Bib-1 attribute set with: Odr_oid *bib1 = odr_getoidbystr(odr, "1.2.840.10003.3.1"); The function char *oid_oid_to_dotstring(const Odr_oid *oid, char *oidbuf) does the reverse of oid_oiddotstring_to_oid. It converts an OID to the string-based representation using dots. The supplied char buffer oidbuf holds the resulting string and must be at least OID_STR_MAX in size. OIDs can be copied with oid_oidcpy which takes two OID lists as arguments. Alternatively, an OID copy can be allocated on an ODR stream with: Odr_oid *odr_oiddup(ODR odr, const Odr_oid *o); OIDs can be compared with oid_oidcmp which returns zero if the two OIDs provided are identical; non-zero otherwise. OID database From YAZ version 3 and later, the oident system has been replaced by an OID database. OID database is a misnomer .. the old odient system was also a database. The OID database is really just a map between named Object Identifiers (string) and their OID raw equivalents. Most operations either convert from string to OID or other way around. Unfortunately, whenever we supply a string we must also specify the OID class. The class is necessary because some strings correspond to multiple OIDs. An example of such a string is Bib-1 which may either be an attribute-set or a diagnostic-set. Applications using the YAZ database should include yaz/oid_db.h. A YAZ database handle is of type yaz_oid_db_t. Actually that's a pointer. You need not deal with that. YAZ has a built-in database which can be considered "constant" for most purposes. We can get hold of that by using function yaz_oid_std. All functions with prefix yaz_string_to_oid converts from class + string to OID. We have variants of this operation due to different memory allocation strategies. All functions with prefix yaz_oid_to_string converts from OID to string + class. Create OID with YAZ DB We can create an OID for the Bib-1 attribute set on the ODR stream odr with: Odr_oid *bib1 = yaz_string_to_oid_odr(yaz_oid_std(), CLASS_ATTSET, "Bib-1", odr); This is more complex than using odr_getoidbystr. You would only use yaz_string_to_oid_odr when the string (here Bib-1) is supplied by a user or configuration. Standard OIDs All the object identifiers in the standard OID database as returned by yaz_oid_std can be referenced directly in a program as a constant OID. Each constant OID is prefixed with yaz_oid_ - followed by OID class (lowercase) - then by OID name (normalized and lowercase). See for list of all object identifiers built into YAZ. These are declared in yaz/oid_std.h but are included by yaz/oid_db.h as well. Use a built-in OID We can allocate our own OID filled with the constant OID for Bib-1 with: Odr_oid *bib1 = odr_oiddup(o, yaz_oid_attset_bib1); Nibble Memory Sometimes when you need to allocate and construct a large, interconnected complex of structures, it can be a bit of a pain to release the associated memory again. For the structures describing the Z39.50 PDUs and related structures, it is convenient to use the memory-management system of the &odr; subsystem (see ). However, in some circumstances where you might otherwise benefit from using a simple nibble-memory management system, it may be impractical to use odr_malloc() and odr_reset(). For this purpose, the memory manager which also supports the &odr; streams is made available in the NMEM module. The external interface to this module is given in the nmem.h file. The following prototypes are given: NMEM nmem_create(void); void nmem_destroy(NMEM n); void *nmem_malloc(NMEM n, size_t size); void nmem_reset(NMEM n); size_t nmem_total(NMEM n); void nmem_init(void); void nmem_exit(void); The nmem_create() function returns a pointer to a memory control handle, which can be released again by nmem_destroy() when no longer needed. The function nmem_malloc() allocates a block of memory of the requested size. A call to nmem_reset() or nmem_destroy() will release all memory allocated on the handle since it was created (or since the last call to nmem_reset(). The function nmem_total() returns the number of bytes currently allocated on the handle. The nibble-memory pool is shared amongst threads. POSIX mutexes and WIN32 Critical sections are introduced to keep the module thread safe. Function nmem_init() initializes the nibble-memory library and it is called automatically the first time the YAZ.DLL is loaded. &yaz; uses function DllMain to achieve this. You should not call nmem_init or nmem_exit unless you're absolute sure what you're doing. Note that in previous &yaz; versions you'd have to call nmem_init yourself. Log &yaz; has evolved a fairly complex log system which should be useful both for debugging &yaz; itself, debugging applications that use &yaz;, and for production use of those applications. The log functions are declared in header yaz/log.h and implemented in src/log.c. Due to name clash with syslog and some math utilities the logging interface has been modified as of YAZ 2.0.29. The obsolete interface is still available in header file yaz/log.h. The key points of the interface are: void yaz_log(int level, const char *fmt, ...) void yaz_log_init(int level, const char *prefix, const char *name); void yaz_log_init_file(const char *fname); void yaz_log_init_level(int level); void yaz_log_init_prefix(const char *prefix); void yaz_log_time_format(const char *fmt); void yaz_log_init_max_size(int mx); int yaz_log_mask_str(const char *str); int yaz_log_module_level(const char *name); The reason for the whole log module is the yaz_log function. It takes a bitmask indicating the log levels, a printf-like format string, and a variable number of arguments to log. The log level is a bit mask, that says on which level(s) the log entry should be made, and optionally set some behaviour of the logging. In the most simple cases, it can be one of YLOG_FATAL, YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits that modify the way the log entry is written:YLOG_ERRNO, YLOG_NOTIME, YLOG_FLUSH. Most of the rest of the bits are deprecated, and should not be used. Use the dynamic log levels instead. Applications that use &yaz;, should not use the LOG_LOG for ordinary messages, but should make use of the dynamic loglevel system. This consists of two parts, defining the loglevel and checking it. To define the log levels, the (main) program should pass a string to yaz_log_mask_str to define which log levels are to be logged. This string should be a comma-separated list of log level names, and can contain both hard-coded names and dynamic ones. The log level calculation starts with YLOG_DEFAULT_LEVEL and adds a bit for each word it meets, unless the word starts with a '-', in which case it clears the bit. If the string 'none' is found, all bits are cleared. Typically this string comes from the command-line, often identified by -v. The yaz_log_mask_str returns a log level that should be passed to yaz_log_init_level for it to take effect. Each module should check what log bits should be used, by calling yaz_log_module_level with a suitable name for the module. The name is cleared of a preceding path and an extension, if any, so it is quite possible to use __FILE__ for it. If the name has been passed to yaz_log_mask_str, the routine returns a non-zero bitmask, which should then be used in consequent calls to yaz_log. (It can also be tested, so as to avoid unnecessary calls to yaz_log, in time-critical places, or when the log entry would take time to construct.) Yaz uses the following dynamic log levels: server, session, request, requestdetail for the server functionality. zoom for the zoom client API. ztest for the simple test server. malloc, nmem, odr, eventl for internal debugging of yaz itself. Of course, any program using yaz is welcome to define as many new ones as it needs. By default the log is written to stderr, but this can be changed by a call to yaz_log_init_file or yaz_log_init. If the log is directed to a file, the file size is checked at every write, and if it exceeds the limit given in yaz_log_init_max_size, the log is rotated. The rotation keeps one old version (with a .1 appended to the name). The size defaults to 1GB. Setting it to zero will disable the rotation feature. A typical yaz-log looks like this 13:23:14-23/11 yaz-ztest(1) [session] Starting session from tcp:127.0.0.1 (pid=30968) 13:23:14-23/11 yaz-ztest(1) [request] Init from 'YAZ' (81) (ver 2.0.28) OK 13:23:17-23/11 yaz-ztest(1) [request] Search Z: @attrset Bib-1 foo OK:7 hits 13:23:22-23/11 yaz-ztest(1) [request] Present: [1] 2+2 OK 2 records returned 13:24:13-23/11 yaz-ztest(1) [request] Close OK The log entries start with a time stamp. This can be omitted by setting the YLOG_NOTIME bit in the loglevel. This way automatic tests can be hoped to produce identical log files, that are easy to diff. The format of the time stamp can be set with yaz_log_time_format, which takes a format string just like strftime. Next in a log line comes the prefix, often the name of the program. For yaz-based servers, it can also contain the session number. Then comes one or more logbits in square brackets, depending on the logging level set by yaz_log_init_level and the loglevel passed to yaz_log_init_level. Finally comes the format string and additional values passed to yaz_log The log level YLOG_LOGLVL, enabled by the string loglevel, will log all the log-level affecting operations. This can come in handy if you need to know what other log levels would be useful. Grep the logfile for [loglevel]. The log system is almost independent of the rest of &yaz;, the only important dependence is of nmem, and that only for using the semaphore definition there. The dynamic log levels and log rotation were introduced in &yaz; 2.0.28. At the same time, the log bit names were changed from LOG_something to YLOG_something, to avoid collision with syslog.h. MARC YAZ provides a fast utility for working with MARC records. Early versions of the MARC utility only allowed decoding of ISO2709. Today the utility may both encode - and decode to a variety of formats. /* create handler */ yaz_marc_t yaz_marc_create(void); /* destroy */ void yaz_marc_destroy(yaz_marc_t mt); /* set XML mode YAZ_MARC_LINE, YAZ_MARC_SIMPLEXML, ... */ void yaz_marc_xml(yaz_marc_t mt, int xmlmode); #define YAZ_MARC_LINE 0 #define YAZ_MARC_SIMPLEXML 1 #define YAZ_MARC_OAIMARC 2 #define YAZ_MARC_MARCXML 3 #define YAZ_MARC_ISO2709 4 #define YAZ_MARC_XCHANGE 5 #define YAZ_MARC_CHECK 6 #define YAZ_MARC_TURBOMARC 7 #define YAZ_MARC_JSON 8 /* supply iconv handle for character set conversion .. */ void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd); /* set debug level, 0=none, 1=more, 2=even more, .. */ void yaz_marc_debug(yaz_marc_t mt, int level); /* decode MARC in buf of size bsize. Returns >0 on success; <=0 on failure. On success, result in *result with size *rsize. */ int yaz_marc_decode_buf(yaz_marc_t mt, const char *buf, int bsize, const char **result, size_t *rsize); /* decode MARC in buf of size bsize. Returns >0 on success; <=0 on failure. On success, result in WRBUF */ int yaz_marc_decode_wrbuf(yaz_marc_t mt, const char *buf, int bsize, WRBUF wrbuf); ]]> The synopsis is just a basic subset of all functionality. Refer to the actual header file marcdisp.h for details. A MARC conversion handle must be created by using yaz_marc_create and destroyed by calling yaz_marc_destroy. All other functions operate on a yaz_marc_t handle. The output is specified by a call to yaz_marc_xml. The xmlmode must be one of YAZ_MARC_LINE A simple line-by-line format suitable for display but not recommended for further (machine) processing. YAZ_MARC_MARCXML MARCXML. YAZ_MARC_ISO2709 ISO2709 (sometimes just referred to as "MARC"). YAZ_MARC_XCHANGE MarcXchange. YAZ_MARC_CHECK Pseudo format for validation only. Does not generate any real output except diagnostics. YAZ_MARC_TURBOMARC XML format with same semantics as MARCXML but more compact and geared towards fast processing with XSLT. Refer to for more information. YAZ_MARC_JSON MARC-in-JSON format. The actual conversion functions are yaz_marc_decode_buf and yaz_marc_decode_wrbuf which decodes and encodes a MARC record. The former function operates on simple buffers, and stores the resulting record in a WRBUF handle (WRBUF is a simple string type). Display of MARC record The following program snippet illustrates how the MARC API may be used to convert a MARC record to the line-by-line format: TurboMARC TurboMARC is yet another XML encoding of a MARC record. The format was designed for fast processing with XSLT. Applications like Pazpar2 uses XSLT to convert an XML encoded MARC record to an internal representation. This conversion mostly checks the tag of a MARC field to determine the basic rules in the conversion. This check is costly when that tag is encoded as an attribute in MARCXML. By having the tag value as the element instead, makes processing many times faster (at least for Libxslt). TurboMARC is encoded as follows: Record elements is part of namespace "http://www.indexdata.com/turbomarc". A record is enclosed in element r. A collection of records is enclosed in element collection. The leader is encoded as element l with the leader content as its (text) value. A control field is encoded as element c concatenated with the tag value of the control field if the tag value matches the regular expression [a-zA-Z0-9]*. If the tag value does not match the regular expression [a-zA-Z0-9]* the control field is encoded as element c and attribute code will hold the tag value. This rule ensures that in the rare cases where a tag value might result in a non-well-formed XML, then YAZ will encode it as a coded attribute (as in MARCXML). The control field content is the text value of this element. Indicators are encoded as attribute names i1, i2, etc. and corresponding values for each indicator. A data field is encoded as element d concatenated with the tag value of the data field or using the attribute code as described in the rules for control fields. The children of the data field element are subfield elements. Each subfield element is encoded as s concatenated with the sub field code. The text of the subfield element is the contents of the subfield. Indicators are encoded as attributes for the data field element, similar to the encoding for control fields. Retrieval Facility YAZ version 2.1.20 or later includes a Retrieval facility tool which allows a SRU/Z39.50 to describe itself and perform record conversions. The idea is the following: An SRU/Z39.50 client sends a retrieval request which includes a combination of the following parameters: syntax (format), schema (or element set name). The retrieval facility is invoked with parameters in a server/proxy. The retrieval facility matches the parameters a set of "supported" retrieval types. If there is no match, the retrieval signals an error (syntax and / or schema not supported). For a successful match, the backend is invoked with the same or altered retrieval parameters (syntax, schema). If a record is received from the backend, it is converted to the frontend name / syntax. The resulting record is sent back the client and tagged with the frontend syntax / schema. The Retrieval facility is driven by an XML configuration. The configuration is neither Z39.50 ZeeRex or SRU ZeeRex. But it should be easy to generate both of them from the XML configuration. (Unfortunately the two versions of ZeeRex differ substantially in this regard.) Retrieval XML format All elements should be covered by namespace http://indexdata.com/yaz . The root element node must be retrievalinfo. The retrievalinfo must include one or more retrieval elements. Each retrieval defines specific combination of syntax, name and identifier supported by this retrieval service. The retrieval element may include any of the following attributes: syntax (REQUIRED) Defines the record syntax. Possible values is any of the names defined in YAZ' OID database or a raw OID in (n.n ... n). name (OPTIONAL) Defines the name of the retrieval format. This can be any string. For SRU, the value is equivalent to schema (short-hand); for Z39.50 it's equivalent to simple element set name. For YAZ 3.0.24 and later this name may be specified as a glob expression with operators * and ?. identifier (OPTIONAL) Defines the URI schema name of the retrieval format. This can be any string. For SRU, the value is equivalent to URI schema. For Z39.50, there is no equivalent. The retrieval may include one backend element. If a backend element is given, it specifies how the records are retrieved by some backend and how the records are converted from the backend to the "frontend". The attributes, name and syntax may be specified for the backend element. The semantics of these attributes is equivalent to those for the retrieval. However, these values are passed to the "backend". The backend element may include one or more conversion instructions (as children elements). The supported conversions are: marc The marc element specifies a conversion to - and from ISO2709 encoded MARC and &acro.marcxml;/MarcXchange. The following attributes may be specified: inputformat (REQUIRED) Format of input. Supported values are marc (for ISO2709), xml (MARCXML/MarcXchange) and json (MARC-in-JSON). outputformat (REQUIRED) Format of output. Supported values are line (MARC line format); marcxml (for MARCXML), marc (ISO2709), turbomarc, marcxchange (for MarcXchange), or json (MARC-in-JSON ). inputcharset (OPTIONAL) Encoding of input. For XML input formats, this need not be given, but for ISO2709 based input formats, this should be set to the encoding used. For MARC21 records, a common inputcharset value would be marc-8. If inputformat is marc and inputcharset is marc-8, then effective inputcharset is UTF-8 if leader position has value 'a' (MARC21 rule). outputcharset (OPTIONAL) Encoding of output. If outputformat is XML based, it is strongly recommended to use utf-8. leaderspec (OPTIONAL) Specifies a modification to the leader for the resulting output record. The leaderspec is a comma separated list of pos=value pairs, where pos is an integer offset (0 - 23) for leader. Value is either a quoted string or an integer (character value in decimal). For example, to set leader at offset 9 to a, use 9='a'. This has same effect as -l for . select The select selects one or more text nodes and decodes them as XML. The following attributes may be specified: path (REQUIRED) X-Path expression for selecting text nodes. This conversion is available in YAZ 5.8.0 and later. solrmarc The solrmarc decodes solrmarc records. It assumes that the input is pure solrmarc text (no escaping) and will convert all sequences of the form #XX; to a single character of the hexadecimal value as given by XX. The output, presumably, is a valid ISO2709 buffer. This conversion is available in YAZ 5.0.21 and later. xslt The xslt element specifies a conversion via &acro.xslt;. The following attributes may be specified: stylesheet (REQUIRED) Stylesheet file. In addition, the element can be configured as follows: param (OPTIONAL) A param tag configures a parameter to be passed to the &acro.xslt; stylesheet. Multiple param tags may be defined. rdf-lookup The rdf-lookup element looks up BIBFRAME elements in some suitable service, for example http://id.loc.gov/authorities/names and replaces the URIs for specified elements with URIs it finds at that service. Its configuration consists of debug (OPTIONAL) Attribute to the rdf-lookup tag to enable debug output. A value of "1" makes the filter to add a XML comment next to each key it tried to look up, showing the URL, the result, and timing. This is useful for debugging the configuration. The default is not to add any comments. timeout (OPTIONAL) Attribute of the rdf-lookup tag which defines timeout in seconds for the HTTP based rdf-lookup. namespace (OPTIONAL) A namespace tag declares a namespace to be used in the xpath below. The tag requires two attributes: prefix and href. lookup (REQUIRED) A section that defines one tag to be looked up, for example an author.The xpath attribute (REQUIRED) specifies the path to the element(s). key (REQUIRED) A tag withing the lookup tag specifies the value to be used in the lookup, for example a name or an ID. It is a relative Xpath starting from the tag specified in the lookup. server (OPTIONAL) Specifies the URL for server to use for the lookup. A %s is replaced by the key value to be looked up. If not specified, defaults to the same as the previous lookup section, or lacking one, to . The method attribute can be used to specify the HTTP method to be used in this lookup. The default is GET, and the useful alternative is HEAD. See the example below. This conversion is available in YAZ 5.19.0 and later. Retrieval Facility Examples MARC21 backend A typical way to use the retrieval facility is to enable XML for servers that only supports ISO2709 encoded MARC21 records. ]]> This means that our frontend supports: MARC21 F(ull) records. MARC21 B(rief) records. MARCXML records. Dublin core records. MARCXML backend SRW/SRU and Solr backends return records in XML. If they return MARCXML or MarcXchange, the retrieval module can convert those into ISO2709 formats, most commonly USMARC (AKA MARC21). In this example, the backend returns MARCXML for schema="marcxml". ]]> This means that our frontend supports: MARC21 records (any element set name) in MARC-8 encoding. MARCXML records for element-set=marcxml Dublin core records for element-set=dc. RDF-lookup backend This is a minimal example of the backend configuration for the rdf-lookup. It could well be used with some heavy xslt transforms that make BIBFRAME records out of MarxXml. ]]> The debug=1 attribute tells the filter to add XML comments to the key nodes that indicate what lookup it tried to do, how it went, and how long it took. The namespace prefix bf: is defined in the namespace tags. These namespaces are used in the xpath expressions in the lookup sections. The lookup tag specifies one tag to be looked up. The xpath attribute defines which node to modify. It may make use of the namespace definitions above. The server tag gives the URL to be used for the lookup. A %s in the string will get replaced by the key value. If there is no server tag, the one from the preceding lookup section is used, and if there is no previous section, the id.loc.gov address is used as a default. The default is to make a GET request, this example uses HEAD API It should be easy to use the retrieval systems from applications. Refer to the headers yaz/retrieval.h and yaz/record_conv.h. Sorting This chapter describes sorting and how it is supported in YAZ. Sorting applies to a result-set. The Z39.50 sorting facility takes one or more input result-sets and one result-set as output. The most simple case is that the input-set is the same as the output-set. Z39.50 sorting has a separate APDU (service) that is, thus, performed following a search (two phases). In SRU/Solr, however, the model is different. Here, sorting is specified during the search operation. Note, however, that SRU might perform sort as separate search, by referring to an existing result-set in the query (result-set reference). Using the Z39.50 sort service yaz-client and the ZOOM API support the Z39.50 sort facility. In any case the sort sequence or sort criteria is using a string notation. This notation is a one-line notation suitable for being manually entered or generated, and allows for easy logging (one liner). For the ZOOM API, the sort is specified in the call to ZOOM_query_sortby function. For yaz-client the sort is performed and specified using the sort and sort+ commands. For description of the sort criteria notation refer to the sort command in the yaz-client manual. The ZOOM API might choose one of several sort strategies for sorting. Refer to . Type-7 sort Type-7 sort is an extension to the Bib-1 based RPN query where the sort specification is embedded as an Attribute-Plus-Term. The objectives for introducing Type-7 sorting is that it allows a client to perform sorting even if it does not implement/support Z39.50 sort. Virtually all Z39.50 client software supports RPN queries. It also may improve performance because the sort criteria is specified along with the search query. The sort is triggered by the presence of type 7, and the value of type 7 specifies the sortRelation . The value for type 7 is 1 for ascending and 2 for descending. For the sortElement only the generic part is handled. If generic sortKey is of type sortField, then attribute type 1 is present and the value is sortField (InternationalString). If generic sortKey is of type sortAttributes, then the attributes in the list are used. Generic sortKey of type elementSpec is not supported. The term in the sorting Attribute-Plus-Term combo should hold an integer. The value is 0 for primary sorting criteria, 1 for second criteria, etc. Facets YAZ supports facets in the Solr, SRU 2.0 and Z39.50 protocols. Like Type-1/RPN, YAZ supports a string notation for specifying facets. This notataion maps straight to facets.asn. The notation is parsed by function yaz_pqf_parse_facet_list defined in header yaz/pquery.h. For ZOOM C the facets are specified by option "facets". For yaz-client, the 'facets' command is used. The grammar of this specification is as follows: facet-spec ::= facet-list facet-list ::= facet-list ',' attr-spec | attr-spec attr-spec ::= attr-spec '@attr' string | '@attr' string The notation is inspired by PQF. The string following '@attr' must not include blanks and is of the form type=value, where type is an integer and value is a string or an integer. There is no formal facets attribute set (it is not given in the protocol by the facets, although it could). The following types apply: Facet attributes Type Description 1 Field-name. This is often a string, e.g. "Author", "Year", etc. 2 Sort order. Value should be an integer. Value 0: count descending (frequency). Value 1: alpha ascending. 3 Number of terms requested. 4 Start offset (starting from 1)
The ODR Module Introduction &odr; is the BER-encoding/decoding subsystem of &yaz;. Care has been taken to isolate &odr; from the rest of the package - specifically from the transport interface. &odr; may be used in any context where basic ASN.1/BER representations are used. If you are only interested in writing a Z39.50 implementation based on the PDUs that are already provided with &yaz;, you only need to concern yourself with the section on managing ODR streams (). Only if you need to implement ASN.1 beyond that which has been provided, should you worry about the second half of the documentation (). If you use one of the higher-level interfaces, you can skip this section entirely. This is important, so we'll repeat it for emphasis: You do not need to read to implement Z39.50 with &yaz;. If you need a part of the protocol that isn't already in &yaz;, you should contact the authors before going to work on it yourself: We might already be working on it. Conversely, if you implement a useful part of the protocol before us, we'd be happy to include it in a future release. Using ODR ODR Streams Conceptually, the ODR stream is the source of encoded data in the decoding mode; when encoding, it is the receptacle for the encoded data. Before you can use an ODR stream it must be allocated. This is done with the function ODR odr_createmem(int direction); The odr_createmem() function takes as argument one of three manifest constants: ODR_ENCODE, ODR_DECODE, or ODR_PRINT. An &odr; stream can be in only one mode - it is not possible to change its mode once it's selected. Typically, your program will allocate at least two ODR streams - one for decoding, and one for encoding. When you're done with the stream, you can use void odr_destroy(ODR o); to release the resources allocated for the stream. Memory Management Two forms of memory management take place in the &odr; system. The first one, which has to do with allocating little bits of memory (sometimes quite large bits of memory, actually) when a protocol package is decoded, and turned into a complex of interlinked structures. This section deals with this system, and how you can use it for your own purposes. The next section deals with the memory management which is required when encoding data - to make sure that a large enough buffer is available to hold the fully encoded PDU. The &odr; module has its own memory management system, which is used whenever memory is required. Specifically, it is used to allocate space for data when decoding incoming PDUs. You can use the memory system for your own purposes, by using the function void *odr_malloc(ODR o, size_t size); You can't use the normal free(2) routine to free memory allocated by this function, and &odr; doesn't provide a parallel function. Instead, you can call void odr_reset(ODR o); when you are done with the memory: Everything allocated since the last call to odr_reset() is released. The odr_reset() call is also required to clear up an error condition on a stream. The function size_t odr_total(ODR o); returns the number of bytes allocated on the stream since the last call to odr_reset(). The memory subsystem of &odr; is fairly efficient at allocating and releasing little bits of memory. Rather than managing the individual, small bits of space, the system maintains a free-list of larger chunks of memory, which are handed out in small bits. This scheme is generally known as a nibble-memory system. It is very useful for maintaining short-lived constructions such as protocol PDUs. If you want to retain a bit of memory beyond the next call to odr_reset(), you can use the function ODR_MEM odr_extract_mem(ODR o); This function will give you control of the memory recently allocated on the ODR stream. The memory will live (past calls to odr_reset()), until you call the function void odr_release_mem(ODR_MEM p); The opaque ODR_MEM handle has no other purpose than referencing the memory block for you until you want to release it. You can use odr_extract_mem() repeatedly between allocating data, to retain individual control of separate chunks of data. Encoding and Decoding Data When encoding data, the ODR stream will write the encoded octet string in an internal buffer. To retrieve the data, use the function char *odr_getbuf(ODR o, int *len, int *size); The integer pointed to by len is set to the length of the encoded data, and a pointer to that data is returned. *size is set to the size of the buffer (unless size is null, signaling that you are not interested in the size). The next call to a primitive function using the same &odr; stream will overwrite the data, unless a different buffer has been supplied using the call void odr_setbuf(ODR o, char *buf, int len, int can_grow); which sets the encoding (or decoding) buffer used by o to buf, using the length len. Before a call to an encoding function, you can use odr_setbuf() to provide the stream with an encoding buffer of sufficient size (length). The can_grow parameter tells the encoding &odr; stream whether it is allowed to use realloc(2) to increase the size of the buffer when necessary. The default condition of a new encoding stream is equivalent to the results of calling odr_setbuf(stream, 0, 0, 1); In this case, the stream will allocate and reallocate memory as necessary. The stream reallocates memory by repeatedly doubling the size of the buffer - the result is that the buffer will typically reach its maximum, working size with only a small number of reallocation operations. The memory is freed by the stream when the latter is destroyed, unless it was assigned by the user with the can_grow parameter set to zero (in this case, you are expected to retain control of the memory yourself). To assume full control of an encoded buffer, you must first call odr_getbuf() to fetch the buffer and its length. Next, you should call odr_setbuf() to provide a different buffer (or a null pointer) to the stream. In the simplest case, you will reuse the same buffer over and over again, and you will just need to call odr_getbuf() after each encoding operation to get the length and address of the buffer. Note that the stream may reallocate the buffer during an encoding operation, so it is necessary to retrieve the correct address after each encoding operation. It is important to realize that the ODR stream will not release this memory when you call odr_reset(): It will merely update its internal pointers to prepare for the encoding of a new data value. When the stream is released by the odr_destroy() function, the memory given to it by odr_setbuf will be released only if the can_grow parameter to odr_setbuf() was nonzero. The can_grow parameter, in other words, is a way of signaling who is to own the buffer, you or the ODR stream. If you never call odr_setbuf() on your encoding stream, which is typically the case, the buffer allocated by the stream will belong to the stream by default. When you wish to decode data, you should first call odr_setbuf(), to tell the decoding stream where to find the encoded data, and how long the buffer is (the can_grow parameter is ignored by a decoding stream). After this, you can call the function corresponding to the data you wish to decode (e.g. odr_integer() odr z_APDU()). Encoding and decoding functions int odr_integer(ODR o, Odr_int **p, int optional, const char *name); int z_APDU(ODR o, Z_APDU **p, int optional, const char *name); If the data is absent (or doesn't match the tag corresponding to the type), the return value will be either 0 or 1 depending on the optional flag. If optional is 0 and the data is absent, an error flag will be raised in the stream, and you'll need to call odr_reset() before you can use the stream again. If optional is nonzero, the pointer pointed to/ by p will be set to the null value, and the function will return 1. The name argument is used to pretty-print the tag in question. It may be set to NULL if pretty-printing is not desired. If the data value is found where it's expected, the pointer pointed to by the p argument will be set to point to the decoded type. The space for the type will be allocated and owned by the &odr; stream, and it will live until you call odr_reset() on the stream. You cannot use free(2) to release the memory. You can decode several data elements (by repeated calls to odr_setbuf() and your decoding function), and new memory will be allocated each time. When you do call odr_reset(), everything decoded since the last call to odr_reset() will be released. Encoding and decoding of an integer The use of the double indirection can be a little confusing at first (its purpose will become clear later on, hopefully), so an example is in order. We'll encode an integer value, and immediately decode it again using a different stream. A useless, but informative operation. This looks like a lot of work, offhand. In practice, the &odr; streams will typically be allocated once, in the beginning of your program (or at the beginning of a new network session), and the encoding and decoding will only take place in a few, isolated places in your program, so the overhead is quite manageable. Printing When an ODR stream is created of type ODR_PRINT the ODR module will print the contents of a PDU in a readable format. By default output is written to the stderr stream. This behavior can be changed, however, by calling the function odr_setprint(ODR o, FILE *file); before encoders or decoders are being invoked. It is also possible to direct the output to a buffer (or indeed another file), by using the more generic mechanism: void odr_set_stream(ODR o, void *handle, void (*stream_write)(ODR o, void *handle, int type, const char *buf, int len), void (*stream_close)(void *handle)); Here the user provides an opaque handle and two handlers, stream_write for writing, and stream_close which is supposed to close/free resources associated with handle. The stream_close handler is optional and if NULL for the function is provided, it will not be invoked. The stream_write takes the ODR handle as parameter, the user-defined handle, a type ODR_OCTETSTRING, ODR_VISIBLESTRING which indicates the type of contents being written. Another utility useful for diagnostics (error handling) or as part of the printing facilities is: const char **odr_get_element_path(ODR o); which returns a list of current elements that ODR deals with at the moment. For the returned array, say ar, then ar[0] is the top level element, ar[n] is the last. The last element has the property that ar[n+1] == NULL. Element Path for record For a database record part of a PresentResponse the array returned by odr_get_element is presentResponse, databaseOrSurDiagnostics, ?, record, ?, databaseRecord . The question mark appears due to unnamed constructions. Diagnostics The encoding/decoding functions all return 0 when an error occurs. Until you call odr_reset(), you cannot use the stream again, and any function called will immediately return 0. To provide information to the programmer or administrator, the function void odr_perror(ODR o, char *message); is provided, which prints the message argument to stderr along with an error message from the stream. You can also use the function int odr_geterror(ODR o); to get the current error number from the screen. The number will be one of these constants: ODR Error codes code Description OMEMORYMemory allocation failed. OSYSERRA system- or library call has failed. The standard diagnostic variable errno should be examined to determine the actual error. OSPACENo more space for encoding. This will only occur when the user has explicitly provided a buffer for an encoding stream without allowing the system to allocate more space. OREQUIREDThis is a common protocol error; A required data element was missing during encoding or decoding. OUNEXPECTEDAn unexpected data element was found during decoding. OOTHEROther error. This is typically an indication of misuse of the &odr; system by the programmer, and also that the diagnostic system isn't as good as it should be, yet.
The character string array char *odr_errlist[] can be indexed by the error code to obtain a human-readable representation of the problem.
Summary and Synopsis #include <yaz/odr.h> ODR odr_createmem(int direction); void odr_destroy(ODR o); void odr_reset(ODR o); char *odr_getbuf(ODR o, int *len, int *size); void odr_setbuf(ODR o, char *buf, int len, int can_grow); void *odr_malloc(ODR o, int size); NMEM odr_extract_mem(ODR o); int odr_geterror(ODR o); void odr_perror(ODR o, const char *message); extern char *odr_errlist[];
Programming with ODR The API of &odr; is designed to reflect the structure of ASN.1, rather than BER itself. Future releases may be able to represent data in other external forms. There is an ASN.1 tutorial available at this site. This site also has standards for ASN.1 (X.680) and BER (X.690) online. The ODR interface is based loosely on that of the Sun Microsystems XDR routines. Specifically, each function which corresponds to an ASN.1 primitive type has a dual function. Depending on the settings of the ODR stream which is supplied as a parameter, the function may be used either to encode or decode data. The functions that can be built using these primitive functions, to represent more complex data types, share this quality. The result is that you only have to enter the definition for a type once - and you have the functionality of encoding, decoding (and pretty-printing) all in one unit. The resulting C source code is quite compact, and is a pretty straightforward representation of the source ASN.1 specification. In many cases, the model of the XDR functions works quite well in this role. In others, it is less elegant. Most of the hassle comes from the optional SEQUENCE members which don't exist in XDR. The Primitive ASN.1 Types ASN.1 defines a number of primitive types (many of which correspond roughly to primitive types in structured programming languages, such as C). INTEGER The &odr; function for encoding or decoding (or printing) the ASN.1 INTEGER type looks like this: int odr_integer(ODR o, Odr_int **p, int optional, const char *name); The Odr_int is just a simple integer. This form is typical of the primitive &odr; functions. They are named after the type of data that they encode or decode. They take an &odr; stream, an indirect reference to the type in question, and an optional flag (corresponding to the OPTIONAL keyword of ASN.1) as parameters. They all return an integer value of either one or zero. When you use the primitive functions to construct encoders for complex types of your own, you should follow this model as well. This ensures that your new types can be reused as elements in yet more complex types. The o parameter should obviously refer to a properly initialized &odr; stream of the right type (encoding/decoding/printing) for the operation that you wish to perform. When encoding or printing, the function first looks at * p. If * p (the pointer pointed to by p) is a null pointer, this is taken to mean that the data element is absent. If the optional parameter is nonzero, the function will return one (signifying success) without any further processing. If the optional is zero, an internal error flag is set in the &odr; stream, and the function will return 0. No further operations can be carried out on the stream without a call to the function odr_reset(). If *p is not a null pointer, it is expected to point to an instance of the data type. The data will be subjected to the encoding rules, and the result will be placed in the buffer held by the &odr; stream. The other ASN.1 primitives have similar functions that operate in similar manners: BOOLEAN int odr_bool(ODR o, Odr_bool **p, int optional, const char *name); REAL Not defined. NULL int odr_null(ODR o, Odr_null **p, int optional, const char *name); In this case, the value of **p is not important. If *p is different from the null pointer, the null value is present, otherwise it's absent. OCTET STRING typedef struct odr_oct { unsigned char *buf; int len; } Odr_oct; int odr_octetstring(ODR o, Odr_oct **p, int optional, const char *name); The buf field should point to the character array that holds the octetstring. The len field holds the actual length. The character array need not be null-terminated. To make things a little easier, an alternative is given for string types that are not expected to contain embedded NULL characters (e.g. VisibleString): int odr_cstring(ODR o, char **p, int optional, const char *name); which encodes or decodes between OCTETSTRING representations and null-terminated C strings. Functions are provided for the derived string types, e.g.: int odr_visiblestring(ODR o, char **p, int optional, const char *name); BIT STRING int odr_bitstring(ODR o, Odr_bitmask **p, int optional, const char *name); The opaque type Odr_bitmask is only suitable for holding relatively brief bit strings, e.g. for options fields, etc. The constant ODR_BITMASK_SIZE multiplied by 8 gives the maximum possible number of bits. A set of macros are provided for manipulating the Odr_bitmask type: void ODR_MASK_ZERO(Odr_bitmask *b); void ODR_MASK_SET(Odr_bitmask *b, int bitno); void ODR_MASK_CLEAR(Odr_bitmask *b, int bitno); int ODR_MASK_GET(Odr_bitmask *b, int bitno); The functions are modeled after the manipulation functions that accompany the fd_set type used by the select(2) call. ODR_MASK_ZERO should always be called first on a new bitmask, to initialize the bits to zero. OBJECT IDENTIFIER int odr_oid(ODR o, Odr_oid **p, int optional, const char *name); The C OID representation is simply an array of integers, terminated by the value -1 (the Odr_oid type is synonymous with the short type). We suggest that you use the OID database module (see ) to handle object identifiers in your application. Tagging Primitive Types The simplest way of tagging a type is to use the odr_implicit_tag() or odr_explicit_tag() macros: int odr_implicit_tag(ODR o, Odr_fun fun, int class, int tag, int optional, const char *name); int odr_explicit_tag(ODR o, Odr_fun fun, int class, int tag, int optional, const char *name); To create a type derived from the integer type by implicit tagging, you might write: MyInt ::= [210] IMPLICIT INTEGER In the &odr; system, this would be written like: int myInt(ODR o, Odr_int **p, int optional, const char *name) { return odr_implicit_tag(o, odr_integer, p, ODR_CONTEXT, 210, optional, name); } The function myInt() can then be used like any of the primitive functions provided by &odr;. Note that the behavior of odr_explicit_tag() and odr_implicit_tag() macros act exactly the same as the functions they are applied to - they respond to error conditions, etc, in the same manner - they simply have three extra parameters. The class parameter may take one of the values: ODR_CONTEXT, ODR_PRIVATE, ODR_UNIVERSAL, or /ODR_APPLICATION. Constructed Types Constructed types are created by combining primitive types. The &odr; system only implements the SEQUENCE and SEQUENCE OF constructions (although adding the rest of the container types should be simple enough, if the need arises). For implementing SEQUENCEs, the functions int odr_sequence_begin(ODR o, void *p, int size, const char *name); int odr_sequence_end(ODR o); are provided. The odr_sequence_begin() function should be called in the beginning of a function that implements a SEQUENCE type. Its parameters are the &odr; stream, a pointer (to a pointer to the type you're implementing), and the size of the type (typically a C structure). On encoding, it returns 1 if * p is a null pointer. The size parameter is ignored. On decoding, it returns 1 if the type is found in the data stream. size bytes of memory are allocated, and *p is set to point to this space. The odr_sequence_end() is called at the end of the complex function. Assume that a type is defined like this: MySequence ::= SEQUENCE { intval INTEGER, boolval BOOLEAN OPTIONAL } The corresponding &odr; encoder/decoder function and the associated data structures could be written like this: typedef struct MySequence { Odr_int *intval; Odr_bool *boolval; } MySequence; int mySequence(ODR o, MySequence **p, int optional, const char *name) { if (odr_sequence_begin(o, p, sizeof(**p), name) == 0) return optional && odr_ok(o); return odr_integer(o, &(*p)->intval, 0, "intval") && odr_bool(o, &(*p)->boolval, 1, "boolval") && odr_sequence_end(o); } Note the 1 in the call to odr_bool(), to mark that the sequence member is optional. If either of the member types had been tagged, the macros odr_implicit_tag() or odr_explicit_tag() could have been used. The new function can be used exactly like the standard functions provided with &odr;. It will encode, decode or pretty-print a data value of the MySequence type. We like to name types with an initial capital, as done in ASN.1 definitions, and to name the corresponding function with the first character of the name in lower case. You could, of course, name your structures, types, and functions any way you please - as long as you're consistent, and your code is easily readable. odr_ok is just that - a predicate that returns the state of the stream. It is used to ensure that the behavior of the new type is compatible with the interface of the primitive types. Tagging Constructed Types See for information on how to tag the primitive types, as well as types that are already defined. Implicit Tagging Assume the type above had been defined as MySequence ::= [10] IMPLICIT SEQUENCE { intval INTEGER, boolval BOOLEAN OPTIONAL } You would implement this in &odr; by calling the function int odr_implicit_settag(ODR o, int class, int tag); which overrides the tag of the type immediately following it. The macro odr_implicit_tag() works by calling odr_implicit_settag() immediately before calling the function pointer argument. Your type function could look like this: int mySequence(ODR o, MySequence **p, int optional, const char *name) { if (odr_implicit_settag(o, ODR_CONTEXT, 10) == 0 || odr_sequence_begin(o, p, sizeof(**p), name) == 0) return optional && odr_ok(o); return odr_integer(o, &(*p)->intval, 0, "intval") && odr_bool(o, &(*p)->boolval, 1, "boolval") && odr_sequence_end(o); } The definition of the structure MySequence would be the same. Explicit Tagging Explicit tagging of constructed types is a little more complicated, since you are in effect adding a level of construction to the data. Assume the definition: MySequence ::= [10] IMPLICIT SEQUENCE { intval INTEGER, boolval BOOLEAN OPTIONAL } Since the new type has an extra level of construction, two new functions are needed to encapsulate the base type: int odr_constructed_begin(ODR o, void *p, int class, int tag, const char *name); int odr_constructed_end(ODR o); Assume that the IMPLICIT in the type definition above were replaced with EXPLICIT (or that the IMPLICIT keyword was simply deleted, which would be equivalent). The structure definition would look the same, but the function would look like this: int mySequence(ODR o, MySequence **p, int optional, const char *name) { if (odr_constructed_begin(o, p, ODR_CONTEXT, 10, name) == 0) return optional && odr_ok(o); if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); if (odr_sequence_begin(o, p, sizeof(**p), 0) == 0) { *p = 0; /* this is almost certainly a protocol error */ return 0; } return odr_integer(o, &(*p)->intval, 0, "intval") && odr_bool(o, &(*p)->boolval, 1, "boolval") && odr_sequence_end(o) && odr_constructed_end(o); } Notice that the interface here gets kind of nasty. The reason is simple: Explicitly tagged, constructed types are fairly rare in the protocols that we care about, so the aesthetic annoyance (not to mention the dangers of a cluttered interface) is less than the time that would be required to develop a better interface. Nevertheless, it is far from satisfying, and it's a point that will be worked on in the future. One option for you would be to simply apply the odr_explicit_tag() macro to the first function, and not have to worry about odr_constructed_* yourself. Incidentally, as you might have guessed, the odr_sequence_ functions are themselves implemented using the /odr_constructed_ functions. SEQUENCE OF To handle sequences (arrays) of a specific type, the function int odr_sequence_of(ODR o, int (*fun)(ODR o, void *p, int optional), void *p, int *num, const char *name); The fun parameter is a pointer to the decoder/encoder function of the type. p is a pointer to an array of pointers to your type. num is the number of elements in the array. Assume a type MyArray ::= SEQUENCE OF INTEGER The C representation might be typedef struct MyArray { int num_elements; Odr_int **elements; } MyArray; And the function might look like int myArray(ODR o, MyArray **p, int optional, const char *name) { if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p)); if (odr_sequence_of(o, odr_integer, &(*p)->elements, &(*p)->num_elements, name)) return 1; *p = 0; return optional && odr_ok(o); } CHOICE Types The choice type is used fairly often in some ASN.1 definitions, so some work has gone into streamlining its interface. CHOICE types are handled by the function: int odr_choice(ODR o, Odr_arm arm[], void *p, void *whichp, const char *name); The arm array is used to describe each of the possible types that the CHOICE type may assume. Internally in your application, the CHOICE type is represented as a discriminated union. That is, a C union accompanied by an integer (or enum) identifying the active 'arm' of the union. whichp is a pointer to the union discriminator. When encoding, it is examined to determine the current type. When decoding, it is set to reference the type that was found in the input stream. The Odr_arm type is defined thus: typedef struct odr_arm { int tagmode; int class; int tag; int which; Odr_fun fun; char *name; } Odr_arm; The interpretation of the fields are: tagmode Either ODR_IMPLICIT, ODR_EXPLICIT, or ODR_NONE (-1) to mark no tagging. which The value of the discriminator that corresponds to this CHOICE element. Typically, it will be a #defined constant, or an enum member. fun A pointer to a function that implements the type of the CHOICE member. It may be either a standard &odr; type or a type defined by yourself. name Name of tag. A handy way to prepare the array for use by the odr_choice() function is to define it as a static, initialized array in the beginning of your decoding/encoding function. Assume the type definition: MyChoice ::= CHOICE { untagged INTEGER, tagged [99] IMPLICIT INTEGER, other BOOLEAN } Your C type might look like typedef struct MyChoice { enum { MyChoice_untagged, MyChoice_tagged, MyChoice_other } which; union { Odr_int *untagged; Odr_int *tagged; Odr_bool *other; } u; }; And your function could look like this: int myChoice(ODR o, MyChoice **p, int optional, const char *name) { static Odr_arm arm[] = { {-1, -1, -1, MyChoice_untagged, odr_integer, "untagged"}, {ODR_IMPLICIT, ODR_CONTEXT, 99, MyChoice_tagged, odr_integer, "tagged"}, {-1, -1, -1, MyChoice_other, odr_boolean, "other"}, {-1, -1, -1, -1, 0} }; if (o->direction == ODR_DECODE) *p = odr_malloc(o, sizeof(**p); else if (!*p) return optional && odr_ok(o); if (odr_choice(o, arm, &(*p)->u, &(*p)->which), name) return 1; *p = 0; return optional && odr_ok(o); } In some cases (say, a non-optional choice which is a member of a sequence), you can "embed" the union and its discriminator in the structure belonging to the enclosing type, and you won't need to fiddle with memory allocation to create a separate structure to wrap the discriminator and union. The corresponding function is somewhat nicer in the Sun XDR interface. Most of the complexity of this interface comes from the possibility of declaring sequence elements (including CHOICEs) optional. The ASN.1 specifications naturally require that each member of a CHOICE have a distinct tag, so they can be told apart on decoding. Sometimes it can be useful to define a CHOICE that has multiple types that share the same tag. You'll need some other mechanism, perhaps keyed to the context of the CHOICE type. In effect, we would like to introduce a level of context-sensitiveness to our ASN.1 specification. When encoding an internal representation, we have no problem, as long as each CHOICE member has a distinct discriminator value. For decoding, we need a way to tell the choice function to look for a specific arm of the table. The function void odr_choice_bias(ODR o, int what); provides this functionality. When called, it leaves a notice for the next call to odr_choice() to be called on the decoding stream o, that only the arm entry with a which field equal to what should be tried. The most important application (perhaps the only one, really) is in the definition of application-specific EXTERNAL encoders/decoders which will automatically decode an ANY member given the direct or indirect reference. Debugging The protocol modules are suffering somewhat from a lack of diagnostic tools at the moment. Specifically ways to pretty-print PDUs that aren't recognized by the system. We'll include something to this end in a not-too-distant release. In the meantime, what we do when we get packages we don't understand is to compile the ODR module with ODR_DEBUG defined. This causes the module to dump tracing information as it processes data units. With this output and the protocol specification (Z39.50), it is generally fairly easy to see what goes wrong.
The COMSTACK Module Synopsis (blocking mode) Introduction The &comstack; subsystem provides a transparent interface to different types of transport stacks for the exchange of BER-encoded data and HTTP packets. At present, the RFC1729 method (BER over TCP/IP), local UNIX socket and an experimental SSL stack are supported, but others may be added in time. The philosophy of the module is to provide a simple interface by hiding unused options and facilities of the underlying libraries. This is always done at the risk of losing generality, and it may prove that the interface will need extension later on. There hasn't been interest in the XTImOSI stack for some years. Therefore, it is no longer supported. The interface is implemented in such a fashion that only the sub-layers constructed to the transport methods that you wish to use in your application are linked in. You will note that even though simplicity was a goal in the design, the interface is still orders of magnitudes more complex than the transport systems found in many other packages. One reason is that the interface needs to support the somewhat different requirements of the different lower-layer communications stacks; another important reason is that the interface seeks to provide a more or less industrial-strength approach to asynchronous event-handling. When no function is allowed to block, things get more complex - particularly on the server side. We urge you to have a look at the demonstration client and server provided with the package. They are meant to be easily readable and instructive, while still being at least moderately useful. Common Functions Managing Endpoints COMSTACK cs_create(CS_TYPE type, int blocking, int protocol); Creates an instance of the protocol stack - a communications endpoint. The type parameter determines the mode of communication. At present the following values are supported: tcpip_type TCP/IP (BER over TCP/IP or HTTP over TCP/IP) ssl_type Secure Socket Layer (SSL). This COMSTACK is experimental and is not fully implemented. If HTTP is used, this effectively is HTTPS. unix_type Unix socket (unix only). Local Transfer via file socket. See unix 7. The cs_create function returns a null-pointer if a system error occurs. The blocking parameter should be '1' if you wish the association to operate in blocking mode, and '0' otherwise. The protocol field should be PROTO_Z3950 or PROTO_HTTP. Protocol PROTO_SR is no longer supported. void cs_close(COMSTACK handle); Closes the connection (as elegantly as the lower layers will permit), and releases the resources pointed to by the handle parameter. The handle should not be referenced again after this call. We really need a soft disconnect, don't we? Data Exchange int cs_put(COMSTACK handle, char *buf, int len); Sends buf down the wire. In blocking mode, this function will return only when a full buffer has been written, or an error has occurred. In nonblocking mode, it's possible that the function will be unable to send the full buffer at once, which will be indicated by a return value of 1. The function will keep track of the number of octets already written; you should call it repeatedly with the same values of buf and len, until the buffer has been transmitted. When a full buffer has been sent, the function will return 0 for success. The return value -1 indicates an error condition (see below). int cs_get(COMSTACK handle, char **buf, int *size); Receives a PDU or HTTP Response from the peer. Returns the number of bytes read. In nonblocking mode, it is possible that not all of the packet can be read at once. In this case, the function returns 1. To simplify the interface, the function is responsible for managing the size of the buffer. It will be reallocated if necessary to contain large packages, and will sometimes be moved around internally by the subsystem when partial packages are read. Before calling cs_get for the first time, the buffer can be initialized to the null pointer, and the length should also be set to 0 (cs_get will perform a malloc(2) on the buffer for you). When a full buffer has been read, the size of the package is returned (which will always be greater than 1). The return value -1 indicates an error condition. See also the cs_more() function below. int cs_more(COMSTACK handle); The cs_more() function should be used in conjunction with cs_get and select(2). The cs_get() function will sometimes (notably in the TCP/IP mode) read more than a single protocol package off the network. When this happens, the extra package is stored by the subsystem. After calling cs_get(), and before waiting for more input, You should always call cs_more() to check if there's a full protocol package already read. If cs_more() returns 1, cs_get() can be used to immediately fetch the new package. For the mOSI subsystem, the function should always return 0, but if you want your stuff to be protocol independent, you should use it. The cs_more() function is required because the RFC1729-method does not provide a way of separating individual PDUs, short of partially decoding the BER. Some other implementations will carefully nibble at the packet by calling read(2) several times. This was felt to be too inefficient (or at least clumsy) - hence the call for this extra function. int cs_look(COMSTACK handle); This function is useful when you're operating in nonblocking mode. Call it when select(2) tells you there's something happening on the line. It returns one of the following values: CS_NONE No event is pending. The data found on the line was not a complete package. CS_CONNECT A response to your connect request has been received. Call cs_rcvconnect to process the event and to finalize the connection establishment. CS_DISCON The other side has closed the connection (or maybe sent a disconnect request - but do we care? Maybe later). Call cs_close to close your end of the association as well. CS_LISTEN A connect request has been received. Call cs_listen to process the event. CS_DATA There's data to be found on the line. Call cs_get to get it. You should be aware that even if cs_look() tells you that there's an event event pending, the corresponding function may still return and tell you there was nothing to be found. This means that only part of a package was available for reading. The same event will show up again, when more data has arrived. int cs_fileno(COMSTACK h); returns the file descriptor of the association. Use this when file-level operations on the endpoint are required (select(2) operations, specifically). Client Side int cs_connect(COMSTACK handle, void *address); Initiate a connection with the target at address (more on addresses below). The function will return 0 on success, and 1 if the operation does not complete immediately (this will only happen on a nonblocking endpoint). In this case, use cs_rcvconnect to complete the operation, when select(2) or poll(2) reports input pending on the association. int cs_rcvconnect(COMSTACK handle); Complete a connect operation initiated by cs_connect(). It will return 0 on success; 1 if the operation has not yet completed (in this case, call the function again later); -1 if an error has occurred. Server Side To establish a server under the inetd server, you can use COMSTACK cs_createbysocket(int socket, CS_TYPE type, int blocking, int protocol); The socket parameter is an established socket (when your application is invoked from inetd, the socket will typically be 0. The following parameters are identical to the ones for cs_create. int cs_bind(COMSTACK handle, void *address, int mode) Binds a local address to the endpoint. Read about addresses below. The mode parameter should be either CS_CLIENT or CS_SERVER. int cs_listen(COMSTACK handle, char *addr, int *addrlen); Call this to process incoming events on an endpoint that has been bound in listening mode. It will return 0 to indicate that the connect request has been received, 1 to signal a partial reception, and -1 to indicate an error condition. COMSTACK cs_accept(COMSTACK handle); This finalizes the server-side association establishment, after cs_listen has completed successfully. It returns a new connection endpoint, which represents the new association. The application will typically wish to fork off a process to handle the association at this point, and continue listen for new connections on the old handle. You can use the call const char *cs_addrstr(COMSTACK); on an established connection to retrieve the host-name of the remote host. You may need to use this function with some care if your name server service is slow or unreliable. Addresses The low-level format of the addresses are different depending on the mode of communication you have chosen. A function is provided by each of the lower layers to map a user-friendly string-form address to the binary form required by the lower layers. void *cs_straddr(COMSTACK handle, const char *str); The format for TCP/IP and SSL addresses is: <host> [ ':' <portnum> ] The hostname can be either a domain name or an IP address. The port number, if omitted, defaults to 210. For TCP/IP and SSL, the special hostnames @, maps to IN6ADDR_ANY_INIT with IPV4 binding as well (bindv6only=0), The special hostname @4 binds to INADDR_ANY (IPV4 only listener). The special hostname @6 binds to IN6ADDR_ANY_INIT with bindv6only=1 (IPV6 only listener). For UNIX sockets, the format of an address is the socket filename. When a connection has been established, you can use const char *cs_addrstr(COMSTACK h); to retrieve the host name of the peer system. The function returns a pointer to a static area, which is overwritten on the next call to the function. A fairly recent addition to the &comstack; module is the utility function COMSTACK cs_create_host (const char *str, int blocking, void **vp); which is just a wrapper for cs_create and cs_straddr. The str is similar to that described for cs_straddr but with a prefix denoting the &comstack; type. Prefixes supported are tcp: and unix: and ssl: for TCP/IP and UNIX and SSL respectively. If no prefix is given, then TCP/IP is used. The blocking is passed to function cs_create. The third parameter vp is a pointer to &comstack; stack type specific values. Parameter vp is reserved for future use. Set it to NULL. SSL void *cs_get_ssl(COMSTACK cs); Returns the SSL handle, SSL * for comstack. If comstack is not of type SSL, then NULL is returned. int cs_set_ssl_ctx(COMSTACK cs, void *ctx); Sets SSL context for comstack. The parameter is expected to be of type SSL_CTX *. This function should be called just after comstack has been created (before connect, bind, etc). This function returns 1 for success; 0 for failure. int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname); Sets SSL certificate for comstack as a PEM file. This function returns 1 for success; 0 for failure. int cs_get_ssl_peer_certificate_x509(COMSTACK cs, char **buf, int *len); This function returns the peer certificate. If successful, *buf and *len holds X509 buffer and length respectively. Buffer should be freed with xfree. This function returns 1 for success; 0 for failure. Diagnostics All functions return -1 if an error occurs. Typically, the functions will return 0 on success, but the data exchange functions (cs_get, cs_put, cs_more) follow special rules. Consult their descriptions. The error code for the COMSTACK can be retrieved using C macro cs_errno which will return one of the error codes CSYSERR, CSOUTSTATE, CSNODATA, ... int cs_errno(COMSTACK handle); You can the textual representation of the error code by using cs_errmsg, which works like strerror(3). const char *cs_errmsg(int n); It is also possible to get straight to the textual representation without the error code, by using cs_strerror. const char *cs_strerror(COMSTACK h); Summary and Synopsis #include /* this is for TCP/IP and SSL support */ #include /* this is for UNIX socket support */ COMSTACK cs_create(CS_TYPE type, int blocking, int protocol); COMSTACK cs_createbysocket(int s, CS_TYPE type, int blocking, int protocol); COMSTACK cs_create_host(const char *str, int blocking, void **vp); int cs_bind(COMSTACK handle, int mode); int cs_connect(COMSTACK handle, void *address); int cs_rcvconnect(COMSTACK handle); int cs_listen(COMSTACK handle); COMSTACK cs_accept(COMSTACK handle); int cs_put(COMSTACK handle, char *buf, int len); int cs_get(COMSTACK handle, char **buf, int *size); int cs_more(COMSTACK handle); void cs_close(COMSTACK handle); int cs_look(COMSTACK handle); void *cs_straddr(COMSTACK handle, const char *str); const char *cs_addrstr(COMSTACK h); ]]> Future Directions We have a new and better version of the front-end server on the drawing board. Resources and external commitments will govern when we'll be able to do something real with it. Features should include greater flexibility, greater support for access/resource control, and easy support for Explain (possibly with Zebra as an extra database engine). &yaz; is a BER toolkit and as such should support all protocols out there based on that. We'd like to see running ILL applications. It shouldn't be that hard. Another thing that would be interesting is LDAP. Maybe a generic framework for doing IR using both LDAP and Z39.50 transparently. The SOAP implementation is incomplete. In the future we hope to add more features to it. Perhaps make a WSDL/XML Schema compiler. The authors of libxml2 are already working on XML Schema and RELAX NG compilers so this may not be too hard. It would be neat to have a proper module mechanism for the Generic Frontend Server so that backend would be dynamically loaded (as shared objects / DLLs). Other than that, &yaz; generally moves in the directions which appear to make the most people happy (including ourselves, as prime users of the software). If there's something you'd like to see in here, then drop us a note and let's see what we can come up with. Reference The material in this chapter is drawn directly from the individual manual entries. &manref; List of Object Identifiers These is a list of object identifiers that are built into YAZ. &std-oid-table; Bib-1 diagnostics List of Bib-1 diagnostics that are known to YAZ. &bib1-diag-table; SRU diagnostics List of SRU diagnostics that are known to YAZ. &srw-diag-table; License Index Data Copyright Copyright © ©right-year; Index Data. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY INDEX DATA ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL INDEX DATA BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. About Index Data Index Data is a consulting and software-development enterprise that specializes in library and information management systems. Our interests and expertise span a broad range of related fields, and one of our primary, long-term objectives is the development of a powerful information management system with open network interfaces and hyper-media capabilities. We make this software available free of charge, on a fairly unrestrictive license; as a service to the networking community, and to further the development of quality software for open network communication. We'll be happy to answer questions about the software, and about ourselves in general. The Hacker's Jargon File has the following to say about the use of the prefix "YA" in the name of a software product. Yet Another. adj. 1. Of your own work: A humorous allusion often used in titles to acknowledge that the topic is not original, though the content is. As in "Yet Another AI Group" or "Yet Another Simulated Annealing Algorithm". 2. Of others' work: Describes something of which there are already far too many. Credits This appendix lists individuals that have contributed in the development of &yaz;. Some have contributed with code, while others have provided bug fixes or suggestions. If we're missing somebody, of if you, for whatever reason, don't like to be listed here, let us know. Gary Anderson Dimitrios Andreadis Morten Bøgeskov Rocco Carbone Matthew Carey Hans van Dalen Irina Dijour Larry E. Dixson Hans van den Dool Mads Bondo Dydensborg Franck Falcoz Kevin Gamiel Morten Garkier Hendriksen Morten Holmqvist Ian Ibbotson Shigeru Ishida Heiko Jansen David Johnson Oleg Kolobov Giannis Kosmas Kang-Jin Lee Pieter Van Lierop Stefan Lohrum Ronald van der Meer Thomas W. Place Peter Popovics Jacob Chr. Poulsen Ko van der Sloot Mike Taylor Rustam T. Usmanov Charles Woodfield Tom André Øverland Hugh McMaster Guillaume Jactat
yaz-5.34.4/doc/bib1.html0000664000175000017500000001536314754707607010376 Bib-1 Attribute Set

Name

bib1-attr — Bib-1 Attribute Set

DESCRIPTION

This reference entry lists the Bib-1 attribute set types and values.

TYPES

The Bib-1 attribute set defines six attribute types: Use (1), Relation (2), Position (3), Structure (4), Truncation (5) and Completeness (6).

USE (1)

    1     Personal-name
    2     Corporate-name
    3     Conference-name
    4     Title
    5     Title-series
    6     Title-uniform
    7     ISBN
    8     ISSN
    9     LC-card-number
    10    BNB-card-number
    11    BGF-number
    12    Local-number
    13    Dewey-classification
    14    UDC-classification
    15    Bliss-classification
    16    LC-call-number
    17    NLM-call-number
    18    NAL-call-number
    19    MOS-call-number
    20    Local-classification
    21    Subject-heading
    22    Subject-Rameau
    23    BDI-index-subject
    24    INSPEC-subject
    25    MESH-subject
    26    PA-subject
    27    LC-subject-heading
    28    RVM-subject-heading
    29    Local-subject-index
    30    Date
    31    Date-of-publication
    32    Date-of-acquisition
    33    Title-key
    34    Title-collective
    35    Title-parallel
    36    Title-cover
    37    Title-added-title-page
    38    Title-caption
    39    Title-running
    40    Title-spine
    41    Title-other-variant
    42    Title-former
    43    Title-abbreviated
    44    Title-expanded
    45    Subject-precis
    46    Subject-rswk
    47    Subject-subdivision
    48    Number-natl-biblio
    49    Number-legal-deposit
    50    Number-govt-pub
    51    Number-music-publisher
    52    Number-db
    53    Number-local-call
    54    Code-language
    55    Code-geographic
    56    Code-institution
    57    Name-and-title
    58    Name-geographic
    59    Place-publication
    60    CODEN
    61    Microform-generation
    62    Abstract
    63    Note
    1000  Author-title
    1001  Record-type
    1002  Name
    1003  Author
    1004  Author-name-personal
    1005  Author-name-corporate
    1006  Author-name-conference
    1007  Identifier-standard
    1008  Subject-LC-childrens
    1009  Subject-name-personal
    1010  Body-of-text
    1011  Date/time-added-to-db
    1012  Date/time-last-modified
    1013  Authority/format-id
    1014  Concept-text
    1015  Concept-reference
    1016  Any
    1017  Server-choice
    1018  Publisher
    1019  Record-source
    1020  Editor
    1021  Bib-level
    1022  Geographic-class
    1023  Indexed-by
    1024  Map-scale
    1025  Music-key
    1026  Related-periodical
    1027  Report-number
    1028  Stock-number
    1030  Thematic-number
    1031  Material-type
    1032  Doc-id
    1033  Host-item
    1034  Content-type
    1035  Anywhere
    1036  Author-Title-Subject
   

RELATION (2)

    1 Less than
    2 Less than or equal
    3 Equal
    4 Greater or equal
    5 Greater than
    6 Not equal
    100 Phonetic
    101 Stem
    102 Relevance
    103 AlwaysMatches
   

POSITION (3)

    1 First in field
    2 First in subfield
    3 Any position in field
   

STRUCTURE (4)

    1 Phrase
    2 Word
    3 Key
    4 Year
    5 Date (normalized)
    6 Word list
    100 Date (un-normalized)
    101 Name (normalized)
    102 Name (un-normalized)
    103 Structure
    104 Urx
    105 Free-form-text
    106 Document-text
    107 Local-number
    108 String
    109 Numeric-string
   

TRUNCATION (5)

    1 Right truncation
    2 Left truncation
    3 Left and right truncation
    100 Do not truncate
    101 Process # in search term  . regular #=.*
    102 RegExpr-1
    103 RegExpr-2
    104 Process # ?n . regular: #=., ?n=.{0,n} or ?=.* Z39.58
   

The 105-106 truncation attributes below are only supported by Index Data's Zebra server.

    105 Process * ! regular: *=.*, !=. and right truncate
    106 Process * ! regular: *=.*, !=.
   

COMPLETENESS (6)

    1 Incomplete subfield
    2 Complete subfield
    3 Complete field
   

SORTING (7)

    1 ascending
    2 descending
   

Type 7 is an Index Data extension to RPN queries that allows embedding a sort critieria into a query.

yaz-5.34.4/doc/comstack.html0000664000175000017500000001076514754707607011366 Chapter 9. The COMSTACK Module

Chapter 9. The COMSTACK Module

1. Synopsis (blocking mode)

    COMSTACK stack;
    char *buf = 0;
    int size = 0, length_incoming;
    char server_address_str[] = "localhost:9999";
    void *server_address_ip;
    int status;

    char *protocol_package = "GET / HTTP/1.0\r\n\r\n";
    int protocol_package_length = strlen(protocol_package);

    stack = cs_create(tcpip_type, 1, PROTO_HTTP);
    if (!stack) {
        perror("cs_create");  /* use perror() here since we have no stack yet */
        return -1;
    }

    server_address_ip = cs_straddr(stack, server_address_str);
    if (!server_address_ip) {
        fprintf(stderr, "cs_straddr: address could not be resolved\n");
        return -1;
    }

    status = cs_connect(stack, server_address_ip);
    if (status) {
        fprintf(stderr, "cs_connect: %s\n", cs_strerror(stack));
        return -1;
    }

    status = cs_rcvconnect(stack);
    if (status) {
        fprintf(stderr, "cs_rcvconnect: %s\n", cs_strerror(stack));
        return -1;
    }

    status = cs_put(stack, protocol_package, protocol_package_length);
    if (status) {
        fprintf(stderr, "cs_put: %s\n", cs_strerror(stack));
        return -1;
    }

    /* Now get a response */
    length_incoming = cs_get(stack, &buf, &size);
    if (!length_incoming) {
        fprintf(stderr, "Connection closed\n");
        return -1;
    } else if (length_incoming < 0) {
        fprintf(stderr, "cs_get: %s\n", cs_strerror(stack));
        return -1;
    }

    /* Print result */
    fwrite(buf, length_incoming, 1, stdout);

    /* clean up */
    cs_close(stack);
    if (buf)
        xfree(buf);
    return 0;

   
yaz-5.34.4/doc/yaz-json-parse-man.xml0000664000175000017500000000404414631643521013026 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-json-parse 1 Commands yaz-json-parse YAZ JSON parser yaz-json-parse -p DESCRIPTION yaz-json-parse is a utility which demonstrates the JSON API of YAZ. (yaz/json.h). The program attempts to parse a JSON from standard input (stdin). It will return exit code 1 if parsing fails and the parsing error message will be printed to standard error (stderr). The program returns exit code 0 if parsing succeeds, and returns no output unless -p is given (see below). OPTIONS -p Makes the JSON parser echo the JSON result string to standard output, if parsing from stdin was successful. If -p is given twice, then the output is a multi-line output with indentation (pretty print). SEE ALSO yaz 7 yaz-5.34.4/doc/zoom.resultsets.html0000664000175000017500000003253214754707607012756 3. Result sets

3. Result sets

The result set object is a container for records returned from a target.

     ZOOM_resultset ZOOM_connection_search(ZOOM_connection, ZOOM_query q);

     ZOOM_resultset ZOOM_connection_search_pqf(ZOOM_connection c,
                                               const char *q);
     void ZOOM_resultset_destroy(ZOOM_resultset r);
   

Function ZOOM_connection_search creates a result set, given a connection and query. Destroy a result set by calling ZOOM_resultset_destroy. Simple clients using PQF only, may use the function ZOOM_connection_search_pqf in which case creating query objects is not necessary.

     void ZOOM_resultset_option_set(ZOOM_resultset r,
                                    const char *key, const char *val);

     const char *ZOOM_resultset_option_get(ZOOM_resultset r, const char *key);

     size_t ZOOM_resultset_size(ZOOM_resultset r);
   

Functions ZOOM_resultset_options_set and ZOOM_resultset_get sets and gets an option for a result set similar to ZOOM_connection_option_get and ZOOM_connection_option_set.

The number of hits, also called result-count, is returned by function ZOOM_resultset_size.

Table 3.3. ZOOM Result set Options

OptionDescriptionDefault
startOffset of first record to be retrieved from target. First record has offset 0 unlike the protocol specifications where first record has position 1. This option affects ZOOM_resultset_search and ZOOM_resultset_search_pqf and must be set before any of these functions are invoked. If a range of records must be fetched manually after search, function ZOOM_resultset_records should be used. 0
countNumber of records to be retrieved. This option affects ZOOM_resultset_search and ZOOM_resultset_search_pqf and must be set before any of these functions are invoked. 0
presentChunkThe number of records to be requested from the server in each chunk (present request). The value 0 means to request all the records in a single chunk. (The old step option is also supported for the benefit of old applications.) 0
elementSetNameElement-Set name of records. Most targets should honor element set name B and F for brief and full respectively. none
preferredRecordSyntaxPreferred Syntax, such as USMARC, SUTRS, etc. none
schemaSchema for retrieval, such as Gils-schema, Geo-schema, etc. none
setnameName of Result Set (Result Set ID). If this option isn't set, the ZOOM module will automatically allocate a result set name. default
rpnCharsetCharacter set for RPN terms. If this is set, ZOOM C will assume that the ZOOM application is running UTF-8. Terms in RPN queries are then converted to the rpnCharset. If this is unset, ZOOM C will not assume any encoding of RPN terms and no conversion is performed. none

For servers that support Search Info report, the following options may be read using ZOOM_resultset_get. This detailed information is read after a successful search has completed.

This information is a list of of items, where each item is information about a term or subquery. All items in the list are prefixed by SearchResult.no where no presents the item number (0=first, 1=second). Read searchresult.size to determine the number of items.

Table 3.4. Search Info Report Options

OptionDescription
searchresult.size number of search result entries. This option is non-existent if no entries are returned by the server.
searchresult.no.idsub query ID
searchresult.no.countresult count for item (number of hits)
searchresult.no.subquery.termsubquery term
searchresult.no.interpretation.term interpretation term
searchresult.no.recommendation.term recommendation term

3.1. Z39.50 Result-set Sort

     void ZOOM_resultset_sort(ZOOM_resultset r,
                              const char *sort_type, const char *sort_spec);

     int ZOOM_resultset_sort1(ZOOM_resultset r,
                              const char *sort_type, const char *sort_spec);
    

ZOOM_resultset_sort and ZOOM_resultset_sort1 both sort an existing result-set. The sort_type parameter is not used. Set it to "yaz". The sort_spec is same notation as ZOOM_query_sortby and identical to that offered by yaz-client's sort command.

These functions only work for Z39.50. Use the more generic utility ZOOM_query_sortby2 for other protocols (and even Z39.50).

3.2. Z39.50 Protocol behavior

The creation of a result set involves at least a SearchRequest - SearchResponse protocol handshake. Following that, if a sort criteria was specified as part of the query, a SortRequest - SortResponse handshake takes place. Note that it is necessary to perform sorting before any retrieval takes place, so no records will be returned from the target as part of the SearchResponse because these would be unsorted. Hence, piggyback is disabled when sort criteria are set. Following Search - and a possible sort - Retrieval takes place - as one or more Present Requests/Response pairs being transferred.

The API allows for two different modes for retrieval. A high level mode which is somewhat more powerful and a low level one. The low level is enabled when searching on a Connection object for which the settings smallSetUpperBound, mediumSetPresentNumber and largeSetLowerBound are set. The low level mode thus allows you to precisely set how records are returned as part of a search response as offered by the Z39.50 protocol. Since the client may be retrieving records as part of the search response, this mode doesn't work well if sorting is used.

The high-level mode allows you to fetch a range of records from the result set with a given start offset. When you use this mode the client will automatically use piggyback if that is possible with the target, and perform one or more present requests as needed. Even if the target returns fewer records as part of a present response because of a record size limit, etc. the client will repeat sending present requests. As an example, if option start is 0 (default) and count is 4, and piggyback is 1 (default) and no sorting criteria is specified, then the client will attempt to retrieve the 4 records as part the search response (using piggyback). On the other hand, if either start is positive or if a sorting criteria is set, or if piggyback is 0, then the client will not perform piggyback but send Present Requests instead.

If either of the options mediumSetElementSetName and smallSetElementSetName are unset, the value of option elementSetName is used for piggyback searches. This means that for the high-level mode you only have to specify one elementSetName option rather than three.

3.3. SRU Protocol behavior

Current version of YAZ does not take advantage of a result set id returned by the SRU server. Future versions might do, however. Since the ZOOM driver does not save result set IDs, any present (retrieval) is transformed to a SRU SearchRetrieveRequest with same query but, possibly, different offsets.

Option schema specifies SRU schema for retrieval. However, options elementSetName and preferredRecordSyntax are ignored.

Options start and count are supported by SRU. The remaining options piggyback, smallSetUpperBound, largeSetLowerBound, mediumSetPresentNumber, mediumSetElementSetName, smallSetElementSetName are unsupported.

SRU supports CQL queries, not PQF. If PQF is used, however, the PQF query is transferred anyway using non-standard element pQuery in SRU SearchRetrieveRequest.

Solr queries need to be done in Solr query format.

Unfortunately, SRU and Solr do not define a database setting. Hence, databaseName is unsupported and ignored. However, the path part in host parameter for functions ZOOM_connecton_new and ZOOM_connection_connect acts as a database (at least for the YAZ SRU server).

yaz-5.34.4/doc/zoom.queryconversions.html0000664000175000017500000000614314754707607014176 9. Query conversions

9. Query conversions

    int ZOOM_query_cql2rpn(ZOOM_query s, const char *cql_str,
                           ZOOM_connection conn);

    int ZOOM_query_ccl2rpn(ZOOM_query s, const char *ccl_str,
                           const char *config,
                           int *ccl_error, const char **error_string,
                           int *error_pos);
   

ZOOM_query_cql2rpn translates the CQL string, client-side, into RPN which may be passed to the server. This is useful for servers that don't themselves support CQL, for which ZOOM_query_cql is useless. 'conn' is used only as a place to stash diagnostics if compilation fails; if this information is not needed, a null pointer may be used. The CQL conversion is driven by option cqlfile from connection conn. This specifies a conversion file (e.g. pqf.properties) which must be present.

ZOOM_query_ccl2rpn translates the CCL string, client-side, into RPN which may be passed to the server. The conversion is driven by the specification given by config. Upon completion 0 is returned on success; -1 is returned on failure. On failure error_string and error_pos hold the error message and position of first error in original CCL string.

yaz-5.34.4/doc/yaz-client.html0000664000175000017500000011302114754707607011626 yaz-client

Name

yaz-client — Z39.50/SRU client for implementors

Synopsis

yaz-client [-a apdulog] [-b berdump] [-c cclfile] [-d dump] [-f cmdfile] [-k size] [-m marclog] [-p proxy-addr] [-q cqlfile] [-t dispcharset] [-u auth] [-v loglevel] [-V] [-x] [server-addr]

DESCRIPTION

yaz-client is a Z39.50/SRU client (origin) with a simple command line interface that allows you to test behavior and performance of Z39.50 targets and SRU servers.

From YAZ version 4.1.0 yaz-client may also operate as a Solr Web Service client.

If the server-addr is specified, the client creates a connection to the Z39.50/SRU target at the address given.

When yaz-client is started it tries to read commands from one of the following files:

  • Command file if it is given by option -f.

  • .yazclientrc in current working directory.

  • .yazclientrc in the user's home directory. The value of the $HOME environment variable is used to determine the home directory. Normally, $HOME is only set on POSIX systems such as Linux, FreeBSD, Solaris.

OPTIONS

-a filename

If specified, logging of protocol packages will be appended to the file given. If filename is specified as -, the output is written to stdout.

-b filename

If specified, YAZ will dump BER data in readable notation to the file specified. If filename is specified as - the output is written to stdout.

-c filename

If specified, CCL configuration will be read from the file given.

-d dump

If specified, YAZ will dump BER data for all PDUs sent and received to individual files, named dump.DDD.raw, where DDD is 001, 002, 003, ...

-f cmdfile

Reads commands from cmdfile. When this option is used, YAZ client does not read .yazclientrc from current directory or home directory.

-k size

Sets preferred messages and maximum record size for Initialize Request in kilobytes. Default value is 65536 (64 MB).

-m filename

If specified, retrieved records will be appended to the file given.

-p proxy-addr

If specified, the client will use the proxy at the address given. YAZ client will connect to a proxy on the address and port given. The actual target will be specified as part of the InitRequest to inform the proxy about the actual target.

-q filename

If specified, CQL configuration will be read from the file given.

-t displaycharset

If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running).

-u auth

If specified, the auth string will be used for authentication.

-v level
Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none.
-V

Prints YAZ version.

-x

Makes the YAZ client print hex dumps of packages sent and received on standard output.

COMMANDS

The YAZ client accepts the following commands.

open zurl

Opens a connection to a server. The syntax for zurl is the same as described above for connecting from the command line.

Syntax:

[(tcp|ssl|unix|http)':']host [:port][/base]

quit

Quits YAZ client

find query

Sends a Search Request using the query given. By default the query is assumed to be PQF. See command querytype for more information.

delete setname

Deletes result set with name setname on the server.

base base1 base2 ...

Sets the name(s) of the database(s) to search. One or more databases may be specified, separated by blanks. This command overrides the database given in zurl.

show [start[+number [+resultset]]]

Fetches records by sending a Present Request from the start position given by start and a number of records given by number, from the result set resultset. If start is not given, then the client will fetch from the position of the last retrieved record plus 1. If number is not given, then one record will be fetched at a time. If resultset is not given, the most recently retrieved result set is used.

scan term

Scans database index for a term. The syntax resembles the syntax for find. If you want to scan for the word water you could write

      scan water
     

but if you want to scan only in, say the title field, you would write

      scan @attr 1=4 water
     
setscan set term
Scans database index for a term within a result set. This is similar to the scan command but has a result set as its first argument.
scanpos pos
Sets preferred position for scan. This value is used in the next scan. By default, position is 1.
scansize size
Sets number of entries to be returned by scan. Default number of entries is 20.
scanstep step
Set step-size for scan. This value is used in the next scan sent to the target. By default step-size is 0.
sort sortspecs

Sorts a result set. The sort command takes a sequence of space-separated sort specifications, with each sort specification consisting of two space-separated words (so that the whole specification list is made up of an even number of words). The first word of each specification holds a field (sort criterion) and the second holds flags. If the sort criterion includes = it is assumed that the SortKey is of type sortAttributes using Bib-1: in this case the integer before = is the attribute type and the integer following = is the attribute value. If no = character is in the criterion, it is treated as a sortfield of type InternationalString. The flags word of each sort specification must consist of s for case sensitive or i for case insensitive, and < for ascending order or > for descending order.

Example using sort criterion with attributes use=local-number and structure=numeric and ascending flag: 1=12,4=109 <

Another example with "Title" sort field and descending flag: Title >

sort+

Same as sort but stores the sorted result set in a new result set.

authentication [auth1 [auth2 [auth3]]]

Configures authentication strings to be sent to server. Zero, 1, 2 or 3 arguments may follow the auth command.

If no (0) arguments are given, no authentication string is sent.

If one argument is given, the Z39.50 v2 OpenStyle authentication is used. A common convention for the auth1 string is that the username and password is separated by a slash, e.g. myusername/mysecret.

If two or more arguments is given Z39.50 v3 authentication is used, in which cased the first argument is used, second argument is group and third argument is password. If only two arguments are given the group is assumed to be empty.

As for other commands in yaz-client, the arguments are separated by whitespace. A backslash character can be used to include a character verbatim. For example, auth myuser a\ b is a two argument auth command where user is myuser and password is a b.

The authentication string is first sent to the server when the open command is issued and the Z39.50 Initialize Request is sent, so this command must be used before open in order to be effective.

sru method version

Selects Web Service method and version. Must be one of post, get, soap (default) or solr. Version should be either 1.1, 1.2 or 2.0 for SRU. Other versions are allowed - for testing purposes (version negotiation with SRU server). The version is currently not used for Solr Web Services

list_all

This command displays status and values for many settings.

lslb n

Sets the limit for when no records should be returned together with the search result. See the Z39.50 standard on set bounds for more details.

ssub n

Sets the limit for when all records should be returned with the search result. See the Z39.50 standard on set bounds for more details.

mspn n

Sets the number of records that should be returned if the number of records in the result set is between the values of lslb and ssub. See the Z39.50 standard on set bounds for more details.

status

Displays the values of lslb, ssub and mspn.

setname

Switches named result sets on and off. Default is on.

cancel

Sends a Trigger Resource Control Request to the target.

facets spec

Specifies requested facets to be used in search. The notation is specified in Section 8, “Facets”.

format oid

Sets the preferred transfer syntax for retrieved records. yaz-client supports all the record syntaxes that currently are registered. See Z39.50 Record Syntax Identifiers for more details. Commonly used records syntaxes include usmarc, sutrs and xml.

elements e

Sets the element set name for the records. Many targets support element sets B (for brief) and F (for full).

close

Sends a Z39.50 Close APDU and closes connection with the peer

querytype type

Sets the query type as used by command find. The following is supported: prefix for Prefix Query Notation (Type-1 Query); ccl for CCL search (Type-2 Query), cql for CQL (Type-104 search with CQL OID), ccl2rpn for CCL to RPN conversion (Type-1 Query), cql2rpn for CQL to RPN conversion (Type-1 Query).

attributeset set

Sets attribute set OID for prefix queries (RPN, Type-1).

refid id

Sets reference ID for Z39.50 Request(s).

itemorder type no

Sends an Item Order Request using the ILL External. type is either 1 or 2 which corresponds to ILL-Profile 1 and 2 respectively. The no is the Result Set position of the record to be ordered.

update action recid doc

Sends Item Update Request. The action argument must be the action type: one of insert, replace, delete and update. The second argument, recid, is the record identifier (any string). Third argument which is optional is the record document for the request. If doc is preceded with "<", then the following characters are treated as a filename with the records to be updated. Otherwise doc is treated as a document itself. The doc may also be quoted in double quotes. If doc is omitted, the last received record (as part of present response or piggybacked search response) is used for the update.

source filename

Executes list of commands from file filename, just like 'source' on most UNIX shells. A single dot (.) can be used as an alternative.

! args

Executes command args in subshell using the system call.

push_command command

The push_command takes another command as its argument. That command is then added to the history information (so you can retrieve it later). The command itself is not executed. This command only works if you have GNU readline/history enabled.

set_apdufile filename

Sets that APDU should be logged to file filename. Another way to achieve APDU log is by using command-line option -a.

set_auto_reconnect flag

Specifies whether YAZ client automatically reconnects if the target closes connection (Z39.50 only).

flag must be either on or off.

set_auto_wait flag

Specifies whether YAZ client should wait for response protocol packages after a request. By default YAZ client waits (on) for response packages immediately after a command (find, show) has been issued. If off is used, YAZ client does not attempt to receive packages automatically. These will have to be manually received when command wait_response is used.

flag must be either on or off.

set_marcdump filename

Specifies that all retrieved records should be appended to file filename. This command does the same thing as option -m.

schema schemaid

Specifies schema for retrieval. Schema may be specified as an OID for Z39.50. For SRU, schema is a simple string URI.

charset negotiationcharset [displaycharset] [[marccharset]]

Specifies character set (encoding) for Z39.50 negotiation / SRU encoding and/or character set for output (terminal).

negotiationcharset is the name of the character set to be negotiated by the server. The special name - for negotiationcharset specifies no character set to be negotiated.

If displaycharset is given, it specifies name of the character set of the output (on the terminal on which YAZ client is running). To disable conversion of characters to the output encoding, the special name - (dash) can be used. If the special name auto is given, YAZ client will convert strings to the encoding of the terminal as returned by nl_langinfo call.

If marccharset is given, it specifies name of the character set of retrieved MARC records from server. See also marccharset command.

Note

Since character set negotiation takes effect in the Z39.50 Initialize Request you should issue this command before command open is used.

Note

MARC records are not covered by Z39.50 character set negotiation, so that's why there is a separate character that must be known in order to do meaningful conversion(s).

negcharset charset

Specifies character set for negotiation (Z39.50). The argument is the same as second argument for command charset.

displaycharset charset

Specifies character set for output (display). The argument is the same as second argument for command charset.

marccharset charset

Specifies character set for retrieved MARC records so that YAZ client can display them in a character suitable for your display. See charset command. If auto is given, YAZ will assume that MARC21/USMARC is using MARC8/UTF8 and ISO-8859-1 for all other MARC variants. The charset argument is the same as third argument for command charset.

querycharset charset

Specifies character set for query terms for Z39.50 RPN queries and Z39.50 Scan Requests (termListAndStartPoint). This is a pure client-side conversion which converts from displayCharset to queryCharset.

set_cclfile filename

Specifies that CCL fields should be read from file file filename. This command does the same thing as option -c.

set_cqlfile filename

Specifies that CQL fields should be read from file file filename. This command does the same thing as option -q.

register_oid name class OID

This command allows you to register your own object identifier - so that instead of entering a long dot-notation you can use a short name instead. The name is your name for the OID, class is the class, and OID is the raw OID in dot notation. Class is one of: appctx, absyn, attet, transyn, diagset, recsyn, resform, accform, extserv, userinfo, elemspec, varset, schema, tagset, general. If you're in doubt use the general class.

register_tab command string

This command registers a TAB completion string for the command given.

sleep seconds

This command makes YAZ client sleep (be idle) for the number of seconds given.

wait_response [ number]

This command makes YAZ client wait for a number of response packages from target. If number is omitted, 1 is assumed.

This command is rarely used and is only useful if command set_auto_wait is set to off.

xmles OID doc

Sends XML Extended Services request using the OID and doc given.

zversion ver

This command sets Z39.50 version for negotiation. Should be used before open. By default 3 (version 3) is used.

options op1 op2..

This command sets Z39.50 options for negotiation. Should be used before open.

The following options are supported: search, present, delSet, resourceReport, triggerResourceCtrl, resourceCtrl, accessCtrl, scan, sort, extendedServices, level_1Segmentation, level_2Segmentation, concurrentOperations, namedResultSets, encapsulation, resultCount, negotiationModel, duplicationDetection, queryType104, pQESCorrection, stringSchema.

EXAMPLE

The simplest example of a Prefix Query would be something like

    f knuth
   

or

    f "donald knuth"
   

In those queries, no attributes were specified. This leaves it up to the server what fields to search but most servers will search in all fields. Some servers do not support this feature though, and require that some attributes are defined. To add one attribute you could do:

    f @attr 1=4 computer
   

where we search in the title field, since the use(1) is title(4). If we want to search in the author field and in the title field, and in the title field using right truncation it could look something like this:

    f @and @attr 1=1003 knuth @attr 1=4 @attr 5=1 computer
   

Finally using a mix of Bib-1 and GILS attributes could look something like this:

    f @attrset Bib-1 @and @attr GILS 1=2008 Washington @attr 1=21 weather
   

FILES

yaz-<version>/client/client.c

$HOME/.yazclientrc

$HOME/.yazclient.history

SEE ALSO

yaz(7) bib1-attr(7)

yaz-5.34.4/doc/yaz-url-man.xml0000664000175000017500000000752314753611150011552 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-url 1 Commands yaz-url YAZ URL fetch utility yaz-url -H name:value -m method -O fname -p fname -R num -u user/password -v -x proxy url DESCRIPTION yaz-url is utility to get web content. It is very limited in functionality compared to programs such as curl, wget. The options must precede the URL given on the command line, to take effect. Fetched HTTP content is written to stdout, unless option -O is given. OPTIONS -H name:value Specifies HTTP header content with name and value. This option can be given multiple times (for different names, of course). -m method Specifies the HTTP method to be used for the next URL. Default is method "GET". However, option -p sets it to "POST". -O fname Sets output filename for HTTP content. -p fname Sets a file to be POSTed in the following URL. -R num Sets maximum number of HTTP redirects to be followed. A value of zero disables follow of HTTP redirects. -u user/password Specifies a user and a password to be used in HTTP basic authentication in the following URL fetch. The user and password must be separated by a slash (thus it is not possible to specify a user with a slash in it). -v Makes yaz-url dump each HTTP request/response to stdout. -x proxy Specifies a proxy to be used for URL fetch. SEE ALSO yaz 7 yaz-5.34.4/doc/introduction.api.html0000664000175000017500000002174014754707607013046 2. The API

2. The API

The YAZ toolkit offers several different levels of access to the ISO23950/Z39.50, ILL and SRU protocols. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement. If you're developing a client application you should consider the ZOOM API. It is, by far, the easiest way to develop clients in C. Server implementors should consider the generic front-end server. None of those high-level APIs support the whole protocol, but they do include most facilities used in existing Z39.50 applications.

If you're using 'exotic' functionality (meaning anything not included in the high-level APIs), developing non-standard extensions to Z39.50 or you're going to develop an ILL application, you'll have to learn the lower level APIs of YAZ.

The YAZ toolkit modules are shown in figure Figure 1.1, “YAZ layers”.

Figure 1.1. YAZ layers

YAZ layers

There are four layers.

  • A client or server application (or both). This layer includes ZOOM and the generic front-end server.

  • The second layer provides a C representation of the protocol units (packages) for Z39.50 ASN.1, ILL ASN.1, SRU.

  • The third layer encodes and decodes protocol data units to simple packages (buffer with certain length). The ODR module encodes and decodes BER whereas the HTTP modules encodes and decodes HTTP requests/responses.

  • The lowest layer is COMSTACK which exchanges the encoded packages with a peer process over a network.

The Z39.50 ASN.1 module represents the ASN.1 definition of the Z39.50 protocol. It establishes a set of type and structure definitions, with one structure for each of the top-level PDUs, and one structure or type for each of the contained ASN.1 types. For primitive types, or other types that are defined by the ASN.1 standard itself (such as the EXTERNAL type), the C representation is provided by the ODR (Open Data Representation) subsystem.

ODR is a basic mechanism for representing an ASN.1 type in the C programming language, and for implementing BER encoders and decoders for values of that type. The types defined in the Z39.50 ASN.1 module generally have the prefix Z_, and a suffix corresponding to the name of the type in the ASN.1 specification of the protocol (generally Z39.50-1995). In the case of base types (those originating in the ASN.1 standard itself), the prefix Odr_ is sometimes seen. Either way, look for the actual definition in either z-core.h (for the types from the protocol), odr.h (for the primitive ASN.1 types). The Z39.50 ASN.1 library also provides functions (which are, in turn, defined using ODR primitives) for encoding and decoding data values. Their general form is

int z_xxx(o,  
 p,  
 optional,  
 name); 
ODR o;
Z_xxx **p;
int optional;
const char *name;
 

(note the lower-case "z" in the function name)

Note

If you are using the premade definitions of the Z39.50 ASN.1 module, and you are not adding a new protocol of your own, the only parts of ODR that you need to worry about are documented in Section 2, “Using ODR”.

When you have created a BER-encoded buffer, you can use the COMSTACK subsystem to transmit (or receive) data over the network. The COMSTACK module provides simple functions for establishing a connection (passively or actively, depending on the role of your application), and for exchanging BER-encoded PDUs over that connection. When you create a connection endpoint, you need to specify what transport to use (TCP/IP, SSL or UNIX sockets). For the remainder of the connection's lifetime, you don't have to worry about the underlying transport protocol at all - the COMSTACK will ensure that the correct mechanism is used.

We call the combined interfaces to ODR, Z39.50 ASN.1, and COMSTACK the service level API. It's the API that most closely models the Z39.50 service/protocol definition, and it provides unlimited access to all fields and facilities of the protocol definitions.

The reason that the YAZ service-level API is a conglomerate of the APIs from three different sub-modules is twofold. First, we wanted to allow the user a choice of different options for each major task. For instance, if you don't like the protocol API provided by ODR/Z39.50 ASN.1, you can use SNACC or BERUtils instead, and still have the benefits of the transparent transport approach of the COMSTACK module. Secondly, we realize that you may have to fit the toolkit into an existing event-processing structure, in a way that is incompatible with the COMSTACK interface or some other part of YAZ.

yaz-5.34.4/doc/yaz-record-conv.10000664000175000017500000000524014754707606011767 '\" t .\" Title: yaz-record-iconv .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-RECORD\-ICONV" "1" "02/17/2025" "YAZ 5.34.4" "Commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-record-conv \- YAZ Record Conversion Utility .SH "SYNOPSIS" .HP \w'\fByaz\-record\-conv\fR\ 'u \fByaz\-record\-conv\fR [\fB\-v\ \fR\fB\fIloglevel\fR\fR] [\fIconfig\fR] [\fIfname\fR...] .SH "DESCRIPTION" .PP \fByaz\-record\-conv\fR is a program that exercises the record conversion sub system\&. Refer to record_conv\&.h header\&. .SH "OPTIONS" .PP \-v \fIlevel\fR .RS 4 Sets the LOG level to \fIlevel\fR\&. Level is a sequence of tokens separated by comma\&. Each token is a integer or a named LOG item \- one of fatal, debug, warn, log, malloc, all, none\&. .RE .SH "EXAMPLES" .PP The following backend configuration converts MARC records (ISO2709) to Dublin\-Core XML\&. .sp .if n \{\ .RS 4 .\} .nf .fi .if n \{\ .RE .\} .PP We can convert one of the sample records from YAZ\*(Aq test directory with: .sp .if n \{\ .RS 4 .\} .nf $ \&.\&./util/yaz\-record\-conv record\-conv\-conf\&.xml marc6\&.marc How to program a computer Jack Collins text Penguin eng .fi .if n \{\ .RE .\} .sp .SH "FILES" .PP record_conv\&.h .SH "SEE ALSO" .PP yaz(7) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/zoom.query.html0000664000175000017500000001037614754707607011710 2. Queries

2. Queries

Query objects represents queries.

     ZOOM_query ZOOM_query_create(void);

     void ZOOM_query_destroy(ZOOM_query q);

     int ZOOM_query_prefix(ZOOM_query q, const char *str);

     int ZOOM_query_cql(ZOOM_query s, const char *str);

     int ZOOM_query_sortby(ZOOM_query q, const char *criteria);

     int ZOOM_query_sortby2(ZOOM_query q, const char *strategy,
                            const char *criteria);
   

Create query objects using ZOOM_query_create and destroy them by calling ZOOM_query_destroy. RPN-queries can be specified in PQF notation by using the function ZOOM_query_prefix. The ZOOM_query_cql specifies a CQL query to be sent to the server/target. More query types will be added in future versions of YAZ, such as CCL to RPN-mapping, native CCL query, etc. In addition to a search, a sort criteria may be set. Function ZOOM_query_sortby enables Z39.50 sorting and it takes sort criteria using the same string notation as yaz-client's sort command.

ZOOM_query_sortby2 is similar to ZOOM_query_sortby but allows a strategy for sorting. The reason for the strategy parameter is that some protocols offer multiple ways of performing sorting. For example, Z39.50 has the standard sort, which is performed after search on an existing result set. It's also possible to use CQL in Z39.50 as the query type and use CQL's SORTBY keyword. Finally, Index Data's Zebra server also allows sorting to be specified as part of RPN (Type 7).

Table 3.2. ZOOM sort strategy

NameDescription
z39.50Z39.50 resultset sort
type7Sorting embedded in RPN(Type-7)
cqlCQL SORTBY
sru11SRU sortKeys parameter
solrSolr sort
embedtype7 for Z39.50, cql for SRU, solr for Solr protocol

yaz-5.34.4/doc/server.invocation.html0000664000175000017500000003225314754707607013234 6. Application Invocation

6. Application Invocation

The finished application has the following invocation syntax (by way of statserv_main()):

application [-install] [-installa] [-remove] [-a file] [-v level] [-l file] [-u uid] [-c config] [-f vconfig] [-C fname] [-t minutes] [-k kilobytes] [-K] [-d daemon] [-w dir] [-p pidfile] [-r kilobytes] [-ziDSTV1] [listener-spec...]

The options are:

-a file

Specify a file for dumping PDUs (for diagnostic purposes). The special name - (dash) sends output to stderr.

-S

Don't fork or make threads on connection requests. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users.

-1

Like -S but after one session the server exits. This mode is for debugging only.

-T

Operate the server in threaded mode. The server creates a thread for each connection rather than fork a process. Only available on UNIX systems that offer POSIX threads.

-s

Use the SR protocol (obsolete).

-z

Use the Z39.50 protocol (default). This option and -s complement each other. You can use both multiple times on the same command line, between listener-specifications (see below). This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports.

-l file

The logfile.

-c config

A user option that serves as a specifier for some sort of configuration, usually a filename. The argument to this option is transferred to member configname of the statserv_options_block.

-f vconfig

This specifies an XML file that describes one or more YAZ frontend virtual servers.

-C fname

Sets SSL certificate file name for server (PEM).

-v level

The log level. Use a comma-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}.

-u uid

Set user ID. Sets the real UID of the server process to that of the given user. It's useful if you aren't comfortable with having the server run as root, but you need to start it as such to bind a privileged port.

-w dir

The server changes to this directory before listening to incoming connections. This option is useful when the server is operating from the inetd daemon (see -i).

-p pidfile

Specifies that the server should write its Process ID to the file given by pidfile. A typical location would be /var/run/yaz-ztest.pid.

-i

Use this to make the the server run from the inetd server (UNIX only).

-D

Use this to make the server put itself in the background and run as a daemon. If neither -i nor -D is given, the server starts in the foreground.

-install

Use this to install the server as an NT service (Windows NT/2000/XP only). Control the server by going to the Services in the Control Panel.

-installa

Use this to install the server as an NT service and mark it as "auto-start. Control the server by going to the Services in the Control Panel.

-remove

Use this to remove the server from the NT services (Windows NT/2000/XP only).

-t minutes

Idle session timeout, in minutes.

-k size

Maximum record size/message size, in kilobytes.

-K

Forces no-keepalive for HTTP sessions. By default GFS will keep sessions alive for HTTP 1.1 sessions (as defined by the standard). Using this option will force GFS to close the connection for each operation.

-r size

Maximum size of log file before rotation occurs, in kilobytes. Default size is 1048576 k (=1 GB).

-d daemon

Set name of daemon to be used in hosts access file. See hosts_access(5) and tcpd(8).

-m time-format

Sets the format of time-stamps in the log-file. Specify a string in the input format to strftime().

-V

Display YAZ version and exit.

A listener specification consists of a transport mode followed by a colon (:) followed by a listener address. The transport mode is either tcp, unix: or ssl.

For TCP and SSL, an address has the form

    hostname | IP-number [: portnumber]
   

The port number defaults to 210 (standard Z39.50 port).

For UNIX, the address is the filename of socket.

For TCP/IP and SSL, the special hostnames @, maps to IN6ADDR_ANY_INIT with IPV4 binding as well (bindv6only=0), The special hostname @4 binds to INADDR_ANY (IPV4 only listener). The special hostname @6 binds to IN6ADDR_ANY_INIT with bindv6only=1 (IPV6 only listener).

Example 4.1. Running the GFS on Unix

Assuming the server application appname is started as root, the following will make it listen on port 210. The server will change identity to nobody and write its log to /var/log/app.log.

      application -l /var/log/app.log -u nobody tcp:@:210
     

The server will accept Z39.50 requests and offer SRU service on port 210.


Example 4.2. Setting up Apache as SRU Frontend

If you use Apache as your public web server and want to offer HTTP port 80 access to the YAZ server on 210, you can use the ProxyPass directive. If you have virtual host srw.mydomain you can use the following directives in Apache's httpd.conf:

      <VirtualHost *>
       ErrorLog /home/srw/logs/error_log
       TransferLog /home/srw/logs/access_log
       ProxyPass / http://srw.mydomain:210/
      </VirtualHost>
     

The above is for the Apache 1.3 series.


Example 4.3. Running a server with local access only

A server that is only being accessed from the local host should listen on UNIX file socket rather than an Internet socket. To listen on /tmp/mysocket start the server as follows:

      application unix:/tmp/mysocket
     


yaz-5.34.4/doc/soap.http.html0000664000175000017500000000470214754707607011474 2. HTTP

2. HTTP

YAZ only offers HTTP as transport carrier for SOAP, but it is relatively easy to change that.

The following definition of Z_GDU (Generic Data Unit) allows for both HTTP and Z39.50 in one packet.

#include <yaz/zgdu.h>

#define Z_GDU_Z3950         1
#define Z_GDU_HTTP_Request  2
#define Z_GDU_HTTP_Response 3
typedef struct {
  int which;
  union {
    Z_APDU *z3950;
    Z_HTTP_Request *HTTP_Request;
    Z_HTTP_Response *HTTP_Response;
  } u;
} Z_GDU ;
   

The corresponding Z_GDU encoder/decoder is z_GDU. The z3950 is any of the known BER encoded Z39.50 APDUs. HTTP_Request and HTTP_Response is the HTTP Request and Response respectively.

yaz-5.34.4/doc/odr.html0000664000175000017500000001375114754707607010344 Chapter 8. The ODR Module

Chapter 8. The ODR Module

1. Introduction

ODR is the BER-encoding/decoding subsystem of YAZ. Care has been taken to isolate ODR from the rest of the package - specifically from the transport interface. ODR may be used in any context where basic ASN.1/BER representations are used.

If you are only interested in writing a Z39.50 implementation based on the PDUs that are already provided with YAZ, you only need to concern yourself with the section on managing ODR streams (Section 2, “Using ODR”). Only if you need to implement ASN.1 beyond that which has been provided, should you worry about the second half of the documentation (Section 3, “Programming with ODR”). If you use one of the higher-level interfaces, you can skip this section entirely.

This is important, so we'll repeat it for emphasis: You do not need to read Section 3, “Programming with ODR” to implement Z39.50 with YAZ.

If you need a part of the protocol that isn't already in YAZ, you should contact the authors before going to work on it yourself: We might already be working on it. Conversely, if you implement a useful part of the protocol before us, we'd be happy to include it in a future release.

yaz-5.34.4/doc/Makefile.in0000664000175000017500000007455014754707577010751 # Makefile.in generated by automake 1.16.5 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2021 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_check_icu.m4 \ $(top_srcdir)/m4/acx_pthread.m4 $(top_srcdir)/m4/libtool.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/m4/yaz.m4 $(top_srcdir)/m4/yaz_libxml2.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = local0.ent CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" \ "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docdir)" man7dir = $(mandir)/man7 man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) DATA = $(doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/local0.ent.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSSSL_DIR = @DSSSL_DIR@ DSYMUTIL = @DSYMUTIL@ DTD_DIR = @DTD_DIR@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FILECMD = @FILECMD@ GREP = @GREP@ HIREDIS_LIBS = @HIREDIS_LIBS@ HTML_COMPILE = @HTML_COMPILE@ ICU_CFLAGS = @ICU_CFLAGS@ ICU_CONFIG = @ICU_CONFIG@ ICU_CPPFLAGS = @ICU_CPPFLAGS@ ICU_LIBS = @ICU_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_COMPILE = @MAN_COMPILE@ MEMCACHED_LIBS = @MEMCACHED_LIBS@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PDF_COMPILE = @PDF_COMPILE@ PKG_CONFIG = @PKG_CONFIG@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SSL_CFLAGS = @SSL_CFLAGS@ SSL_LIBS = @SSL_LIBS@ STRIP = @STRIP@ TCLSH = @TCLSH@ TCPD_LIBS = @TCPD_LIBS@ TKL_COMPILE = @TKL_COMPILE@ VERSION = @VERSION@ VERSION_HEX = @VERSION_HEX@ VERSION_SHA1 = @VERSION_SHA1@ WIN_FILEVERSION = @WIN_FILEVERSION@ XML2_CFLAGS = @XML2_CFLAGS@ XSLTPROC_COMPILE = @XSLTPROC_COMPILE@ XSL_DIR = @XSL_DIR@ YACC = @YACC@ YAZ_CONFIG_CFLAGS = @YAZ_CONFIG_CFLAGS@ YAZ_CONF_CFLAGS = @YAZ_CONF_CFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ acx_pthread_config = @acx_pthread_config@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgconfigpath = @pkgconfigpath@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = common XMLFILES = book.xml \ gfs-options.xml gfs-virtual.xml gfs-synopsis.xml \ std-oid-table.xml bib1-diag-table.xml srw-diag-table.xml \ manref.xml local.ent HTMLFILES = index.html MANFILES = yaz-client.1 yaz-ztest.8 \ yaz-config.1 yaz.7 zoomsh.1 yaz-asncomp.1 \ yaz-marcdump.1 yaz-iconv.1 yaz-log.7 \ yaz-illclient.1 yaz-icu.1 yaz-url.1 bib1-attr.7 \ yaz-json-parse.1 yaz-record-conv.1 REFFILES = yaz-client-man.xml yaz-ztest-man.xml yaz-config-man.xml \ yaz-man.xml zoomsh-man.xml yaz-asncomp-man.xml \ yaz-marcdump-man.xml yaz-iconv-man.xml yaz-log-man.xml \ yaz-illclient-man.xml yaz-icu-man.xml yaz-url-man.xml \ bib1-attr-man.xml yaz-json-parse-man.xml yaz-record-conv-man.xml SUPPORTFILES = entities.ent apilayer.obj doc_DATA = $(HTMLFILES) apilayer.png man_MANS = $(MANFILES) EXTRA_DIST = $(XMLFILES) $(SUPPORTFILES) $(man_MANS) $(REFFILES) \ $(doc_DATA) all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): local0.ent: $(top_builddir)/config.status $(srcdir)/local0.ent.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) install-man7: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man7dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man7dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man7dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.7[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man7dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man7dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man7dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man7dir)" || exit $$?; }; \ done; } uninstall-man7: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man7dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.7[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^7][0-9a-z]*$$,7,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man7dir)'; $(am__uninstall_files_from_dir) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-recursive all-am: Makefile $(MANS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man7dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docDATA install-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-man7 install-man8 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-docDATA uninstall-man @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 uninstall-man7 uninstall-man8 .MAKE: $(am__recursive_targets) install-am install-data-am \ install-strip uninstall-am .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am dist-hook distclean distclean-generic \ distclean-libtool distclean-local distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-data-hook install-docDATA \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-man1 install-man7 install-man8 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-docDATA \ uninstall-hook uninstall-man uninstall-man1 uninstall-man7 \ uninstall-man8 .PRECIOUS: Makefile std-oid-table.xml: $(srcdir)/../src/oid.csv $(TCLSH) $(top_srcdir)/src/oidtoc.tcl $(top_srcdir)/src/oid.csv std-oid-table.xml bib1-diag-table.xml: $(srcdir)/../src/bib1.csv $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/bib1.csv bib1-diag-table.xml bib1-diag-table srw-diag-table.xml: $(srcdir)/../src/srw.csv $(TCLSH) $(srcdir)/../src/csvtodiag.tcl $(srcdir)/../src/srw.csv srw-diag-table.xml srw-diag-table yaz-client.1: $(srcdir)/yaz-client-man.xml $(MAN_COMPILE) $(srcdir)/yaz-client-man.xml yaz-ztest.8: yaz-ztest-man.xml gfs-options.xml gfs-synopsis.xml gfs-virtual.xml $(MAN_COMPILE) $(srcdir)/yaz-ztest-man.xml yaz-config.1: yaz-config-man.xml $(MAN_COMPILE) $(srcdir)/yaz-config-man.xml yaz.7: yaz-man.xml $(MAN_COMPILE) $(srcdir)/yaz-man.xml bib1-attr.7: bib1-attr-man.xml $(MAN_COMPILE) $(srcdir)/bib1-attr-man.xml zoomsh.1: zoomsh-man.xml $(MAN_COMPILE) $(srcdir)/zoomsh-man.xml yaz-asncomp.1: yaz-asncomp-man.xml $(MAN_COMPILE) $(srcdir)/yaz-asncomp-man.xml yaz-marcdump.1: yaz-marcdump-man.xml $(MAN_COMPILE) $(srcdir)/yaz-marcdump-man.xml yaz-iconv.1: yaz-iconv-man.xml $(MAN_COMPILE) $(srcdir)/yaz-iconv-man.xml yaz-illclient.1: yaz-illclient-man.xml $(MAN_COMPILE) $(srcdir)/yaz-illclient-man.xml yaz-log.7: yaz-log-man.xml $(MAN_COMPILE) $(srcdir)/yaz-log-man.xml yaz-icu.1: yaz-icu-man.xml $(MAN_COMPILE) $(srcdir)/yaz-icu-man.xml yaz-url.1: yaz-url-man.xml $(MAN_COMPILE) $(srcdir)/yaz-url-man.xml yaz-json-parse.1: yaz-json-parse-man.xml $(MAN_COMPILE) $(srcdir)/yaz-json-parse-man.xml yaz-record-conv.1: yaz-record-conv-man.xml $(MAN_COMPILE) $(srcdir)/yaz-record-conv-man.xml $(HTMLFILES): $(XMLFILES) rm -f *.html $(HTML_COMPILE) $(srcdir)/book.xml $(MANFILES): local.ent yaz.pdf: $(XMLFILES) $(PDF_COMPILE) $(srcdir)/book.xml && mv book.pdf yaz.pdf yazj.pdf: jade -E14 -D $(srcdir) -d common/print.dsl -t tex $(srcdir)/common/xml.dcl $(srcdir)/book.xml rm -f yazj.pdf cp book.tex yazj.tex pdfjadetex yazj.tex pdfjadetex yazj.tex >/dev/null pdfjadetex yazj.tex >/dev/null manref.xml: $(REFFILES) $(srcdir)/common/stripref.xsl local.ent rm -f manref.xml for i in $(REFFILES); do \ xsltproc $(srcdir)/common/stripref.xsl $(srcdir)/$$i | sed 1d >>manref.xml; \ done apilayer.png: tgif -print -xbm apilayer.obj xbmtopbm apilayer.png dist-hook: if test -f index.html; then d=.; else d="$(srcdir)"; fi; \ for p in $$d/*.html; do \ cp $$p $(distdir); \ done doc-clean: rm -f manref.xml *.html *.[0-9] *.pdf toc.hhc htmlhelp.hhp install-data-hook: if test -f index.html; then d=.; else d="$(srcdir)"; fi; \ for p in $$d/*.html; do \ $(INSTALL_DATA) $$p $(DESTDIR)$(docdir); \ done uninstall-hook: rm -r $(DESTDIR)$(docdir) distclean-local: doc-clean # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: yaz-5.34.4/doc/zoom.facets.html0000664000175000017500000001064614754707607012010 5. ZOOM Facets

5. ZOOM Facets

Facets are only supported for a few Z39.50 targets. It is a relatively new non-standard Z39.50 extension (see facets.asn in the YAZ source). However, facets are usually supported for Solr and SRU 2.0 targets.

Facets may be specified by the facets option before a search is sent. See Section 8, “Facets” for the notation. For inspection of the returned facets, the following functions are available:

    ZOOM_facet_field *ZOOM_resultset_facets(ZOOM_resultset r);

    size_t ZOOM_resultset_facets_size(ZOOM_resultset r);

    ZOOM_facet_field ZOOM_resultset_get_facet_field(ZOOM_resultset r,
                                                    const char *facet_name);

    ZOOM_facet_field ZOOM_resultset_get_facet_field_by_index(ZOOM_resultset r,
                                                             int pos);

    const char *ZOOM_facet_field_name(ZOOM_facet_field facet_field);

    size_t ZOOM_facet_field_term_count(ZOOM_facet_field facet_field);

    const char *ZOOM_facet_field_get_term(ZOOM_facet_field facet_field,
                                          size_t idx, int *freq);
   

References to temporary structures are returned by all functions. They are only valid as long the Result set is valid.

All facet fields may be returned by a call to ZOOM_resultset_facets. The length of the array is given by ZOOM_resultset_facets_size. The array is zero-based and the last entry will be at ZOOM_resultset_facets_size(result_set)-1.

Facet fields can also be fetched via its name using ZOOM_resultset_get_facet_field. Or by its index (starting from 0) by a call to ZOOM_resultset_get_facet_field_by_index. Both of these functions return NULL if name is not found or index is out of bounds.

Function ZOOM_facet_field_name gets the request facet name from a returned facet field.

Function ZOOM_facet_field_get_term returns the idx'th term and term count for a facet field. Idx must between 0 and ZOOM_facet_field_term_count-1, otherwise the returned reference will be NULL. On a valid idx, the value of the freq reference will be the term count. The freq parameter must be valid pointer to integer.

yaz-5.34.4/doc/asn.pdu.html0000664000175000017500000004653214754707607011133 4. PDU Contents Table

4. PDU Contents Table

We include, for reference, a listing of the fields of each top-level PDU, as well as their default settings.

Table 5.1. Default settings for PDU Initialize Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
protocolVersionOdr_bitmaskEmpty bitmask
optionsOdr_bitmaskEmpty bitmask
preferredMessageSizeOdr_int30*1024
maximumRecordSizeOdr_int30*1024
idAuthenticationZ_IdAuthenticationNULL
implementationIdchar*"81"
implementationNamechar*"YAZ"
implementationVersionchar*YAZ_VERSION
userInformationFieldZ_UserInformationNULL
otherInfoZ_OtherInformationNULL

Table 5.2. Default settings for PDU Initialize Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
protocolVersionOdr_bitmaskEmpty bitmask
optionsOdr_bitmaskEmpty bitmask
preferredMessageSizeOdr_int30*1024
maximumRecordSizeOdr_int30*1024
resultOdr_boolTRUE
implementationIdchar*"id)"
implementationNamechar*"YAZ"
implementationVersionchar*YAZ_VERSION
userInformationFieldZ_UserInformationNULL
otherInfoZ_OtherInformationNULL

Table 5.3. Default settings for PDU Search Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
smallSetUpperBoundOdr_int0
largeSetLowerBoundOdr_int1
mediumSetPresentNumberOdr_int0
replaceIndicatorOdr_boolTRUE
resultSetNamechar *"default"
num_databaseNamesOdr_int0
databaseNameschar **NULL
smallSetElementSetNamesZ_ElementSetNames NULL
mediumSetElementSetNamesZ_ElementSetNames NULL
preferredRecordSyntaxOdr_oidNULL
queryZ_QueryNULL
additionalSearchInfoZ_OtherInformation NULL
otherInfoZ_OtherInformationNULL

Table 5.4. Default settings for PDU Search Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
resultCountOdr_int0
numberOfRecordsReturnedOdr_int0
nextResultSetPositionOdr_int0
searchStatusOdr_boolTRUE
resultSetStatusOdr_intNULL
presentStatusOdr_intNULL
recordsZ_RecordsNULL
additionalSearchInfoZ_OtherInformationNULL
otherInfoZ_OtherInformationNULL

Table 5.5. Default settings for PDU Present Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
resultSetIdchar*"default"
resultSetStartPointOdr_int1
numberOfRecordsRequestedOdr_int10
num_rangesOdr_int0
additionalRangesZ_RangeNULL
recordCompositionZ_RecordCompositionNULL
preferredRecordSyntaxOdr_oidNULL
maxSegmentCountOdr_intNULL
maxRecordSizeOdr_intNULL
maxSegmentSizeOdr_intNULL
otherInfoZ_OtherInformationNULL

Table 5.6. Default settings for PDU Present Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
numberOfRecordsReturnedOdr_int0
nextResultSetPositionOdr_int0
presentStatusOdr_intZ_PresentStatus_success
recordsZ_RecordsNULL
otherInfoZ_OtherInformationNULL

Table 5.7. Default settings for Delete Result Set Request

FieldTypeDefault Value
referenceId Z_ReferenceIdNULL
deleteFunctionOdr_intZ_DeleteResultSetRequest_list
num_idsOdr_int0
resultSetListchar**NULL
otherInfoZ_OtherInformationNULL

Table 5.8. Default settings for Delete Result Set Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
deleteOperationStatusOdr_intZ_DeleteStatus_success
num_statusesOdr_int0
deleteListStatusesZ_ListStatus**NULL
numberNotDeletedOdr_intNULL
num_bulkStatusesOdr_int0
bulkStatusesZ_ListStatusNULL
deleteMessagechar*NULL
otherInfoZ_OtherInformationNULL

Table 5.9. Default settings for Scan Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
num_databaseNamesOdr_int0
databaseNameschar**NULL
attributeSetOdr_oidNULL
termListAndStartPointZ_AttributesPlus... NULL
stepSizeOdr_intNULL
numberOfTermsRequestedOdr_int20
preferredPositionInResponseOdr_intNULL
otherInfoZ_OtherInformationNULL

Table 5.10. Default settings for Scan Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
stepSizeOdr_intNULL
scanStatusOdr_intZ_Scan_success
numberOfEntriesReturnedOdr_int0
positionOfTermOdr_intNULL
entriesZ_ListEntriesNULL
attributeSetOdr_oidNULL
otherInfoZ_OtherInformationNULL

Table 5.11. Default settings for Trigger Resource Control Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
requestedActionOdr_int Z_TriggerResourceCtrl_resou..
prefResourceReportFormatOdr_oidNULL
resultSetWantedOdr_boolNULL
otherInfoZ_OtherInformationNULL

Table 5.12. Default settings for Resource Control Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
suspendedFlagOdr_boolNULL
resourceReportZ_ExternalNULL
partialResultsAvailableOdr_intNULL
responseRequiredOdr_boolFALSE
triggeredRequestFlagOdr_boolNULL
otherInfoZ_OtherInformationNULL

Table 5.13. Default settings for Resource Control Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
continueFlagbool_tTRUE
resultSetWantedbool_tNULL
otherInfoZ_OtherInformationNULL

Table 5.14. Default settings for Access Control Request

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
whichenumZ_AccessRequest_simpleForm;
uunionNULL
otherInfoZ_OtherInformationNULL

Table 5.15. Default settings for Access Control Response

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
whichenumZ_AccessResponse_simpleForm
uunionNULL
diagnosticZ_DiagRecNULL
otherInfoZ_OtherInformationNULL

Table 5.16. Default settings for Segment

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
numberOfRecordsReturnedOdr_intvalue=0
num_segmentRecordsOdr_int0
segmentRecordsZ_NamePlusRecordNULL
otherInfoZ_OtherInformationNULL

Table 5.17. Default settings for Close

FieldTypeDefault Value
referenceIdZ_ReferenceIdNULL
closeReasonOdr_intZ_Close_finished
diagnosticInformationchar*NULL
resourceReportFormatOdr_oidNULL
resourceFormatZ_ExternalNULL
otherInfoZ_OtherInformationNULL

yaz-5.34.4/doc/zoom.extendedservices.html0000664000175000017500000004526214754707607014111 7. Extended Services

7. Extended Services

ZOOM offers an interface to a subset of the Z39.50 extended services as well as a few privately defined ones:

To create an extended service operation, a ZOOM_package must be created. The operation is a five step operation. The package is created, package is configured by means of options, the package is sent, result is inspected (by means of options), the package is destroyed.

    ZOOM_package ZOOM_connection_package(ZOOM_connection c,
                                         ZOOM_options options);

    const char *ZOOM_package_option_get(ZOOM_package p,
                                        const char *key);
    void ZOOM_package_option_set(ZOOM_package p, const char *key,
                                 const char *val);
    void ZOOM_package_send(ZOOM_package p, const char *type);

    void ZOOM_package_destroy(ZOOM_package p);
   

The ZOOM_connection_package creates a package for the connection given using the options specified.

Functions ZOOM_package_option_get and ZOOM_package_option_set gets and sets options.

ZOOM_package_send sends the package the via connection specified in ZOOM_connection_package. The type specifies the actual extended service package type to be sent.

Table 3.6. Extended Service Type

TypeDescription
itemorderItem Order
updateRecord Update
createDatabase Create
dropDatabase Drop
commitCommit Operation

Table 3.7. Extended Service Common Options

OptionDescriptionDefault
package-nameExtended Service Request package name. Must be specified as part of a request.none
user-idUser ID of Extended Service Package. Is a request option.none
function Function of package - one of create, delete, modify. Is a request option. create
waitAction Wait action for package. Possible values: wait, waitIfPossible, dontWait or dontReturnPackage. waitIfPossible
operationStatus Read after response. One of: done, accepted or failure. Inspect with ZOOM_pacakage_option_get. none
targetReference Target Reference. This is part of the response as returned by the target. Read it after a successful operation. Inspect with ZOOM_pacakage_option_get. none
taskStatus Read after response: One of: pending, active, complete, aborted. none
esError Read after response: is set to diagnostic code for response. none
esAddinfo Read after response: is set to additional info for response. none

7.1. Item Order

For Item Order, type must be set to itemorder in ZOOM_package_send.

Table 3.8. Item Order Options

OptionDescriptionDefault
contact-nameILL contact namenone
contact-phoneILL contact phonenone
contact-emailILL contact emailnone
itemorder-setnameName of result set for recorddefault
itemorder-itemPosition for item (record) requested. An integer1

There are two variants of item order: ILL-variant and XML document variant. In order to use the XML variant the setting doc must hold the XML item order document. If that setting is unset, the ILL-variant is used.

Table 3.9. ILL Request Options

Option
protocol-version-num
transaction-id,initial-requester-id,person-or-institution-symbol,person
transaction-id,initial-requester-id,person-or-institution-symbol,institution
transaction-id,initial-requester-id,name-of-person-or-institution,name-of-person
transaction-id,initial-requester-id,name-of-person-or-institution,name-of-institution
transaction-id,transaction-group-qualifier
transaction-id,transaction-qualifier
transaction-id,sub-transaction-qualifier
service-date-time,this,date
service-date-time,this,time
service-date-time,original,date
service-date-time,original,time
requester-id,person-or-institution-symbol,person
requester-id,person-or-institution-symbol,institution
requester-id,name-of-person-or-institution,name-of-person
requester-id,name-of-person-or-institution,name-of-institution
responder-id,person-or-institution-symbol,person
responder-id,person-or-institution-symbol,institution
responder-id,name-of-person-or-institution,name-of-person
responder-id,name-of-person-or-institution,name-of-institution
transaction-type
delivery-address,postal-address,name-of-person-or-institution,name-of-person
delivery-address,postal-address,name-of-person-or-institution,name-of-institution
delivery-address,postal-address,extended-postal-delivery-address
delivery-address,postal-address,street-and-number
delivery-address,postal-address,post-office-box
delivery-address,postal-address,city
delivery-address,postal-address,region
delivery-address,postal-address,country
delivery-address,postal-address,postal-code
delivery-address,electronic-address,telecom-service-identifier
delivery-address,electronic-address,telecom-service-addreess
billing-address,postal-address,name-of-person-or-institution,name-of-person
billing-address,postal-address,name-of-person-or-institution,name-of-institution
billing-address,postal-address,extended-postal-delivery-address
billing-address,postal-address,street-and-number
billing-address,postal-address,post-office-box
billing-address,postal-address,city
billing-address,postal-address,region
billing-address,postal-address,country
billing-address,postal-address,postal-code
billing-address,electronic-address,telecom-service-identifier
billing-address,electronic-address,telecom-service-addreess
ill-service-type
requester-optional-messages,can-send-RECEIVED
requester-optional-messages,can-send-RETURNED
requester-optional-messages,requester-SHIPPED
requester-optional-messages,requester-CHECKED-IN
search-type,level-of-service
search-type,need-before-date
search-type,expiry-date
search-type,expiry-flag
place-on-hold
client-id,client-name
client-id,client-status
client-id,client-identifier
item-id,item-type
item-id,call-number
item-id,author
item-id,title
item-id,sub-title
item-id,sponsoring-body
item-id,place-of-publication
item-id,publisher
item-id,series-title-number
item-id,volume-issue
item-id,edition
item-id,publication-date
item-id,publication-date-of-component
item-id,author-of-article
item-id,title-of-article
item-id,pagination
item-id,ISBN
item-id,ISSN
item-id,additional-no-letters
item-id,verification-reference-source
copyright-complicance
retry-flag
forward-flag
requester-note
forward-note

7.2. Record Update

For Record Update, type must be set to update in ZOOM_package_send.

Table 3.10. Record Update Options

OptionDescriptionDefault
action The update action. One of specialUpdate, recordInsert, recordReplace, recordDelete, elementUpdate. specialUpdate (recordInsert for updateVersion=1 which does not support specialUpdate)
recordIdOpaqueOpaque Record IDnone
recordIdNumberRecord ID numbernone
recordIdStringRecord ID stringnone
recordThe record itselfnone
recordOpaqueSpecifies an opaque record which is encoded as an ASN.1 ANY type with the OID as given by option syntax (see below). Option recordOpaque is an alternative to record - and record option (above) is ignored if recordOpaque is set. This option is only available in YAZ 3.0.35 and later, and is meant to facilitate Updates with servers from OCLC. none
syntaxThe record syntax (transfer syntax). Is a string that is a known record syntax. no syntax
databaseNameDatabase from connection objectDefault
correlationInfo.noteCorrelation Info Note (string)none
correlationInfo.idCorrelation Info ID (integer)none
elementSetNameElement Set for Recordnone
updateVersionRecord Update version which holds one of the values 1, 2 or 3. Each version has a distinct OID: 1.2.840.10003.9.5 (first version) , 1.2.840.10003.9.5.1 (second version) and 1.2.840.10003.9.5.1.1 (third and newest version). 3

7.3. Database Create

For Database Create, type must be set to create in ZOOM_package_send.

Table 3.11. Database Create Options

OptionDescriptionDefault
databaseNameDatabase from connection objectDefault

7.4. Database Drop

For Database Drop, type must be set to drop in ZOOM_package_send.

Table 3.12. Database Drop Options

OptionDescriptionDefault
databaseNameDatabase from connection objectDefault

7.5. Commit Operation

For Commit, type must be set to commit in ZOOM_package_send.

7.6. Protocol behavior

All the extended services are Z39.50-only.

Note

The database create, drop, and commit services are privately defined operations. Refer to esadmin.asn in YAZ for the ASN.1 definitions.

yaz-5.34.4/doc/bib1-diag-table.xml0000664000175000017500000004041514754707604012212 Code Text 1 Permanent system error 2 Temporary system error 3 Unsupported search 4 Terms only exclusion (stop) words 5 Too many argument words 6 Too many boolean operators 7 Too many truncated words 8 Too many incomplete subfields 9 Truncated words too short 10 Invalid format for record number (search term) 11 Too many characters in search statement 12 Too many records retrieved 13 Present request out of range 14 System error in presenting records 15 Record no authorized to be sent intersystem 16 Record exceeds Preferred-message-size 17 Record exceeds Maximum-record-size 18 Result set not supported as a search term 19 Only single result set as search term supported 20 Only ANDing of a single result set as search term supported 21 Result set exists and replace indicator off 22 Result set naming not supported 23 Combination of specified databases not supported 24 Element set names not supported 25 Specified element set name not valid for specified database 26 Only a single element set name supported 27 Result set no longer exists - unilaterally deleted by target 28 Result set is in use 29 One of the specified databases is locked 30 Specified result set does not exist 31 Resources exhausted - no results available 32 Resources exhausted - unpredictable partial results available 33 Resources exhausted - valid subset of results available 100 Unspecified error 101 Access-control failure 102 Security challenge required but could not be issued - request terminated 103 Security challenge required but could not be issued - record not included 104 Security challenge failed - record not included 105 Terminated by negative continue response 106 No abstract syntaxes agreed to for this record 107 Query type not supported 108 Malformed query 109 Database unavailable 110 Operator unsupported 111 Too many databases specified 112 Too many result sets created 113 Unsupported attribute type 114 Unsupported Use attribute 115 Unsupported value for Use attribute 116 Use attribute required but not supplied 117 Unsupported Relation attribute 118 Unsupported Structure attribute 119 Unsupported Position attribute 120 Unsupported Truncation attribute 121 Unsupported Attribute Set 122 Unsupported Completeness attribute 123 Unsupported attribute combination 124 Unsupported coded value for term 125 Malformed search term 126 Illegal term value for attribute 127 Unparsable format for un-normalized value 128 Illegal result set name 129 Proximity search of sets not supported 130 Illegal result set in proximity search 131 Unsupported proximity relation 132 Unsupported proximity unit code 201 Proximity not supported with this attribute combination 202 Unsupported distance for proximity 203 Ordered flag not supported for proximity 205 Only zero step size supported for Scan 206 Specified step size not supported for Scan 207 Cannot sort according to sequence 208 No result set name supplied on Sort 209 Generic sort not supported (database-specific sort only supported) 210 Database specific sort not supported 211 Too many sort keys 212 Duplicate sort keys 213 Unsupported missing data action 214 Illegal sort relation 215 Illegal case value 216 Illegal missing data action 217 Segmentation: Cannot guarantee records will fit in specified segments 218 ES: Package name already in use 219 ES: no such package, on modify/delete 220 ES: quota exceeded 221 ES: extended service type not supported 222 ES: permission denied on ES - id not authorized 223 ES: permission denied on ES - cannot modify or delete 224 ES: immediate execution failed 225 ES: immediate execution not supported for this service 226 ES: immediate execution not supported for these parameters 227 No data available in requested record syntax 228 Scan: malformed scan 229 Term type not supported 230 Sort: too many input results 231 Sort: incompatible record formats 232 Scan: term list not supported 233 Scan: unsupported value of position-in-response 234 Too many index terms processed 235 Database does not exist 236 Access to specified database denied 237 Sort: illegal sort 238 Record not available in requested syntax 239 Record syntax not supported 240 Scan: Resources exhausted looking for satisfying terms 241 Scan: Beginning or end of term list 242 Segmentation: max-segment-size too small to segment record 243 Present: additional-ranges parameter not supported 244 Present: comp-spec parameter not supported 245 Type-1 query: restriction ('resultAttr') operand not supported 246 Type-1 query: 'complex' attributeValue not supported 247 Type-1 query: 'attributeSet' as part of AttributeElement not supported 1001 Malformed APDU 1002 ES: EXTERNAL form of Item Order request not supported 1003 ES: Result set item form of Item Order request not supported 1004 ES: Extended services not supported unless access control is in effect 1005 Response records in Search response not supported 1006 Response records in Search response not possible for specified database (or database combination) 1007 No Explain server. Addinfo: pointers to servers that have a surrogate Explain database for this server 1008 ES: missing mandatory parameter for specified function. Addinfo: parameter 1009 ES: Item Order, unsupported OID in itemRequest. Addinfo: OID 1010 Init/AC: Bad Userid 1011 Init/AC: Bad Userid and/or Password 1012 Init/AC: No searches remaining (pre-purchased searches exhausted) 1013 Init/AC: Incorrect interface type (specified id valid only when used with a particular access method or client) 1014 Init/AC: Authentication System error 1015 Init/AC: Maximum number of simultaneous sessions for Userid 1016 Init/AC: Blocked network address 1017 Init/AC: No databases available for specified userId 1018 Init/AC: System temporarily out of resources 1019 Init/AC: System not available due to maintenance 1020 Init/AC: System temporarily unavailable (Addinfo: when it's expected back up) 1021 Init/AC: Account has expired 1022 Init/AC: Password has expired so a new one must be supplied 1023 Init/AC: Password has been changed by an administrator so a new one must be supplied 1024 Unsupported Attribute 1025 Service not supported for this database 1026 Record cannot be opened because it is locked 1027 SQL error 1028 Record deleted 1029 Scan: too many terms requested. Addinfo: max terms supported 1040 ES: Invalid function 1041 ES: Error in retention time 1042 ES: Permissions data not understood 1043 ES: Invalid OID for task specific parameters 1044 ES: Invalid action 1045 ES: Unknown schema 1046 ES: Too many records in package 1047 ES: Invalid wait action 1048 ES: Cannot create task package -- exceeds maximum permissible size 1049 ES: Cannot return task package -- exceeds maximum permissible size 1050 ES: Extended services request too large 1051 Scan: Attribute set id required -- not supplied 1052 ES: Cannot process task package record -- exceeds maximum permissible record size for ES 1053 ES: Cannot return task package record -- exceeds maximum permissible record size for ES response 1054 Init: Required negotiation record not included 1055 Init: negotiation option required 1056 Attribute not supported for database 1057 ES: Unsupported value of task package parameter 1058 Duplicate Detection: Cannot dedup on requested record portion 1059 Duplicate Detection: Requested detection criterion not supported 1060 Duplicate Detection: Requested level of match not supported 1061 Duplicate Detection: Requested regular expression not supported 1062 Duplicate Detection: Cannot do clustering 1063 Duplicate Detection: Retention criterion not supported 1064 Duplicate Detection: Requested number (or percentage) of entries 1065 Duplicate Detection: Requested sort criterion not supported 1066 CompSpec: Unknown schema, or schema not supported. 1067 Encapsulation: Encapsulated sequence of PDUs not supported 1068 Encapsulation: Base operation (and encapsulated PDUs) not executed based on pre-screening analysis 1069 No syntaxes available for this request 1070 user not authorized to receive record(s) in requested syntax 1071 preferredRecordSyntax not supplied 1072 Query term includes characters that do not translate into the target character set 1073 Database records do not contain data associated with access point 1074 Proxy failure yaz-5.34.4/doc/yaz-ztest.80000664000175000017500000003705314754707605010734 '\" t .\" Title: yaz-ztest .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: System management commands .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ\-ZTEST" "8" "02/17/2025" "YAZ 5.34.4" "System management commands" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz-ztest \- Z39\&.50/SRU Test Server .SH "SYNOPSIS" .HP \w'\fBapplication\fR\ 'u \fBapplication\fR [\fB\-install\fR] [\fB\-installa\fR] [\fB\-remove\fR] [\fB\-a\ \fR\fB\fIfile\fR\fR] [\fB\-v\ \fR\fB\fIlevel\fR\fR] [\fB\-l\ \fR\fB\fIfile\fR\fR] [\fB\-u\ \fR\fB\fIuid\fR\fR] [\fB\-c\ \fR\fB\fIconfig\fR\fR] [\fB\-f\ \fR\fB\fIvconfig\fR\fR] [\fB\-C\ \fR\fB\fIfname\fR\fR] [\fB\-t\ \fR\fB\fIminutes\fR\fR] [\fB\-k\ \fR\fB\fIkilobytes\fR\fR] [\fB\-K\fR] [\fB\-d\ \fR\fB\fIdaemon\fR\fR] [\fB\-w\ \fR\fB\fIdir\fR\fR] [\fB\-p\ \fR\fB\fIpidfile\fR\fR] [\fB\-r\ \fR\fB\fIkilobytes\fR\fR] [\fB\-ziDSTV1\fR] [listener\-spec...] .SH "DESCRIPTION" .PP \fByaz\-ztest\fR is a Z39\&.50/SRU test server that uses the YAZ generic front\-end server (GFS) API\&. The server acts as a real Z39\&.50/SRU server but does not use a database\&. It returns a random hit count and returns a subset of a few built\-in records\&. .PP The \fIlistener\-spec\fR consists of a transport mode followed by a colon, followed by a listener address\&. The transport mode is either tcp, unix, or ssl\&. .PP For TCP and SSL, an address has the form: .sp .if n \{\ .RS 4 .\} .nf hostname | IP\-number [ : portnumber ] .fi .if n \{\ .RE .\} .PP For UNIX local socket, the address is the filename of the local socket\&. .SH "OPTIONS" .PP \-a \fIfile\fR .RS 4 Specify a file for dumping PDUs (for diagnostic purposes)\&. The special name \- (dash) sends output to stderr\&. .RE .PP \-S .RS 4 Don\*(Aqt fork or make threads on connection requests\&. This is good for debugging, but not recommended for real operation: Although the server is asynchronous and non\-blocking, it can be nice to keep a software malfunction (okay then, a crash) from affecting all current users\&. .RE .PP \-1 .RS 4 Like \-S but after one session the server exits\&. This mode is for debugging \fIonly\fR\&. .RE .PP \-T .RS 4 Operate the server in threaded mode\&. The server creates a thread for each connection rather than fork a process\&. Only available on UNIX systems that offer POSIX threads\&. .RE .PP \-s .RS 4 Use the SR protocol (obsolete)\&. .RE .PP \-z .RS 4 Use the Z39\&.50 protocol (default)\&. This option and \-s complement each other\&. You can use both multiple times on the same command line, between listener\-specifications (see below)\&. This way, you can set up the server to listen for connections in both protocols concurrently, on different local ports\&. .RE .PP \-l \fIfile\fR .RS 4 The logfile\&. .RE .PP \-c \fIconfig\fR .RS 4 A user option that serves as a specifier for some sort of configuration, usually a filename\&. The argument to this option is transferred to member configname of the statserv_options_block\&. .RE .PP \-f \fIvconfig\fR .RS 4 This specifies an XML file that describes one or more YAZ frontend virtual servers\&. .RE .PP \-C \fIfname\fR .RS 4 Sets SSL certificate file name for server (PEM)\&. .RE .PP \-v \fIlevel\fR .RS 4 The log level\&. Use a comma\-separated list of members of the set {fatal,debug,warn,log,malloc,all,none}\&. .RE .PP \-u \fIuid\fR .RS 4 Set user ID\&. Sets the real UID of the server process to that of the given user\&. It\*(Aqs useful if you aren\*(Aqt comfortable with having the server run as root, but you need to start it as such to bind a privileged port\&. .RE .PP \-w \fIdir\fR .RS 4 The server changes to this directory before listening to incoming connections\&. This option is useful when the server is operating from the inetd daemon (see \-i)\&. .RE .PP \-p \fIpidfile\fR .RS 4 Specifies that the server should write its Process ID to the file given by \fIpidfile\fR\&. A typical location would be /var/run/yaz\-ztest\&.pid\&. .RE .PP \-i .RS 4 Use this to make the the server run from the inetd server (UNIX only)\&. .RE .PP \-D .RS 4 Use this to make the server put itself in the background and run as a daemon\&. If neither \-i nor \-D is given, the server starts in the foreground\&. .RE .PP \-install .RS 4 Use this to install the server as an NT service (Windows NT/2000/XP only)\&. Control the server by going to the Services in the Control Panel\&. .RE .PP \-installa .RS 4 Use this to install the server as an NT service and mark it as "auto\-start\&. Control the server by going to the Services in the Control Panel\&. .RE .PP \-remove .RS 4 Use this to remove the server from the NT services (Windows NT/2000/XP only)\&. .RE .PP \-t \fIminutes\fR .RS 4 Idle session timeout, in minutes\&. .RE .PP \-k \fIsize\fR .RS 4 Maximum record size/message size, in kilobytes\&. .RE .PP \-K .RS 4 Forces no\-keepalive for HTTP sessions\&. By default GFS will keep sessions alive for HTTP 1\&.1 sessions (as defined by the standard)\&. Using this option will force GFS to close the connection for each operation\&. .RE .PP \-r \fIsize\fR .RS 4 Maximum size of log file before rotation occurs, in kilobytes\&. Default size is 1048576 k (=1 GB)\&. .RE .PP \-d \fIdaemon\fR .RS 4 Set name of daemon to be used in hosts access file\&. See \fBhosts_access\fR(5) and \fBtcpd\fR(8)\&. .RE .PP \-m \fItime\-format\fR .RS 4 Sets the format of time\-stamps in the log\-file\&. Specify a string in the input format to strftime()\&. .RE .PP \-V .RS 4 Display YAZ version and exit\&. .RE .SH "TESTING" .PP \fByaz\-ztest\fR normally returns a random hit count between 0 and 24\&. However, if a query term includes leading digits, then the integer value of that term is used as hit count\&. This allows testers to return any number of hits\&. \fByaz\-ztest\fR includes 24 MARC records for testing\&. Hit counts exceeding 24 will make \fByaz\-ztest\fR return the same record batch over and over\&. So record at position 1, 25, 49, etc\&. are equivalent\&. .PP For XML, if no element set is given or element has value "marcxml", MARCXML is returned (each of the 24 dummy records converted from ISO2709 to XML)\&. For element set OP, then OPAC XML is returned\&. .PP yaz\-ztest may also return predefined XML records (for testing)\&. This is enabled if YAZ_ZTEST_XML_FETCH environment variable is defined\&. A record is fetched from a file (one record per file)\&. The path for the filename is \fIF\fR\fIE\fR\&.\fId\fR\&.xml where \fIF\fR is the YAZ_ZTEST_XML_FETCH value (possibly empty), \fIE\fR is element\-set, \fId\fR is record position (starting from 1)\&. .PP The following databases are honored by \fByaz\-ztest\fR: Default, slow and db\&.* (all databases with prefix "db")\&. Any other database will make \fByaz\-ztest\fR return diagnostic 109: "Database unavailable"\&. .PP Options for search may be included in the form or URL get arguments included as part of the Z39\&.50 database name\&. The following database options are present: search\-delay, present\-delay, fetch\-delay and seed\&. .PP The former, delay type options, specify a fake delay (sleep) that \fByaz\-ztest\fR will perform when searching, presenting, fetching records respectively\&. The value of the delay may either be a fixed floating point value which specifies the delay in seconds\&. Alternatively the value may be given as two floating point numbers separated by colon, which will make \fByaz\-ztest\fR perform a random sleep between the first and second number\&. .PP The database parameter seed takes an integer as value\&. This will call srand with this integer to ensure that the random behavior can be re\-played\&. .PP Suppose we want searches to take between 0\&.1 and 0\&.5 seconds and a fetch to take 0\&.2 second\&. To access test database Default we\*(Aqd use: Default?search\-delay=0\&.1:0\&.5&fetch\-delay=0\&.2\&. .SH "GFS CONFIGURATION AND VIRTUAL HOSTS" .PP The Virtual hosts mechanism allows a YAZ front\-end server to support multiple back\-ends\&. A back\-end is selected on the basis of the TCP/IP binding (port+listening address) and/or the virtual host\&. .PP A back\-end can be configured to execute in a particular working directory\&. Or the YAZ front\-end may perform CQL to RPN conversion, thus allowing traditional Z39\&.50 back\-ends to be offered as a SRW/SRU service\&. SRW/SRU Explain information for a particular back\-end may also be specified\&. .PP For the HTTP protocol, the virtual host is specified in the Host header\&. For the Z39\&.50 protocol, the virtual host is specified as in the Initialize Request in the OtherInfo, OID 1\&.2\&.840\&.10003\&.10\&.1000\&.81\&.1\&. .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP Not all Z39\&.50 clients allow the VHOST information to be set\&. For those, the selection of the back\-end must rely on the TCP/IP information alone (port and address)\&. .sp .5v .RE .PP The YAZ front\-end server uses XML to describe the back\-end configurations\&. Command\-line option \-f specifies filename of the XML configuration\&. .PP The configuration uses the root element yazgfs\&. This element includes a list of listen elements, followed by one or more server elements\&. .PP The listen describes listener (transport end point), such as TCP/IP, Unix file socket or SSL server\&. Content for a listener: .PP CDATA (required) .RS 4 The CDATA for the listen element holds the listener string, such as tcp:@:210, tcp:server1:2100, etc\&. .RE .PP attribute id (optional) .RS 4 Identifier for this listener\&. This may be referred to from server sections\&. .RE .if n \{\ .sp .\} .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 \fBNote\fR .ps -1 .br .PP We expect more information to be added for the listen section in a future version, such as CERT file for SSL servers\&. .sp .5v .RE .PP The server describes a server and the parameters for this server type\&. Content for a server: .PP attribute id (optional) .RS 4 Identifier for this server\&. Currently not used for anything, but it might be for logging purposes\&. .RE .PP attribute listenref (optional) .RS 4 Specifies one or more listeners for this server\&. Each server ID is separated by a comma\&. If this attribute is not given, the server is accessible from all listeners\&. In order for the server to be used for real, however, the virtual host must match if specified in the configuration\&. .RE .PP element config (optional) .RS 4 Specifies the server configuration\&. This is equivalent to the config specified using command line option \-c\&. .RE .PP element directory (optional) .RS 4 Specifies a working directory for this backend server\&. If specified, the YAZ frontend changes current working directory to this directory whenever a backend of this type is started (backend handler bend_start), stopped (backend handler hand_stop) and initialized (bend_init)\&. .RE .PP element host (optional) .RS 4 Specifies the virtual host for this server\&. If this is specified a client \fImust\fR specify this host string in order to use this backend\&. .RE .PP element cql2rpn (optional) .RS 4 Specifies a filename that includes CQL to RPN conversion for this backend server\&. See ???\&. If given, the backend server will only "see" a Type\-1/RPN query\&. .RE .PP element ccl2rpn (optional) .RS 4 Specifies a filename that includes CCL to RPN conversion for this backend server\&. See ???\&. If given, the backend server will only "see" a Type\-1/RPN query\&. .RE .PP element stylesheet (optional) .RS 4 Specifies the stylesheet reference to be part of SRU HTTP responses when the client does not specify one\&. If none is given, then if the client does not specify one, then no stylesheet reference is part of the SRU HTTP response\&. .RE .PP element client_query_charset (optional) .RS 4 If specified, a conversion from the character set given to UTF\-8 is performed by the generic frontend server\&. It is only executed for Z39\&.50 search requests (SRU/Solr are assumed to be UTF\-8 encoded already)\&. .RE .PP element docpath (optional) .RS 4 Specifies a path for local file access using HTTP\&. All URLs with a leading prefix (/ excluded) that matches the value of docpath are used for file access\&. For example, if the server is to offer access in directory xsl, the docpath would be xsl and all URLs of the form http://host/xsl will result in a local file access\&. .RE .PP element explain (optional) .RS 4 Specifies SRW/SRU ZeeRex content for this server\&. Copied verbatim to the client\&. As things are now, some of the Explain content seem redundant because host information, etc\&. is also stored elsewhere\&. .RE .PP element maximumrecordsize (optional) .RS 4 Specifies maximum record size/message size, in bytes\&. This value also serves as the maximum size of \fIincoming\fR packages (for Record Updates etc)\&. It\*(Aqs the same value as that given by the \-k option\&. .RE .PP element retrievalinfo (optional) .RS 4 Enables the retrieval facility to support conversions and specifications of record formats/types\&. See ??? for more information\&. .RE .PP The XML below configures a server that accepts connections from two ports, TCP/IP port 9900 and a local UNIX file socket\&. We name the TCP/IP server public and the other server internal\&. .sp .if n \{\ .RS 4 .\} .nf tcp:@:9900 unix:/var/tmp/socket server1\&.mydomain /var/www/s1 config\&.cfg server2\&.mydomain /var/www/s2 config\&.cfg \&.\&./etc/pqf\&.properties server2\&.mydomain 9900 a /var/www/s3 config\&.cfg .fi .if n \{\ .RE .\} .PP There are three configured backend servers\&. The first two servers, "server1" and "server2", can be reached by both listener addresses\&. "server1" is reached by all (two) since no listenref attribute is specified\&. "server2" is reached by the two listeners specified\&. In order to distinguish between the two, a virtual host has been specified for each server in the host elements\&. .PP For "server2" elements for CQL to RPN conversion is supported and explain information has been added (a short one here to keep the example small)\&. .PP The third server, "server3" can only be reached via listener "internal"\&. .SH "FILES" .PP yaz\-/ztest/yaz\-ztest\&.c .PP yaz\-/include/yaz/backend\&.h .SH "SEE ALSO" .PP \fByaz\fR(7) \fByaz-log\fR(7) .SH "AUTHORS" .PP \fBIndex Data\fR yaz-5.34.4/doc/yaz-record-conv-man.xml0000664000175000017500000000602114631643521013163 %local; %entities; %idcommon; ]> YAZ &version; Index Data yaz-record-iconv 1 Commands yaz-record-conv YAZ Record Conversion Utility yaz-record-conv config fname DESCRIPTION yaz-record-conv is a program that exercises the record conversion sub system. Refer to record_conv.h header. OPTIONS -v level Sets the LOG level to level. Level is a sequence of tokens separated by comma. Each token is a integer or a named LOG item - one of fatal, debug, warn, log, malloc, all, none. EXAMPLES The following backend configuration converts MARC records (ISO2709) to Dublin-Core XML. ]]> We can convert one of the sample records from YAZ' test directory with: How to program a computer Jack Collins text Penguin eng ]]> FILES record_conv.h SEE ALSO yaz(7) yaz-5.34.4/doc/yaz.70000664000175000017500000000742514754707605007564 '\" t .\" Title: yaz .\" Author: Index Data .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 02/17/2025 .\" Manual: Conventions and miscellaneous .\" Source: YAZ 5.34.4 .\" Language: English .\" .TH "YAZ" "7" "02/17/2025" "YAZ 5.34.4" "Conventions and miscellaneous" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" yaz \- Z39\&.50 toolkit\&. .SH "DESCRIPTION" .PP YAZ is a C/C++ programmer\*(Aqs toolkit supporting the development of Z39\&.50v3 clients and servers\&. The YAZ toolkit offers several different levels of access to the ISO23950/Z39\&.50, SRU Solr (client only) and ILL protocols\&. The level that you need to use depends on your requirements, and the role (server or client) that you want to implement\&. .SH "COPYRIGHT" .PP Copyright \(co 1995\-2025 Index Data\&. .PP All rights reserved\&. .PP Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Neither the name of Index Data nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\&. .RE .PP THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS\*(Aq\*(Aq AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\&. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\&. .SH "SEE ALSO" .PP \fByaz-client\fR(1), \fByaz-ztest\fR(8), \fByaz-config\fR(8), \fBzoomsh\fR(1) \fBbib1-attr\fR(7) .PP YAZ manual ( /usr/share/doc/yaz) .PP \m[blue]\fBYAZ home page\fR\m[]\&\s-2\u[1]\d\s+2\&. .PP \m[blue]\fBZ39\&.50 Maintenance Agency Page\fR\m[]\&\s-2\u[2]\d\s+2\&. .SH "AUTHORS" .PP \fBIndex Data\fR .SH "NOTES" .IP " 1." 4 YAZ home page .RS 4 \%http://www.indexdata.com/yaz .RE .IP " 2." 4 Z39.50 Maintenance Agency Page .RS 4 \%https://www.loc.gov/z3950/agency/ .RE yaz-5.34.4/doc/list-oids.html0000664000175000017500000006350214754707607011466 Appendix A. List of Object Identifiers

Appendix A. List of Object Identifiers

These is a list of object identifiers that are built into YAZ.

NameClassConstant / OID
BER TRANSYN yaz_oid_transyn_ber
2.1.1
ISO2709 TRANSYN yaz_oid_transyn_iso2709
1.0.2709.1.1
ISOILL-1 GENERAL yaz_oid_general_isoill_1
1.0.10161.2.1
Z-APDU ABSYN yaz_oid_absyn_z_apdu
2.1
Z-BASIC APPCTX yaz_oid_appctx_z_basic
1.1
Bib-1 ATTSET yaz_oid_attset_bib_1
Z3950_PREFIX.3.1
Exp-1 ATTSET yaz_oid_attset_exp_1
Z3950_PREFIX.3.2
Ext-1 ATTSET yaz_oid_attset_ext_1
Z3950_PREFIX.3.3
CCL-1 ATTSET yaz_oid_attset_ccl_1
Z3950_PREFIX.3.4
GILS ATTSET yaz_oid_attset_gils
Z3950_PREFIX.3.5
GILS-attset ATTSET yaz_oid_attset_gils_attset
Z3950_PREFIX.3.5
STAS-attset ATTSET yaz_oid_attset_stas_attset
Z3950_PREFIX.3.6
Collections-attset ATTSET yaz_oid_attset_collections_attset
Z3950_PREFIX.3.7
CIMI-attset ATTSET yaz_oid_attset_cimi_attset
Z3950_PREFIX.3.8
Geo-attset ATTSET yaz_oid_attset_geo_attset
Z3950_PREFIX.3.9
ZBIG ATTSET yaz_oid_attset_zbig
Z3950_PREFIX.3.10
Util ATTSET yaz_oid_attset_util
Z3950_PREFIX.3.11
XD-1 ATTSET yaz_oid_attset_xd_1
Z3950_PREFIX.3.12
Zthes ATTSET yaz_oid_attset_zthes
Z3950_PREFIX.3.13
Fin-1 ATTSET yaz_oid_attset_fin_1
Z3950_PREFIX.3.14
Dan-1 ATTSET yaz_oid_attset_dan_1
Z3950_PREFIX.3.15
Holdings ATTSET yaz_oid_attset_holdings
Z3950_PREFIX.3.16
MARC ATTSET yaz_oid_attset_marc
Z3950_PREFIX.3.17
Bib-2 ATTSET yaz_oid_attset_bib_2
Z3950_PREFIX.3.18
ZeeRex ATTSET yaz_oid_attset_zeerex
Z3950_PREFIX.3.19
Thesaurus-attset ATTSET yaz_oid_attset_thesaurus_attset
Z3950_PREFIX.3.1000.81.1
IDXPATH ATTSET yaz_oid_attset_idxpath
Z3950_PREFIX.3.1000.81.2
EXTLITE ATTSET yaz_oid_attset_extlite
Z3950_PREFIX.3.1000.81.3
Bib-1 DIAGSET yaz_oid_diagset_bib_1
Z3950_PREFIX.4.1
Diag-1 DIAGSET yaz_oid_diagset_diag_1
Z3950_PREFIX.4.2
Diag-ES DIAGSET yaz_oid_diagset_diag_es
Z3950_PREFIX.4.3
Diag-General DIAGSET yaz_oid_diagset_diag_general
Z3950_PREFIX.4.3
Unimarc RECSYN yaz_oid_recsyn_unimarc
Z3950_PREFIX.5.1
Intermarc RECSYN yaz_oid_recsyn_intermarc
Z3950_PREFIX.5.2
CCF RECSYN yaz_oid_recsyn_ccf
Z3950_PREFIX.5.3
USmarc RECSYN yaz_oid_recsyn_usmarc
Z3950_PREFIX.5.10
MARC21 RECSYN yaz_oid_recsyn_marc21
Z3950_PREFIX.5.10
UKmarc RECSYN yaz_oid_recsyn_ukmarc
Z3950_PREFIX.5.11
Normarc RECSYN yaz_oid_recsyn_normarc
Z3950_PREFIX.5.12
Librismarc RECSYN yaz_oid_recsyn_librismarc
Z3950_PREFIX.5.13
Danmarc RECSYN yaz_oid_recsyn_danmarc
Z3950_PREFIX.5.14
Finmarc RECSYN yaz_oid_recsyn_finmarc
Z3950_PREFIX.5.15
MAB RECSYN yaz_oid_recsyn_mab
Z3950_PREFIX.5.16
Canmarc RECSYN yaz_oid_recsyn_canmarc
Z3950_PREFIX.5.17
SBN RECSYN yaz_oid_recsyn_sbn
Z3950_PREFIX.5.18
Picamarc RECSYN yaz_oid_recsyn_picamarc
Z3950_PREFIX.5.19
Ausmarc RECSYN yaz_oid_recsyn_ausmarc
Z3950_PREFIX.5.20
Ibermarc RECSYN yaz_oid_recsyn_ibermarc
Z3950_PREFIX.5.21
Carmarc RECSYN yaz_oid_recsyn_carmarc
Z3950_PREFIX.5.22
Malmarc RECSYN yaz_oid_recsyn_malmarc
Z3950_PREFIX.5.23
JPmarc RECSYN yaz_oid_recsyn_jpmarc
Z3950_PREFIX.5.24
SWEmarc RECSYN yaz_oid_recsyn_swemarc
Z3950_PREFIX.5.25
SIGLEmarc RECSYN yaz_oid_recsyn_siglemarc
Z3950_PREFIX.5.26
ISDSmarc RECSYN yaz_oid_recsyn_isdsmarc
Z3950_PREFIX.5.27
RUSmarc RECSYN yaz_oid_recsyn_rusmarc
Z3950_PREFIX.5.28
Hunmarc RECSYN yaz_oid_recsyn_hunmarc
Z3950_PREFIX.5.29
NACSIS-CATP RECSYN yaz_oid_recsyn_nacsis_catp
Z3950_PREFIX.5.30
FINMARC2000 RECSYN yaz_oid_recsyn_finmarc2000
Z3950_PREFIX.5.31
MARC21-fin RECSYN yaz_oid_recsyn_marc21_fin
Z3950_PREFIX.5.32
Explain RECSYN yaz_oid_recsyn_explain
Z3950_PREFIX.5.100
SUTRS RECSYN yaz_oid_recsyn_sutrs
Z3950_PREFIX.5.101
OPAC RECSYN yaz_oid_recsyn_opac
Z3950_PREFIX.5.102
Summary RECSYN yaz_oid_recsyn_summary
Z3950_PREFIX.5.103
GRS-0 RECSYN yaz_oid_recsyn_grs_0
Z3950_PREFIX.5.104
GRS-1 RECSYN yaz_oid_recsyn_grs_1
Z3950_PREFIX.5.105
Extended RECSYN yaz_oid_recsyn_extended
Z3950_PREFIX.5.106
Fragment RECSYN yaz_oid_recsyn_fragment
Z3950_PREFIX.5.107
pdf RECSYN yaz_oid_recsyn_pdf
Z3950_PREFIX.5.109.1
postscript RECSYN yaz_oid_recsyn_postscript
Z3950_PREFIX.5.109.2
html RECSYN yaz_oid_recsyn_html
Z3950_PREFIX.5.109.3
tiff RECSYN yaz_oid_recsyn_tiff
Z3950_PREFIX.5.109.4
gif RECSYN yaz_oid_recsyn_gif
Z3950_PREFIX.5.109.5
jpeg RECSYN yaz_oid_recsyn_jpeg
Z3950_PREFIX.5.109.6
png RECSYN yaz_oid_recsyn_png
Z3950_PREFIX.5.109.7
mpeg RECSYN yaz_oid_recsyn_mpeg
Z3950_PREFIX.5.109.8
sgml RECSYN yaz_oid_recsyn_sgml
Z3950_PREFIX.5.109.9
tiff-b RECSYN yaz_oid_recsyn_tiff_b
Z3950_PREFIX.5.110.1
wav RECSYN yaz_oid_recsyn_wav
Z3950_PREFIX.5.110.2
SQL-RS RECSYN yaz_oid_recsyn_sql_rs
Z3950_PREFIX.5.111
SOIF RECSYN yaz_oid_recsyn_soif
Z3950_PREFIX.5.1000.81.2
JSON RECSYN yaz_oid_recsyn_json
Z3950_PREFIX.5.1000.81.3
XML RECSYN yaz_oid_recsyn_xml
Z3950_PREFIX.5.109.10
text-XML RECSYN yaz_oid_recsyn_text_xml
Z3950_PREFIX.5.109.10
application-XML RECSYN yaz_oid_recsyn_application_xml
Z3950_PREFIX.5.109.11
Resource-1 RESFORM yaz_oid_resform_resource_1
Z3950_PREFIX.7.1
Resource-2 RESFORM yaz_oid_resform_resource_2
Z3950_PREFIX.7.2
UNIverse-Resource-Report RESFORM yaz_oid_resform_universe_resource_report
Z3950_PREFIX.7.1000.81.1
Prompt-1 ACCFORM yaz_oid_accform_prompt_1
Z3950_PREFIX.8.1
Des-1 ACCFORM yaz_oid_accform_des_1
Z3950_PREFIX.8.2
Krb-1 ACCFORM yaz_oid_accform_krb_1
Z3950_PREFIX.8.3
Persistent set EXTSERV yaz_oid_extserv_persistent_set
Z3950_PREFIX.9.1
Persistent query EXTSERV yaz_oid_extserv_persistent_query
Z3950_PREFIX.9.2
Periodic query EXTSERV yaz_oid_extserv_periodic_query
Z3950_PREFIX.9.3
Item order EXTSERV yaz_oid_extserv_item_order
Z3950_PREFIX.9.4
Database Update (first version) EXTSERV yaz_oid_extserv_database_update_first_version
Z3950_PREFIX.9.5
Database Update (second version) EXTSERV yaz_oid_extserv_database_update_second_version
Z3950_PREFIX.9.5.1
Database Update EXTSERV yaz_oid_extserv_database_update
Z3950_PREFIX.9.5.1.1
exp. spec. EXTSERV yaz_oid_extserv_exp__spec_
Z3950_PREFIX.9.6
exp. inv. EXTSERV yaz_oid_extserv_exp__inv_
Z3950_PREFIX.9.7
Admin EXTSERV yaz_oid_extserv_admin
Z3950_PREFIX.9.1000.81.1
searchResult-1 USERINFO yaz_oid_userinfo_searchresult_1
Z3950_PREFIX.10.1
CharSetandLanguageNegotiation USERINFO yaz_oid_userinfo_charsetandlanguagenegotiation
Z3950_PREFIX.10.2
UserInfo-1 USERINFO yaz_oid_userinfo_userinfo_1
Z3950_PREFIX.10.3
MultipleSearchTerms-1 USERINFO yaz_oid_userinfo_multiplesearchterms_1
Z3950_PREFIX.10.4
MultipleSearchTerms-2 USERINFO yaz_oid_userinfo_multiplesearchterms_2
Z3950_PREFIX.10.5
DateTime USERINFO yaz_oid_userinfo_datetime
Z3950_PREFIX.10.6
Proxy USERINFO yaz_oid_userinfo_proxy
Z3950_PREFIX.10.1000.81.1
Cookie USERINFO yaz_oid_userinfo_cookie
Z3950_PREFIX.10.1000.81.2
Client-IP USERINFO yaz_oid_userinfo_client_ip
Z3950_PREFIX.10.1000.81.3
Scan-Set USERINFO yaz_oid_userinfo_scan_set
Z3950_PREFIX.10.1000.81.4
Facet-1 USERINFO yaz_oid_userinfo_facet_1
Z3950_PREFIX.10.1000.81.5
Espec-1 ELEMSPEC yaz_oid_elemspec_espec_1
Z3950_PREFIX.11.1
Variant-1 VARSET yaz_oid_varset_variant_1
Z3950_PREFIX.12.1
WAIS-schema SCHEMA yaz_oid_schema_wais_schema
Z3950_PREFIX.13.1
GILS-schema SCHEMA yaz_oid_schema_gils_schema
Z3950_PREFIX.13.2
Collections-schema SCHEMA yaz_oid_schema_collections_schema
Z3950_PREFIX.13.3
Geo-schema SCHEMA yaz_oid_schema_geo_schema
Z3950_PREFIX.13.4
CIMI-schema SCHEMA yaz_oid_schema_cimi_schema
Z3950_PREFIX.13.5
Update ES SCHEMA yaz_oid_schema_update_es
Z3950_PREFIX.13.6
Holdings SCHEMA yaz_oid_schema_holdings
Z3950_PREFIX.13.7
Zthes SCHEMA yaz_oid_schema_zthes
Z3950_PREFIX.13.8
thesaurus-schema SCHEMA yaz_oid_schema_thesaurus_schema
Z3950_PREFIX.13.1000.81.1
Explain-schema SCHEMA yaz_oid_schema_explain_schema
Z3950_PREFIX.13.1000.81.2
TagsetM TAGSET yaz_oid_tagset_tagsetm
Z3950_PREFIX.14.1
TagsetG TAGSET yaz_oid_tagset_tagsetg
Z3950_PREFIX.14.2
STAS-tagset TAGSET yaz_oid_tagset_stas_tagset
Z3950_PREFIX.14.3
GILS-tagset TAGSET yaz_oid_tagset_gils_tagset
Z3950_PREFIX.14.4
Collections-tagset TAGSET yaz_oid_tagset_collections_tagset
Z3950_PREFIX.14.5
CIMI-tagset TAGSET yaz_oid_tagset_cimi_tagset
Z3950_PREFIX.14.6
thesaurus-tagset TAGSET yaz_oid_tagset_thesaurus_tagset
Z3950_PREFIX.14.1000.81.1
Explain-tagset TAGSET yaz_oid_tagset_explain_tagset
Z3950_PREFIX.14.1000.81.2
Zthes-tagset TAGSET yaz_oid_tagset_zthes_tagset
Z3950_PREFIX.14.8
Charset-3 NEGOT yaz_oid_negot_charset_3
Z3950_PREFIX.15.3
Charset-4 NEGOT yaz_oid_negot_charset_4
Z3950_PREFIX.15.4
Charset-ID NEGOT yaz_oid_negot_charset_id
Z3950_PREFIX.15.1000.81.1
CQL USERINFO yaz_oid_userinfo_cql
Z3950_PREFIX.16.2
UCS-2 GENERAL yaz_oid_general_ucs_2
1.0.10646.1.0.2
UCS-4 GENERAL yaz_oid_general_ucs_4
1.0.10646.1.0.4
UTF-16 GENERAL yaz_oid_general_utf_16
1.0.10646.1.0.5
UTF-8 GENERAL yaz_oid_general_utf_8
1.0.10646.1.0.8
OCLC-userInfo USERINFO yaz_oid_userinfo_oclc_userinfo
Z3950_PREFIX.10.1000.17.1
XML-ES EXTSERV yaz_oid_extserv_xml_es
Z3950_PREFIX.9.1000.105.4
yaz-5.34.4/doc/odr.debugging.html0000664000175000017500000000440614754707607012273 4. Debugging

4. Debugging

The protocol modules are suffering somewhat from a lack of diagnostic tools at the moment. Specifically ways to pretty-print PDUs that aren't recognized by the system. We'll include something to this end in a not-too-distant release. In the meantime, what we do when we get packages we don't understand is to compile the ODR module with ODR_DEBUG defined. This causes the module to dump tracing information as it processes data units. With this output and the protocol specification (Z39.50), it is generally fairly easy to see what goes wrong.

yaz-5.34.4/Doxyfile.in0000664000175000017500000031771114631643521010227 # Doxyfile 1.8.11 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. # # All text after a double hash (##) is considered a comment and is placed in # front of the TAG it is preceding. # # All text after a single hash (#) is considered a comment and will be ignored. # The format is: # TAG = value [value, ...] # For lists, items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (\" \"). #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all text # before the first occurrence of this tag. Doxygen uses libiconv (or the iconv # built into libc) for the transcoding. See http://www.gnu.org/software/libiconv # for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by # double-quotes, unless you are using Doxywizard) that should identify the # project for which the documentation is generated. This name is used in the # title of most generated pages and in a few other places. # The default value is: My Project. PROJECT_NAME = YAZ # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. PROJECT_NUMBER = @VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. PROJECT_BRIEF = # With the PROJECT_LOGO tag one can specify a logo or an icon that is included # in the documentation. The maximum height of the logo should not exceed 55 # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. PROJECT_LOGO = # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. OUTPUT_DIRECTORY = dox # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and # will distribute the generated files over these directories. Enabling this # option can be useful when feeding doxygen a huge amount of source files, where # putting all generated files in the same directory would otherwise causes # performance problems for the file system. # The default value is: NO. CREATE_SUBDIRS = NO # If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII # characters to appear in the names of generated files. If set to NO, non-ASCII # characters will be escaped, for example _xE3_x81_x84 will be used for Unicode # U+3044. # The default value is: NO. ALLOW_UNICODE_NAMES = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, # Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), # Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, # Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, # Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, # Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, # Ukrainian and Vietnamese. # The default value is: English. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. # The default value is: YES. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief # description of a member or function before the detailed description # # Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. # The default value is: YES. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator that is # used to form the text in various listings. Each string in this list, if found # as the leading text of the brief description, will be stripped from the text # and the result, after processing the whole list, is used as the annotated # text. Otherwise, the brief description is used as-is. If left blank, the # following values are used ($name is automatically replaced with the name of # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief # description. # The default value is: NO. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. # The default value is: NO. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path # before files name in the file list and in the header files. If set to NO the # shortest path that makes the file name unique will be used # The default value is: YES. FULL_PATH_NAMES = NO # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand # part of the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the path to # strip. # # Note that you can specify absolute paths here, but also relative paths, which # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which # header file to include in order to use a class. If left blank only the name of # the header file containing the class definition is used. Otherwise one should # specify the list of include paths that are normally passed to the compiler # using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't # support long names like on DOS, Mac, or CD-ROM. # The default value is: NO. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the # first line (until the first dot) of a Javadoc-style comment as the brief # description. If set to NO, the Javadoc-style will behave just like regular Qt- # style comments (thus requiring an explicit @brief command for a brief # description.) # The default value is: NO. JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first # line (until the first dot) of a Qt-style comment as the brief description. If # set to NO, the Qt-style will behave just like regular Qt-style comments (thus # requiring an explicit \brief command for a brief description.) # The default value is: NO. QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a # multi-line C++ special comment block (i.e. a block of //! or /// comments) as # a brief description. This used to be the default behavior. The new default is # to treat a multi-line C++ comment block as a detailed description. Set this # tag to YES if you prefer the old behavior instead. # # Note that setting this tag to YES also means that rational rose comments are # not recognized any more. # The default value is: NO. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the # documentation from any documented member that it re-implements. # The default value is: YES. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new # page for each member. If set to NO, the documentation of a member will be part # of the file/class/namespace that contains it. # The default value is: NO. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen # uses this value to replace tabs by spaces in code fragments. # Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that act as commands in # the documentation. An alias has the form: # name=value # For example adding # "sideeffect=@par Side Effects:\n" # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert # newlines. ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For # instance, some of the names that are used will be different. The list of all # members will be omitted, etc. # The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or # Python sources only. Doxygen will then generate output that is more tailored # for that language. For instance, namespaces will be presented as packages, # qualified scopes will look different, etc. # The default value is: NO. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources. Doxygen will then generate output that is tailored for Fortran. # The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for VHDL. # The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, # C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: # FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: # Fortran. In the later case the parser tries to guess whether the code is fixed # or free formatted code, this is the default for Fortran type files), VHDL. For # instance to make doxygen treat .inc files as Fortran files (default is PHP), # and .f files as C (default is Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable # documentation. See http://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. # The default value is: YES. MARKDOWN_SUPPORT = YES # When enabled doxygen tries to link words that correspond to documented # classes, or namespaces to their corresponding documentation. Such a link can # be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. # The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should set this # tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); # versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. # The default value is: NO. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. # The default value is: NO. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: # http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate # getter and setter methods for a property. Setting this option to YES will make # doxygen to replace the get and set methods by a property in the documentation. # This will only work if the methods are indeed getting or setting a simple # type. If this is not the case, or you want to show the methods anyway, you # should set this option to NO. # The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. # The default value is: NO. DISTRIBUTE_GROUP_DOC = NO # If one adds a struct or class to a group and this option is enabled, then also # any nested class or struct is added to the same group. By default this option # is disabled and one has to add nested compounds explicitly via \ingroup. # The default value is: NO. GROUP_NESTED_COMPOUNDS = NO # Set the SUBGROUPING tag to YES to allow class member groups of the same type # (for instance a group of public functions) to be put as a subgroup of that # type (e.g. under the Public Functions section). Set it to NO to prevent # subgrouping. Alternatively, this can be done per class using the # \nosubgrouping command. # The default value is: YES. SUBGROUPING = YES # When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions # are shown inside the group in which they are included (e.g. using \ingroup) # instead of on a separate page (for HTML and Man pages) or section (for LaTeX # and RTF). # # Note that this feature does not work in combination with # SEPARATE_MEMBER_PAGES. # The default value is: NO. INLINE_GROUPED_CLASSES = NO # When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set # to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. INLINE_SIMPLE_STRUCTS = NO # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or # enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically be # useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. # The default value is: NO. TYPEDEF_HIDES_STRUCT = NO # The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This # cache is used to resolve symbols given their name and scope. Since this can be # an expensive process and often the same symbol appears multiple times in the # code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small # doxygen will become slower. If the cache is too large, memory is wasted. The # cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range # is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 # symbols. At the end of a run doxygen will report the cache usage and suggest # the optimal cache size from a speed point of view. # Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in # documentation are documented, even if no documentation was available. Private # class members and static file members will be hidden unless the # EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. # Note: This will also disable the warnings about undocumented members that are # normally produced when WARNINGS is set to YES. # The default value is: NO. EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will # be included in the documentation. # The default value is: NO. EXTRACT_PRIVATE = YES # If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal # scope will be included in the documentation. # The default value is: NO. EXTRACT_PACKAGE = NO # If the EXTRACT_STATIC tag is set to YES, all static members of a file will be # included in the documentation. # The default value is: NO. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined # locally in source files will be included in the documentation. If set to NO, # only classes defined in header files are included. Does not have any effect # for Java sources. # The default value is: YES. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. If set to YES, local methods, # which are defined in the implementation section but not in the interface are # included in the documentation. If set to NO, only methods in the interface are # included. # The default value is: NO. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base name of # the file that contains the anonymous namespace. By default anonymous namespace # are hidden. # The default value is: NO. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all # undocumented members inside documented classes or files. If set to NO these # members will be included in the various overviews, but no documentation # section is generated. This option has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. If set # to NO, these classes will be included in the various overviews. This option # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be # included in the documentation. # The default value is: NO. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any # documentation blocks found inside the body of a function. If set to NO, these # blocks will be appended to the function's detailed documentation block. # The default value is: NO. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation that is typed after a # \internal command is included. If the tag is set to NO then the documentation # will be excluded. Set it to YES to include the internal documentation. # The default value is: NO. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file # names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. # The default value is: system dependent. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with # their full class and namespace scopes in the documentation. If set to YES, the # scope will be hidden. # The default value is: NO. HIDE_SCOPE_NAMES = NO # If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will # append additional text to a page's title, such as Class Reference. If set to # YES the compound reference will be hidden. # The default value is: NO. HIDE_COMPOUND_REFERENCE= NO # If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of # the files that are included by a file in the documentation of that file. # The default value is: YES. SHOW_INCLUDE_FILES = YES # If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each # grouped member an include statement to the documentation, telling the reader # which file to include in order to use the member. # The default value is: NO. SHOW_GROUPED_MEMB_INC = NO # If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. FORCE_LOCAL_INCLUDES = NO # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. # The default value is: YES. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the # (detailed) documentation of file and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. # The default value is: YES. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief # descriptions of file, namespace and class members alphabetically by member # name. If set to NO, the members will appear in declaration order. Note that # this will also influence the order of the classes in the class list. # The default value is: NO. SORT_BRIEF_DOCS = NO # If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the # (brief and detailed) documentation of class members so that constructors and # destructors are listed first. If set to NO the constructors will appear in the # respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. # Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief # member documentation. # Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting # detailed member documentation. # The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy # of group names into alphabetical order. If set to NO the group names will # appear in their defined order. # The default value is: NO. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by # fully-qualified names, including namespaces. If set to NO, the class list will # be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the alphabetical # list. # The default value is: NO. SORT_BY_SCOPE_NAME = NO # If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper # type resolution of all parameters of a function it will reject a match between # the prototype and the implementation of a member function even if there is # only one candidate or it is obvious which candidate to choose by doing a # simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still # accept a match between prototype and implementation in such cases. # The default value is: NO. STRICT_PROTO_MATCHING = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo # list. This list is created by putting \todo commands in the documentation. # The default value is: YES. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test # list. This list is created by putting \test commands in the documentation. # The default value is: YES. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug # list. This list is created by putting \bug commands in the documentation. # The default value is: YES. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) # the deprecated list. This list is created by putting \deprecated commands in # the documentation. # The default value is: YES. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional documentation # sections, marked by \if ... \endif and \cond # ... \endcond blocks. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the # documentation. If the initializer consists of more lines than specified here # it will be hidden. Use a value of 0 to hide initializers completely. The # appearance of the value of individual variables and macros / defines can be # controlled using \showinitializer or \hideinitializer command in the # documentation regardless of this setting. # Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated at # the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. # The default value is: YES. SHOW_USED_FILES = YES # Set the SHOW_FILES tag to NO to disable the generation of the Files page. This # will remove the Files entry from the Quick Index and from the Folder Tree View # (if specified). # The default value is: YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces # page. This will remove the Namespaces entry from the Quick Index and from the # Folder Tree View (if specified). # The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command command input-file, where command is the value of the # FILE_VERSION_FILTER tag, and input-file is the name of an input file provided # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated # output files in an output format independent way. To create the layout file # that represents doxygen's defaults, run doxygen with the -l option. You can # optionally specify a file name after the option, if omitted DoxygenLayout.xml # will be used as the name of the layout file. # # Note that if you run doxygen from a directory containing a file called # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool # to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated to # standard output by doxygen. If QUIET is set to YES this implies that the # messages are off. # The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated to standard error (stderr) by doxygen. If WARNINGS is set to YES # this implies that the warnings are on. # # Tip: Turn warnings on while writing the documentation. # The default value is: YES. WARNINGS = YES # If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate # warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag # will automatically be disabled. # The default value is: YES. WARN_IF_UNDOCUMENTED = YES # If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some parameters # in a documented function, or documenting parameters that don't exist or using # markup commands wrongly. # The default value is: YES. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete # parameter documentation, but not about the absence of documentation. # The default value is: NO. WARN_NO_PARAMDOC = NO # If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when # a warning is encountered. # The default value is: NO. WARN_AS_ERROR = NO # The WARN_FORMAT tag determines the format of the warning messages that doxygen # can produce. The string should contain the $file, $line, and $text tags, which # will be replaced by the file and line number from which the warning originated # and the warning text. Optionally the format may contain $version, which will # be replaced by the version of the file (if it could be obtained via # FILE_VERSION_FILTER) # The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text " # The WARN_LOGFILE tag can be used to specify a file to which warning and error # messages should be written. If left blank the output is written to standard # error (stderr). WARN_LOGFILE = #--------------------------------------------------------------------------- # Configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag is used to specify the files and/or directories that contain # documented source files. You may enter file names like myfile.cpp or # directories like /usr/src/myproject. Separate the files or directories with # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. INPUT = src \ ztest \ include # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv # documentation (see: http://www.gnu.org/software/libiconv) for the list of # possible encodings. # The default value is: UTF-8. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and # *.h) to filter out the source-files in the directories. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # read by doxygen. # # If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f, *.for, *.tcl, # *.vhd, *.vhdl, *.ucf, *.qsf, *.as and *.js. FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. # The default value is: NO. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. # # Note that relative paths are relative to the directory from which doxygen is # run. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. # The default value is: NO. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test # # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands # irrespective of the value of the RECURSIVE tag. # The default value is: NO. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or directories # that contain images that are to be included in the documentation (see the # \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command: # # # # where is the value of the INPUT_FILTER tag, and is the # name of an input file. Doxygen will then use the output that the filter # program writes to standard output. If FILTER_PATTERNS is specified, this tag # will be ignored. # # Note that the filter must not add or remove lines; it is applied before the # code is scanned, but not when the output code is generated. If lines are added # or removed, the anchors will not be placed correctly. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: pattern=filter # (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how # filters are used. If the FILTER_PATTERNS tag is empty or if none of the # patterns match the file name, INPUT_FILTER is applied. # # Note that for custom extensions or not directly supported extensions you also # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for # producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). # The default value is: NO. FILTER_SOURCE_FILES = NO # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file # pattern. A pattern will override the setting for FILTER_PATTERN (if any) and # it is also possible to disable source filtering for a specific pattern using # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will be # generated. Documented entities will be cross-referenced with these sources. # # Note: To get rid of all source code in the generated output, make sure that # also VERBATIM_HEADERS is set to NO. # The default value is: NO. SOURCE_BROWSER = YES # Setting the INLINE_SOURCES tag to YES will include the body of functions, # classes and enums directly into the documentation. # The default value is: NO. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any # special comment blocks from generated source code fragments. Normal C, C++ and # Fortran comments will always remain visible. # The default value is: YES. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented # function all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES then for each documented function # all documented entities called/used by that function will be listed. # The default value is: NO. REFERENCES_RELATION = YES # If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set # to YES then the hyperlinks from functions in REFERENCES_RELATION and # REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will # link to the documentation. # The default value is: YES. REFERENCES_LINK_SOURCE = YES # If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the # source code will show a tooltip with additional information such as prototype, # brief description and links to the definition and documentation. Since this # will make the HTML file larger and loading of large files a bit slower, you # can opt to disable this feature. # The default value is: YES. # This tag requires that the tag SOURCE_BROWSER is set to YES. SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system # (see http://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global # - Enable SOURCE_BROWSER and USE_HTAGS in the config file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # # Doxygen will invoke htags (and that will in turn invoke gtags), so these # tools must be available from the command line (i.e. in the search path). # # The result: instead of the source browser generated by doxygen, the links to # source code will now point to the output of htags. # The default value is: NO. # This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a # verbatim copy of the header file for each class for which an include is # specified. Set to NO to disable this. # See also: Section \class. # The default value is: YES. VERBATIM_HEADERS = YES # If the CLANG_ASSISTED_PARSING tag is set to YES then doxygen will use the # clang parser (see: http://clang.llvm.org/) for more accurate parsing at the # cost of reduced performance. This can be particularly helpful with template # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was # generated with the -Duse-libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO # If clang assisted parsing is enabled you can provide the compiler with command # line options that you would normally use when invoking the compiler. Note that # the include paths will already be set by doxygen for the files and directories # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. CLANG_OPTIONS = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all # compounds will be generated. Enable this if the project contains a lot of # classes, structs, unions or interfaces. # The default value is: YES. ALPHABETICAL_INDEX = NO # The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in # which the alphabetical index list will be split. # Minimum value: 1, maximum value: 20, default value: 5. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all classes will # be put under the same header in the alphabetical index. The IGNORE_PREFIX tag # can be used to specify a prefix (or a list of prefixes) that should be ignored # while generating the index headers. # This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output # The default value is: YES. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a # relative path is entered the value of OUTPUT_DIRECTORY will be put in front of # it. # The default directory is: html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for each # generated HTML page (for example: .htm, .php, .asp). # The default value is: .html. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a user-defined HTML header file for # each generated HTML page. If the tag is left blank doxygen will generate a # standard header. # # To get valid HTML the header file that includes any scripts and style sheets # that doxygen needs, which is dependent on the configuration options used (e.g. # the setting GENERATE_TREEVIEW). It is highly recommended to start with a # default header using # doxygen -w html new_header.html new_footer.html new_stylesheet.css # YourConfigFile # and then modify the file new_header.html. See also section "Doxygen usage" # for information on how to generate the default header that doxygen normally # uses. # Note: The header is subject to change so you typically have to regenerate the # default header when upgrading to a newer version of doxygen. For a description # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard # footer. See HTML_HEADER for more information on how to generate a default # footer and what special commands can be used inside the footer. See also # section "Doxygen usage" for information on how to generate the default footer # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of # the HTML output. If left blank doxygen will generate a default style sheet. # See also section "Doxygen usage" for information on how to generate the style # sheet that doxygen normally uses. # Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as # it is more robust and this tag (HTML_STYLESHEET) will in the future become # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the # standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet files to the output directory. # Note: The order of the extra style sheet files is of importance (e.g. the last # style sheet in the list overrules the setting of the previous ones in the # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the # $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these # files. In the HTML_STYLESHEET file, use the file name only. Also note that the # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see # http://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 # The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors # in the HTML output. For a value of 0 the output will use grayscales only. A # value of 255 will produce the most vivid colors. # Minimum value: 0, maximum value: 255, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 # The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the # luminance component of the colors in the HTML output. Values below 100 # gradually make the output lighter, whereas values above 100 make the output # darker. The value divided by 100 is the actual gamma applied, so 80 represents # a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not # change the gamma. # Minimum value: 40, maximum value: 240, default value: 80. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML # page will contain the date and time when the page was generated. Setting this # to YES can help to show when doxygen was last run and thus if the # documentation is up to date. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = NO # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = NO # With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries # shown in the various tree structured indices initially; the user can expand # and collapse entries dynamically later on. Doxygen will expand the tree to # such a level that at most the specified number of entries are visible (unless # a fully collapsed tree already exceeds this amount). So setting the number of # entries 1 will produce a full collapsed tree by default. 0 is a special value # representing an infinite number of entries and will result in a full expanded # tree by default. # Minimum value: 0, maximum value: 9999, default value: 100. # This tag requires that the tag GENERATE_HTML is set to YES. HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development # environment (see: http://developer.apple.com/tools/xcode/), introduced with # OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at # startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html # for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO # This tag determines the name of the docset feed. A documentation feed provides # an umbrella under which multiple documentation sets from a single provider # (such as a company or product suite) can be grouped. # The default value is: Doxygen generated docs. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "Doxygen generated docs" # This tag specifies a string that should uniquely identify the documentation # set bundle. This should be a reverse domain-name style string, e.g. # com.mycompany.MyDocSet. Doxygen will append .docset to the name. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = org.doxygen.Project # The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. # The default value is: org.doxygen.Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher # The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. # The default value is: Publisher. # This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop # (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output # generated by doxygen into a single compiled HTML file (.chm). Compiled HTML # files are now used as the Windows 98 help format, and will replace the old # Windows help format (.hlp) on all Windows platforms in the future. Compressed # HTML files also contain an index, a table of contents, and you can search for # words in the documentation. The HTML workshop also contains a viewer for # compressed HTML files. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO # The CHM_FILE tag can be used to specify the file name of the resulting .chm # file. You can add a path in front of the file if the result should not be # written to the html output directory. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = # The HHC_LOCATION tag can be used to specify the location (absolute path # including file name) of the HTML help compiler (hhc.exe). If non-empty, # doxygen will try to run the HTML help compiler on the generated index.hhp. # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO # The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it # enables the Previous and Next buttons. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members to # the table of contents of the HTML help documentation and to the tree view. # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that # can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help # (.qch) of the generated HTML documentation. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO # If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify # the file name of the resulting .qch file. The path specified is relative to # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace # (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual # Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom # Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: # http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To # install this plugin and make it available under the help contents menu in # Eclipse, the contents of the directory containing the HTML and XML files needs # to be copied into the plugins directory of eclipse. The name of the directory # within the plugins directory should be the same as the ECLIPSE_DOC_ID value. # After copying Eclipse needs to be restarted before the help appears. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO # A unique identifier for the Eclipse help plugin. When installing the plugin # the directory name containing the HTML and XML files should also have this # name. Each documentation set should have its own identifier. # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The # DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top # of each HTML page. A value of NO enables the index and the value YES disables # it. Since the tabs in the index contain the same information as the navigation # tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. If the tag # value is set to YES, a side panel will be generated containing a tree-like # index structure (just like the one that is generated for HTML Help). For this # to work a browser that supports JavaScript, DHTML, CSS and frames is required # (i.e. any modern browser). Windows users are probably better off using the # HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can # further fine-tune the look of the index. As an example, the default style # sheet generated by doxygen has an example that shows how to put an image at # the root of the tree instead of the PROJECT_NAME. Since the tree basically has # the same information as the tab index, you could consider setting # DISABLE_INDEX to YES when enabling this option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = NO # The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that # doxygen will group on one line in the generated HTML documentation. # # Note that a value of 0 will completely suppress the enum values from appearing # in the overview section. # Minimum value: 0, maximum value: 20, default value: 4. # This tag requires that the tag GENERATE_HTML is set to YES. ENUM_VALUES_PER_LINE = 4 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used # to set the initial width (in pixels) of the frame in which the tree is shown. # Minimum value: 0, maximum value: 1500, default value: 250. # This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 # If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to # external symbols imported via tag files in a separate window. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO # Use this tag to change the font size of LaTeX formulas included as images in # the HTML documentation. When you change the font size after a successful # doxygen run you need to manually remove any form_*.png images from the HTML # output directory to force them to be regenerated. # Minimum value: 8, maximum value: 50, default value: 10. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 # Use the FORMULA_TRANPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # # Note that when changing this option you need to delete any form_*.png files in # the HTML output directory before the changes have effect. # The default value is: YES. # This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see # http://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path # to it using the MATHJAX_RELPATH option. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO # When MathJax is enabled you can set the default output format to be used for # the MathJax output. See the MathJax site (see: # http://docs.mathjax.org/en/latest/output.html) for more details. # Possible values are: HTML-CSS (which is slower, but has the best # compatibility), NativeMML (i.e. MathML) and SVG. # The default value is: HTML-CSS. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_FORMAT = HTML-CSS # When MathJax is enabled you need to specify the location relative to the HTML # output directory using the MATHJAX_RELPATH option. The destination directory # should contain the MathJax.js script. For instance, if the mathjax directory # is located at the same level as the HTML output directory, then # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of # MathJax from http://www.mathjax.org before deployment. # The default value is: http://cdn.mathjax.org/mathjax/latest. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest # The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax # extension names that should be enabled during MathJax rendering. For example # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site # (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and # should work on any modern browser. Note that when using HTML help # (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) # there is already a search function so this one should typically be disabled. # For large projects the javascript based search engine can be slow, then # enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to # search using the keyboard; to jump to the search box use + S # (what the is depends on the OS and browser, but it is typically # , /