| 1 |
/************************************************************************* |
| 2 |
* Copyright (c) 2011 AT&T Intellectual Property |
| 3 |
* All rights reserved. This program and the accompanying materials |
| 4 |
* are made available under the terms of the Eclipse Public License v1.0 |
| 5 |
* which accompanies this distribution, and is available at |
| 6 |
* https://www.eclipse.org/legal/epl-v10.html |
| 7 |
* |
| 8 |
* Contributors: Details at https://graphviz.org |
| 9 |
*************************************************************************/ |
| 10 |
|
| 11 |
#pragma once |
| 12 |
|
| 13 |
#ifdef __cplusplus |
| 14 |
extern "C" { |
| 15 |
#endif |
| 16 |
|
| 17 |
#include <sfio/sfio.h> |
| 18 |
#include "cgraph.h" |
| 19 |
#include <ast/ast.h> |
| 20 |
#include <setjmp.h> |
| 21 |
#include <stdbool.h> |
| 22 |
#include <stddef.h> |
| 23 |
#include <stdio.h> |
| 24 |
#include <expr/expr.h> |
| 25 |
#include <util/list.h> |
| 26 |
#include <util/strview.h> |
| 27 |
#include <util/list.h> |
| 28 |
#include "gvpr.h" |
| 29 |
|
| 30 |
typedef LIST(strview_t) strviews_t; |
| 31 |
|
| 32 |
typedef enum { TV_flat, TV_ne, TV_en, |
| 33 |
TV_bfs, |
| 34 |
TV_dfs, TV_fwd, TV_rev, |
| 35 |
TV_postdfs, TV_postfwd, TV_postrev, |
| 36 |
TV_prepostdfs, TV_prepostfwd, TV_prepostrev, |
| 37 |
} trav_type; |
| 38 |
|
| 39 |
typedef struct { |
| 40 |
Agraph_t *curgraph; |
| 41 |
Agraph_t *nextgraph; |
| 42 |
Agraph_t *target; |
| 43 |
Agraph_t *outgraph; |
| 44 |
Agobj_t *curobj; |
| 45 |
Exdisc_t *dp; |
| 46 |
Exerror_f errf; |
| 47 |
Exexit_f exitf; |
| 48 |
char *tgtname; |
| 49 |
char *infname; |
| 50 |
FILE *outFile; |
| 51 |
trav_type tvt; |
| 52 |
Agnode_t *tvroot; |
| 53 |
Agnode_t *tvnext; |
| 54 |
Agedge_t *tvedge; |
| 55 |
int name_used; |
| 56 |
strviews_t args; |
| 57 |
int flags; |
| 58 |
gvprbinding* bindings; |
| 59 |
size_t n_bindings; |
| 60 |
jmp_buf jbuf; |
| 61 |
} Gpr_t; |
| 62 |
|
| 63 |
typedef struct { |
| 64 |
FILE *outFile; |
| 65 |
strviews_t args; |
| 66 |
Exerror_f errf; |
| 67 |
Exexit_f exitf; |
| 68 |
int flags; |
| 69 |
} gpr_info; |
| 70 |
|
| 71 |
extern Gpr_t *openGPRState(gpr_info*); |
| 72 |
extern void addBindings(Gpr_t* state, gvprbinding*); |
| 73 |
extern gvprbinding* findBinding(Gpr_t* state, char*); |
| 74 |
extern void closeGPRState(Gpr_t* state); |
| 75 |
extern void initGPRState(Gpr_t *); |
| 76 |
extern bool validTVT(long long); |
| 77 |
|
| 78 |
#ifdef __cplusplus |
| 79 |
} |
| 80 |
#endif |