11 #ifndef FIRM_ADT_PDEQ_H
12 #define FIRM_ADT_PDEQ_H
33 typedef int (*
cmp_fun)(
const void *elem,
const void *key);
void * pdeq_getr(pdeq *dq)
Retrieve (and remove) a pointer from the right site of a double ended pointer list.
pdeq * pdeq_putl(pdeq *dq, const void *x)
Add a pointer to the left side of a double ended pointer list.
void del_pdeq(pdeq *dq)
Delete a double ended pointer list.
pdeq * pdeq_putr(pdeq *dq, const void *x)
Add a pointer to the right side of a double ended pointer list.
void * pdeq_getl(pdeq *dq)
Retrieve (and remove) a pointer from the left site of a double ended pointer list.
void * pdeq_search(pdeq const *qp, cmp_fun cmp, const void *key)
Search a key in a double ended pointer list, the search is controlled by a compare function...
size_t pdeq_len(pdeq const *dq)
Returns the length of a double ended pointer list.
int(* cmp_fun)(const void *elem, const void *key)
The type of the pointer compare function.
pdeq * new_pdeq(void)
Creates a new double ended pointer list.
int pdeq_contains(pdeq const *dq, const void *x)
Returns non-zero if a double ended pointer list contains a pointer x.
struct pdeq pdeq
The pointer double ended queue (list).
int pdeq_empty(pdeq const *dq)
Checks if a list is empty.
void ** pdeq_copyr(const pdeq *qp, const void **dst)
Convert the double ended pointer list into a linear array beginning from right, the first element in ...
void ** pdeq_copyl(const pdeq *qp, const void **dst)
Convert the double ended pointer list into a linear array beginning from left, the first element in t...