pcb 4.1.1
An interactive printed circuit board layout editor.
|
Prototypes for vectors routines. More...
Go to the source code of this file.
Typedefs | |
typedef struct vector_struct | vector_t |
What a vector looks like. | |
typedef void * | vector_element_t |
What data in a vector looks like. | |
Functions | |
vector_t * | vector_create () |
Create an empty vector. | |
void | vector_destroy (vector_t **vector) |
Destroy a vector. | |
vector_t * | vector_duplicate (vector_t *vector) |
Copy a vector. | |
int | vector_is_empty (vector_t *vector) |
int | vector_size (vector_t *vector) |
vector_element_t | vector_element (vector_t *vector, int N) |
vector_element_t | vector_element_first (vector_t *vector) |
Return the first element of the vector. | |
vector_element_t | vector_element_last (vector_t *vector) |
Return the last element of the vector. | |
void | vector_append (vector_t *vector, vector_element_t data) |
Add data to end of vector. | |
void | vector_append_many (vector_t *vector, vector_element_t data[], int count) |
Add multiple elements to end of vector. | |
void | vector_append_vector (vector_t *vector, vector_t *other_vector) |
Add a vector of elements to the end of vector. | |
void | vector_insert (vector_t *vector, int N, vector_element_t data) |
Add data at specified position of vector. | |
void | vector_insert_many (vector_t *vector, int N, vector_element_t data[], int count) |
Add data at specified position of vector. | |
vector_element_t | vector_remove_last (vector_t *vector) |
Return and delete the *last* element of vector. | |
vector_element_t | vector_remove (vector_t *vector, int N) |
Return and delete data at specified position of vector. | |
vector_element_t | vector_replace (vector_t *vector, vector_element_t data, int N) |
Replace the data at the specified position with the given data. |
Prototypes for vectors routines.
PCB, interactive printed circuit board design
Copyright (C) 1994,1995,1996 Thomas Nau
Copyright (C) 1998,1999,2000,2001 harry eaton
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 2 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Contact addresses for paper mail and Email:
harry eaton, 6697 Buttonhole Ct, Columbia, MD 21044 USA
Definition in file vector.h.
typedef void* vector_element_t |
typedef struct vector_struct vector_t |
void vector_append | ( | vector_t * | vector, |
vector_element_t | data | ||
) |
Add data to end of vector.
Definition at line 169 of file vector.c.
References vector_struct::size, and vector_insert_many().
Referenced by append(), moveable_edge(), mtspace_query_rect(), path_conflicts(), qloop(), query_one(), and RouteOne().
void vector_append_many | ( | vector_t * | vector, |
vector_element_t | data[], | ||
int | count | ||
) |
Add multiple elements to end of vector.
Definition at line 178 of file vector.c.
References vector_struct::size, and vector_insert_many().
Referenced by vector_append_vector().
Add a vector of elements to the end of vector.
Definition at line 187 of file vector.c.
References vector_struct::element, vector_struct::size, and vector_append_many().
vector_t* vector_create | ( | ) |
Create an empty vector.
Definition at line 95 of file vector.c.
References __vector_is_good().
Referenced by BreakManyEdges(), mtspace_query_rect(), path_conflicts(), RouteOne(), and vector_duplicate().
void vector_destroy | ( | vector_t ** | vector | ) |
Destroy a vector.
Definition at line 109 of file vector.c.
References __vector_is_good().
Referenced by mtsFreeWork(), and RouteOne().
Copy a vector.
Definition at line 230 of file vector.c.
References __vector_is_good(), vector_struct::element, malloc(), vector_struct::max, vector_struct::size, and vector_create().
Referenced by path_conflicts().
vector_element_t vector_element | ( | vector_t * | vector, |
int | N | ||
) |
Definition at line 135 of file vector.c.
References __vector_is_good(), vector_struct::element, and N.
Referenced by __routebox_is_good(), touch_conflicts(), vector_element_first(), and vector_element_last().
vector_element_t vector_element_first | ( | vector_t * | vector | ) |
Return the first element of the vector.
Definition at line 146 of file vector.c.
References __vector_is_good(), vector_struct::size, and vector_element().
vector_element_t vector_element_last | ( | vector_t * | vector | ) |
Return the last element of the vector.
Definition at line 157 of file vector.c.
References __vector_is_good(), vector_struct::size, and vector_element().
void vector_insert | ( | vector_t * | vector, |
int | N, | ||
vector_element_t | data | ||
) |
Add data at specified position of vector.
Definition at line 196 of file vector.c.
References vector_insert_many().
void vector_insert_many | ( | vector_t * | vector, |
int | N, | ||
vector_element_t | data[], | ||
int | count | ||
) |
Add data at specified position of vector.
Definition at line 205 of file vector.c.
References __vector_is_good(), vector_struct::element, MAX, vector_struct::max, realloc(), and vector_struct::size.
Referenced by vector_append(), vector_append_many(), and vector_insert().
int vector_is_empty | ( | vector_t * | vector | ) |
Definition at line 121 of file vector.c.
References __vector_is_good(), and vector_struct::size.
Referenced by do_via_search(), mtsFreeWork(), mtspace_query_rect(), qloop(), and RouteOne().
vector_element_t vector_remove | ( | vector_t * | vector, |
int | N | ||
) |
Return and delete data at specified position of vector.
Definition at line 257 of file vector.c.
References __vector_is_good(), vector_struct::element, N, and vector_struct::size.
Referenced by vector_remove_last().
vector_element_t vector_remove_last | ( | vector_t * | vector | ) |
Return and delete the *last* element of vector.
Definition at line 247 of file vector.c.
References vector_struct::size, and vector_remove().
Referenced by do_via_search(), mtsFreeWork(), qloop(), and RouteOne().
vector_element_t vector_replace | ( | vector_t * | vector, |
vector_element_t | data, | ||
int | N | ||
) |
Replace the data at the specified position with the given data.
Definition at line 277 of file vector.c.
References __vector_is_good(), vector_struct::element, and N.
int vector_size | ( | vector_t * | vector | ) |
Definition at line 128 of file vector.c.
References __vector_is_good(), and vector_struct::size.
Referenced by __routebox_is_good(), mtsBoxCount(), and touch_conflicts().