Commit 9562351a authored by antirez's avatar antirez
Browse files

more stuff into example

parent 3d8d3aa0
...@@ -30,7 +30,22 @@ int main(void) { ...@@ -30,7 +30,22 @@ int main(void) {
printf("SET (binary API): %s\n", reply->reply); printf("SET (binary API): %s\n", reply->reply);
freeReplyObject(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 */ /* Create a list of numbers, from 0 to 9 */
reply = redisCommand(fd,"DEL mylist");
freeReplyObject(reply);
for (j = 0; j < 10; j++) { for (j = 0; j < 10; j++) {
char buf[64]; char buf[64];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment