YAZ  5.23.1
Macros | Typedefs | Functions
proto.h File Reference

Header for Z39.50 Protocol. More...

#include <yaz/yaz-version.h>
#include <yaz/z-accdes1.h>
#include <yaz/z-accform1.h>
#include <yaz/z-acckrb1.h>
#include <yaz/z-core.h>
#include <yaz/z-diag1.h>
#include <yaz/z-espec1.h>
#include <yaz/z-estask.h>
#include <yaz/z-exp.h>
#include <yaz/z-facet-1.h>
#include <yaz/z-grs.h>
#include <yaz/z-opac.h>
#include <yaz/z-rrf1.h>
#include <yaz/z-rrf2.h>
#include <yaz/z-sum.h>
#include <yaz/z-sutrs.h>
#include <yaz/z-uifr1.h>
#include <yaz/zes-expi.h>
#include <yaz/zes-exps.h>
#include <yaz/zes-order.h>
#include <yaz/zes-pquery.h>
#include <yaz/zes-psched.h>
#include <yaz/zes-pset.h>
#include <yaz/zes-update.h>
#include <yaz/zes-admin.h>
#include <yaz/z-date.h>
#include <yaz/z-univ.h>
#include <yaz/zes-update0.h>
#include <yaz/z-charneg.h>
#include <yaz/z-mterm2.h>
#include <yaz/wrbuf.h>
#include <yaz/matchstr.h>
#include <yaz/zgdu.h>
#include <yaz/z-oclcui.h>
#include <yaz/marcdisp.h>
#include <yaz/prt-ext.h>

Go to the source code of this file.

Macros

#define Z_95   1
 
#define ASN_COMPILED   1
 
#define Z_PRES_SUCCESS   Z_PresentStatus_success
 
#define Z_PRES_PARTIAL_1   Z_PresentStatus_partial_1
 
#define Z_PRES_PARTIAL_2   Z_PresentStatus_partial_2
 
#define Z_PRES_PARTIAL_3   Z_PresentStatus_partial_3
 
#define Z_PRES_PARTIAL_4   Z_PresentStatus_partial_4
 
#define Z_PRES_FAILURE   Z_PresentStatus_failure
 
#define Z_RES_SUBSET   Z_SearchResponse_subset
 
#define Z_RES_INTERIM   Z_SearchResponse_interim
 
#define Z_RES_NONE   Z_SearchResponse_none
 
#define Z_SortStatus_success   Z_SortResponse_success
 
#define Z_SortStatus_partial_1   Z_SortResponse_partial_1
 
#define Z_SortStatus_failure   Z_SortResponse_failure
 
#define Z_SortRelation_ascending   Z_SortKeySpec_ascending
 
#define Z_SortRelation_descending   Z_SortKeySpec_descending
 
#define Z_SortRelation_ascendingByFreq   Z_SortKeySpec_ascendingByFrequency
 
#define Z_SortRelation_descendingByFreq   Z_SortKeySpec_descendingByfrequency
 
#define Z_SortCase_caseSensitive   Z_SortKeySpec_caseSensitive
 
#define Z_SortCase_caseInsensitive   Z_SortKeySpec_caseInsensitive
 
#define Z_TriggerResourceCtrl_resourceReport   Z_TriggerResourceControlRequest_resourceReport
 
#define Z_TriggerResourceCtrl_resourceControl   Z_TriggerResourceControlRequest_resourceControl
 
#define Z_TriggerResourceCtrl_cancel   Z_TriggerResourceControlRequest_cancel
 
#define Z_DeleteRequest_list   Z_DeleteResultSetRequest_list
 
#define Z_DeleteRequest_all   Z_DeleteResultSetRequest_all
 
#define Z_AccessRequest_simpleForm   Z_AccessControlRequest_simpleForm
 
#define Z_AccessRequest_externallyDefined   Z_AccessControlRequest_externallyDefined
 
#define Z_AccessResponse_simpleForm   Z_AccessControlResponse_simpleForm
 
#define Z_AccessResponse_externallyDefined   Z_AccessControlResponse_externallyDefined
 
