Graphviz 12.0.1~dev.20240715.2254
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;
13
14 if(!disc || !meth)
15 return NULL;
16
17 /* allocate space for dictionary */
18 if(!(dt = malloc(sizeof(Dt_t))))
19 return NULL;
20
21 /* initialize all absolutely private data */
22 dt->searchf = NULL;
23 dt->meth = NULL;
24 dt->disc = NULL;
25 dtdisc(dt, disc);
26 dt->nview = 0;
27 dt->view = dt->walk = NULL;
28 dt->user = NULL;
29
30 /* allocate sharable data */
31 if (!(data = malloc(sizeof(Dtdata_t))))
32 {
33 free(dt);
34 return NULL;
35 }
36
37 data->type = meth->type;
38 data->here = NULL;
39 data->htab = NULL;
40 data->ntab = data->size = data->loop = 0;
41
42 dt->data = data;
43 dt->searchf = meth->searchf;
44 dt->meth = meth;
45
46 return dt;
47}
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
void * malloc(YYSIZE_T)
void free(void *)
node NULL
Definition grammar.y:149
Definition cdt.h:104
Dtsearch_f searchf
Definition cdt.h:104
Dt_t * view
Definition cdt.h:109
Dt_t * walk
Definition cdt.h:110
int nview
Definition cdt.h:108
Dtdata_t * data
Definition cdt.h:106
Dtdisc_t * disc
Definition cdt.h:105
Dtmethod_t * meth
Definition cdt.h:107
void * user
Definition cdt.h:111
int type
Definition cdt.h:71
Dtsearch_f searchf
Definition cdt.h:70
Definition legal.c:50