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
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}
CDT_API Dtdisc_t * dtdisc(Dt_t *dt, Dtdisc_t *)
Definition dtdisc.c:11
Dt_t * dtopen(Dtdisc_t *disc, Dtmethod_t *meth)
Definition dtopen.c:9
static Dtdisc_t disc
Definition exparse.y:209
void * malloc(YYSIZE_T)
node NULL
Definition grammar.y:163
Definition cdt.h:72
int type
Definition cdt.h:72
Dtsearch_f searchf
Definition cdt.h:66
int type
Definition cdt.h:67
Definition cdt.h:100
Dtmethod_t * meth
Definition cdt.h:103
Dt_t * walk
Definition cdt.h:106
Dtsearch_f searchf
Definition cdt.h:100
Dtdata_t data
sharable data
Definition cdt.h:102
void * user
Definition cdt.h:107
int nview
Definition cdt.h:104
Dtdisc_t * disc
Definition cdt.h:101
Dt_t * view
Definition cdt.h:105