threadsafe-hiredis 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/hiredis/version.rb +1 -1
- data/vendor/hiredis/COPYING +29 -0
- data/vendor/hiredis/Makefile +148 -0
- data/vendor/hiredis/async.c +622 -0
- data/vendor/hiredis/async.h +125 -0
- data/vendor/hiredis/dict.c +338 -0
- data/vendor/hiredis/dict.h +126 -0
- data/vendor/hiredis/fmacros.h +16 -0
- data/vendor/hiredis/hiredis.c +1285 -0
- data/vendor/hiredis/hiredis.h +210 -0
- data/vendor/hiredis/net.c +291 -0
- data/vendor/hiredis/net.h +47 -0
- data/vendor/hiredis/sds.c +605 -0
- data/vendor/hiredis/sds.h +88 -0
- data/vendor/hiredis/test.c +656 -0
- metadata +22 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f80d370be8f2b39063e5bcd7f0cf4b3f25a8bf1f
|
4
|
+
data.tar.gz: c0f46f606062b763356bb93e5f46c10106838c75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 941f1f9051a71fde86b8d3636d88d7c5467e0a9b792e1a82fd6cf5afb1126aaa3273fa7b20e92a30c49a322e054d3c158f65727edf6ad1b431c24a4959c745a2
|
7
|
+
data.tar.gz: 0b5670ad252129c2096fbde4ca47f2068efd4e10aaf94afd25cf685abdec89a2394b8e1e6400395a34dab4fec963d82856e13b9b496e43c8868a7f965b3ff534
|
data/lib/hiredis/version.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
|
2
|
+
Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
|
3
|
+
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
* Neither the name of Redis nor the names of its contributors may be used
|
17
|
+
to endorse or promote products derived from this software without specific
|
18
|
+
prior written permission.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
21
|
+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
22
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
24
|
+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
25
|
+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
26
|
+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
27
|
+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
28
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
29
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# Hiredis Makefile
|
2
|
+
# Copyright (C) 2010-2011 Salvatore Sanfilippo <antirez at gmail dot com>
|
3
|
+
# Copyright (C) 2010-2011 Pieter Noordhuis <pcnoordhuis at gmail dot com>
|
4
|
+
# This file is released under the BSD license, see the COPYING file
|
5
|
+
|
6
|
+
OBJ=net.o hiredis.o sds.o async.o
|
7
|
+
BINS=hiredis-example hiredis-test
|
8
|
+
LIBNAME=libhiredis
|
9
|
+
|
10
|
+
HIREDIS_MAJOR=0
|
11
|
+
HIREDIS_MINOR=10
|
12
|
+
|
13
|
+
# Fallback to gcc when $CC is not in $PATH.
|
14
|
+
CC:=$(shell sh -c 'type $(CC) >/dev/null 2>/dev/null && echo $(CC) || echo gcc')
|
15
|
+
OPTIMIZATION?=-O3
|
16
|
+
WARNINGS=-Wall -W -Wstrict-prototypes -Wwrite-strings
|
17
|
+
DEBUG?= -g -ggdb
|
18
|
+
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CFLAGS) $(WARNINGS) $(DEBUG) $(ARCH)
|
19
|
+
REAL_LDFLAGS=$(LDFLAGS) $(ARCH)
|
20
|
+
|
21
|
+
DYLIBSUFFIX=so
|
22
|
+
STLIBSUFFIX=a
|
23
|
+
DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR).$(HIREDIS_MINOR)
|
24
|
+
DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIREDIS_MAJOR)
|
25
|
+
DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
|
26
|
+
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
|
27
|
+
STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
|
28
|
+
STLIB_MAKE_CMD=ar rcs $(STLIBNAME)
|
29
|
+
|
30
|
+
# Platform-specific overrides
|
31
|
+
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
32
|
+
ifeq ($(uname_S),SunOS)
|
33
|
+
REAL_LDFLAGS+= -ldl -lnsl -lsocket
|
34
|
+
DYLIB_MAKE_CMD=$(CC) -G -o $(DYLIBNAME) -h $(DYLIB_MINOR_NAME) $(LDFLAGS)
|
35
|
+
INSTALL= cp -r
|
36
|
+
endif
|
37
|
+
ifeq ($(uname_S),Darwin)
|
38
|
+
DYLIBSUFFIX=dylib
|
39
|
+
DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(HIREDIS_MINOR).$(DYLIBSUFFIX)
|
40
|
+
DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDIS_MAJOR).$(DYLIBSUFFIX)
|
41
|
+
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
|
42
|
+
endif
|
43
|
+
|
44
|
+
all: $(DYLIBNAME) $(BINS)
|
45
|
+
|
46
|
+
# Deps (use make dep to generate this)
|
47
|
+
net.o: net.c fmacros.h net.h hiredis.h
|
48
|
+
async.o: async.c async.h hiredis.h sds.h dict.c dict.h
|
49
|
+
example.o: example.c hiredis.h
|
50
|
+
hiredis.o: hiredis.c fmacros.h hiredis.h net.h sds.h
|
51
|
+
sds.o: sds.c sds.h
|
52
|
+
test.o: test.c hiredis.h
|
53
|
+
|
54
|
+
$(DYLIBNAME): $(OBJ)
|
55
|
+
$(DYLIB_MAKE_CMD) $(OBJ)
|
56
|
+
|
57
|
+
$(STLIBNAME): $(OBJ)
|
58
|
+
$(STLIB_MAKE_CMD) $(OBJ)
|
59
|
+
|
60
|
+
dynamic: $(DYLIBNAME)
|
61
|
+
static: $(STLIBNAME)
|
62
|
+
|
63
|
+
# Binaries:
|
64
|
+
hiredis-example-libevent: example-libevent.c adapters/libevent.h $(STLIBNAME)
|
65
|
+
$(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -levent example-libevent.c $(STLIBNAME)
|
66
|
+
|
67
|
+
hiredis-example-libev: example-libev.c adapters/libev.h $(STLIBNAME)
|
68
|
+
$(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -lev example-libev.c $(STLIBNAME)
|
69
|
+
|
70
|
+
ifndef AE_DIR
|
71
|
+
hiredis-example-ae:
|
72
|
+
@echo "Please specify AE_DIR (e.g. <redis repository>/src)"
|
73
|
+
@false
|
74
|
+
else
|
75
|
+
hiredis-example-ae: example-ae.c adapters/ae.h $(STLIBNAME)
|
76
|
+
$(CC) -o $@ $(REAL_CFLAGS) $(REAL_LDFLAGS) -I$(AE_DIR) $(AE_DIR)/ae.o $(AE_DIR)/zmalloc.o example-ae.c $(STLIBNAME)
|
77
|
+
endif
|
78
|
+
|
79
|
+
hiredis-%: %.o $(STLIBNAME)
|
80
|
+
$(CC) -o $@ $(REAL_LDFLAGS) $< $(STLIBNAME)
|
81
|
+
|
82
|
+
test: hiredis-test
|
83
|
+
./hiredis-test
|
84
|
+
|
85
|
+
check: hiredis-test
|
86
|
+
echo \
|
87
|
+
"daemonize yes\n" \
|
88
|
+
"pidfile /tmp/hiredis-test-redis.pid\n" \
|
89
|
+
"port 56379\n" \
|
90
|
+
"bind 127.0.0.1\n" \
|
91
|
+
"unixsocket /tmp/hiredis-test-redis.sock" \
|
92
|
+
| redis-server -
|
93
|
+
./hiredis-test -h 127.0.0.1 -p 56379 -s /tmp/hiredis-test-redis.sock || \
|
94
|
+
( kill `cat /tmp/hiredis-test-redis.pid` && false )
|
95
|
+
kill `cat /tmp/hiredis-test-redis.pid`
|
96
|
+
|
97
|
+
.c.o:
|
98
|
+
$(CC) -std=c99 -pedantic -c $(REAL_CFLAGS) $<
|
99
|
+
|
100
|
+
clean:
|
101
|
+
rm -rf $(DYLIBNAME) $(STLIBNAME) $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov
|
102
|
+
|
103
|
+
dep:
|
104
|
+
$(CC) -MM *.c
|
105
|
+
|
106
|
+
# Installation related variables and target
|
107
|
+
PREFIX?=/usr/local
|
108
|
+
INCLUDE_PATH?=include/hiredis
|
109
|
+
LIBRARY_PATH?=lib
|
110
|
+
INSTALL_INCLUDE_PATH= $(PREFIX)/$(INCLUDE_PATH)
|
111
|
+
INSTALL_LIBRARY_PATH= $(PREFIX)/$(LIBRARY_PATH)
|
112
|
+
|
113
|
+
ifeq ($(uname_S),SunOS)
|
114
|
+
INSTALL?= cp -r
|
115
|
+
endif
|
116
|
+
|
117
|
+
INSTALL?= cp -a
|
118
|
+
|
119
|
+
install: $(DYLIBNAME) $(STLIBNAME)
|
120
|
+
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
|
121
|
+
$(INSTALL) hiredis.h async.h adapters $(INSTALL_INCLUDE_PATH)
|
122
|
+
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
|
123
|
+
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
|
124
|
+
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
|
125
|
+
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
|
126
|
+
|
127
|
+
32bit:
|
128
|
+
@echo ""
|
129
|
+
@echo "WARNING: if this fails under Linux you probably need to install libc6-dev-i386"
|
130
|
+
@echo ""
|
131
|
+
$(MAKE) CFLAGS="-m32" LDFLAGS="-m32"
|
132
|
+
|
133
|
+
gprof:
|
134
|
+
$(MAKE) CFLAGS="-pg" LDFLAGS="-pg"
|
135
|
+
|
136
|
+
gcov:
|
137
|
+
$(MAKE) CFLAGS="-fprofile-arcs -ftest-coverage" LDFLAGS="-fprofile-arcs"
|
138
|
+
|
139
|
+
coverage: gcov
|
140
|
+
make check
|
141
|
+
mkdir -p tmp/lcov
|
142
|
+
lcov -d . -c -o tmp/lcov/hiredis.info
|
143
|
+
genhtml --legend -o tmp/lcov/report tmp/lcov/hiredis.info
|
144
|
+
|
145
|
+
noopt:
|
146
|
+
$(MAKE) OPTIMIZATION=""
|
147
|
+
|
148
|
+
.PHONY: all test check clean dep install 32bit gprof gcov noopt
|