📄 data1.h
字号:
/* $Id: data1.h,v 1.8 2003/06/23 15:36:11 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Index Data ApsThis file is part of the Zebra server.Zebra is free software; you can redistribute it and/or modify it underthe terms of the GNU General Public License as published by the FreeSoftware Foundation; either version 2, or (at your option) any laterversion.Zebra is distributed in the hope that it will be useful, but WITHOUT ANYWARRANTY; without even the implied warranty of MERCHANTABILITY orFITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public Licensefor more details.You should have received a copy of the GNU General Public Licensealong with Zebra; see the file LICENSE.zebra. If not, write to theFree Software Foundation, 59 Temple Place - Suite 330, Boston, MA02111-1307, USA.*/#ifndef DATA1_H#define DATA1_H#define ENHANCED_XELM 1#include <stdio.h>#include <yaz/nmem.h>#include <yaz/oid.h>#include <yaz/proto.h>#include <d1_attset.h>#include <d1_map.h>#include <yaz/yaz-util.h>#include <yaz/wrbuf.h>#include <dfa.h> /* pop */#include <zebra_xpath.h> /* pop */#define d1_isspace(c) strchr(" \r\n\t\f", c)#define d1_isdigit(c) ((c) <= '9' && (c) >= '0')YAZ_BEGIN_CDECL#define data1_matchstr(s1, s2) yaz_matchstr(s1, s2)#define DATA1_MAX_SYMBOL 31typedef struct data1_name{ char *name; struct data1_name *next;} data1_name;typedef struct data1_absyn_cache_info *data1_absyn_cache;typedef struct data1_attset_cache_info *data1_attset_cache;typedef enum data1_datatype{ DATA1K_unknown, DATA1K_structured, DATA1K_string, DATA1K_numeric, DATA1K_bool, DATA1K_oid, DATA1K_generalizedtime, DATA1K_intunit, DATA1K_int, DATA1K_octetstring, DATA1K_null} data1_datatype;typedef struct data1_marctab{ char *name; oid_value reference; char record_status[2]; char implementation_codes[5]; int indicator_length; int identifier_length; char user_systems[4]; int length_data_entry; int length_starting; int length_implementation; char future_use[2]; int force_indicator_length; int force_identifier_length; char leader[24]; /* Fixme! Need linear access to LEADER of MARC record */ struct data1_marctab *next;} data1_marctab;typedef struct data1_esetname{ char *name; Z_Espec1 *spec; struct data1_esetname *next;} data1_esetname;/* * Variant set definitions. */typedef struct data1_vartype{ char *name; struct data1_varclass *zclass; int type; data1_datatype datatype; struct data1_vartype *next;} data1_vartype;typedef struct data1_varclass{ char *name; struct data1_varset *set; int zclass; data1_vartype *types; struct data1_varclass *next;} data1_varclass;typedef struct data1_varset{ char *name; oid_value reference; data1_varclass *classes;} data1_varset;/* * Tagset definitions */struct data1_tagset;typedef struct data1_tag{ data1_name *names;#define DATA1T_numeric 1#define DATA1T_string 2 int which; union { int numeric; char *string; } value; data1_datatype kind; struct data1_tagset *tagset; struct data1_tag *next;} data1_tag;typedef struct data1_tagset data1_tagset;struct data1_tagset{ int type; /* type of tagset in current context */ char *name; /* symbolic name */ oid_value reference; data1_tag *tags; /* tags defined by this set */ data1_tagset *children; /* children */ data1_tagset *next; /* sibling */};typedef struct data1_termlist{ data1_att *att; char *structure; char *source; struct data1_termlist *next;} data1_termlist;/* * abstract syntax specification */typedef struct data1_element{ char *name; data1_tag *tag; data1_termlist *termlists; char *sub_name; struct data1_element *children; struct data1_element *next;} data1_element;typedef struct data1_sub_elements { char *name; struct data1_sub_elements *next; data1_element *elements;} data1_sub_elements;/* pop */typedef struct data1_xpelement{ char *xpath_expr;#ifdef ENHANCED_XELM struct xpath_location_step xpath[XPATH_STEP_COUNT]; int xpath_len;#endif struct DFA *dfa; data1_termlist *termlists; struct data1_xpelement *next;} data1_xpelement;typedef struct data1_xattr { char *name; char *value; struct data1_xattr *next; unsigned short what; /* DATA1I_text, .. see data1_node.u.data */} data1_xattr;#if 0typedef struct data1_absyn data1_absyn;#elsetypedef struct data1_absyn{ char *name; oid_value reference; data1_tagset *tagset; data1_attset *attset; data1_varset *varset; data1_esetname *esetnames; data1_maptab *maptabs; data1_marctab *marc; data1_sub_elements *sub_elements; data1_element *main_elements; data1_xpelement *xp_elements; /* pop */ struct data1_systag *systags; char *encoding; int enable_xpath_indexing;} data1_absyn;#endif/* * record data node (tag/data/variant) */typedef struct data1_node{ /* the root of a record (containing global data) */#define DATA1N_root 1 /* a tag */#define DATA1N_tag 2 /* some data under a leaf tag or variant */#define DATA1N_data 3 /* variant specification (a triple, actually) */#define DATA1N_variant 4 /* comment (same as data) */#define DATA1N_comment 5 /* preprocessing instruction */#define DATA1N_preprocess 6 int which; union { struct { char *type; data1_absyn *absyn; /* abstract syntax for this type */ } root;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -