summaryrefslogtreecommitdiff
path: root/example.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2010-05-18 18:13:25 +0200
committerantirez <antirez@gmail.com>2010-05-18 18:13:25 +0200
commit9562351ae543ca0f5ad67967eeb5a0147cb730b7 (patch)
tree213015adc445683519c8d4d45a48136f3e7aef4f /example.c
parent3d8d3aa0e57570612e62507ed69f3b7656428157 (diff)
more stuff into example
Diffstat (limited to 'example.c')
-rw-r--r--example.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/example.c b/example.c
index 2de310f..c3f1473 100644
--- a/example.c
+++ b/example.c
@@ -30,7 +30,22 @@ int main(void) {
printf("SET (binary API): %s\n", reply->reply);
freeReplyObject(reply);
+ /* Try a GET and two INCR */
+ reply = redisCommand(fd,"GET foo");
+ printf("GET foo: %s\n", reply->reply);
+ freeReplyObject(reply);
+
+ reply = redisCommand(fd,"INCR counter");
+ printf("INCR counter: %lld\n", reply->integer);
+ freeReplyObject(reply);
+ /* again ... */
+ reply = redisCommand(fd,"INCR counter");
+ printf("INCR counter: %lld\n", reply->integer);
+ freeReplyObject(reply);
+
/* Create a list of numbers, from 0 to 9 */
+ reply = redisCommand(fd,"DEL mylist");
+ freeReplyObject(reply);
for (j = 0; j < 10; j++) {
char buf[64];