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