deps/hiredict: update to restructured version

this allows for redict to use the same include paths for both system and
vendored hiredict, allowing use of system hiredict without patches.

Signed-off-by: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
This commit is contained in:
Anna (navi) Figueiredo Gomes 2024-04-19 12:29:19 +02:00
parent d2e5e96559
commit 52c3e46637
73 changed files with 244 additions and 213 deletions

View File

@ -111,18 +111,18 @@ Files: deps/hiredict/.gitignore deps/hiredict/.travis.yml deps/hiredict/appveyor
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: deps/hiredict/hiredict.pc.in deps/hiredict/hiredict.targets deps/hiredict/hiredict_ssl.pc.in Files: deps/hiredict/util/hiredict.pc.in deps/hiredict/util/hiredict.targets deps/hiredict/util/hiredict_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: deps/hiredict/shim/hiredis.pc.in deps/hiredict/shim/hiredis_ssl.pc.in Files: deps/hiredict/util/hiredis.pc.in deps/hiredict/util/hiredis_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: deps/hiredict/hiredict-config.cmake.in deps/hiredict/hiredict_ssl-config.cmake.in Files: deps/hiredict/util/hiredict-config.cmake.in deps/hiredict/util/hiredict_ssl-config.cmake.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: deps/hiredict/hiredict.targets Files: deps/hiredict/util/hiredict.targets
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause

View File

