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