pcb 4.1.1
An interactive printed circuit board layout editor.

vector.h

Go to the documentation of this file.
00001 
00040 #ifndef PCB_VECTOR_H
00041 #define PCB_VECTOR_H
00042 
00046 typedef struct vector_struct vector_t;
00047 
00051 typedef void *vector_element_t;
00052 
00053 vector_t *vector_create ();
00054 void vector_destroy (vector_t ** vector);
00055 vector_t *vector_duplicate (vector_t * vector);
00056 
00057 /* -- interrogation -- */
00058 int vector_is_empty (vector_t * vector);
00059 int vector_size (vector_t * vector);
00060 vector_element_t vector_element (vector_t * vector, int N);
00061 vector_element_t vector_element_first (vector_t * vector);
00062 vector_element_t vector_element_last (vector_t * vector);
00063 
00064 /* -- mutation -- */
00065 void vector_append (vector_t * vector, vector_element_t data);
00066 void vector_append_many (vector_t * vector,
00067                          vector_element_t data[], int count);
00068 void vector_append_vector (vector_t * vector, vector_t * other_vector);
00069 void vector_insert (vector_t * vector, int N, vector_element_t data);
00070 void vector_insert_many (vector_t * vector, int N,
00071                          vector_element_t data[], int count);
00072 vector_element_t vector_remove_last (vector_t * vector);
00073 vector_element_t vector_remove (vector_t * vector, int N);
00074 vector_element_t vector_replace (vector_t * vector,
00075                                  vector_element_t data, int N);
00076 
00077 #endif /* PCB_VECTOR_H */