@ -1,6 +1,7 @@
/hiredict-test /hiredict-test
/examples/hiredict-example* /examples/hiredict-example*
/*.o src/*.o
src/*.d
/*.so /*.so
/*.dylib /*.dylib
/*.a /*.a

View File

@ -7,18 +7,18 @@ Files: .gitignore .travis.yml appveyor.yml
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: hiredict.pc.in hiredict.targets hiredict_ssl.pc.in Files: util/hiredict.pc.in util/hiredict.targets util/hiredict_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: shim/hiredis.pc.in shim/hiredis_ssl.pc.in Files: util/hiredis.pc.in util/hiredis_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: hiredict-config.cmake.in hiredict_ssl-config.cmake.in Files: util/hiredict-config.cmake.in util/hiredict_ssl-config.cmake.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause
Files: hiredict.targets Files: util/hiredict.targets
Copyright: Salvatore Sanfilippo <antirez at gmail dot com> Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause License: BSD-3-Clause

View File

@ -8,7 +8,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
MACRO(getVersionBit name) MACRO(getVersionBit name)
SET(VERSION_REGEX "^#define ${name} (.+)$") SET(VERSION_REGEX "^#define ${name} (.+)$")
FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/hiredict.h" FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/include/hiredict/hiredict.h"
VERSION_BIT REGEX ${VERSION_REGEX}) VERSION_BIT REGEX ${VERSION_REGEX})
STRING(REGEX REPLACE ${VERSION_REGEX} "\\1" ${name} "${VERSION_BIT}") STRING(REGEX REPLACE ${VERSION_REGEX} "\\1" ${name} "${VERSION_BIT}")
ENDMACRO(getVersionBit) ENDMACRO(getVersionBit)
@ -38,13 +38,13 @@ SET(CMAKE_C_STANDARD 99)
SET(CMAKE_DEBUG_POSTFIX d) SET(CMAKE_DEBUG_POSTFIX d)
SET(hiredict_sources SET(hiredict_sources
alloc.c src/alloc.c
async.c src/async.c
hiredict.c src/hiredict.c
net.c src/net.c
read.c src/read.c
sds.c src/sds.c
sockcompat.c) src/sockcompat.c)
SET(hiredict_sources ${hiredict_sources}) SET(hiredict_sources ${hiredict_sources})
@ -52,6 +52,7 @@ IF(WIN32)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS -DWIN32_LEAN_AND_MEAN)
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(include)
ADD_LIBRARY(hiredict ${hiredict_sources}) ADD_LIBRARY(hiredict ${hiredict_sources})
ADD_LIBRARY(hiredict::hiredict ALIAS hiredict) ADD_LIBRARY(hiredict::hiredict ALIAS hiredict)
set(hiredict_export_name hiredict CACHE STRING "Name of the exported target") set(hiredict_export_name hiredict CACHE STRING "Name of the exported target")
@ -76,8 +77,8 @@ ENDIF()
TARGET_INCLUDE_DIRECTORIES(hiredict PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) TARGET_INCLUDE_DIRECTORIES(hiredict PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
CONFIGURE_FILE(hiredict.pc.in hiredict.pc @ONLY) CONFIGURE_FILE(util/hiredict.pc.in hiredict.pc @ONLY)
CONFIGURE_FILE(shim/hiredis.pc.in hiredis.pc @ONLY) CONFIGURE_FILE(util/hiredis.pc.in hiredis.pc @ONLY)
set(CPACK_PACKAGE_VENDOR "Redict") set(CPACK_PACKAGE_VENDOR "Redict")
set(CPACK_PACKAGE_DESCRIPTION "\ set(CPACK_PACKAGE_DESCRIPTION "\
@ -118,18 +119,24 @@ endif()
if (ENABLE_NUGET) if (ENABLE_NUGET)
# For NuGet packages # For NuGet packages
INSTALL(FILES hiredict.targets INSTALL(FILES util/hiredict.targets
DESTINATION build/native) DESTINATION build/native)
endif() endif()
INSTALL(FILES hiredict.h read.h sds.h async.h alloc.h sockcompat.h INSTALL(FILES
include/hiredict/hiredict.h
include/hiredict/read.h
include/hiredict/sds.h
include/hiredict/async.h
include/hiredict/alloc.h
include/hiredict/sockcompat.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(FILES shim/hiredis.h shim/read.h shim/sds.h INSTALL(FILES shim/hiredis.h shim/read.h shim/sds.h
shim/async.h shim/alloc.h shim/sockcompat.h shim/async.h shim/alloc.h shim/sockcompat.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
INSTALL(DIRECTORY adapters INSTALL(DIRECTORY include/hiredict/adapters
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(DIRECTORY shim/adapters INSTALL(DIRECTORY shim/adapters
@ -154,7 +161,7 @@ SET(INCLUDE_INSTALL_DIR include)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/hiredict-config-version.cmake" write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/hiredict-config-version.cmake"
COMPATIBILITY SameMajorVersion) COMPATIBILITY SameMajorVersion)
configure_package_config_file(hiredict-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredict-config.cmake configure_package_config_file(util/hiredict-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/hiredict-config.cmake
INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR} INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR}
PATH_VARS INCLUDE_INSTALL_DIR) PATH_VARS INCLUDE_INSTALL_DIR)
@ -176,7 +183,7 @@ IF(ENABLE_SSL)
ENDIF() ENDIF()
FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(OpenSSL REQUIRED)
SET(hiredict_ssl_sources SET(hiredict_ssl_sources
ssl.c) src/ssl.c)
ADD_LIBRARY(hiredict_ssl ${hiredict_ssl_sources}) ADD_LIBRARY(hiredict_ssl ${hiredict_ssl_sources})
ADD_LIBRARY(hiredict::hiredict_ssl ALIAS hiredict_ssl) ADD_LIBRARY(hiredict::hiredict_ssl ALIAS hiredict_ssl)
@ -196,8 +203,8 @@ IF(ENABLE_SSL)
IF(WIN32) IF(WIN32)
TARGET_LINK_LIBRARIES(hiredict_ssl PRIVATE hiredict) TARGET_LINK_LIBRARIES(hiredict_ssl PRIVATE hiredict)
ENDIF() ENDIF()
CONFIGURE_FILE(hiredict_ssl.pc.in hiredict_ssl.pc @ONLY) CONFIGURE_FILE(util/hiredict_ssl.pc.in hiredict_ssl.pc @ONLY)
CONFIGURE_FILE(shim/hiredis_ssl.pc.in hiredis_ssl.pc @ONLY) CONFIGURE_FILE(util/hiredis_ssl.pc.in hiredis_ssl.pc @ONLY)
INSTALL(TARGETS hiredict_ssl INSTALL(TARGETS hiredict_ssl
EXPORT hiredict_ssl-targets EXPORT hiredict_ssl-targets
@ -211,7 +218,7 @@ IF(ENABLE_SSL)
CONFIGURATIONS Debug RelWithDebInfo) CONFIGURATIONS Debug RelWithDebInfo)
endif() endif()
INSTALL(FILES hiredict_ssl.h INSTALL(FILES include/hiredict/hiredict_ssl.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(FILES shim/hiredis_ssl.h INSTALL(FILES shim/hiredis_ssl.h
@ -232,7 +239,7 @@ IF(ENABLE_SSL)
else() else()
SET(CMAKE_CONF_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/hiredict_ssl) SET(CMAKE_CONF_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/hiredict_ssl)
endif() endif()
configure_package_config_file(hiredict_ssl-config.cmake.in configure_package_config_file(util/hiredict_ssl-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/hiredict_ssl-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/hiredict_ssl-config.cmake
INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR} INSTALL_DESTINATION ${CMAKE_CONF_INSTALL_DIR}
PATH_VARS INCLUDE_INSTALL_DIR) PATH_VARS INCLUDE_INSTALL_DIR)
@ -248,7 +255,7 @@ ENDIF()
IF(NOT DISABLE_TESTS) IF(NOT DISABLE_TESTS)
ENABLE_TESTING() ENABLE_TESTING()
ADD_EXECUTABLE(hiredict-test test.c) ADD_EXECUTABLE(hiredict-test src/test.c)
TARGET_LINK_LIBRARIES(hiredict-test hiredict) TARGET_LINK_LIBRARIES(hiredict-test hiredict)
IF(ENABLE_SSL_TESTS) IF(ENABLE_SSL_TESTS)
ADD_DEFINITIONS(-DHIREDICT_TEST_SSL=1) ADD_DEFINITIONS(-DHIREDICT_TEST_SSL=1)
@ -259,7 +266,7 @@ IF(NOT DISABLE_TESTS)
TARGET_LINK_LIBRARIES(hiredict-test event) TARGET_LINK_LIBRARIES(hiredict-test event)
ENDIF() ENDIF()
ADD_TEST(NAME hiredict-test ADD_TEST(NAME hiredict-test
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test.sh) COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/util/test.sh)
ENDIF() ENDIF()
# Add examples # Add examples

View File

@ -9,20 +9,38 @@
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# SPDX-License-Identifier: LGPL-3.0-or-later # SPDX-License-Identifier: LGPL-3.0-or-later
OBJ=alloc.o net.o hiredict.o sds.o async.o read.o sockcompat.o OBJ=src/alloc.o src/net.o src/hiredict.o src/sds.o src/async.o src/read.o src/sockcompat.o src/test.o
EXAMPLES=hiredict-example hiredict-example-libevent hiredict-example-libev hiredict-example-glib hiredict-example-push hiredict-example-poll EXAMPLES=hiredict-example hiredict-example-libevent hiredict-example-libev hiredict-example-glib hiredict-example-push hiredict-example-poll
TESTS=hiredict-test TESTS=hiredict-test
LIBNAME=libhiredict LIBNAME=libhiredict
PKGCONFNAME=hiredict.pc PKGCONFNAME=hiredict.pc
SHIM_PKGCONFNAME=shim/hiredis.pc SHIM_PKGCONFNAME=hiredis.pc
HIREDICT_MAJOR=$(shell grep HIREDICT_MAJOR hiredict.h | awk '{print $$3}') HIREDICT_HEADER=include/hiredict/hiredict.h
HIREDICT_MINOR=$(shell grep HIREDICT_MINOR hiredict.h | awk '{print $$3}')
HIREDICT_PATCH=$(shell grep HIREDICT_PATCH hiredict.h | awk '{print $$3}') HIREDICT_MAJOR=$(shell grep HIREDICT_MAJOR $(HIREDICT_HEADER) | awk '{print $$3}')
HIREDICT_SONAME=$(shell grep HIREDICT_SONAME hiredict.h | awk '{print $$3}') HIREDICT_MINOR=$(shell grep HIREDICT_MINOR $(HIREDICT_HEADER) | awk '{print $$3}')
HIREDICT_PATCH=$(shell grep HIREDICT_PATCH $(HIREDICT_HEADER) | awk '{print $$3}')
HIREDICT_SONAME=$(shell grep HIREDICT_SONAME $(HIREDICT_HEADER) | awk '{print $$3}')
HIREDICT_VERSION=$(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH) HIREDICT_VERSION=$(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH)
INSTALL_HEADERS=$(HIREDICT_HEADER) \
include/hiredict/adapters \
include/hiredict/alloc.h \
include/hiredict/async.h \
include/hiredict/read.h \
include/hiredict/sds.h \
include/hiredict/sockcompat.h
INSTALL_SHIM_HEADERS=shim/hiredis.h \
shim/adapters \
shim/alloc.h \
shim/async.h \
shim/read.h \
shim/sds.h \
shim/sockcompat.h
# Installation related variables and target # Installation related variables and target
PREFIX?=/usr/local PREFIX?=/usr/local
INCLUDE_PATH?=include/hiredict INCLUDE_PATH?=include/hiredict
@ -56,6 +74,7 @@ ifeq ($(USE_WERROR),1)
WARNINGS+=-Werror WARNINGS+=-Werror
endif endif
DEBUG_FLAGS?= -g -ggdb DEBUG_FLAGS?= -g -ggdb
CFLAGS+=-Iinclude -MMD
REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(PLATFORM_FLAGS) REAL_CFLAGS=$(OPTIMIZATION) -fPIC $(CPPFLAGS) $(CFLAGS) $(WARNINGS) $(DEBUG_FLAGS) $(PLATFORM_FLAGS)
REAL_LDFLAGS=$(LDFLAGS) REAL_LDFLAGS=$(LDFLAGS)
@ -70,10 +89,10 @@ STLIBNAME=$(LIBNAME).$(STLIBSUFFIX)
STLIB_MAKE_CMD=$(AR) rcs STLIB_MAKE_CMD=$(AR) rcs
#################### SSL variables start #################### #################### SSL variables start ####################
SSL_OBJ=ssl.o SSL_OBJ=src/ssl.o
SSL_LIBNAME=libhiredict_ssl SSL_LIBNAME=libhiredict_ssl
SSL_PKGCONFNAME=hiredict_ssl.pc SSL_PKGCONFNAME=hiredict_ssl.pc
SSL_SHIM_PKGCONFNAME=shim/hiredis_ssl.pc SSL_SHIM_PKGCONFNAME=hiredis_ssl.pc
SSL_INSTALLNAME=install-ssl SSL_INSTALLNAME=install-ssl
SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_SONAME) SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_SONAME)
SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_MAJOR) SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_MAJOR)
@ -155,7 +174,10 @@ endif
ifeq ($(uname_S),Darwin) ifeq ($(uname_S),Darwin)
DYLIBSUFFIX=dylib DYLIBSUFFIX=dylib
DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDICT_SONAME).$(DYLIBSUFFIX) DYLIB_MINOR_NAME=$(LIBNAME).$(HIREDICT_SONAME).$(DYLIBSUFFIX)
DYLIB_MAJOR_NAME=$(LIBNAME).$(HIREDICT_MAJOR).$(DYLIBSUFFIX)
DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS) DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(DYLIB_MINOR_NAME) -o $(DYLIBNAME) $(LDFLAGS)
SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(HIREDICT_SONAME).$(DYLIBSUFFIX)
SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(HIREDICT_MAJOR).$(DYLIBSUFFIX)
SSL_DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) -o $(SSL_DYLIBNAME) $(LDFLAGS) $(SSL_LDFLAGS) SSL_DYLIB_MAKE_CMD=$(CC) -dynamiclib -Wl,-install_name,$(PREFIX)/$(LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) -o $(SSL_DYLIBNAME) $(LDFLAGS) $(SSL_LDFLAGS)
DYLIB_PLUGIN=-Wl,-undefined -Wl,dynamic_lookup DYLIB_PLUGIN=-Wl,-undefined -Wl,dynamic_lookup
endif endif
@ -168,16 +190,8 @@ static: $(STLIBNAME) $(SSL_STLIB)
pkgconfig: $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONF) $(SSL_SHIM_PKGCONF) pkgconfig: $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONF) $(SSL_SHIM_PKGCONF)
# Deps (use make dep to generate this) # include header dependencies generated by -MMD.
alloc.o: alloc.c fmacros.h alloc.h -include $(OBJ:%.o=%.d)
async.o: async.c fmacros.h alloc.h async.h hiredict.h read.h sds.h net.h dict.c dict.h win32.h async_private.h
dict.o: dict.c fmacros.h alloc.h dict.h
hiredict.o: hiredict.c fmacros.h hiredict.h read.h sds.h alloc.h net.h async.h win32.h
net.o: net.c fmacros.h net.h hiredict.h read.h sds.h alloc.h sockcompat.h win32.h
read.o: read.c fmacros.h alloc.h read.h sds.h win32.h
sds.o: sds.c sds.h sdsalloc.h alloc.h
sockcompat.o: sockcompat.c sockcompat.h
test.o: test.c fmacros.h hiredict.h read.h sds.h alloc.h net.h sockcompat.h win32.h
$(DYLIBNAME): $(OBJ) $(DYLIBNAME): $(OBJ)
$(DYLIB_MAKE_CMD) -o $(DYLIBNAME) $(OBJ) $(REAL_LDFLAGS) $(DYLIB_MAKE_CMD) -o $(DYLIBNAME) $(OBJ) $(REAL_LDFLAGS)
@ -191,8 +205,6 @@ $(SSL_DYLIBNAME): $(SSL_OBJ)
$(SSL_STLIBNAME): $(SSL_OBJ) $(SSL_STLIBNAME): $(SSL_OBJ)
$(STLIB_MAKE_CMD) $(SSL_STLIBNAME) $(SSL_OBJ) $(STLIB_MAKE_CMD) $(SSL_STLIBNAME) $(SSL_OBJ)
$(SSL_OBJ): ssl.c hiredict.h read.h sds.h alloc.h async.h win32.h async_private.h
#################### SSL building rules end #################### #################### SSL building rules end ####################
# Binaries: # Binaries:
@ -272,7 +284,7 @@ ifeq ($(TEST_ASYNC),1)
TEST_LDFLAGS += -levent TEST_LDFLAGS += -levent
endif endif
hiredict-test: test.o $(TEST_LIBS) hiredict-test: src/test.o $(TEST_LIBS)
$(CC) -o $@ $(REAL_CFLAGS) -I. $^ $(REAL_LDFLAGS) $(TEST_LDFLAGS) $(CC) -o $@ $(REAL_CFLAGS) -I. $^ $(REAL_LDFLAGS) $(TEST_LDFLAGS)
hiredict-%: %.o $(STLIBNAME) hiredict-%: %.o $(STLIBNAME)
@ -282,22 +294,22 @@ test: hiredict-test
./hiredict-test ./hiredict-test
check: hiredict-test check: hiredict-test
TEST_SSL=$(USE_SSL) ./test.sh TEST_SSL=$(USE_SSL) ./util/test.sh
.c.o: .c.o:
$(CC) -std=c99 -c $(REAL_CFLAGS) $< $(CC) -std=c99 -c $(REAL_CFLAGS) $< -o $@
clean: clean:
rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) \ rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) \
$(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) \ $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) \
examples/hiredict-example* *.o *.gcda *.gcno *.gcov examples/hiredict-example* src/*.o src/*.d *.gcda *.gcno *.gcov
dep: dep:
$(CC) $(CPPFLAGS) $(CFLAGS) -MM *.c $(CC) $(CPPFLAGS) $(CFLAGS) -MM src/*.c
INSTALL?= cp -pPR INSTALL?= cp -pPR
%.pc: %.pc.in %.pc: util/%.pc.in
@echo "Generating $@ for pkgconfig..." @echo "Generating $@ for pkgconfig..."
@sed -e 's#@PREFIX@#$(PREFIX)#' \ @sed -e 's#@PREFIX@#$(PREFIX)#' \
-e 's#@LIBDIR@#$(LIBRARY_PATH)#' \ -e 's#@LIBDIR@#$(LIBRARY_PATH)#' \
@ -305,11 +317,12 @@ INSTALL?= cp -pPR
"$<" > "$@" "$<" > "$@"
install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_INSTALL) install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_INSTALL)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH) $(SHIM_INSTALL_INCLUDE_PATH)/adapters mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH) \
$(INSTALL) hiredict.h async.h read.h sds.h alloc.h sockcompat.h $(INSTALL_INCLUDE_PATH) $(SHIM_INSTALL_INCLUDE_PATH) $(SHIM_INSTALL_INCLUDE_PATH)/adapters
$(INSTALL) shim/hiredis.h shim/async.h shim/read.h shim/sds.h shim/alloc.h shim/sockcompat.h $(SHIM_INSTALL_INCLUDE_PATH)
$(INSTALL) adapters/*.h $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL) $(INSTALL_HEADERS) $(INSTALL_INCLUDE_PATH)
$(INSTALL) shim/adapters/*.h $(SHIM_INSTALL_INCLUDE_PATH)/adapters $(INSTALL) $(INSTALL_SHIM_HEADERS) $(SHIM_INSTALL_INCLUDE_PATH)
$(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME) $(INSTALL) $(DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME) cd $(INSTALL_LIBRARY_PATH) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIBNAME) && ln -sf $(DYLIB_MINOR_NAME) $(DYLIB_MAJOR_NAME)
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH) $(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
@ -318,7 +331,7 @@ install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_INST
install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH) mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH)
$(INSTALL) hiredict_ssl.h $(INSTALL_INCLUDE_PATH) $(INSTALL) include/hiredict/hiredict_ssl.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) shim/hiredis_ssl.h $(SHIM_INSTALL_INCLUDE_PATH) $(INSTALL) shim/hiredis_ssl.h $(SHIM_INSTALL_INCLUDE_PATH)
$(INSTALL) $(SSL_DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME) $(INSTALL) $(SSL_DYLIBNAME) $(INSTALL_LIBRARY_PATH)/$(SSL_DYLIB_MINOR_NAME)
cd $(INSTALL_LIBRARY_PATH) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIBNAME) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIB_MAJOR_NAME) cd $(INSTALL_LIBRARY_PATH) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIBNAME) && ln -sf $(SSL_DYLIB_MINOR_NAME) $(SSL_DYLIB_MAJOR_NAME)

View File

@ -1,25 +0,0 @@
# Appveyor configuration file for CI build of hiredict on Windows (under Cygwin)
environment:
matrix:
- CYG_BASH: C:\cygwin64\bin\bash
CC: gcc
- CYG_BASH: C:\cygwin\bin\bash
CC: gcc
CFLAGS: -m32
CXXFLAGS: -m32
LDFLAGS: -m32
clone_depth: 1
# Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
init:
- git config --global core.autocrlf input
# Install needed build dependencies
install:
- '%CYG_BASH% -lc "cygcheck -dc cygwin"'
build_script:
- 'echo building...'
- '%CYG_BASH% -lc "cd $APPVEYOR_BUILD_FOLDER; exec 0</dev/null; mkdir build && cd build && cmake .. -G \"Unix Makefiles\" && make VERBOSE=1"'

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/ae.h> #include <hiredict/adapters/ae.h>
/* Put event loop in the global scope, so it can be explicitly stopped */ /* Put event loop in the global scope, so it can be explicitly stopped */
static aeEventLoop *loop; static aeEventLoop *loop;

