hirlite 0.0.2 → 0.0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/hirlite_ext/extconf.rb +2 -2
- data/lib/hirlite/version.rb +1 -1
- data/vendor/rlite/deps/lua/Makefile +128 -0
- data/vendor/rlite/deps/lua/src/fpconv.c +205 -0
- data/vendor/rlite/deps/lua/src/fpconv.h +22 -0
- data/vendor/rlite/deps/lua/src/lapi.c +1087 -0
- data/vendor/rlite/deps/lua/src/lapi.h +16 -0
- data/vendor/rlite/deps/lua/src/lauxlib.c +652 -0
- data/vendor/rlite/deps/lua/src/lauxlib.h +174 -0
- data/vendor/rlite/deps/lua/src/lbaselib.c +653 -0
- data/vendor/rlite/deps/lua/src/lcode.c +831 -0
- data/vendor/rlite/deps/lua/src/lcode.h +76 -0
- data/vendor/rlite/deps/lua/src/ldblib.c +398 -0
- data/vendor/rlite/deps/lua/src/ldebug.c +638 -0
- data/vendor/rlite/deps/lua/src/ldebug.h +33 -0
- data/vendor/rlite/deps/lua/src/ldo.c +519 -0
- data/vendor/rlite/deps/lua/src/ldo.h +57 -0
- data/vendor/rlite/deps/lua/src/ldump.c +164 -0
- data/vendor/rlite/deps/lua/src/lfunc.c +174 -0
- data/vendor/rlite/deps/lua/src/lfunc.h +34 -0
- data/vendor/rlite/deps/lua/src/lgc.c +710 -0
- data/vendor/rlite/deps/lua/src/lgc.h +110 -0
- data/vendor/rlite/deps/lua/src/linit.c +38 -0
- data/vendor/rlite/deps/lua/src/liolib.c +556 -0
- data/vendor/rlite/deps/lua/src/llex.c +463 -0
- data/vendor/rlite/deps/lua/src/llex.h +81 -0
- data/vendor/rlite/deps/lua/src/llimits.h +128 -0
- data/vendor/rlite/deps/lua/src/lmathlib.c +263 -0
- data/vendor/rlite/deps/lua/src/lmem.c +86 -0
- data/vendor/rlite/deps/lua/src/lmem.h +49 -0
- data/vendor/rlite/deps/lua/src/loadlib.c +666 -0
- data/vendor/rlite/deps/lua/src/lobject.c +214 -0
- data/vendor/rlite/deps/lua/src/lobject.h +381 -0
- data/vendor/rlite/deps/lua/src/lopcodes.c +102 -0
- data/vendor/rlite/deps/lua/src/lopcodes.h +268 -0
- data/vendor/rlite/deps/lua/src/loslib.c +243 -0
- data/vendor/rlite/deps/lua/src/lparser.c +1339 -0
- data/vendor/rlite/deps/lua/src/lparser.h +82 -0
- data/vendor/rlite/deps/lua/src/lstate.c +214 -0
- data/vendor/rlite/deps/lua/src/lstate.h +169 -0
- data/vendor/rlite/deps/lua/src/lstring.c +111 -0
- data/vendor/rlite/deps/lua/src/lstring.h +31 -0
- data/vendor/rlite/deps/lua/src/lstrlib.c +871 -0
- data/vendor/rlite/deps/lua/src/ltable.c +588 -0
- data/vendor/rlite/deps/lua/src/ltable.h +40 -0
- data/vendor/rlite/deps/lua/src/ltablib.c +287 -0
- data/vendor/rlite/deps/lua/src/ltm.c +75 -0
- data/vendor/rlite/deps/lua/src/ltm.h +54 -0
- data/vendor/rlite/deps/lua/src/lua.c +392 -0
- data/vendor/rlite/deps/lua/src/lua.h +388 -0
- data/vendor/rlite/deps/lua/src/lua_bit.c +189 -0
- data/vendor/rlite/deps/lua/src/lua_cjson.c +1427 -0
- data/vendor/rlite/deps/lua/src/lua_cmsgpack.c +957 -0
- data/vendor/rlite/deps/lua/src/lua_struct.c +421 -0
- data/vendor/rlite/deps/lua/src/luac.c +200 -0
- data/vendor/rlite/deps/lua/src/luaconf.h +763 -0
- data/vendor/rlite/deps/lua/src/lualib.h +53 -0
- data/vendor/rlite/deps/lua/src/lundump.c +227 -0
- data/vendor/rlite/deps/lua/src/lundump.h +36 -0
- data/vendor/rlite/deps/lua/src/lvm.c +767 -0
- data/vendor/rlite/deps/lua/src/lvm.h +36 -0
- data/vendor/rlite/deps/lua/src/lzio.c +82 -0
- data/vendor/rlite/deps/lua/src/lzio.h +67 -0
- data/vendor/rlite/deps/lua/src/print.c +227 -0
- data/vendor/rlite/deps/lua/src/strbuf.c +251 -0
- data/vendor/rlite/deps/lua/src/strbuf.h +154 -0
- data/vendor/rlite/src/Makefile +97 -25
- data/vendor/rlite/{deps → src}/crc64.c +0 -0
- data/vendor/rlite/{deps → src}/crc64.h +0 -0
- data/vendor/rlite/src/dump.c +2 -2
- data/vendor/rlite/{deps → src}/endianconv.h +0 -0
- data/vendor/rlite/src/hirlite.c +134 -90
- data/vendor/rlite/src/hirlite.h +34 -1
- data/vendor/rlite/{deps → src}/hyperloglog.c +0 -0
- data/vendor/rlite/{deps → src}/hyperloglog.h +0 -0
- data/vendor/rlite/{deps → src}/lzf.h +0 -0
- data/vendor/rlite/{deps → src}/lzfP.h +0 -0
- data/vendor/rlite/{deps → src}/lzf_c.c +0 -0
- data/vendor/rlite/{deps → src}/lzf_d.c +0 -0
- data/vendor/rlite/src/page_btree.c +10 -10
- data/vendor/rlite/src/page_btree.h +2 -2
- data/vendor/rlite/src/page_list.c +3 -3
- data/vendor/rlite/src/page_list.h +1 -1
- data/vendor/rlite/src/page_multi_string.c +1 -1
- data/vendor/rlite/src/page_skiplist.c +1 -1
- data/vendor/rlite/src/page_skiplist.h +1 -1
- data/vendor/rlite/src/rand.c +93 -0
- data/vendor/rlite/src/rand.h +38 -0
- data/vendor/rlite/src/restore.c +286 -155
- data/vendor/rlite/src/restore.h +6 -0
- data/vendor/rlite/src/rlite.c +30 -30
- data/vendor/rlite/src/rlite.h +1 -1
- data/vendor/rlite/src/scripting.c +1138 -0
- data/vendor/rlite/src/scripting.h +10 -0
- data/vendor/rlite/{deps → src}/sha1.c +0 -0
- data/vendor/rlite/{deps → src}/sha1.h +0 -0
- data/vendor/rlite/src/solarisfixes.h +54 -0
- data/vendor/rlite/src/sort.c +4 -2
- data/vendor/rlite/src/sort.h +1 -1
- data/vendor/rlite/src/type_string.c +1 -1
- data/vendor/rlite/src/util.c +4 -4
- data/vendor/rlite/src/util.h +3 -3
- data/vendor/rlite/{deps → src}/utilfromredis.c +0 -0
- data/vendor/rlite/{deps → src}/utilfromredis.h +0 -0
- metadata +84 -15
@@ -0,0 +1,154 @@
|
|
1
|
+
/* strbuf - String buffer routines
|
2
|
+
*
|
3
|
+
* Copyright (c) 2010-2012 Mark Pulford <mark@kyne.com.au>
|
4
|
+
*
|
5
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
* a copy of this software and associated documentation files (the
|
7
|
+
* "Software"), to deal in the Software without restriction, including
|
8
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
* the following conditions:
|
12
|
+
*
|
13
|
+
* The above copyright notice and this permission notice shall be
|
14
|
+
* included in all copies or substantial portions of the Software.
|
15
|
+
*
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
*/
|
24
|
+
|
25
|
+
#include <stdlib.h>
|
26
|
+
#include <stdarg.h>
|
27
|
+
|
28
|
+
/* Size: Total bytes allocated to *buf
|
29
|
+
* Length: String length, excluding optional NULL terminator.
|
30
|
+
* Increment: Allocation increments when resizing the string buffer.
|
31
|
+
* Dynamic: True if created via strbuf_new()
|
32
|
+
*/
|
33
|
+
|
34
|
+
typedef struct {
|
35
|
+
char *buf;
|
36
|
+
int size;
|
37
|
+
int length;
|
38
|
+
int increment;
|
39
|
+
int dynamic;
|
40
|
+
int reallocs;
|
41
|
+
int debug;
|
42
|
+
} strbuf_t;
|
43
|
+
|
44
|
+
#ifndef STRBUF_DEFAULT_SIZE
|
45
|
+
#define STRBUF_DEFAULT_SIZE 1023
|
46
|
+
#endif
|
47
|
+
#ifndef STRBUF_DEFAULT_INCREMENT
|
48
|
+
#define STRBUF_DEFAULT_INCREMENT -2
|
49
|
+
#endif
|
50
|
+
|
51
|
+
/* Initialise */
|
52
|
+
extern strbuf_t *strbuf_new(int len);
|
53
|
+
extern void strbuf_init(strbuf_t *s, int len);
|
54
|
+
extern void strbuf_set_increment(strbuf_t *s, int increment);
|
55
|
+
|
56
|
+
/* Release */
|
57
|
+
extern void strbuf_free(strbuf_t *s);
|
58
|
+
extern char *strbuf_free_to_string(strbuf_t *s, int *len);
|
59
|
+
|
60
|
+
/* Management */
|
61
|
+
extern void strbuf_resize(strbuf_t *s, int len);
|
62
|
+
static int strbuf_empty_length(strbuf_t *s);
|
63
|
+
static int strbuf_length(strbuf_t *s);
|
64
|
+
static char *strbuf_string(strbuf_t *s, int *len);
|
65
|
+
static void strbuf_ensure_empty_length(strbuf_t *s, int len);
|
66
|
+
static char *strbuf_empty_ptr(strbuf_t *s);
|
67
|
+
static void strbuf_extend_length(strbuf_t *s, int len);
|
68
|
+
|
69
|
+
/* Update */
|
70
|
+
extern void strbuf_append_fmt(strbuf_t *s, int len, const char *fmt, ...);
|
71
|
+
extern void strbuf_append_fmt_retry(strbuf_t *s, const char *format, ...);
|
72
|
+
static void strbuf_append_mem(strbuf_t *s, const char *c, int len);
|
73
|
+
extern void strbuf_append_string(strbuf_t *s, const char *str);
|
74
|
+
static void strbuf_append_char(strbuf_t *s, const char c);
|
75
|
+
static void strbuf_ensure_null(strbuf_t *s);
|
76
|
+
|
77
|
+
/* Reset string for before use */
|
78
|
+
static inline void strbuf_reset(strbuf_t *s)
|
79
|
+
{
|
80
|
+
s->length = 0;
|
81
|
+
}
|
82
|
+
|
83
|
+
static inline int strbuf_allocated(strbuf_t *s)
|
84
|
+
{
|
85
|
+
return s->buf != NULL;
|
86
|
+
}
|
87
|
+
|
88
|
+
/* Return bytes remaining in the string buffer
|
89
|
+
* Ensure there is space for a NULL terminator. */
|
90
|
+
static inline int strbuf_empty_length(strbuf_t *s)
|
91
|
+
{
|
92
|
+
return s->size - s->length - 1;
|
93
|
+
}
|
94
|
+
|
95
|
+
static inline void strbuf_ensure_empty_length(strbuf_t *s, int len)
|
96
|
+
{
|
97
|
+
if (len > strbuf_empty_length(s))
|
98
|
+
strbuf_resize(s, s->length + len);
|
99
|
+
}
|
100
|
+
|
101
|
+
static inline char *strbuf_empty_ptr(strbuf_t *s)
|
102
|
+
{
|
103
|
+
return s->buf + s->length;
|
104
|
+
}
|
105
|
+
|
106
|
+
static inline void strbuf_extend_length(strbuf_t *s, int len)
|
107
|
+
{
|
108
|
+
s->length += len;
|
109
|
+
}
|
110
|
+
|
111
|
+
static inline int strbuf_length(strbuf_t *s)
|
112
|
+
{
|
113
|
+
return s->length;
|
114
|
+
}
|
115
|
+
|
116
|
+
static inline void strbuf_append_char(strbuf_t *s, const char c)
|
117
|
+
{
|
118
|
+
strbuf_ensure_empty_length(s, 1);
|
119
|
+
s->buf[s->length++] = c;
|
120
|
+
}
|
121
|
+
|
122
|
+
static inline void strbuf_append_char_unsafe(strbuf_t *s, const char c)
|
123
|
+
{
|
124
|
+
s->buf[s->length++] = c;
|
125
|
+
}
|
126
|
+
|
127
|
+
static inline void strbuf_append_mem(strbuf_t *s, const char *c, int len)
|
128
|
+
{
|
129
|
+
strbuf_ensure_empty_length(s, len);
|
130
|
+
memcpy(s->buf + s->length, c, len);
|
131
|
+
s->length += len;
|
132
|
+
}
|
133
|
+
|
134
|
+
static inline void strbuf_append_mem_unsafe(strbuf_t *s, const char *c, int len)
|
135
|
+
{
|
136
|
+
memcpy(s->buf + s->length, c, len);
|
137
|
+
s->length += len;
|
138
|
+
}
|
139
|
+
|
140
|
+
static inline void strbuf_ensure_null(strbuf_t *s)
|
141
|
+
{
|
142
|
+
s->buf[s->length] = 0;
|
143
|
+
}
|
144
|
+
|
145
|
+
static inline char *strbuf_string(strbuf_t *s, int *len)
|
146
|
+
{
|
147
|
+
if (len)
|
148
|
+
*len = s->length;
|
149
|
+
|
150
|
+
return s->buf;
|
151
|
+
}
|
152
|
+
|
153
|
+
/* vi:ai et sw=4 ts=4:
|
154
|
+
*/
|
data/vendor/rlite/src/Makefile
CHANGED
@@ -1,7 +1,23 @@
|
|
1
|
-
|
1
|
+
# Hirlite 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
|
+
# Copyright (C) 2015 Sebastian Waisbrot <seppo0010 at gmail dot com>
|
5
|
+
|
6
|
+
# Partially based on hiredis's Makefile
|
7
|
+
# https://github.com/redis/hiredis/blob/master/Makefile
|
8
|
+
|
9
|
+
uname_S:= $(shell sh -c 'uname -s 2>/dev/null || echo not')
|
10
|
+
|
11
|
+
OBJ=rlite.o page_skiplist.o page_string.o page_list.o page_btree.o page_key.o page_multi_string.o page_long.o type_string.o type_list.o type_set.o type_zset.o type_hash.o util.o restore.o dump.o sort.o pqsort.o utilfromredis.o hyperloglog.o sha1.o crc64.o lzf_c.o lzf_d.o scripting.o rand.o hirlite.o
|
12
|
+
LIBNAME=libhirlite
|
13
|
+
PKGCONFNAME=hirlite.pc
|
14
|
+
|
15
|
+
HIRLITE_MAJOR=$(shell grep HIRLITE_MAJOR hirlite.h | awk '{print $$3}')
|
16
|
+
HIRLITE_MINOR=$(shell grep HIRLITE_MINOR hirlite.h | awk '{print $$3}')
|
17
|
+
HIRLITE_PATCH=$(shell grep HIRLITE_PATCH hirlite.h | awk '{print $$3}')
|
2
18
|
|
19
|
+
OPTIMIZATION?=-O2
|
3
20
|
ifeq ($(uname_S),SunOS)
|
4
|
-
# make isinf() available
|
5
21
|
CFLAGS?= -pedantic $(OPTIMIZATION) -Wall -W -D__EXTENSIONS__ -D_XPG6 -fPIC
|
6
22
|
DEBUG?=-g -ggdb
|
7
23
|
else
|
@@ -9,8 +25,10 @@ else
|
|
9
25
|
DEBUG?=-g -ggdb
|
10
26
|
endif
|
11
27
|
|
28
|
+
CFLAGS += -I./ -I../deps/lua/src/
|
29
|
+
|
12
30
|
DEBUG.gcc += -rdynamic
|
13
|
-
CFLAGS.gcc += -std=c99
|
31
|
+
CFLAGS.gcc += -std=c99
|
14
32
|
|
15
33
|
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
|
16
34
|
DEBUG += ${DEBUG.clang}
|
@@ -22,7 +40,35 @@ endif
|
|
22
40
|
|
23
41
|
LIBS=-lm
|
24
42
|
|
25
|
-
|
43
|
+
INSTALL?= cp -a
|
44
|
+
# Installation related variables and target
|
45
|
+
PREFIX?=/usr/local
|
46
|
+
INCLUDE_PATH?=include/hirlite
|
47
|
+
LIBRARY_PATH?=lib
|
48
|
+
PKGCONF_PATH?=pkgconfig
|
49
|
+
INSTALL_INCLUDE_PATH=$(DESTDIR)$(PREFIX)/$(INCLUDE_PATH)
|
50
|
+
INSTALL_LIBRARY_PATH=$(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
|
51
|
+
INSTALL_PKGCONF_PATH=$(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH)
|
52
|
+
|
53
|
+
ifeq ($(shell uname -s),Darwin)
|
54
|
+
DYLIBSUFFIX=dylib
|
55
|
+
DYLIB_MINOR_NAME=$(LIBNAME).$(HIRLITE_MAJOR).$(HIRLITE_MINOR).$(DYLIBSUFFIX)
|
56
|
+
DYLIB_MAJOR_NAME=$(LIBNAME).$(HIRLITE_MAJOR).$(DYLIBSUFFIX)
|
57
|
+
DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
|
58
|
+
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-install_name,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
|
59
|
+
else
|
60
|
+
DYLIBSUFFIX=so
|
61
|
+
DYLIB_MINOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIRLITE_MAJOR).$(HIRLITE_MINOR)
|
62
|
+
DYLIB_MAJOR_NAME=$(LIBNAME).$(DYLIBSUFFIX).$(HIRLITE_MAJOR)
|
63
|
+
DYLIBNAME=$(LIBNAME).$(DYLIBSUFFIX)
|
64
|
+
DYLIB_MAKE_CMD=$(CC) -shared -Wl,-soname,$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
|
65
|
+
endif
|
66
|
+
|
67
|
+
|
68
|
+
STLIBSUFFIX=a
|
69
|
+
STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
|
70
|
+
|
71
|
+
all: $(DYLIBNAME) $(STLIBNAME)
|
26
72
|
|
27
73
|
gcov: CFLAGS += -fprofile-arcs -ftest-coverage
|
28
74
|
gcov: clean test
|
@@ -32,48 +78,74 @@ builddebug: clean buildtest
|
|
32
78
|
|
33
79
|
debug: builddebug vtest
|
34
80
|
|
81
|
+
ifeq ($(uname_S),SunOS)
|
82
|
+
# Make isinf() available
|
83
|
+
LUA_CFLAGS= -D__C99FEATURES__=1
|
84
|
+
endif
|
85
|
+
LUA_CFLAGS+= -O2 -Wall -DENABLE_CJSON_GLOBAL $(CFLAGS)
|
86
|
+
LUA_LDFLAGS+= $(LDFLAGS)
|
87
|
+
LUA_STLIB=../deps/lua/src/liblua.a
|
88
|
+
AR=ar
|
89
|
+
ARFLAGS=rcu
|
90
|
+
|
91
|
+
lua:
|
92
|
+
cd ../deps/lua && $(MAKE) ansi CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)" AR="$(AR) $(ARFLAGS)"
|
93
|
+
|
35
94
|
lcov: gcov
|
36
95
|
mkdir -p lcov
|
37
96
|
lcov --directory . --capture --output-file lcov/app.info
|
38
97
|
genhtml lcov/app.info -o lcov/html
|
39
98
|
|
40
99
|
full-lcov: CFLAGS += -fprofile-arcs -ftest-coverage -DDEBUG=1
|
41
|
-
full-lcov: clean buildtest
|
100
|
+
full-lcov: clean buildtest
|
42
101
|
|
43
102
|
clang-analyzer:
|
44
103
|
rm -rf analyzer
|
45
|
-
scan-build -o analyzer
|
104
|
+
scan-build -o analyzer $(MAKE)
|
46
105
|
|
47
106
|
.c.o:
|
48
107
|
$(CC) $(ARCH) $(DEBUG) $(CFLAGS) -c $<
|
49
108
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
librlite.a: rlite.o page_skiplist.o page_string.o page_list.o page_btree.o page_key.o page_multi_string.o page_long.o type_string.o type_list.o type_set.o type_zset.o type_hash.o util.o restore.o dump.o sort.o pqsort.o ../deps/utilfromredis.o ../deps/hyperloglog.o ../deps/sha1.o ../deps/crc64.o ../deps/lzf_c.o ../deps/lzf_d.o
|
54
|
-
ar -cq librlite.a rlite.o page_skiplist.o page_string.o page_list.o page_btree.o page_key.o type_string.o type_list.o type_set.o type_zset.o type_hash.o page_long.o page_multi_string.o util.o utilfromredis.o hyperloglog.o sha1.o crc64.o lzf_c.o lzf_d.o restore.o dump.o sort.o pqsort.o
|
109
|
+
$(DYLIBNAME): $(OBJ) lua
|
110
|
+
$(DYLIB_MAKE_CMD) $(LUA_STLIB) $(OBJ)
|
55
111
|
|
56
|
-
|
57
|
-
|
112
|
+
$(STLIBNAME): $(OBJ)
|
113
|
+
ar -cq libhirlite.a $(OBJ)
|
58
114
|
|
59
|
-
|
60
|
-
$(CC) $(DEBUG) $(CFLAGS) -o
|
115
|
+
buildtest: $(STLIBNAME) test/rlite-test.o test/btree-test.o test/list-test.o test/string-test.o test/multi_string-test.o test/multi-test.o test/key-test.o test/type_string-test.o test/type_list-test.o test/type_set-test.o test/type_zset-test.o test/type_hash-test.o test/skiplist-test.o test/long-test.o test/restore-test.o test/hyperloglog-test.o test/dump-test.o test/sort-test.o test/test_util.o test/test.o test/echo.o test/hash.o test/list.o test/parser.o test/set.o test/string.o test/test_hirlite.o test/zset.o test/db.o test/multi.o test/hsort.o test/scripting-test.o
|
116
|
+
$(CC) $(DEBUG) $(CFLAGS) -o rlite-test test.o rlite-test.o btree-test.o list-test.o string-test.o multi_string-test.o multi-test.o key-test.o type_string-test.o type_list-test.o type_set-test.o type_zset-test.o type_hash-test.o skiplist-test.o long-test.o restore-test.o hyperloglog-test.o dump-test.o sort-test.o test_util.o $(STLIBNAME) $(LIBS)
|
117
|
+
$(CC) $(DEBUG) $(CFLAGS) -o hirlite-test echo.o hash.o list.o parser.o set.o string.o test_hirlite.o zset.o db.o multi.o hsort.o scripting-test.o $(STLIBNAME) $(LUA_STLIB) $(LIBS)
|
61
118
|
|
62
|
-
|
119
|
+
test: buildtest
|
63
120
|
./rlite-test
|
64
|
-
|
65
|
-
hirlitetest: buildhirlitetest
|
66
121
|
./hirlite-test
|
67
122
|
|
68
|
-
|
69
|
-
|
70
|
-
vrlitetest: buildtest
|
123
|
+
vtest: buildtest
|
71
124
|
valgrind --track-origins=yes --leak-check=full --show-reachable=yes ./rlite-test
|
72
|
-
|
73
|
-
vhirlitetest: buildhirlitetest
|
74
125
|
valgrind --track-origins=yes --leak-check=full --show-reachable=yes ./hirlite-test
|
75
126
|
|
76
|
-
|
127
|
+
$(PKGCONFNAME): hirlite.h
|
128
|
+
@echo "Generating $@ for pkgconfig..."
|
129
|
+
@echo prefix=$(PREFIX) > $@
|
130
|
+
@echo exec_prefix=$${prefix} >> $@
|
131
|
+
@echo libdir=$(PREFIX)/$(INCLUDE_PATH) >> $@
|
132
|
+
@echo includedir=$(PREFIX)/$(LIBRARY_PATH) >> $@
|
133
|
+
@echo >> $@
|
134
|
+
@echo Name: hirlite >> $@
|
135
|
+
@echo Description: rlite database library. >> $@
|
136
|
+
@echo Version: $(HIRLITE_MAJOR).$(HIRLITE_MINOR).$(HIRLITE_PATCH) >> $@
|
137
|
+
@echo Libs: -L$${libdir} -lhirlite >> $@
|
138
|
+
@echo Cflags: -I$${includedir} -D_FILE_OFFSET_BITS=64 >> $@
|
139
|
+
|
140
|
+
install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME)
|
141
|
+
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
|
142
|
+
$(INSTALL) *.h $(INSTALL_INCLUDE_PATH)
|
143
|
+
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
|
144
|
+
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
|
145
|
+
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MAJOR_NAME) $(DYLIBNAME)
|
146
|
+
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
|
147
|
+
mkdir -p $(INSTALL_PKGCONF_PATH)
|
148
|
+
$(INSTALL) $(PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
|
77
149
|
|
78
150
|
clean:
|
79
|
-
rm -rf *-test *.o *.a *.dSYM *.gcda *.gcno lcov
|
151
|
+
rm -rf *-test *.o *.a *.dSYM *.gcda *.gcno lcov *.dylib ./deps/lua/src/*.a
|
File without changes
|
File without changes
|
data/vendor/rlite/src/dump.c
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
#include <arpa/inet.h>
|
2
2
|
#include "rlite.h"
|
3
3
|
#include "util.h"
|
4
|
-
#include "
|
5
|
-
#include "
|
4
|
+
#include "crc64.h"
|
5
|
+
#include "endianconv.h"
|
6
6
|
|
7
7
|
int rl_dump(struct rlite *db, const unsigned char *key, long keylen, unsigned char **data, long *datalen)
|
8
8
|
{
|
File without changes
|