YAZ  5.23.1
init_diag.c
Go to the documentation of this file.
1 /* This file is part of the YAZ toolkit.
2  * Copyright (C) Index Data
3  * See the file LICENSE for details.
4  */
9 #if HAVE_CONFIG_H
10 #include <config.h>
11 #endif
12 
13 #include <yaz/proto.h>
14 
16  Z_DiagnosticFormat *diag)
17 {
18  int i;
19  for (i = 0; i < diag->num; i++)
20  {
21  Z_DiagnosticFormat_s *ds = diag->elements[i];
23  {
24  if (*no == 0)
25  return ds->u.defaultDiagRec;
26  (*no)--;
27  }
28  }
29  return 0;
30 }
31 
33 {
34  Z_External *uif = initrs->userInformationField;
35  if (uif && uif->which == Z_External_userInfo1)
36  {
37  int i;
38  Z_OtherInformation *ui = uif->u.userInfo1;
39  for (i = 0; i < ui->num_elements; i++)
40  {
41  Z_OtherInformationUnit *unit = ui->list[i];
46  {
50  if (r)
51  return r;
52  }
53  }
54  }
55  return 0;
56 }
57 /*
58  * Local variables:
59  * c-basic-offset: 4
60  * c-file-style: "Stroustrup"
61  * indent-tabs-mode: nil
62  * End:
63  * vim: shiftwidth=4 tabstop=8 expandtab
64  */
union Z_DiagnosticFormat_s::@81 u
#define Z_External_diag1
Definition: prt-ext.h:77
#define Z_DiagnosticFormat_s_defaultDiagRec
Definition: z-diag1.h:89
Z_DiagnosticFormat * diag1
Definition: prt-ext.h:119
Z_OtherInformation * userInfo1
Definition: prt-ext.h:131
union Z_External::@30 u
int which
Definition: prt-ext.h:63
#define Z_External_userInfo1
Definition: prt-ext.h:87
Z_DefaultDiagFormat * yaz_decode_init_diag(int no, Z_InitResponse *initrs)
returns diagnostics from an init response
Definition: init_diag.c:32
Z_External * userInformationField
Definition: z-core.h:421
Z_External * externallyDefinedInfo
Definition: z-core.h:1285
Header for Z39.50 Protocol.
Z_DefaultDiagFormat * defaultDiagRec
Definition: z-diag1.h:87
Z_DiagnosticFormat_s ** elements
Definition: z-diag1.h:97
union Z_OtherInformationUnit::@74 information
structure for all known EXTERNALs
Definition: prt-ext.h:58
#define Z_OtherInfo_externallyDefinedInfo
Definition: z-core.h:1289
static Z_DefaultDiagFormat * interpret_init_diag2(int *no, Z_DiagnosticFormat *diag)
Definition: init_diag.c:15
Z_OtherInformationUnit ** list
Definition: z-core.h:1296