| 1 |
/** |
| 2 |
* @file |
| 3 |
* @brief API cghdr.h |
| 4 |
* @ingroup cgraph_utils |
| 5 |
*/ |
| 6 |
/************************************************************************* |
| 7 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 8 |
* All rights reserved. This program and the accompanying materials |
| 9 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 10 |
* which accompanies this distribution, and is available at |
| 11 |
* https://www.eclipse.org/legal/epl-v10.html |
| 12 |
* |
| 13 |
* Contributors: Details at https://graphviz.org |
| 14 |
*************************************************************************/ |
| 15 |
|
| 16 |
#include "config.h" |
| 17 |
|
| 18 |
#include <cgraph/cghdr.h> |
| 19 |
#include <stdlib.h> |
| 20 |
|
| 21 |
static Agraph_t *Ag_dictop_G; |
| 22 |
|
| 23 |
Dict_t *agdtopen(Dtdisc_t *disc, Dtmethod_t *method) { |
| 24 |
return dtopen(disc, method); |
| 25 |
} |
| 26 |
|
| 27 |
int agdtdelete(Agraph_t * g, Dict_t * dict, void *obj) |
| 28 |
{ |
| 29 |
Ag_dictop_G = g; |
| 30 |
return dtdelete(dict, obj) != NULL; |
| 31 |
} |
| 32 |
|
| 33 |
int agdtclose(Agraph_t * g, Dict_t * dict) |
| 34 |
{ |
| 35 |
dtdisc(dict, NULL); |
| 36 |
Ag_dictop_G = g; |
| 37 |
if (dtclose(dict)) |
| 38 |
return 1; |
| 39 |
Ag_dictop_G = NULL; |
| 40 |
return 0; |
| 41 |
} |
| 42 |
|
| 43 |
void agdtdisc(Agraph_t * g, Dict_t * dict, Dtdisc_t * disc) |
| 44 |
{ |
| 45 |
(void)g; /* unused */ |
| 46 |
if (disc && dtdisc(dict, NULL) != disc) { |
| 47 |
dtdisc(dict, disc); |
| 48 |
} |
| 49 |
/* else unchanged, disc is same as old disc */ |
| 50 |
} |
| 51 |
/// @defgroup cgraph_utils utilities |
| 52 |
/// @brief low level cgraph utilities |
| 53 |
/// @ingroup cgraph |