View File

@ -6,9 +6,9 @@
#include <stdlib.h> #include <stdlib.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/glib.h> #include <hiredict/adapters/glib.h>
static GMainLoop *mainloop; static GMainLoop *mainloop;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/ivykis.h> #include <hiredict/adapters/ivykis.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libev.h> #include <hiredict/adapters/libev.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -9,10 +9,10 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <hiredict_ssl.h> #include <hiredict/hiredict_ssl.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libevent.h> #include <hiredict/adapters/libevent.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libevent.h> #include <hiredict/adapters/libevent.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libhv.h> #include <hiredict/adapters/libhv.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libsdevent.h> #include <hiredict/adapters/libsdevent.h>
void debugCallback(redictAsyncContext *c, void *r, void *privdata) { void debugCallback(redictAsyncContext *c, void *r, void *privdata) {
(void)privdata; (void)privdata;

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/libuv.h> #include <hiredict/adapters/libuv.h>
void debugCallback(redictAsyncContext *c, void *r, void *privdata) { void debugCallback(redictAsyncContext *c, void *r, void *privdata) {
(void)privdata; //unused (void)privdata; //unused

View File

@ -8,9 +8,9 @@
#include <stdio.h> #include <stdio.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/macosx.h> #include <hiredict/adapters/macosx.h>
void getCallback(redictAsyncContext *c, void *r, void *privdata) { void getCallback(redictAsyncContext *c, void *r, void *privdata) {
redictReply *reply = r; redictReply *reply = r;

View File

@ -10,8 +10,8 @@
#include <signal.h> #include <signal.h>
#include <unistd.h> #include <unistd.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/poll.h> #include <hiredict/adapters/poll.h>
/* Put in the global scope, so that loop can be explicitly stopped */ /* Put in the global scope, so that loop can be explicitly stopped */
static int exit_loop = 0; static int exit_loop = 0;

View File

@ -9,7 +9,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#define KEY_COUNT 5 #define KEY_COUNT 5

View File

@ -7,7 +7,7 @@
#ifndef __HIREDICT_EXAMPLE_QT_H #ifndef __HIREDICT_EXAMPLE_QT_H
#define __HIREDICT_EXAMPLE_QT_H #define __HIREDICT_EXAMPLE_QT_H
#include <adapters/qt.h> #include <hiredict/adapters/qt.h>
class ExampleQt : public QObject { class ExampleQt : public QObject {

View File

@ -9,9 +9,9 @@
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <async.h> #include <hiredict/async.h>
#include <adapters/redictmoduleapi.h> #include <hiredict/adapters/redictmoduleapi.h>
void debugCallback(redictAsyncContext *c, void *r, void *privdata) { void debugCallback(redictAsyncContext *c, void *r, void *privdata) {
(void)privdata; //unused (void)privdata; //unused

View File

@ -8,8 +8,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <hiredict_ssl.h> #include <hiredict/hiredict_ssl.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#include <winsock2.h> /* For struct timeval */ #include <winsock2.h> /* For struct timeval */

View File

@ -7,7 +7,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#include <winsock2.h> /* For struct timeval */ #include <winsock2.h> /* For struct timeval */

View File

@ -17,7 +17,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "hiredict.h" #include <hiredict/hiredict.h>
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
char *new_str, *cmd; char *new_str, *cmd;

View File

@ -13,8 +13,8 @@
#define __HIREDICT_AE_H__ #define __HIREDICT_AE_H__
#include <sys/types.h> #include <sys/types.h>
#include <ae.h> #include <ae.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct redictAeEvents { typedef struct redictAeEvents {
redictAsyncContext *context; redictAsyncContext *context;

View File

@ -14,8 +14,8 @@
#include <glib.h> #include <glib.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct typedef struct
{ {

View File

@ -12,8 +12,8 @@
#ifndef __HIREDICT_IVYKIS_H__ #ifndef __HIREDICT_IVYKIS_H__
#define __HIREDICT_IVYKIS_H__ #define __HIREDICT_IVYKIS_H__
#include <iv.h> #include <iv.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct redictIvykisEvents { typedef struct redictIvykisEvents {
redictAsyncContext *context; redictAsyncContext *context;

View File

@ -16,8 +16,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <ev.h> #include <ev.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct redictLibevEvents { typedef struct redictLibevEvents {
redictAsyncContext *context; redictAsyncContext *context;

View File

@ -12,8 +12,8 @@
#ifndef __HIREDICT_LIBEVENT_H__ #ifndef __HIREDICT_LIBEVENT_H__
#define __HIREDICT_LIBEVENT_H__ #define __HIREDICT_LIBEVENT_H__
#include <event2/event.h> #include <event2/event.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
#define REDICT_LIBEVENT_DELETED 0x01 #define REDICT_LIBEVENT_DELETED 0x01
#define REDICT_LIBEVENT_ENTERED 0x02 #define REDICT_LIBEVENT_ENTERED 0x02

View File

@ -13,8 +13,8 @@
#define __HIREDICT_LIBHV_H__ #define __HIREDICT_LIBHV_H__
#include <hv/hloop.h> #include <hv/hloop.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct redictLibhvEvents { typedef struct redictLibhvEvents {
hio_t *io; hio_t *io;

View File

@ -12,8 +12,8 @@
#ifndef HIREDICT_LIBSDEVENT_H #ifndef HIREDICT_LIBSDEVENT_H
#define HIREDICT_LIBSDEVENT_H #define HIREDICT_LIBSDEVENT_H
#include <systemd/sd-event.h> #include <systemd/sd-event.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
#define REDICT_LIBSDEVENT_DELETED 0x01 #define REDICT_LIBSDEVENT_DELETED 0x01
#define REDICT_LIBSDEVENT_ENTERED 0x02 #define REDICT_LIBSDEVENT_ENTERED 0x02

View File

@ -13,8 +13,8 @@
#define __HIREDICT_LIBUV_H__ #define __HIREDICT_LIBUV_H__
#include <stdlib.h> #include <stdlib.h>
#include <uv.h> #include <uv.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
#include <string.h> #include <string.h>
typedef struct redictLibuvEvents { typedef struct redictLibuvEvents {

View File

@ -14,8 +14,8 @@
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include "../async.h" #include <hiredict/async.h>
typedef struct { typedef struct {
redictAsyncContext *context; redictAsyncContext *context;

View File

@ -12,8 +12,8 @@
#ifndef HIREDICT_POLL_H #ifndef HIREDICT_POLL_H
#define HIREDICT_POLL_H #define HIREDICT_POLL_H
#include "../async.h" #include <hiredict/async.h>
#include "../sockcompat.h" #include <hiredict/sockcompat.h>
#include <string.h> // for memset #include <string.h> // for memset
#include <errno.h> #include <errno.h>

View File

@ -12,7 +12,7 @@
#ifndef __HIREDICT_QT_H__ #ifndef __HIREDICT_QT_H__
#define __HIREDICT_QT_H__ #define __HIREDICT_QT_H__
#include <QSocketNotifier> #include <QSocketNotifier>
#include "../async.h" #include <hiredict/async.h>
static void RedictQtAddRead(void *); static void RedictQtAddRead(void *);
static void RedictQtDelRead(void *); static void RedictQtDelRead(void *);

View File

@ -14,8 +14,8 @@
#include "redictmodule.h" #include "redictmodule.h"
#include "../async.h" #include <hiredict/async.h>
#include "../hiredict.h" #include <hiredict/hiredict.h>
#include <sys/types.h> #include <sys/types.h>

View File

@ -13,7 +13,7 @@
#ifndef __HIREDICT_ASYNC_H #ifndef __HIREDICT_ASYNC_H
#define __HIREDICT_ASYNC_H #define __HIREDICT_ASYNC_H
#include "hiredict.h" #include <hiredict/hiredict.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -17,7 +17,7 @@
#ifndef __HIREDICT_H #ifndef __HIREDICT_H
#define __HIREDICT_H #define __HIREDICT_H
#include "read.h" #include <hiredict/read.h>
#include <stdarg.h> /* for va_list */ #include <stdarg.h> /* for va_list */
#ifndef _MSC_VER #ifndef _MSC_VER
#include <sys/time.h> /* for struct timeval */ #include <sys/time.h> /* for struct timeval */
@ -26,13 +26,13 @@ struct timeval; /* forward declaration */
typedef long long ssize_t; typedef long long ssize_t;
#endif #endif
#include <stdint.h> /* uintXX_t, etc */ #include <stdint.h> /* uintXX_t, etc */
#include "sds.h" /* for sds */ #include <hiredict/sds.h> /* for sds */
#include "alloc.h" /* for allocation wrappers */ #include <hiredict/alloc.h> /* for allocation wrappers */
#define HIREDICT_MAJOR 1 #define HIREDICT_MAJOR 1
#define HIREDICT_MINOR 2 #define HIREDICT_MINOR 3
#define HIREDICT_PATCH 0 #define HIREDICT_PATCH 1
#define HIREDICT_SONAME 1.2.1-dev #define HIREDICT_SONAME 1.3.1
/* Connection type can be blocking or non-blocking and is set in the /* Connection type can be blocking or non-blocking and is set in the
* least significant bit of the flags field in redictContext. */ * least significant bit of the flags field in redictContext. */

View File

@ -19,7 +19,7 @@
#ifndef __NET_H #ifndef __NET_H
#define __NET_H #define __NET_H
#include "hiredict.h" #include <hiredict/hiredict.h>
void redictNetClose(redictContext *c); void redictNetClose(redictContext *c);
ssize_t redictNetRead(redictContext *c, char *buf, size_t bufcap); ssize_t redictNetRead(redictContext *c, char *buf, size_t bufcap);

View File

@ -21,7 +21,7 @@
* the include of your alternate allocator if needed (not needed in order * the include of your alternate allocator if needed (not needed in order
* to use the default libc allocator). */ * to use the default libc allocator). */
#include "alloc.h" #include <hiredict/alloc.h>
#define s_malloc hi_malloc #define s_malloc hi_malloc
#define s_realloc hi_realloc #define s_realloc hi_realloc

View File

@ -10,7 +10,7 @@
*/ */
#include "fmacros.h" #include "fmacros.h"
#include "alloc.h" #include <hiredict/alloc.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>

View File

@ -10,9 +10,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later * SPDX-License-Identifier: LGPL-3.0-or-later
* *
*/ */
#include "fmacros.h" #include "fmacros.h"
#include "alloc.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#ifndef _MSC_VER #ifndef _MSC_VER
@ -21,12 +20,13 @@
#include <assert.h> #include <assert.h>
#include <ctype.h> #include <ctype.h>
#include <errno.h> #include <errno.h>
#include "async.h"
#include <hiredict/alloc.h>
#include <hiredict/async.h>
#include <hiredict/sds.h>
#include "net.h" #include "net.h"
#include "dict.c" #include "dict.c"
#include "sds.h"
#include "win32.h" #include "win32.h"
#include "async_private.h" #include "async_private.h"
#ifdef NDEBUG #ifdef NDEBUG

View File

@ -16,7 +16,7 @@
*/ */
#include "fmacros.h" #include "fmacros.h"
#include "alloc.h" #include <hiredict/alloc.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>

View File

@ -14,18 +14,18 @@
* SPDX-License-Identifier: LGPL-3.0-or-later * SPDX-License-Identifier: LGPL-3.0-or-later
* *
*/ */
#include "fmacros.h" #include "fmacros.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <ctype.h> #include <ctype.h>
#include "hiredict.h" #include <hiredict/hiredict.h>
#include <hiredict/sds.h>
#include <hiredict/async.h>
#include "net.h" #include "net.h"
#include "sds.h"
#include "async.h"
#include "win32.h" #include "win32.h"
extern int redictContextUpdateConnectTimeout(redictContext *c, const struct timeval *timeout); extern int redictContextUpdateConnectTimeout(redictContext *c, const struct timeval *timeout);

View File

@ -15,8 +15,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later * SPDX-License-Identifier: LGPL-3.0-or-later
* *
*/ */
#include "fmacros.h" #include "fmacros.h"
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
@ -26,10 +26,11 @@
#include <limits.h> #include <limits.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
#include <netdb.h>
#include <hiredict/sds.h>
#include <hiredict/sockcompat.h>
#include "net.h" #include "net.h"
#include "sds.h"
#include "sockcompat.h"
#include "win32.h" #include "win32.h"
/* Defined in hiredict.c */ /* Defined in hiredict.c */

View File

@ -24,9 +24,9 @@
#include <limits.h> #include <limits.h>
#include <math.h> #include <math.h>
#include "alloc.h" #include <hiredict/alloc.h>
#include "read.h" #include <hiredict/read.h>
#include "sds.h" #include <hiredict/sds.h>
#include "win32.h" #include "win32.h"
/* Initial size of our nested reply stack and how much we grow it when needd */ /* Initial size of our nested reply stack and how much we grow it when needd */

View File

@ -13,15 +13,16 @@
* SPDX-License-Identifier: LGPL-3.0-or-later * SPDX-License-Identifier: LGPL-3.0-or-later
* *
*/ */
#include "fmacros.h" #include "fmacros.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <assert.h> #include <assert.h>
#include <limits.h> #include <limits.h>
#include "sds.h"
#include <hiredict/sds.h>
#include "sdsalloc.h" #include "sdsalloc.h"
static inline int sdsHdrSize(char type) { static inline int sdsHdrSize(char type) {

View File

@ -10,7 +10,7 @@
*/ */
#define REDICT_SOCKCOMPAT_IMPLEMENTATION #define REDICT_SOCKCOMPAT_IMPLEMENTATION
#include "sockcompat.h" #include <hiredict/sockcompat.h>
#ifdef _WIN32 #ifdef _WIN32
static int _wsaErrorToErrno(int err) { static int _wsaErrorToErrno(int err) {

View File

@ -13,10 +13,6 @@
* *
*/ */
#include "hiredict.h"
#include "async.h"
#include "net.h"
#include <assert.h> #include <assert.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
@ -38,9 +34,13 @@
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include "win32.h" #include <hiredict/hiredict.h>
#include <hiredict/hiredict_ssl.h>
#include <hiredict/async.h>
#include "net.h"
#include "async_private.h" #include "async_private.h"
#include "hiredict_ssl.h" #include "win32.h"
#define OPENSSL_1_1_0 0x10100000L #define OPENSSL_1_1_0 0x10100000L

View File

@ -8,9 +8,8 @@
* SPDX-License-Identifier: LGPL-3.0-or-later * SPDX-License-Identifier: LGPL-3.0-or-later
* *
*/ */
#include "fmacros.h" #include "fmacros.h"
#include "sockcompat.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -24,14 +23,15 @@
#include <limits.h> #include <limits.h>
#include <math.h> #include <math.h>
#include "hiredict.h" #include <hiredict/sockcompat.h>
#include "async.h" #include <hiredict/hiredict.h>
#include "adapters/poll.h" #include <hiredict/async.h>
#include <hiredict/adapters/poll.h>
#ifdef HIREDICT_TEST_SSL #ifdef HIREDICT_TEST_SSL
#include "hiredict_ssl.h" #include <hiredict/hiredict_ssl.h>
#endif #endif
#ifdef HIREDICT_TEST_ASYNC #ifdef HIREDICT_TEST_ASYNC
#include "adapters/libevent.h" #include <hiredict/adapters/libevent.h>
#include <event2/event.h> #include <event2/event.h>
#endif #endif
#include "net.h" #include "net.h"

View File

@ -3,10 +3,9 @@ install_libdir=@LIBDIR@
exec_prefix=${prefix} exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir} libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include includedir=${prefix}/include
pkgincludedir=${includedir}/hiredict
Name: hiredict Name: hiredict
Description: Minimalistic C client library for Redict. Description: Minimalistic C client library for Redict.
Version: @PROJECT_VERSION@ Version: @PROJECT_VERSION@
Libs: -L${libdir} -lhiredict Libs: -L${libdir} -lhiredict
Cflags: -I${pkgincludedir} -I${includedir} -D_FILE_OFFSET_BITS=64 Cflags: -I${includedir} -D_FILE_OFFSET_BITS=64

View File

@ -3,7 +3,6 @@ install_libdir=@LIBDIR@
exec_prefix=${prefix} exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir} libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include includedir=${prefix}/include
pkgincludedir=${includedir}/hiredict
Name: hiredict_ssl Name: hiredict_ssl
Description: SSL Support for hiredict. Description: SSL Support for hiredict.

35
deps/hiredict/util/lint.sh vendored Executable file
View File

@ -0,0 +1,35 @@
#!/bin/sh -e
# SPDX-FileCopyrightText: 2024 Hiredict Contributors
# SPDX-License-Identifier: LGPL-3.0-or-later
signoff() {
if ! git log --format='%b' HEAD^.. | grep 'Signed-off-by' >/dev/null
then
echo "Missing sign-off!" >&2
echo "Run 'git commit --amend -s' to fix" >&2
echo "See CONTRIBUTING.md" >&2
return 1
fi
}
licenses() {
if ! chronic sh -c "reuse lint 2>/dev/null"
then
return 1
fi
}
exitcode=0
for step in signoff licenses
do
if ! $step
then
exitcode=1
fi
done
if [ $exitcode -eq 0 ]
then
echo "Everything looks good!"
fi
exit $exitcode

View File

@ -283,7 +283,7 @@ ifeq ($(USE_SYSTEM_HIREDICT),yes)
else else
DEPENDENCY_TARGETS += hiredict DEPENDENCY_TARGETS += hiredict
FINAL_LIBS+= ../deps/hiredict/libhiredict.a FINAL_LIBS+= ../deps/hiredict/libhiredict.a
FINAL_CFLAGS+= -I../deps/hiredict FINAL_CFLAGS+= -I../deps/hiredict/include
endif endif
# LIBSSL & LIBCRYPTO # LIBSSL & LIBCRYPTO

View File

@ -13,15 +13,15 @@
#include <stdlib.h> #include <stdlib.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <sds.h> #include <hiredict/sds.h>
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <hiredict_ssl.h> #include <hiredict/hiredict_ssl.h>
#endif #endif
#define UNUSED(V) ((void) V) #define UNUSED(V) ((void) V)

View File

@ -7,8 +7,8 @@
#ifndef __CLICOMMON_H #ifndef __CLICOMMON_H
#define __CLICOMMON_H #define __CLICOMMON_H
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <sds.h> #include <hiredict/sds.h>
typedef struct cliSSLconfig { typedef struct cliSSLconfig {
/* Requested SNI, or NULL */ /* Requested SNI, or NULL */

View File

@ -19,13 +19,13 @@
#include <math.h> #include <math.h>
#include <pthread.h> #include <pthread.h>
#include <sds.h>
#include "ae.h" #include "ae.h"
#include <hiredict.h> #include <hiredict/hiredict.h>
#include <hiredict/sds.h>
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <hiredict_ssl.h> #include <hiredict/hiredict_ssl.h>
#endif #endif
#include "adlist.h" #include "adlist.h"
#include "dict.h" #include "dict.h"

View File

@ -23,13 +23,13 @@
#include <math.h> #include <math.h>
#include <termios.h> #include <termios.h>
#include <hiredict.h> #include <hiredict/hiredict.h>
#ifdef USE_OPENSSL #ifdef USE_OPENSSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/err.h> #include <openssl/err.h>
#include <hiredict_ssl.h> #include <hiredict/hiredict_ssl.h>
#endif #endif
#include <sds.h> #include <hiredict/sds.h>
#include "dict.h" #include "dict.h"
#include "adlist.h" #include "adlist.h"
#include "zmalloc.h" #include "zmalloc.h"

View File

@ -6,12 +6,12 @@
// SPDX-License-Identifier: LGPL-3.0-only // SPDX-License-Identifier: LGPL-3.0-only
#include "server.h" #include "server.h"
#include "hiredict.h" #include <hiredict/hiredict.h>
#include <hiredict/async.h>
#if USE_OPENSSL == 1 /* BUILD_YES */ #if USE_OPENSSL == 1 /* BUILD_YES */
#include "openssl/ssl.h" #include <openssl/ssl.h>
#include "hiredict_ssl.h" #include <hiredict/hiredict_ssl.h>
#endif #endif
#include "async.h"
#include <ctype.h> #include <ctype.h>
#include <arpa/inet.h> #include <arpa/inet.h>