gprstate.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. #pragma once
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #include <sfio/sfio.h>
  15. #include "cgraph.h"
  16. #include <ast/ast.h>
  17. #include <setjmp.h>
  18. #include <stdbool.h>
  19. #include <stddef.h>
  20. #include <stdio.h>
  21. #include <expr/expr.h>
  22. #include "gvpr.h"
  23. typedef enum { TV_flat, TV_ne, TV_en,
  24. TV_bfs,
  25. TV_dfs, TV_fwd, TV_rev,
  26. TV_postdfs, TV_postfwd, TV_postrev,
  27. TV_prepostdfs, TV_prepostfwd, TV_prepostrev,
  28. } trav_type;
  29. typedef struct {
  30. Agraph_t *curgraph;
  31. Agraph_t *nextgraph;
  32. Agraph_t *target;
  33. Agraph_t *outgraph;
  34. Agobj_t *curobj;
  35. Exdisc_t *dp;
  36. Exerror_f errf;
  37. Exexit_f exitf;
  38. char *tgtname;
  39. char *infname;
  40. FILE *outFile;
  41. trav_type tvt;
  42. Agnode_t *tvroot;
  43. Agnode_t *tvnext;
  44. Agedge_t *tvedge;
  45. int name_used;
  46. int argc;
  47. char **argv;
  48. int flags;
  49. gvprbinding* bindings;
  50. size_t n_bindings;
  51. jmp_buf jbuf;
  52. } Gpr_t;
  53. typedef struct {
  54. FILE *outFile;
  55. int argc;
  56. char **argv;
  57. Exerror_f errf;
  58. Exexit_f exitf;
  59. int flags;
  60. } gpr_info;
  61. extern Gpr_t *openGPRState(gpr_info*);
  62. extern void addBindings(Gpr_t* state, gvprbinding*);
  63. extern gvprbinding* findBinding(Gpr_t* state, char*);
  64. extern void closeGPRState(Gpr_t* state);
  65. extern void initGPRState(Gpr_t *);
  66. extern bool validTVT(long long);
  67. #ifdef __cplusplus
  68. }
  69. #endif