#define Z_ResourceReportStatus_success   Z_ResourceReportResponse_success
 
#define Z_ResourceReportStatus_partial   Z_ResourceReportResponse_partial
 
#define Z_ResourceReportStatus_failure_1   Z_ResourceReportResponse_failure_1
 
#define Z_ResourceReportStatus_failure_2   Z_ResourceReportResponse_failure_2
 
#define Z_ResourceReportStatus_failure_3   Z_ResourceReportResponse_failure_3
 
#define Z_ResourceReportStatus_failure_4   Z_ResourceReportResponse_failure_4
 
#define Z_ResourceReportStatus_failure_5   Z_ResourceReportResponse_failure_5
 
#define Z_ResourceReportStatus_failure_6   Z_ResourceReportResponse_failure_6
 
#define Z_SortResultSetStatus_empty   Z_SortResponse_empty
 
#define Z_SortResultSetStatus_interim   Z_SortResponse_interim
 
#define Z_SortResultSetStatus_unchanged   Z_SortResponse_unchanged
 
#define Z_SortResultSetStatus_none   Z_SortResponse_none
 

Typedefs

typedef Z_External Z_DatabaseRecord
 
typedef struct Z_IOItemOrder Z_ItemOrder
 

Functions

Z_APDUzget_APDU (ODR o, int which)
 
void yaz_display_grs1 (WRBUF wrbuf, Z_GenericRecord *r, int flags)
 Performs "pretty" display of GRS-1 record to WRBUF. More...
 
int yaz_init_opt_encode (Z_Options *opt, const char *opt_str, int *error_pos)
 Encodes Z39.50 Init OPtions based on string mnemonics. More...
 
void yaz_init_opt_decode (Z_Options *opt, void(*pr)(const char *name, void *clientData), void *clientData)
 Decodes Z39.50 Init Options - for printing. More...
 
Z_DefaultDiagFormatzget_DefaultDiagFormat (ODR o, int error, const char *addinfo)
 Creates Default Diag Format Diagnostic. More...
 
Z_NamePlusRecordzget_surrogateDiagRec (ODR o, const char *dbname, int error, const char *addinfo)
 Creates Surrogate Diagnostic Records. More...
 
Z_Externalzget_init_diagnostics (ODR odr, int error, const char *addinfo)
 Creates Initialize Response diagnostics. More...
 
Z_Externalzget_init_diagnostics_octet (ODR odr, int error, const char *addinfo)
 Creates Initialize Response diagnostics (Octet-aligned EXTERNAL) More...
 
Z_DiagRecszget_DiagRecs (ODR o, int error, const char *addinfo)
 Creates Diagnostic record - Z_DiagRecs type. More...
 
Z_DiagReczget_DiagRec (ODR o, int error, const char *addinfo)
 Creates Diagnostic record - Z_DiagRecs type. More...
 
const char * yaz_get_esn (Z_RecordComposition *comp)
 get element set name from RecordComposition More...
 
void yaz_set_esn (Z_RecordComposition **comp_p, const char *esn, NMEM nmem)
 set element set name in RecordComposition struct More...
 
Z_DefaultDiagFormatyaz_decode_init_diag (int no, Z_InitResponse *initrs)
 returns diagnostics from an init response More...
 
Z_AttributeListzget_AttributeList_use_string (ODR o, const char *name)
 creates AttributeList with type=1(use) and string value More...
 

Detailed Description

Header for Z39.50 Protocol.

Definition in file proto.h.

Macro Definition Documentation

#define ASN_COMPILED   1

Definition at line 36 of file proto.h.

#define Z_95   1

Definition at line 35 of file proto.h.

#define Z_AccessRequest_externallyDefined   Z_AccessControlRequest_externallyDefined

Definition at line 111 of file proto.h.

#define Z_AccessRequest_simpleForm   Z_AccessControlRequest_simpleForm

Definition at line 110 of file proto.h.

#define Z_AccessResponse_externallyDefined   Z_AccessControlResponse_externallyDefined

Definition at line 114 of file proto.h.

