Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
89e06225
Commit
89e06225
authored
Nov 01, 2010
by
Pieter Noordhuis
Browse files
Move libev/libevent headers to adapters directory
parent
d5fc7d8c
Changes
5
Show whitespace changes
Inline
Side-by-side
Makefile
View file @
89e06225
...
@@ -37,11 +37,12 @@ all: ${DYLIBNAME} ${BINS}
...
@@ -37,11 +37,12 @@ all: ${DYLIBNAME} ${BINS}
# Deps (use make dep to generate this)
# Deps (use make dep to generate this)
anet.o
:
anet.c fmacros.h anet.h
anet.o
:
anet.c fmacros.h anet.h
async.o
:
async.c async.h hiredis.h sds.h util.h
async.o
:
async.c async.h hiredis.h sds.h util.h
example-libev.o
:
example-libev.c hiredis.h async.h adapters/libev.h
example-libevent.o
:
example-libevent.c hiredis.h async.h adapters/libevent.h
example.o
:
example.c hiredis.h
example.o
:
example.c hiredis.h
hiredis.o
:
hiredis.c hiredis.h anet.h sds.h util.h
hiredis.o
:
hiredis.c hiredis.h anet.h sds.h util.h
sds.o
:
sds.c sds.h
sds.o
:
sds.c sds.h
test.o
:
test.c hiredis.h
test.o
:
test.c hiredis.h
${DYLIBNAME}
:
${OBJ}
${DYLIBNAME}
:
${OBJ}
${DYLIB_MAKE_CMD}
${DYLIB_MAKE_CMD}
...
@@ -52,23 +53,23 @@ dynamic: ${DYLIBNAME}
...
@@ -52,23 +53,23 @@ dynamic: ${DYLIBNAME}
static
:
${STLIBNAME}
static
:
${STLIBNAME}
# Binaries:
# Binaries:
hiredis-example-libevent
:
${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-lhiredis
-levent
-Wl
,-rpath,. example-libevent.c
hiredis-example-libev
:
${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-lhiredis
-lev
-Wl
,-rpath,. example-libev.c
hiredis-%
:
%.o ${DYLIBNAME}
hiredis-%
:
%.o ${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-l
hiredis
-Wl
,-rpath,.
$<
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-L
.
-lhiredis
-Wl
,-rpath,.
$<
test
:
hiredis-test
test
:
hiredis-test
./hiredis-test
./hiredis-test
libevent-example
:
extra/hiredis/libevent.h libevent-example.c ${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-I
.
-Iextra
-L
.
-lhiredis
-levent
libevent-example.c
libev-example
:
extra/hiredis/libev.h libev-example.c ${DYLIBNAME}
$(CC)
-o
$@
$(CCOPT)
$(DEBUG)
-I
.
-Iextra
-L
.
-lhiredis
-lev
libev-example.c
.c.o
:
.c.o
:
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
$(CC)
-c
$(CFLAGS)
$(DEBUG)
$(COMPILE_TIME)
$<
clean
:
clean
:
rm
-rf
${DYLIBNAME}
${STLIBNAME}
$(BINS)
*
-example
*
.o
*
.gcda
*
.gcno
*
.gcov
rm
-rf
${DYLIBNAME}
${STLIBNAME}
$(BINS)
hiredis
-example
*
*
.o
*
.gcda
*
.gcno
*
.gcov
dep
:
dep
:
$(CC)
-MM
*
.c
$(CC)
-MM
*
.c
...
...
extra/hiredi
s/libev.h
→
adapter
s/libev.h
View file @
89e06225
#include <sys/types.h>
#include <sys/types.h>
#include <ev.h>
#include <ev.h>
#include
<
hiredis.h
>
#include
"../
hiredis.h
"
#include
<
async.h
>
#include
"../
async.h
"
typedef
struct
redisLibevEvents
{
typedef
struct
redisLibevEvents
{
redisAsyncContext
*
context
;
redisAsyncContext
*
context
;
...
...
extra/hiredi
s/libevent.h
→
adapter
s/libevent.h
View file @
89e06225
#include <sys/types.h>
#include <sys/types.h>
#include <event.h>
#include <event.h>
#include
<
hiredis.h
>
#include
"../
hiredis.h
"
#include
<
async.h
>
#include
"../
async.h
"
typedef
struct
redisLibeventEvents
{
typedef
struct
redisLibeventEvents
{
redisAsyncContext
*
context
;
redisAsyncContext
*
context
;
...
...
libev-
example.c
→
example
-libev
.c
View file @
89e06225
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <hiredis/libev.h>
#include <async.h>
#include <signal.h>
#include <signal.h>
#include "hiredis.h"
#include "async.h"
#include "adapters/libev.h"
void
getCallback
(
redisAsyncContext
*
c
,
redisReply
*
reply
,
void
*
privdata
)
{
void
getCallback
(
redisAsyncContext
*
c
,
redisReply
*
reply
,
void
*
privdata
)
{
printf
(
"argv[%s]: %s
\n
"
,
(
char
*
)
privdata
,
reply
->
str
);
printf
(
"argv[%s]: %s
\n
"
,
(
char
*
)
privdata
,
reply
->
str
);
...
...
libevent
-example
.c
→
example-
libevent.c
View file @
89e06225
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdlib.h>
#include <string.h>
#include <string.h>
#include <hiredis/libevent.h>
#include <async.h>
#include <signal.h>
#include <signal.h>
#include "hiredis.h"
#include "async.h"
#include "adapters/libevent.h"
void
getCallback
(
redisAsyncContext
*
c
,
redisReply
*
reply
,
void
*
privdata
)
{
void
getCallback
(
redisAsyncContext
*
c
,
redisReply
*
reply
,
void
*
privdata
)
{
printf
(
"argv[%s]: %s
\n
"
,
(
char
*
)
privdata
,
reply
->
str
);
printf
(
"argv[%s]: %s
\n
"
,
(
char
*
)
privdata
,
reply
->
str
);
...
...
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