]> git.saurik.com Git - redis.git/blobdiff - src/redis.h
Merge pull request #173 from jasondavies/typo
[redis.git] / src / redis.h
index 79ff3a6a0583eb5e8a941327afd497e3c8cfc634..d532e385913375e8edc497bcc73aec7a1e904fe0 100644 (file)
 #define UNIT_SECONDS 0
 #define UNIT_MILLISECONDS 1
 
+/* SHUTDOWN flags */
+#define REDIS_SHUTDOWN_SAVE 1       /* Force SAVE on SHUTDOWN even if no save
+                                       points are configured. */
+#define REDIS_SHUTDOWN_NOSAVE 2     /* Don't SAVE on SHUTDOWN. */
+
 /* We can print the stacktrace, so our assert is defined this way: */
 #define redisAssertWithInfo(_c,_o,_e) ((_e)?(void)0 : (_redisAssertWithInfo(_c,_o,#_e,__FILE__,__LINE__),_exit(1)))
 #define redisAssert(_e) ((_e)?(void)0 : (_redisAssert(#_e,__FILE__,__LINE__),_exit(1)))
@@ -538,7 +543,7 @@ struct redisServer {
     off_t auto_aofrewrite_base_size;/* AOF size on latest startup or rewrite. */
     off_t appendonly_current_size;  /* AOF current size. */
     int aofrewrite_scheduled;       /* Rewrite once BGSAVE terminates. */
-    int shutdown_asap;
+    int shutdown_asap;              /* SHUTDOWN needed */
     int activerehashing;
     char *requirepass;
     /* Persistence */
@@ -615,13 +620,17 @@ struct redisServer {
     /* Scripting */
     lua_State *lua; /* The Lua interpreter. We use just one for all clients */
     redisClient *lua_client; /* The "fake client" to query Redis from Lua */
+    redisClient *lua_caller; /* The client running EVAL right now, or NULL */
     dict *lua_scripts; /* A dictionary of SHA1 -> Lua scripts */
     long long lua_time_limit;
     long long lua_time_start;
+    int lua_write_dirty;  /* True if a write command was called during the
+                             execution of the current script. */
     int lua_random_dirty; /* True if a random command was called during the
-                             exection of the current script. */
+                             execution of the current script. */
     int lua_timedout;     /* True if we reached the time limit for script
                              execution. */
+    int lua_kill;         /* Kill the script if true. */
 };
 
 typedef struct pubsubPattern {
@@ -811,6 +820,7 @@ robj *tryObjectEncoding(robj *o);
 robj *getDecodedObject(robj *o);
 size_t stringObjectLen(robj *o);
 robj *createStringObjectFromLongLong(long long value);
+robj *createStringObjectFromLongDouble(long double value);
 robj *createListObject(void);
 robj *createZiplistObject(void);
 robj *createSetObject(void);
@@ -823,6 +833,8 @@ int checkType(redisClient *c, robj *o, int type);
 int getLongLongFromObjectOrReply(redisClient *c, robj *o, long long *target, const char *msg);
 int getDoubleFromObjectOrReply(redisClient *c, robj *o, double *target, const char *msg);
 int getLongLongFromObject(robj *o, long long *target);
+int getLongDoubleFromObject(robj *o, long double *target);
+int getLongDoubleFromObjectOrReply(redisClient *c, robj *o, long double *target, const char *msg);
 char *strEncoding(int encoding);
 int compareStringObjects(robj *a, robj *b);
 int equalStringObjects(robj *a, robj *b);
@@ -1004,6 +1016,7 @@ void incrCommand(redisClient *c);
 void decrCommand(redisClient *c);
 void incrbyCommand(redisClient *c);
 void decrbyCommand(redisClient *c);
+void incrbyfloatCommand(redisClient *c);
 void selectCommand(redisClient *c);
 void randomkeyCommand(redisClient *c);
 void keysCommand(redisClient *c);
@@ -1100,6 +1113,7 @@ void hgetallCommand(redisClient *c);
 void hexistsCommand(redisClient *c);
 void configCommand(redisClient *c);
 void hincrbyCommand(redisClient *c);
+void hincrbyfloatCommand(redisClient *c);
 void subscribeCommand(redisClient *c);
 void unsubscribeCommand(redisClient *c);
 void psubscribeCommand(redisClient *c);