summaryrefslogtreecommitdiff
path: root/include/bb-list.h
blob: effb61bcfcda3d26dc88804bb505fd3e62235617 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# bb-list.h: bounding box lists.
#
# Copyright (C) 1992, 2011 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

#ifndef BB_LIST_H
#define BB_LIST_H

#include "bounding-box.h"


typedef struct
{
  bounding_box_type *data;
  unsigned length;
} bb_list_type;

/* The length of the list.  */
#define BB_LIST_LENGTH(bb_l) ((bb_l).length)

/* The array of elements as a whole.  */
#define BB_LIST_DATA(bb_l) ((bb_l).data)

/* The Nth element in the list.  */
#define BB_LIST_ELT(bb_l, n) BB_LIST_DATA (bb_l)[n]


/* Initialize a list.  */
extern bb_list_type bb_list_init (void);

/* Append BB to L.  */
extern void bb_list_append (bb_list_type *l, bounding_box_type bb);

/* Splice the elements in list B2 onto B1, changing B1.  */
extern void bb_list_splice (bb_list_type *B1, bb_list_type B2);

/* Free the memory in a list.  */
extern void bb_list_free (bb_list_type *);

#endif /* not BB_LIST_H */