1/* vector.h ..... store a vector of PPTP_CALL information and search it 2 * efficiently. 3 * C. Scott Ananian <cananian@alumni.princeton.edu> 4 * 5 * $Id: vector.h,v 1.1.1.1 2000/12/23 08:19:51 scott Exp $ 6 */ 7 8#ifndef INC_VECTOR_H 9#define INC_VECTOR_H 10 11#include "pptp_ctrl.h" /* for definition of PPTP_CALL */ 12 13typedef struct vector_struct VECTOR; 14 15VECTOR *vector_create(); 16void vector_destroy(VECTOR *v); 17 18int vector_size(VECTOR *v); 19 20/* vector_insert and vector_search return TRUE on success, FALSE on failure. */ 21int vector_insert(VECTOR *v, int key, PPTP_CALL * call); 22int vector_remove(VECTOR *v, int key); 23int vector_search(VECTOR *v, int key, PPTP_CALL ** call); 24/* vector_contains returns FALSE if not found, TRUE if found. */ 25int vector_contains(VECTOR *v, int key); 26/* find first unused key. Returns TRUE on success, FALSE if no. */ 27int vector_scan(VECTOR *v, int lo, int hi, int *key); 28/* get a specific PPTP_CALL ... useful only when iterating. */ 29PPTP_CALL * vector_get_Nth(VECTOR *v, int n); 30 31#endif /* INC_VECTOR_H */ 32