ingraphs.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #pragma once
  21. #include "config.h"
  22. #include <stdbool.h>
  23. #include <stdio.h>
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. #ifdef GVDLL
  28. #ifdef EXPORT_CGHDR
  29. #define CGHDR_API __declspec(dllexport)
  30. #else
  31. #define CGHDR_API __declspec(dllimport)
  32. #endif
  33. #endif
  34. #ifndef CGHDR_API
  35. #define CGHDR_API /* nothing */
  36. #endif
  37. typedef struct {
  38. union {
  39. char** Files;
  40. Agraph_t** Graphs;
  41. } u;
  42. int ctr;
  43. int ingraphs;
  44. void *fp;
  45. Agraph_t *(*readf)(void*);
  46. bool heap;
  47. unsigned errors;
  48. } ingraph_state;
  49. CGHDR_API ingraph_state *newIngraph(ingraph_state *, char **);
  50. CGHDR_API ingraph_state *newIng(ingraph_state *, char **, Agraph_t *(*readf)(void*));
  51. CGHDR_API ingraph_state *newIngGraphs(ingraph_state *, Agraph_t**, Agraph_t *(*readf)(void*));
  52. CGHDR_API void closeIngraph(ingraph_state * sp);
  53. CGHDR_API Agraph_t *nextGraph(ingraph_state *);
  54. CGHDR_API char *fileName(ingraph_state *);
  55. #ifdef __cplusplus
  56. }
  57. #endif