-
Notifications
You must be signed in to change notification settings - Fork 12
/
ssdb_geo.h
86 lines (75 loc) · 1.5 KB
/
ssdb_geo.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
* ssdb_geo.h
*
*/
#ifndef EXT_SSDB_SSDB_GEO_H_
#define EXT_SSDB_SSDB_GEO_H_
#include "php.h"
#include "ssdb_library.h"
#include "geo/geohash.h"
#include "geo/geohash_helper.h"
typedef struct _SSDBGeoNode {
struct _SSDBGeoNode *prev;
struct _SSDBGeoNode *next;
void *data;
} SSDBGeoNode;
typedef struct {
SSDBGeoNode *head;
SSDBGeoNode *tail;
unsigned long num;
void (*free)(void *ptr);
} SSDBGeoList;
typedef struct {
double latitude;
double longitude;
double dist;
char *member;
int member_key_len;
} SSDBGeoPoint;
typedef struct {
SSDBSock *ssdb_sock;
char *key;
int key_len;
char *member_key;
int member_key_len;
char *limit_str;
int limit_str_len;
} SSDBGeoObj;
bool ssdb_geo_set(
SSDBSock *ssdb_sock,
char *key,
int key_len,
char *member_key,
int member_key_len,
double latitude,
double longitude,
INTERNAL_FUNCTION_PARAMETERS);
bool ssdb_geo_get(
SSDBSock *ssdb_sock,
char *key,
int key_len,
char *member_key,
int member_key_len,
INTERNAL_FUNCTION_PARAMETERS);
bool ssdb_geo_neighbours(
SSDBSock *ssdb_sock,
char *key,
int key_len,
char *member_key,
int member_key_len,
double latitude,
double longitude,
double radius_meters,
long return_limit,
long zscan_limit,
INTERNAL_FUNCTION_PARAMETERS);
bool ssdb_geo_distance(
SSDBSock *ssdb_sock,
char *key,
int key_len,
char *member_a_key,
int member_a_key_len,
char *member_b_key,
int member_b_key_len,
INTERNAL_FUNCTION_PARAMETERS);
#endif /* EXT_SSDB_SSDB_GEO_H_ */