#define Z_AccessResponse_simpleForm   Z_AccessControlResponse_simpleForm

Definition at line 113 of file proto.h.

#define Z_DeleteRequest_all   Z_DeleteResultSetRequest_all

Definition at line 108 of file proto.h.

#define Z_DeleteRequest_list   Z_DeleteResultSetRequest_list

Definition at line 107 of file proto.h.

#define Z_PRES_FAILURE   Z_PresentStatus_failure

Definition at line 85 of file proto.h.

#define Z_PRES_PARTIAL_1   Z_PresentStatus_partial_1

Definition at line 81 of file proto.h.

#define Z_PRES_PARTIAL_2   Z_PresentStatus_partial_2

Definition at line 82 of file proto.h.

#define Z_PRES_PARTIAL_3   Z_PresentStatus_partial_3

Definition at line 83 of file proto.h.

#define Z_PRES_PARTIAL_4   Z_PresentStatus_partial_4

Definition at line 84 of file proto.h.

#define Z_PRES_SUCCESS   Z_PresentStatus_success

Definition at line 80 of file proto.h.

#define Z_RES_INTERIM   Z_SearchResponse_interim

Definition at line 88 of file proto.h.

#define Z_RES_NONE   Z_SearchResponse_none

Definition at line 89 of file proto.h.

#define Z_RES_SUBSET   Z_SearchResponse_subset

Definition at line 87 of file proto.h.

#define Z_ResourceReportStatus_failure_1   Z_ResourceReportResponse_failure_1

Definition at line 118 of file proto.h.

#define Z_ResourceReportStatus_failure_2   Z_ResourceReportResponse_failure_2

Definition at line 119 of file proto.h.

#define Z_ResourceReportStatus_failure_3   Z_ResourceReportResponse_failure_3

Definition at line 120 of file proto.h.

#define Z_ResourceReportStatus_failure_4   Z_ResourceReportResponse_failure_4

Definition at line 121 of file proto.h.

#define Z_ResourceReportStatus_failure_5   Z_ResourceReportResponse_failure_5

Definition at line 122 of file proto.h.

#define Z_ResourceReportStatus_failure_6   Z_ResourceReportResponse_failure_6

Definition at line 123 of file proto.h.

#define Z_ResourceReportStatus_partial   Z_ResourceReportResponse_partial

Definition at line 117 of file proto.h.

#define Z_ResourceReportStatus_success   Z_ResourceReportResponse_success

Definition at line 116 of file proto.h.

#define Z_SortCase_caseInsensitive   Z_SortKeySpec_caseInsensitive

Definition at line 101 of file proto.h.

#define Z_SortCase_caseSensitive   Z_SortKeySpec_caseSensitive

Definition at line 100 of file proto.h.

#define Z_SortRelation_ascending   Z_SortKeySpec_ascending

Definition at line 95 of file proto.h.

#define Z_SortRelation_ascendingByFreq   Z_SortKeySpec_ascendingByFrequency

Definition at line 97 of file proto.h.

#define Z_SortRelation_descending   Z_SortKeySpec_descending

Definition at line 96 of file proto.h.

#define Z_SortRelation_descendingByFreq   Z_SortKeySpec_descendingByfrequency

Definition at line 98 of file proto.h.

#define Z_SortResultSetStatus_empty   Z_SortResponse_empty

Definition at line 125 of file proto.h.

#define Z_SortResultSetStatus_interim   Z_SortResponse_interim

Definition at line 126 of file proto.h.

#define Z_SortResultSetStatus_none   Z_SortResponse_none

Definition at line 128 of file proto.h.

#define Z_SortResultSetStatus_unchanged   Z_SortResponse_unchanged

Definition at line 127 of file proto.h.

#define Z_SortStatus_failure   Z_SortResponse_failure

Definition at line 93 of file proto.h.

#define Z_SortStatus_partial_1   Z_SortResponse_partial_1

Definition at line 92 of file proto.h.

#define Z_SortStatus_success   Z_SortResponse_success

Definition at line 91 of file proto.h.

