1/* $Id$ $Revision$ */
2/* vim:set shiftwidth=4 ts=8: */
3
4/*************************************************************************
5 * Copyright (c) 2011 AT&T Intellectual Property
6 * All rights reserved. This program and the accompanying materials
7 * are made available under the terms of the Eclipse Public License v1.0
8 * which accompanies this distribution, and is available at
9 * http://www.eclipse.org/legal/epl-v10.html
10 *
11 * Contributors: See CVS logs. Details at http://www.graphviz.org/
12 *************************************************************************/
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#ifndef GRID_H
19#define GRID_H
20
21#include "config.h"
22
23#include <render.h>
24#include <cdt.h>
25
26 typedef struct _grid Grid;
27
28 typedef struct _node_list {
29 Agnode_t *node;
30 struct _node_list *next;
31 } node_list;
32
33 typedef struct {
34 int i, j;
35 } gridpt;
36
37 typedef struct {
38 gridpt p; /* index of cell */
39 node_list *nodes; /* nodes in cell */
40 Dtlink_t link; /* cdt data */
41 } cell;
42
43 extern Grid *mkGrid(int);
44 extern void adjustGrid(Grid * g, int nnodes);
45 extern void clearGrid(Grid *);
46 extern void addGrid(Grid *, int, int, Agnode_t *);
47 extern void walkGrid(Grid *, int (*)(Dt_t *, cell *, Grid *));
48 extern cell *findGrid(Grid *, int, int);
49 extern void delGrid(Grid *);
50 extern int gLength(cell * p);
51
52#endif
53
54#ifdef __cplusplus
55}
56#endif
57