2 * Copyright (c) 1995-1999, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: d1_handle.c,v $
7 * Revision 1.5 1999-08-27 09:40:32 adam
8 * Renamed logf function to yaz_log. Removed VC++ project files.
10 * Revision 1.4 1998/05/18 13:07:05 adam
11 * Changed the way attribute sets are handled by the retriaval module.
12 * Extended Explain conversion / schema.
13 * Modified server and client to work with ASN.1 compiled protocol handlers.
15 * Revision 1.3 1998/02/11 11:53:35 adam
16 * Changed code so that it compiles as C++.
18 * Revision 1.2 1997/09/30 11:50:04 adam
19 * Added handler data1_get_map_buf that is used by data1_nodetomarc.
21 * Revision 1.1 1997/09/17 12:28:24 adam
22 * Introduced new 'global' data1 handle.
32 struct data1_handle_info {
39 data1_absyn_cache absyn_cache;
40 data1_attset_cache attset_cache;
48 data1_handle data1_create (void)
50 data1_handle p = (data1_handle)xmalloc (sizeof(*p));
54 p->wrbuf = wrbuf_alloc();
59 p->absyn_cache = NULL;
60 p->attset_cache = NULL;
61 p->mem = nmem_create ();
65 NMEM data1_nmem_get (data1_handle dh)
70 data1_absyn_cache *data1_absyn_cache_get (data1_handle dh)
72 return &dh->absyn_cache;
75 data1_attset_cache *data1_attset_cache_get (data1_handle dh)
77 return &dh->attset_cache;
80 void data1_destroy (data1_handle dh)
84 wrbuf_free (dh->wrbuf, 1);
91 nmem_destroy (dh->mem);
96 WRBUF data1_get_wrbuf (data1_handle dp)
101 char **data1_get_read_buf (data1_handle dp, int **lenp)
103 *lenp = &dp->read_len;
104 yaz_log (LOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp);
105 return &dp->read_buf;
108 char **data1_get_map_buf (data1_handle dp, int **lenp)
110 *lenp = &dp->map_len;
111 yaz_log (LOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp);
115 void data1_set_tabpath (data1_handle dp, const char *p)
119 xfree (dp->tab_path);
124 dp->tab_path = (char *)xmalloc (strlen(p)+1);
125 strcpy (dp->tab_path, p);
129 const char *data1_get_tabpath (data1_handle dp)