Graphviz
13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
dtopen.c
Go to the documentation of this file.
1
#include <
cdt/dthdr.h
>
2
#include <stdlib.h>
3
4
/* Make a new dictionary
5
**
6
** Written by Kiem-Phong Vo (5/25/96)
7
*/
8
9
Dt_t
*
dtopen
(
Dtdisc_t
*
disc
,
Dtmethod_t
* meth)
10
{
11
Dt_t
* dt;
12
13
if
(!
disc
|| !meth)
14
return
NULL
;
15
16
/* allocate space for dictionary */
17
if
(!(dt =
malloc
(
sizeof
(
Dt_t
))))
18
return
NULL
;
19
20
/* initialize all absolutely private data */
21
dt->
searchf
=
NULL
;
22
dt->
meth
=
NULL
;
23
dt->
disc
=
NULL
;
24
dtdisc
(dt,
disc
);
25
dt->
nview
= 0;
26
dt->
view
= dt->
walk
=
NULL
;
27
dt->
user
=
NULL
;
28
29
dt->
data
= (
Dtdata_t
){.
type
= meth->
type
};
30
31
dt->
searchf
= meth->
searchf
;
32
dt->
meth
= meth;
33
34
return
dt;
35
}
dtdisc
CDT_API Dtdisc_t * dtdisc(Dt_t *dt, Dtdisc_t *)
Definition
dtdisc.c:11
dthdr.h
dtopen
Dt_t * dtopen(Dtdisc_t *disc, Dtmethod_t *meth)
Definition
dtopen.c:9
disc
static Dtdisc_t disc
Definition
exparse.y:209
malloc
void * malloc(YYSIZE_T)
NULL
node NULL
Definition
grammar.y:163
Dtdata_t
Definition
cdt.h:72
Dtdata_t::type
int type
Definition
cdt.h:72
Dtmethod_t
Definition
cdt.h:66
Dtmethod_t::searchf
Dtsearch_f searchf
Definition
cdt.h:66
Dtmethod_t::type
int type
Definition
cdt.h:67
dt_s_
Definition
cdt.h:100
dt_s_::meth
Dtmethod_t * meth
Definition
cdt.h:103
dt_s_::walk
Dt_t * walk
Definition
cdt.h:106
dt_s_::searchf
Dtsearch_f searchf
Definition
cdt.h:100
dt_s_::data
Dtdata_t data
sharable data
Definition
cdt.h:102
dt_s_::user
void * user
Definition
cdt.h:107
dt_s_::nview
int nview
Definition
cdt.h:104
dt_s_::disc
Dtdisc_t * disc
Definition
cdt.h:101
dt_s_::view
Dt_t * view
Definition
cdt.h:105
dtdisc_s_
Definition
cdt.h:85
lib
cdt
dtopen.c
Generated by
1.9.8