]> git.saurik.com Git - redis.git/blobdiff - src/redis.h
changed license to gpl BSD. LOL
[redis.git] / src / redis.h
index e9a31b8c3889f3a3c74fdc1bfd5aed4799c40807..ec982ee930fcf95c7992237bb1e43a426e5a4583 100644 (file)
 /* Hash table parameters */
 #define REDIS_HT_MINFILL        10      /* Minimal hash table fill 10% */
 
-/* Command flags:
- *   REDIS_CMD_DENYOOM:
- *     Commands marked with this flag will return an error when 'maxmemory' is
- *     set and the server is using more than 'maxmemory' bytes of memory.
- *     In short: commands with this flag are denied on low memory conditions.
- *   REDIS_CMD_FORCE_REPLICATION:
- *     Force replication even if dirty is 0. */
-#define REDIS_CMD_DENYOOM 4
-#define REDIS_CMD_FORCE_REPLICATION 8
+/* Command flags. Please check the command table defined in the redis.c file
+ * for more information about the meaning of every flag. */
+#define REDIS_CMD_WRITE 1                   /* "w" flag */
+#define REDIS_CMD_READONLY 2                /* "r" flag */
+#define REDIS_CMD_DENYOOM 4                 /* "m" flag */
+#define REDIS_CMD_FORCE_REPLICATION 8       /* "f" flag */
+#define REDIS_CMD_ADMIN 16                  /* "a" flag */
+#define REDIS_CMD_PUBSUB 32                 /* "p" flag */
+#define REDIS_CMD_NOSCRIPT  64              /* "s" flag */
+#define REDIS_CMD_RANDOM 128                /* "R" flag */
 
 /* Object types */
 #define REDIS_STRING 0
@@ -622,6 +623,8 @@ struct redisServer {
     dict *lua_scripts; /* A dictionary of SHA1 -> Lua scripts */
     long long lua_time_limit;
     long long lua_time_start;
+    int lua_random_dirty; /* True if a random command was called during the
+                             exection of the current script. */
 };
 
 typedef struct pubsubPattern {
@@ -635,7 +638,8 @@ struct redisCommand {
     char *name;
     redisCommandProc *proc;
     int arity;
-    int flags;
+    char *sflags; /* Flags as string represenation, one char per flag. */
+    int flags;    /* The actual flags, obtained from the 'sflags' field. */
     /* Use a function to determine keys arguments in a command line.
      * Used for Redis Cluster redirect. */
     redisGetKeysProc *getkeys_proc;