Tomato 1.28
[tomato.git] / release / src / router / pptp-client / vector.h
blob06a15d8c11d78b53d7eac447b6a7e657c5e4ca5b
1 /* vector.h ..... store a vector of PPTP_CALL information and search it
2 * efficiently.
3 * C. Scott Ananian <cananian@alumni.princeton.edu>
5 * $Id: vector.h,v 1.1.1.1 2002/07/25 06:52:39 honor Exp $
6 */
8 #ifndef INC_VECTOR_H
9 #define INC_VECTOR_H
11 #include "pptp_ctrl.h" /* for definition of PPTP_CALL */
13 typedef struct vector_struct VECTOR;
15 VECTOR *vector_create();
16 void vector_destroy(VECTOR *v);
18 int vector_size(VECTOR *v);
20 /* vector_insert and vector_search return TRUE on success, FALSE on failure. */
21 int vector_insert(VECTOR *v, int key, PPTP_CALL * call);
22 int vector_remove(VECTOR *v, int key);
23 int vector_search(VECTOR *v, int key, PPTP_CALL ** call);
24 /* vector_contains returns FALSE if not found, TRUE if found. */
25 int vector_contains(VECTOR *v, int key);
26 /* find first unused key. Returns TRUE on success, FALSE if no. */
27 int vector_scan(VECTOR *v, int lo, int hi, int *key);
28 /* get a specific PPTP_CALL ... useful only when iterating. */
29 PPTP_CALL * vector_get_Nth(VECTOR *v, int n);
31 #endif /* INC_VECTOR_H */