grid.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 "config.h"
  15. #include <common/render.h>
  16. #include <cdt/cdt.h>
  17. typedef struct _grid Grid;
  18. typedef struct _node_list {
  19. Agnode_t *node;
  20. struct _node_list *next;
  21. } node_list;
  22. typedef struct {
  23. int i, j;
  24. } gridpt;
  25. typedef struct {
  26. gridpt p; /* index of cell */
  27. node_list *nodes; /* nodes in cell */
  28. Dtlink_t link; /* cdt data */
  29. } cell;
  30. extern Grid *mkGrid(int);
  31. extern void adjustGrid(Grid * g, int nnodes);
  32. extern void clearGrid(Grid *);
  33. extern void addGrid(Grid *, int, int, Agnode_t *);
  34. extern void walkGrid(Grid*, int (*)(cell*, Grid*));
  35. extern cell *findGrid(Grid *, int, int);
  36. extern void delGrid(Grid *);
  37. extern int gLength(cell * p);
  38. #ifdef __cplusplus
  39. }
  40. #endif