| 1 |
/** |
| 2 |
* @file |
| 3 |
* @brief supports user-supplied data |
| 4 |
* |
| 5 |
* The ingraphs library works with libcgraph with all user-supplied data. |
| 6 |
* For this to work, the include file relies upon its context to supply |
| 7 |
* a definition of @ref Agraph_t. |
| 8 |
* |
| 9 |
* @ingroup cgraph_app |
| 10 |
*/ |
| 11 |
/************************************************************************* |
| 12 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 13 |
* All rights reserved. This program and the accompanying materials |
| 14 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 15 |
* which accompanies this distribution, and is available at |
| 16 |
* https://www.eclipse.org/legal/epl-v10.html |
| 17 |
* |
| 18 |
* Contributors: Details at https://graphviz.org |
| 19 |
*************************************************************************/ |
| 20 |
|
| 21 |
#pragma once |
| 22 |
|
| 23 |
#include "config.h" |
| 24 |
#include <stdbool.h> |
| 25 |
#include <stdio.h> |
| 26 |
|
| 27 |
#ifdef __cplusplus |
| 28 |
extern "C" { |
| 29 |
#endif |
| 30 |
|
| 31 |
#ifdef GVDLL |
| 32 |
#ifdef EXPORT_CGHDR |
| 33 |
#define CGHDR_API __declspec(dllexport) |
| 34 |
#else |
| 35 |
#define CGHDR_API __declspec(dllimport) |
| 36 |
#endif |
| 37 |
#endif |
| 38 |
|
| 39 |
#ifndef CGHDR_API |
| 40 |
#define CGHDR_API /* nothing */ |
| 41 |
#endif |
| 42 |
|
| 43 |
typedef struct { |
| 44 |
union { |
| 45 |
char** Files; |
| 46 |
Agraph_t** Graphs; |
| 47 |
} u; |
| 48 |
int ctr; |
| 49 |
int ingraphs; |
| 50 |
void *fp; |
| 51 |
Agraph_t *(*readf)(const char *, void *); |
| 52 |
bool heap; |
| 53 |
unsigned errors; |
| 54 |
} ingraph_state; |
| 55 |
|
| 56 |
CGHDR_API ingraph_state *newIngraph(ingraph_state *, char **); |
| 57 |
CGHDR_API ingraph_state *newIng(ingraph_state *, char **, |
| 58 |
Agraph_t *(*readf)(const char *, void *)); |
| 59 |
CGHDR_API ingraph_state *newIngGraphs(ingraph_state *, Agraph_t **, |
| 60 |
Agraph_t *(*readf)(const char *, void *)); |
| 61 |
CGHDR_API void closeIngraph(ingraph_state * sp); |
| 62 |
CGHDR_API Agraph_t *nextGraph(ingraph_state *); |
| 63 |
CGHDR_API char *fileName(ingraph_state *); |
| 64 |
|
| 65 |
#ifdef __cplusplus |
| 66 |
} |
| 67 |
#endif |