4 * \brief Prototypes for vectors routines.
6 * \author this file, vector.c, was written and is
7 * Copyright (c) 2001 C. Scott Ananian.
11 * <h1><b>Copyright.</b></h1>\n
13 * PCB, interactive printed circuit board design
15 * Copyright (C) 1994,1995,1996 Thomas Nau
17 * Copyright (C) 1998,1999,2000,2001 harry eaton
19 * This program is free software; you can redistribute it and/or modify
20 * it under the terms of the GNU General Public License as published by
21 * the Free Software Foundation; either version 2 of the License, or
22 * (at your option) any later version.
24 * This program is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
29 * You should have received a copy of the GNU General Public License
30 * along with this program; if not, write to the Free Software
31 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
33 * Contact addresses for paper mail and Email:
35 * harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA
37 * haceaton@aplcomm.jhuapl.edu
44 * \brief What a vector looks like.
46 typedef struct vector_struct vector_t
;
49 * \brief What data in a vector looks like.
51 typedef void *vector_element_t
;
53 vector_t
*vector_create ();
54 void vector_destroy (vector_t
** vector
);
55 vector_t
*vector_duplicate (vector_t
* vector
);
57 /* -- interrogation -- */
58 int vector_is_empty (vector_t
* vector
);
59 int vector_size (vector_t
* vector
);
60 vector_element_t
vector_element (vector_t
* vector
, int N
);
61 vector_element_t
vector_element_first (vector_t
* vector
);
62 vector_element_t
vector_element_last (vector_t
* vector
);
65 void vector_append (vector_t
* vector
, vector_element_t data
);
66 void vector_append_many (vector_t
* vector
,
67 vector_element_t data
[], int count
);
68 void vector_append_vector (vector_t
* vector
, vector_t
* other_vector
);
69 void vector_insert (vector_t
* vector
, int N
, vector_element_t data
);
70 void vector_insert_many (vector_t
* vector
, int N
,
71 vector_element_t data
[], int count
);
72 vector_element_t
vector_remove_last (vector_t
* vector
);
73 vector_element_t
vector_remove (vector_t
* vector
, int N
);
74 vector_element_t
vector_replace (vector_t
* vector
,
75 vector_element_t data
, int N
);
77 #endif /* PCB_VECTOR_H */