X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fdata1.h;h=31490e1d784cd1a49d6a48ff418452637e2031da;hb=15441888880455587ad55891b2c3bc00336b8925;hp=7a6a5fc9339e15344611cdfe8d686ae9808b24ac;hpb=809ef8947e98c402bdf0b57e730545525ce4e94a;p=yaz-moved-to-github.git diff --git a/include/yaz/data1.h b/include/yaz/data1.h index 7a6a5fc..31490e1 100644 --- a/include/yaz/data1.h +++ b/include/yaz/data1.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995-1998, Index Data. + * Copyright (c) 1995-2000, Index Data. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation, in whole or in part, for any purpose, is hereby granted, @@ -24,7 +24,21 @@ * OF THIS SOFTWARE. * * $Log: data1.h,v $ - * Revision 1.3 2000-01-04 17:46:17 ian + * Revision 1.7 2002-04-04 20:49:46 adam + * New functions yaz_is_abspath, yaz_path_fopen_base + * + * Revision 1.6 2000/12/05 12:21:45 adam + * Added termlist source for data1 system. + * + * Revision 1.5 2000/11/29 14:22:47 adam + * Implemented XML/SGML attributes for data1 so that d1_read reads them + * and d1_write generates proper attributes for XML/SGML records. Added + * register locking for threaded version. + * + * Revision 1.4 2000/02/28 11:20:06 adam + * Using autoconf. New definitions: YAZ_BEGIN_CDECL/YAZ_END_CDECL. + * + * Revision 1.3 2000/01/04 17:46:17 ian * Added function to count occurences of a tag spec in a data1 tree. * * Revision 1.2 1999/12/21 14:16:19 ian @@ -240,9 +254,10 @@ #define d1_isspace(c) strchr(" \r\n\t\f", c) #define d1_isdigit(c) ((c) <= '9' && (c) >= '0') -#ifdef __cplusplus -extern "C" { -#endif + +#define DATA1_USING_XATTR 1 + +YAZ_BEGIN_CDECL #define data1_matchstr(s1, s2) yaz_matchstr(s1, s2) @@ -368,6 +383,7 @@ typedef struct data1_termlist { data1_att *att; char *structure; + char *source; struct data1_termlist *next; } data1_termlist; @@ -391,6 +407,14 @@ typedef struct data1_sub_elements { data1_element *elements; } data1_sub_elements; +#if DATA1_USING_XATTR +typedef struct data1_xattr { + char *name; + char *value; + struct data1_xattr *next; +} data1_xattr; +#endif + typedef struct data1_absyn { char *name; @@ -437,6 +461,9 @@ typedef struct data1_node int get_bytes; unsigned node_selected : 1; unsigned make_variantlist : 1; +#if DATA1_USING_XATTR + data1_xattr *attributes; +#endif } tag; struct @@ -526,6 +553,7 @@ YAZ_EXPORT data1_element *data1_getelementbyname(data1_handle dh, data1_absyn *absyn, const char *name); YAZ_EXPORT data1_node *data1_mk_node(data1_handle dh, NMEM m); +YAZ_EXPORT data1_node *data1_mk_node_type (data1_handle dh, NMEM m, int type); YAZ_EXPORT data1_absyn *data1_get_absyn(data1_handle dh, const char *name); YAZ_EXPORT data1_attset *data1_get_attset (data1_handle dh, const char *name); YAZ_EXPORT data1_maptab *data1_read_maptab(data1_handle dh, const char *file); @@ -546,7 +574,9 @@ YAZ_EXPORT Z_BriefBib *data1_nodetosummary(data1_handle dh, YAZ_EXPORT char *data1_nodetosoif(data1_handle dh, data1_node *n, int select, int *len); YAZ_EXPORT void data1_set_tabpath(data1_handle dh, const char *path); +YAZ_EXPORT void data1_set_tabroot (data1_handle dp, const char *p); YAZ_EXPORT const char *data1_get_tabpath(data1_handle dh); +YAZ_EXPORT const char *data1_get_tabroot(data1_handle dh); YAZ_EXPORT WRBUF data1_get_wrbuf (data1_handle dp); YAZ_EXPORT char **data1_get_read_buf (data1_handle dp, int **lenp); @@ -574,8 +604,9 @@ YAZ_EXPORT char *data1_getNodeValue(data1_node* node, char* pTagPath); YAZ_EXPORT data1_node *data1_LookupNode(data1_node* node, char* pTagPath); YAZ_EXPORT int data1_CountOccurences(data1_node* node, char* pTagPath); -#ifdef __cplusplus -} -#endif +YAZ_EXPORT FILE *data1_path_fopen (data1_handle dh, const char *file, + const char *mode); + +YAZ_END_CDECL #endif