mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Geo: command function names converted to lowercase, as elsewhere.
In Redis MULTIWORDCOMMANDNAME are mapped to functions where the command name is all lowercase: multiwordcommandnameCommand().
This commit is contained in:
parent
aae0a1f9cc
commit
a12192f5ff
18
src/geo.c
18
src/geo.c
@ -349,7 +349,7 @@ static int sort_gp_desc(const void *a, const void *b) {
|
|||||||
* ==================================================================== */
|
* ==================================================================== */
|
||||||
|
|
||||||
/* GEOADD key long lat name [long2 lat2 name2 ... longN latN nameN] */
|
/* GEOADD key long lat name [long2 lat2 name2 ... longN latN nameN] */
|
||||||
void geoAddCommand(redisClient *c) {
|
void geoaddCommand(redisClient *c) {
|
||||||
/* Check arguments number for sanity. */
|
/* Check arguments number for sanity. */
|
||||||
if ((c->argc - 2) % 3 != 0) {
|
if ((c->argc - 2) % 3 != 0) {
|
||||||
/* Need an odd number of arguments if we got this far... */
|
/* Need an odd number of arguments if we got this far... */
|
||||||
@ -405,7 +405,7 @@ void geoAddCommand(redisClient *c) {
|
|||||||
/* GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]
|
/* GEORADIUS key x y radius unit [WITHDIST] [WITHHASH] [WITHCOORD] [ASC|DESC]
|
||||||
* [COUNT count]
|
* [COUNT count]
|
||||||
* GEORADIUSBYMEMBER key member radius unit ... options ... */
|
* GEORADIUSBYMEMBER key member radius unit ... options ... */
|
||||||
static void geoRadiusGeneric(redisClient *c, int type) {
|
static void georadiusGeneric(redisClient *c, int type) {
|
||||||
robj *key = c->argv[1];
|
robj *key = c->argv[1];
|
||||||
|
|
||||||
/* Look up the requested zset */
|
/* Look up the requested zset */
|
||||||
@ -555,17 +555,17 @@ static void geoRadiusGeneric(redisClient *c, int type) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* GEORADIUS wrapper function. */
|
/* GEORADIUS wrapper function. */
|
||||||
void geoRadiusCommand(redisClient *c) {
|
void georadiusCommand(redisClient *c) {
|
||||||
geoRadiusGeneric(c, RADIUS_COORDS);
|
georadiusGeneric(c, RADIUS_COORDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GEORADIUSBYMEMBER wrapper function. */
|
/* GEORADIUSBYMEMBER wrapper function. */
|
||||||
void geoRadiusByMemberCommand(redisClient *c) {
|
void georadiusByMemberCommand(redisClient *c) {
|
||||||
geoRadiusGeneric(c, RADIUS_MEMBER);
|
georadiusGeneric(c, RADIUS_MEMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GEODECODE long lat */
|
/* GEODECODE long lat */
|
||||||
void geoDecodeCommand(redisClient *c) {
|
void geodecodeCommand(redisClient *c) {
|
||||||
GeoHashBits geohash;
|
GeoHashBits geohash;
|
||||||
if (getLongLongFromObjectOrReply(c, c->argv[1], (long long *)&geohash.bits,
|
if (getLongLongFromObjectOrReply(c, c->argv[1], (long long *)&geohash.bits,
|
||||||
NULL) != REDIS_OK)
|
NULL) != REDIS_OK)
|
||||||
@ -598,7 +598,7 @@ void geoDecodeCommand(redisClient *c) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* GEOENCODE long lat [radius unit] */
|
/* GEOENCODE long lat [radius unit] */
|
||||||
void geoEncodeCommand(redisClient *c) {
|
void geoencodeCommand(redisClient *c) {
|
||||||
double radius_meters = 0;
|
double radius_meters = 0;
|
||||||
if (c->argc == 5) {
|
if (c->argc == 5) {
|
||||||
if ((radius_meters = extractDistanceOrReply(c, c->argv + 3, NULL)) < 0)
|
if ((radius_meters = extractDistanceOrReply(c, c->argv + 3, NULL)) < 0)
|
||||||
@ -659,7 +659,7 @@ void geoEncodeCommand(redisClient *c) {
|
|||||||
*
|
*
|
||||||
* Returns an array with an 11 characters geohash representation of the
|
* Returns an array with an 11 characters geohash representation of the
|
||||||
* position of the specified elements. */
|
* position of the specified elements. */
|
||||||
void geoHashCommand(redisClient *c) {
|
void geohashCommand(redisClient *c) {
|
||||||
char *geoalphabet= "0123456789bcdefghjkmnpqrstuvwxyz";
|
char *geoalphabet= "0123456789bcdefghjkmnpqrstuvwxyz";
|
||||||
int j;
|
int j;
|
||||||
|
|
||||||
|
@ -3,12 +3,6 @@
|
|||||||
|
|
||||||
#include "redis.h"
|
#include "redis.h"
|
||||||
|
|
||||||
void geoEncodeCommand(redisClient *c);
|
|
||||||
void geoDecodeCommand(redisClient *c);
|
|
||||||
void geoRadiusByMemberCommand(redisClient *c);
|
|
||||||
void geoRadiusCommand(redisClient *c);
|
|
||||||
void geoAddCommand(redisClient *c);
|
|
||||||
|
|
||||||
/* Structures used inside geo.c in order to represent points and array of
|
/* Structures used inside geo.c in order to represent points and array of
|
||||||
* points on the earth. */
|
* points on the earth. */
|
||||||
typedef struct geoPoint {
|
typedef struct geoPoint {
|
||||||
|
12
src/redis.c
12
src/redis.c
@ -282,12 +282,12 @@ struct redisCommand redisCommandTable[] = {
|
|||||||
{"bitpos",bitposCommand,-3,"r",0,NULL,1,1,1,0,0},
|
{"bitpos",bitposCommand,-3,"r",0,NULL,1,1,1,0,0},
|
||||||
{"wait",waitCommand,3,"rs",0,NULL,0,0,0,0,0},
|
{"wait",waitCommand,3,"rs",0,NULL,0,0,0,0,0},
|
||||||
{"command",commandCommand,0,"rlt",0,NULL,0,0,0,0,0},
|
{"command",commandCommand,0,"rlt",0,NULL,0,0,0,0,0},
|
||||||
{"geoadd",geoAddCommand,-5,"wm",0,NULL,1,1,1,0,0},
|
{"geoadd",geoaddCommand,-5,"wm",0,NULL,1,1,1,0,0},
|
||||||
{"georadius",geoRadiusCommand,-6,"r",0,NULL,1,1,1,0,0},
|
{"georadius",georadiusCommand,-6,"r",0,NULL,1,1,1,0,0},
|
||||||
{"georadiusbymember",geoRadiusByMemberCommand,-5,"r",0,NULL,1,1,1,0,0},
|
{"georadiusbymember",georadiusByMemberCommand,-5,"r",0,NULL,1,1,1,0,0},
|
||||||
{"geoencode",geoEncodeCommand,-3,"r",0,NULL,0,0,0,0,0},
|
{"geoencode",geoencodeCommand,-3,"r",0,NULL,0,0,0,0,0},
|
||||||
{"geodecode",geoDecodeCommand,2,"r",0,NULL,0,0,0,0,0},
|
{"geodecode",geodecodeCommand,2,"r",0,NULL,0,0,0,0,0},
|
||||||
{"geohash",geoHashCommand,-2,"r",0,NULL,0,0,0,0,0},
|
{"geohash",geohashCommand,-2,"r",0,NULL,0,0,0,0,0},
|
||||||
{"geopos",geoposCommand,-2,"r",0,NULL,0,0,0,0,0},
|
{"geopos",geoposCommand,-2,"r",0,NULL,0,0,0,0,0},
|
||||||
{"pfselftest",pfselftestCommand,1,"r",0,NULL,0,0,0,0,0},
|
{"pfselftest",pfselftestCommand,1,"r",0,NULL,0,0,0,0,0},
|
||||||
{"pfadd",pfaddCommand,-2,"wmF",0,NULL,1,1,1,0,0},
|
{"pfadd",pfaddCommand,-2,"wmF",0,NULL,1,1,1,0,0},
|
||||||
|
12
src/redis.h
12
src/redis.h
@ -1558,12 +1558,12 @@ void bitcountCommand(redisClient *c);
|
|||||||
void bitposCommand(redisClient *c);
|
void bitposCommand(redisClient *c);
|
||||||
void replconfCommand(redisClient *c);
|
void replconfCommand(redisClient *c);
|
||||||
void waitCommand(redisClient *c);
|
void waitCommand(redisClient *c);
|
||||||
void geoEncodeCommand(redisClient *c);
|
void geoencodeCommand(redisClient *c);
|
||||||
void geoDecodeCommand(redisClient *c);
|
void geodecodeCommand(redisClient *c);
|
||||||
void geoRadiusByMemberCommand(redisClient *c);
|
void georadiusByMemberCommand(redisClient *c);
|
||||||
void geoRadiusCommand(redisClient *c);
|
void georadiusCommand(redisClient *c);
|
||||||
void geoAddCommand(redisClient *c);
|
void geoaddCommand(redisClient *c);
|
||||||
void geoHashCommand(redisClient *c);
|
void geohashCommand(redisClient *c);
|
||||||
void geoposCommand(redisClient *c);
|
void geoposCommand(redisClient *c);
|
||||||
void pfselftestCommand(redisClient *c);
|
void pfselftestCommand(redisClient *c);
|
||||||
void pfaddCommand(redisClient *c);
|
void pfaddCommand(redisClient *c);
|
||||||
|
Loading…
Reference in New Issue
Block a user