-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlistIteratorG.h
35 lines (27 loc) · 910 Bytes
/
listIteratorG.h
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
32
33
34
35
/* listIteratorG.h ... interface to generic List Iterator
Written by Ashesh Mahidadia, August 2017
*/
#ifndef LISTITERATORG_H
#define LISTITERATORG_H
#include <stdio.h>
typedef struct IteratorGRep *IteratorG;
typedef int (*ElmCompareFp)(void const *e1, void const *e2);
typedef void *(*ElmNewFp)(void const *e1);
typedef void (*ElmFreeFp)(void *e1);
IteratorG IteratorGNew(ElmCompareFp cmpFp, ElmNewFp newFp, ElmFreeFp freeFp);
int add(IteratorG it, void *vp);
int hasNext(IteratorG it);
int hasPrevious(IteratorG it);
void *next(IteratorG it);
void *previous(IteratorG it);
int delete(IteratorG it);
int set(IteratorG it, void *vp);
void *findNext(IteratorG it, void *vp);
void *findPrevious(IteratorG it, void *vp);
void reset(IteratorG it);
void freeIt(IteratorG it);
void printstuff(IteratorG it);
void current(IteratorG it);
void test(IteratorG it);
void prevtest(IteratorG it);
#endif