Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
9562351a
Commit
9562351a
authored
May 18, 2010
by
antirez
Browse files
more stuff into example
parent
3d8d3aa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
example.c
View file @
9562351a
...
...
@@ -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
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment