2 * Copyright (c) 1995-1997, Index Data.
3 * See the file LICENSE for details.
4 * Sebastian Hammer, Adam Dickmeiss
6 * $Log: d1_handle.c,v $
7 * Revision 1.3 1998-02-11 11:53:35 adam
8 * Changed code so that it compiles as C++.
10 * Revision 1.2 1997/09/30 11:50:04 adam
11 * Added handler data1_get_map_buf that is used by data1_nodetomarc.
13 * Revision 1.1 1997/09/17 12:28:24 adam
14 * Introduced new 'global' data1 handle.
24 struct data1_handle_info {
31 data1_absyn_cache absyn_cache;
39 data1_handle data1_create (void)
41 data1_handle p = (data1_handle)xmalloc (sizeof(*p));
45 p->wrbuf = wrbuf_alloc();
50 p->absyn_cache = NULL;
51 p->mem = nmem_create ();
55 NMEM data1_nmem_get (data1_handle dh)
60 data1_absyn_cache *data1_absyn_cache_get (data1_handle dh)
62 return &dh->absyn_cache;
65 void data1_destroy (data1_handle dh)
69 wrbuf_free (dh->wrbuf, 1);
76 nmem_destroy (dh->mem);
81 WRBUF data1_get_wrbuf (data1_handle dp)
86 char **data1_get_read_buf (data1_handle dp, int **lenp)
88 *lenp = &dp->read_len;
89 logf (LOG_DEBUG, "data1_get_read_buf lenp=%u", **lenp);
93 char **data1_get_map_buf (data1_handle dp, int **lenp)
96 logf (LOG_DEBUG, "data1_get_map_buf lenp=%u", **lenp);
100 void data1_set_tabpath (data1_handle dp, const char *p)
104 xfree (dp->tab_path);
109 dp->tab_path = (char *)xmalloc (strlen(p)+1);
110 strcpy (dp->tab_path, p);
114 const char *data1_get_tabpath (data1_handle dp)