summaryrefslogtreecommitdiff
path: root/examples/example-glib.c
diff options
context:
space:
mode:
authorAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-03-23 01:21:46 +0100
committerAnna (navi) Figueiredo Gomes <navi@vlhl.dev>2024-03-23 01:21:46 +0100
commitbb3475e8eb379ee18f3d8f37caa8040b852a6213 (patch)
tree89975f1c23814a7ab5e16f5c7887f55f1888a27a /examples/example-glib.c
parentaee72918851db8af296e096b759dfb7aaea17968 (diff)
all: rename redis -> redict symbols and commentsmaster
Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Diffstat (limited to 'examples/example-glib.c')
-rw-r--r--examples/example-glib.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/examples/example-glib.c b/examples/example-glib.c
index 46aa550..97cf279 100644
--- a/examples/example-glib.c
+++ b/examples/example-glib.c
@@ -13,10 +13,10 @@
static GMainLoop *mainloop;
static void
-connect_cb (const redisAsyncContext *ac G_GNUC_UNUSED,
+connect_cb (const redictAsyncContext *ac G_GNUC_UNUSED,
int status)
{
- if (status != REDIS_OK) {
+ if (status != REDICT_OK) {
g_printerr("Failed to connect: %s\n", ac->errstr);
g_main_loop_quit(mainloop);
} else {
@@ -25,10 +25,10 @@ connect_cb (const redisAsyncContext *ac G_GNUC_UNUSED,
}
static void
-disconnect_cb (const redisAsyncContext *ac G_GNUC_UNUSED,
+disconnect_cb (const redictAsyncContext *ac G_GNUC_UNUSED,
int status)
{
- if (status != REDIS_OK) {
+ if (status != REDICT_OK) {
g_error("Failed to disconnect: %s", ac->errstr);
} else {
g_printerr("Disconnected...\n");
@@ -37,41 +37,41 @@ disconnect_cb (const redisAsyncContext *ac G_GNUC_UNUSED,
}
static void
-command_cb(redisAsyncContext *ac,
+command_cb(redictAsyncContext *ac,
gpointer r,
gpointer user_data G_GNUC_UNUSED)
{
- redisReply *reply = r;
+ redictReply *reply = r;
if (reply) {
g_print("REPLY: %s\n", reply->str);
}
- redisAsyncDisconnect(ac);
+ redictAsyncDisconnect(ac);
}
gint
main (gint argc G_GNUC_UNUSED,
gchar *argv[] G_GNUC_UNUSED)
{
- redisAsyncContext *ac;
+ redictAsyncContext *ac;
GMainContext *context = NULL;
GSource *source;
- ac = redisAsyncConnect("127.0.0.1", 6379);
+ ac = redictAsyncConnect("127.0.0.1", 6379);
if (ac->err) {
g_printerr("%s\n", ac->errstr);
exit(EXIT_FAILURE);
}
- source = redis_source_new(ac);
+ source = redict_source_new(ac);
mainloop = g_main_loop_new(context, FALSE);
g_source_attach(source, context);
- redisAsyncSetConnectCallback(ac, connect_cb);
- redisAsyncSetDisconnectCallback(ac, disconnect_cb);
- redisAsyncCommand(ac, command_cb, NULL, "SET key 1234");
- redisAsyncCommand(ac, command_cb, NULL, "GET key");
+ redictAsyncSetConnectCallback(ac, connect_cb);
+ redictAsyncSetDisconnectCallback(ac, disconnect_cb);
+ redictAsyncCommand(ac, command_cb, NULL, "SET key 1234");
+ redictAsyncCommand(ac, command_cb, NULL, "GET key");
g_main_loop_run(mainloop);