#define Z_TriggerResourceCtrl_cancel   Z_TriggerResourceControlRequest_cancel

Definition at line 105 of file proto.h.

#define Z_TriggerResourceCtrl_resourceControl   Z_TriggerResourceControlRequest_resourceControl

Definition at line 104 of file proto.h.

#define Z_TriggerResourceCtrl_resourceReport   Z_TriggerResourceControlRequest_resourceReport

Definition at line 103 of file proto.h.

Typedef Documentation

Definition at line 130 of file proto.h.

typedef struct Z_IOItemOrder Z_ItemOrder

Definition at line 131 of file proto.h.

Function Documentation

Z_DefaultDiagFormat* yaz_decode_init_diag ( int  no,
Z_InitResponse initrs 
)

returns diagnostics from an init response

Parameters
nonumber of diagnotic entry to get. 0=first, 1=second, ..
initrsInitResponse structure
Returns
diag entry or 0 (NULL) if none could be found

Definition at line 32 of file init_diag.c.

References Z_External::diag1, Z_OtherInformationUnit::externallyDefinedInfo, Z_OtherInformationUnit::information, interpret_init_diag2(), Z_OtherInformation::list, Z_OtherInformation::num_elements, Z_External::u, Z_External::userInfo1, Z_InitResponse::userInformationField, Z_External::which, Z_OtherInformationUnit::which, Z_External_diag1, Z_External_userInfo1, and Z_OtherInfo_externallyDefinedInfo.

Referenced by ZOOM_handle_Z3950_apdu().

void yaz_display_grs1 ( WRBUF  wrbuf,
Z_GenericRecord r,
int  flags 
)

Performs "pretty" display of GRS-1 record to WRBUF.

Definition at line 125 of file grs1disp.c.

References display_grs1().

Referenced by return_record_wrbuf().

const char* yaz_get_esn ( Z_RecordComposition comp)
void yaz_init_opt_decode ( Z_Options opt,
void(*)(const char *name, void *clientData)  pr,
void *  clientData 
)

Decodes Z39.50 Init Options - for printing.

Definition at line 84 of file initopt.c.

References ODR_MASK_GET, and opt_array.

Referenced by ZOOM_handle_Z3950_apdu().

int yaz_init_opt_encode ( Z_Options opt,
const char *  opt_str,
int *  error_pos 
)

Encodes Z39.50 Init OPtions based on string mnemonics.

Definition at line 45 of file initopt.c.

References name, ODR_MASK_SET, ODR_MASK_ZERO, opt_array, and yaz_matchstr().

void yaz_set_esn ( Z_RecordComposition **  comp_p,
const char *  esn,
NMEM  nmem 
)

set element set name in RecordComposition struct

Parameters
comp_precord composition ptr
esnelement set name string
nmemmemory for result composition

Definition at line 32 of file elementset.c.

References Z_ElementSetNames::generic, nmem_malloc(), nmem_strdup(), Z_RecordComposition::simple, Z_RecordComposition::u, Z_ElementSetNames::u, Z_RecordComposition::which, Z_ElementSetNames::which, Z_ElementSetNames_generic, and Z_RecordComp_simple.

Referenced by retrieve_fetch().

Z_APDU* zget_APDU ( ODR  o,
int  which 
)

Definition at line 410 of file zget.c.

