summaryrefslogtreecommitdiff
path: root/src/commands.h
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2023-05-15 13:08:15 +0300
committerGitHub <noreply@github.com>2023-05-15 13:08:15 +0300
commita51eb05b1895babb17c37c36b963e2bcbd5496d5 (patch)
tree7be24b09e0a5621a03e9f9ffe9ef27fcb44d8345 /src/commands.h
parente26a769d9627ebecb8607375580970a740348956 (diff)
parent986dbf716e0cb904c80bb444635cea3242859cc1 (diff)
downloadredis-7.2.tar.gz
Release Redis 7.2 RC27.2-rc27.2
Diffstat (limited to 'src/commands.h')
-rw-r--r--src/commands.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/commands.h b/src/commands.h
new file mode 100644
index 000000000..52acacfe0
--- /dev/null
+++ b/src/commands.h
@@ -0,0 +1,40 @@
+#ifndef __REDIS_COMMANDS_H
+#define __REDIS_COMMANDS_H
+
+/* Must be synced with ARG_TYPE_STR and generate-command-code.py */
+typedef enum {
+ ARG_TYPE_STRING,
+ ARG_TYPE_INTEGER,
+ ARG_TYPE_DOUBLE,
+ ARG_TYPE_KEY, /* A string, but represents a keyname */
+ ARG_TYPE_PATTERN,
+ ARG_TYPE_UNIX_TIME,
+ ARG_TYPE_PURE_TOKEN,
+ ARG_TYPE_ONEOF, /* Has subargs */
+ ARG_TYPE_BLOCK /* Has subargs */
+} redisCommandArgType;
+
+#define CMD_ARG_NONE (0)
+#define CMD_ARG_OPTIONAL (1<<0)
+#define CMD_ARG_MULTIPLE (1<<1)
+#define CMD_ARG_MULTIPLE_TOKEN (1<<2)
+
+/* WARNING! This struct must match RedisModuleCommandArg */
+typedef struct redisCommandArg {
+ const char *name;
+ redisCommandArgType type;
+ int key_spec_index;
+ const char *token;
+ const char *summary;
+ const char *since;
+ int flags;
+ const char *deprecated_since;
+ int num_args;
+ struct redisCommandArg *subargs;
+ const char *display_text;
+} redisCommandArg;
+
+/* Returns the command group name by group number. */
+const char *commandGroupStr(int index);
+
+#endif