File: vector.h

package info (click to toggle)
pptp-linux 1.10.0-2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 640 kB
  • sloc: ansic: 3,689; makefile: 142; perl: 117
file content (31 lines) | stat: -rw-r--r-- 1,065 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* vector.h ..... store a vector of PPTP_CALL information and search it
 *                efficiently.
 *                C. Scott Ananian <cananian@alumni.princeton.edu>
 *
 * $Id: vector.h,v 1.2 2011/12/19 07:15:03 quozl Exp $
 */

#ifndef INC_VECTOR_H
#define INC_VECTOR_H

#include "pptp_ctrl.h" /* for definition of PPTP_CALL */

typedef struct vector_struct VECTOR;

VECTOR *vector_create(void);
void vector_destroy(VECTOR *v);

int vector_size(VECTOR *v);

/* vector_insert and vector_search return TRUE on success, FALSE on failure. */
int  vector_insert(VECTOR *v, int key, PPTP_CALL * call);
int  vector_remove(VECTOR *v, int key);
int  vector_search(VECTOR *v, int key, PPTP_CALL ** call);
/* vector_contains returns FALSE if not found, TRUE if found. */
int  vector_contains(VECTOR *v, int key);
/* find first unused key. Returns TRUE on success, FALSE if no. */
int  vector_scan(VECTOR *v, int lo, int hi, int *key);
/* get a specific PPTP_CALL ... useful only when iterating. */
PPTP_CALL * vector_get_Nth(VECTOR *v, int n);

#endif /* INC_VECTOR_H */