-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathopcookie.h
More file actions
29 lines (23 loc) · 714 Bytes
/
opcookie.h
File metadata and controls
29 lines (23 loc) · 714 Bytes
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
#ifndef OPCOOKIE_H_
#define OPCOOKIE_H_
#include <php.h>
#include "couchbase.h"
#include "zap.h"
typedef struct {
void *next;
lcb_error_t err;
} opcookie_res;
typedef struct {
opcookie_res *res_head;
opcookie_res *res_tail;
lcb_error_t first_error;
} opcookie;
opcookie * opcookie_init();
void opcookie_destroy(opcookie *cookie);
void opcookie_push(opcookie *cookie, opcookie_res *res);
lcb_error_t opcookie_get_first_error(opcookie *cookie);
opcookie_res * opcookie_next_res(opcookie *cookie, opcookie_res *cur);
#define FOREACH_OPCOOKIE_RES(Type, Res, cookie) \
Res = NULL; \
while ((Res = (Type*)opcookie_next_res(cookie, (opcookie_res*)Res)) != NULL)
#endif /* OPCOOKIE_H_ */