Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
dtclose.c
Go to the documentation of this file.
1
#include <
cdt/dthdr.h
>
2
#include <stdlib.h>
3
4
/* Close a dictionary
5
**
6
** Written by Kiem-Phong Vo (05/25/96)
7
*/
8
int
dtclose
(
Dt_t
* dt)
9
{
10
if
(!dt || dt->
nview
> 0 )
/* can't close if being viewed */
11
return
-1;
12
13
if
(dt->
view
)
/* turn off viewing */
14
dtview
(dt,
NULL
);
15
16
/* release all allocated data */
17
(void)dt->
meth
->
searchf
(dt,
NULL
,
DT_CLEAR
);
18
if
(
dtsize
(dt) > 0)
19
return
-1;
20
21
if
(dt->
data
.
ntab
> 0)
22
free
(dt->
data
.htab);
23
24
free
(dt);
25
26
return
0;
27
}
DT_CLEAR
#define DT_CLEAR
Definition
cdt.h:132
dtsize
CDT_API int dtsize(Dt_t *)
Definition
dtsize.c:12
dtview
CDT_API Dt_t * dtview(Dt_t *, Dt_t *)
Definition
dtview.c:91
dtclose
int dtclose(Dt_t *dt)
Definition
dtclose.c:8
dthdr.h
free
void free(void *)
NULL
node NULL
Definition
grammar.y:163
Dtdata_t::ntab
int ntab
Definition
cdt.h:78
Dtmethod_t::searchf
Dtsearch_f searchf
Definition
cdt.h:66
dt_s_
Definition
cdt.h:100
dt_s_::meth
Dtmethod_t * meth
Definition
cdt.h:103
dt_s_::data
Dtdata_t data
sharable data
Definition
cdt.h:102
dt_s_::nview
int nview
Definition
cdt.h:104
dt_s_::view
Dt_t * view
Definition
cdt.h:105
lib
cdt
dtclose.c
Generated by
1.9.8