References Z_APDU::accessControlRequest, Z_APDU::accessControlResponse, Z_APDU::close, Z_APDU::deleteResultSetRequest, Z_APDU::deleteResultSetResponse, Z_APDU::duplicateDetectionRequest, Z_APDU::duplicateDetectionResponse, Z_APDU::extendedServicesRequest, Z_APDU::extendedServicesResponse, Z_APDU::initRequest, Z_APDU::initResponse, odr_malloc(), Z_APDU::presentRequest, Z_APDU::presentResponse, Z_APDU::resourceControlRequest, Z_APDU::resourceControlResponse, Z_APDU::resourceReportRequest, Z_APDU::resourceReportResponse, Z_APDU::scanRequest, Z_APDU::scanResponse, Z_APDU::searchRequest, Z_APDU::searchResponse, Z_APDU::segmentRequest, Z_APDU::sortRequest, Z_APDU::sortResponse, Z_APDU::triggerResourceControlRequest, Z_APDU::u, Z_APDU::which, Z_APDU_accessControlRequest, Z_APDU_accessControlResponse, Z_APDU_close, Z_APDU_deleteResultSetRequest, Z_APDU_deleteResultSetResponse, Z_APDU_duplicateDetectionRequest, Z_APDU_duplicateDetectionResponse, Z_APDU_extendedServicesRequest, Z_APDU_extendedServicesResponse, Z_APDU_initRequest, Z_APDU_initResponse, Z_APDU_presentRequest, Z_APDU_presentResponse, Z_APDU_resourceControlRequest, Z_APDU_resourceControlResponse, Z_APDU_resourceReportRequest, Z_APDU_resourceReportResponse, Z_APDU_scanRequest, Z_APDU_scanResponse, Z_APDU_searchRequest, Z_APDU_searchResponse, Z_APDU_segmentRequest, Z_APDU_sortRequest, Z_APDU_sortResponse, Z_APDU_triggerResourceControlRequest, zget_AccessControlRequest(), zget_AccessControlResponse(), zget_Close(), zget_DeleteResultSetRequest(), zget_DeleteResultSetResponse(), zget_DuplicateDetectionRequest(), zget_DuplicateDetectionResponse(), zget_ExtendedServicesRequest(), zget_ExtendedServicesResponse(), zget_InitRequest(), zget_InitResponse(), zget_PresentRequest(), zget_PresentResponse(), zget_ResourceControlRequest(), zget_ResourceControlResponse(), zget_ResourceReportRequest(), zget_ResourceReportResponse(), zget_ScanRequest(), zget_ScanResponse(), zget_SearchRequest(), zget_SearchResponse(), zget_Segment(), zget_SortRequest(), zget_SortResponse(), and zget_TriggerResourceControlRequest().

Referenced by create_es_package(), do_close_req(), process_ESRequest(), process_initRequest(), send_Z3950_sort(), Z3950_send_present(), Z3950_send_search(), ZOOM_connection_Z3950_send_init(), and ZOOM_connection_Z3950_send_scan().

Z_AttributeList* zget_AttributeList_use_string ( ODR  o,
const char *  name 
)

creates AttributeList with type=1(use) and string value

Parameters
oODR for encoding
nameuse-value
Returns
attribute list with only one use-attribute

Definition at line 310 of file pquery.c.

References get_attributeList(), and odr_strdup().

Referenced by yaz_solr_decode_facet_field(), yaz_sru_facet_response(), and yaz_sru_proxy_decode_facet_field().

Z_DefaultDiagFormat* zget_DefaultDiagFormat ( ODR  o,
int  error,
const char *  addinfo 
)
Z_DiagRec* zget_DiagRec ( ODR  o,
int  error,
const char *  addinfo 
)

Creates Diagnostic record - Z_DiagRecs type.

Definition at line 511 of file zget.c.

References Z_DiagRec::defaultFormat, odr_malloc(), Z_DiagRec::u, Z_DiagRec::which, Z_DiagRec_defaultFormat, and zget_DefaultDiagFormat().

Referenced by zget_DiagRecs().

Z_DiagRecs* zget_DiagRecs ( ODR  o,
int  error,
const char *  addinfo 
)

Creates Diagnostic record - Z_DiagRecs type.

Definition at line 519 of file zget.c.

References Z_DiagRecs::diagRecs, Z_DiagRecs::num_diagRecs, odr_malloc(), and zget_DiagRec().

Referenced by process_ESRequest(), process_scanRequest(), and process_sortRequest().

Z_External* zget_init_diagnostics ( ODR  odr,
int  error,
const char *  addinfo 
)
Z_External* zget_init_diagnostics_octet ( ODR  odr,
int  error,
const char *  addinfo 
)
Z_NamePlusRecord* zget_surrogateDiagRec ( ODR  o,
const char *  dbname,
int  error,
const char *  addinfo 
)