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