Squashed 'deps/hiredict/' changes from 7bce77ae6..08ac9b200

08ac9b200 .reuse: add hiredis pc files
34dd027d8 Makefile: use .pc.in files
cda15c036 shim: add hiredis shim

git-subtree-dir: deps/hiredict
git-subtree-split: 08ac9b200634c09ebb73e4bf4b121911fe186b54
This commit is contained in:
Drew DeVault 2024-03-25 18:05:00 +01:00
parent cf8c5a2b83
commit 8b493612ae
27 changed files with 936 additions and 46 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@
/*.so
/*.dylib
/*.a
/*.pc
**/*.pc
build/
*.dSYM
tags

View File

@ -3,12 +3,6 @@ Upstream-Name: hiredict
Upstream-Contact: Anna (navi) Figueiredo Gomes <navi@vlhl.dev>
Source: https://redict.io
# Sample paragraph, commented out:
#
# Files: src/*
# Copyright: $YEAR $NAME <$CONTACT>
# License: ...
Files: .gitignore .travis.yml appveyor.yml
Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause
@ -17,6 +11,10 @@ Files: hiredict.pc.in hiredict.targets hiredict_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause
Files: shim/hiredis.pc.in shim/hiredis_ssl.pc.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause
Files: hiredict-config.cmake.in hiredict_ssl-config.cmake.in
Copyright: Salvatore Sanfilippo <antirez at gmail dot com>
License: BSD-3-Clause

View File

@ -55,6 +55,8 @@ ENDIF()
ADD_LIBRARY(hiredict ${hiredict_sources})
ADD_LIBRARY(hiredict::hiredict ALIAS hiredict)
set(hiredict_export_name hiredict CACHE STRING "Name of the exported target")
set(PREFIX "${CMAKE_INSTALL_PREFIX}")
set(LIBDIR "${CMAKE_INSTALL_LIBDIR}")
set_target_properties(hiredict PROPERTIES EXPORT_NAME ${hiredict_export_name})
SET_TARGET_PROPERTIES(hiredict
@ -75,6 +77,7 @@ ENDIF()
TARGET_INCLUDE_DIRECTORIES(hiredict PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
CONFIGURE_FILE(hiredict.pc.in hiredict.pc @ONLY)
CONFIGURE_FILE(shim/hiredis.pc.in hiredis.pc @ONLY)
set(CPACK_PACKAGE_VENDOR "Redict")
set(CPACK_PACKAGE_DESCRIPTION "\
@ -122,12 +125,22 @@ endif()
INSTALL(FILES hiredict.h read.h sds.h async.h alloc.h sockcompat.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(FILES shim/hiredis.h shim/read.h shim/sds.h
shim/async.h shim/alloc.h shim/sockcompat.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
INSTALL(DIRECTORY adapters
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(DIRECTORY shim/adapters
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredict.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
export(EXPORT hiredict-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/hiredict-targets.cmake"
NAMESPACE hiredict::)
@ -184,6 +197,7 @@ IF(ENABLE_SSL)
TARGET_LINK_LIBRARIES(hiredict_ssl PRIVATE hiredict)
ENDIF()
CONFIGURE_FILE(hiredict_ssl.pc.in hiredict_ssl.pc @ONLY)
CONFIGURE_FILE(shim/hiredis_ssl.pc.in hiredis_ssl.pc @ONLY)
INSTALL(TARGETS hiredict_ssl
EXPORT hiredict_ssl-targets
@ -200,9 +214,15 @@ IF(ENABLE_SSL)
INSTALL(FILES hiredict_ssl.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredict)
INSTALL(FILES shim/hiredis_ssl.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredict_ssl.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
export(EXPORT hiredict_ssl-targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/hiredict_ssl-targets.cmake"
NAMESPACE hiredict::)

View File

@ -14,18 +14,23 @@ EXAMPLES=hiredict-example hiredict-example-libevent hiredict-example-libev hired
TESTS=hiredict-test
LIBNAME=libhiredict
PKGCONFNAME=hiredict.pc
SHIM_PKGCONFNAME=shim/hiredis.pc
HIREDICT_MAJOR=$(shell grep HIREDICT_MAJOR hiredict.h | awk '{print $$3}')
HIREDICT_MINOR=$(shell grep HIREDICT_MINOR hiredict.h | awk '{print $$3}')
HIREDICT_PATCH=$(shell grep HIREDICT_PATCH hiredict.h | awk '{print $$3}')
HIREDICT_SONAME=$(shell grep HIREDICT_SONAME hiredict.h | awk '{print $$3}')
HIREDICT_VERSION=$(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH)
# Installation related variables and target
PREFIX?=/usr/local
INCLUDE_PATH?=include/hiredict
SHIM_INCLUDE_PATH?=include/hiredis
LIBRARY_PATH?=lib
PKGCONF_PATH?=pkgconfig
INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(INCLUDE_PATH)
SHIM_INSTALL_INCLUDE_PATH= $(DESTDIR)$(PREFIX)/$(SHIM_INCLUDE_PATH)
INSTALL_LIBRARY_PATH= $(DESTDIR)$(PREFIX)/$(LIBRARY_PATH)
INSTALL_PKGCONF_PATH= $(INSTALL_LIBRARY_PATH)/$(PKGCONF_PATH)
@ -68,6 +73,7 @@ STLIB_MAKE_CMD=$(AR) rcs
SSL_OBJ=ssl.o
SSL_LIBNAME=libhiredict_ssl
SSL_PKGCONFNAME=hiredict_ssl.pc
SSL_SHIM_PKGCONFNAME=shim/hiredis_ssl.pc
SSL_INSTALLNAME=install-ssl
SSL_DYLIB_MINOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_SONAME)
SSL_DYLIB_MAJOR_NAME=$(SSL_LIBNAME).$(DYLIBSUFFIX).$(HIREDICT_MAJOR)
@ -83,11 +89,13 @@ ifeq ($(USE_SSL),1)
SSL_STLIB=$(SSL_STLIBNAME)
SSL_DYLIB=$(SSL_DYLIBNAME)
SSL_PKGCONF=$(SSL_PKGCONFNAME)
SSL_SHIM_PKGCONF=$(SSL_SHIM_PKGCONFNAME)
SSL_INSTALL=$(SSL_INSTALLNAME)
else
SSL_STLIB=
SSL_DYLIB=
SSL_PKGCONF=
SSL_SHIM_PKGCONF=
SSL_INSTALL=
endif
##################### SSL variables end #####################
@ -158,7 +166,7 @@ dynamic: $(DYLIBNAME) $(SSL_DYLIB)
static: $(STLIBNAME) $(SSL_STLIB)
pkgconfig: $(PKGCONFNAME) $(SSL_PKGCONF)
pkgconfig: $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONF) $(SSL_SHIM_PKGCONF)
# Deps (use make dep to generate this)
alloc.o: alloc.c fmacros.h alloc.h
@ -280,60 +288,43 @@ check: hiredict-test
$(CC) -std=c99 -c $(REAL_CFLAGS) $<
clean:
rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) $(PKGCONFNAME) examples/hiredict-example* *.o *.gcda *.gcno *.gcov
rm -rf $(DYLIBNAME) $(STLIBNAME) $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(TESTS) \
$(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) \
examples/hiredict-example* *.o *.gcda *.gcno *.gcov
dep:
$(CC) $(CPPFLAGS) $(CFLAGS) -MM *.c
INSTALL?= cp -pPR
$(PKGCONFNAME): hiredict.h
%.pc: %.pc.in
@echo "Generating $@ for pkgconfig..."
@echo prefix=$(PREFIX) > $@
@echo exec_prefix=\$${prefix} >> $@
@echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@
@echo includedir=$(PREFIX)/include >> $@
@echo pkgincludedir=$(PREFIX)/$(INCLUDE_PATH) >> $@
@echo >> $@
@echo Name: hiredict >> $@
@echo Description: Minimalistic C client library for Redis. >> $@
@echo Version: $(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH) >> $@
@echo Libs: -L\$${libdir} -lhiredict >> $@
@echo Cflags: -I\$${pkgincludedir} -I\$${includedir} -D_FILE_OFFSET_BITS=64 >> $@
@sed -e 's#@PREFIX@#$(PREFIX)#' \
-e 's#@LIBDIR@#$(LIBRARY_PATH)#' \
-e 's#@PROJECT_VERSION@#$(HIREDICT_VERSION)#' \
"$<" > "$@"
$(SSL_PKGCONFNAME): hiredict_ssl.h
@echo "Generating $@ for pkgconfig..."
@echo prefix=$(PREFIX) > $@
@echo exec_prefix=\$${prefix} >> $@
@echo libdir=$(PREFIX)/$(LIBRARY_PATH) >> $@
@echo includedir=$(PREFIX)/include >> $@
@echo pkgincludedir=$(PREFIX)/$(INCLUDE_PATH) >> $@
@echo >> $@
@echo Name: hiredict_ssl >> $@
@echo Description: SSL Support for hiredict. >> $@
@echo Version: $(HIREDICT_MAJOR).$(HIREDICT_MINOR).$(HIREDICT_PATCH) >> $@
@echo Requires: hiredict >> $@
@echo Libs: -L\$${libdir} -lhiredict_ssl >> $@
@echo Libs.private: -lssl -lcrypto >> $@
install: $(DYLIBNAME) $(STLIBNAME) $(PKGCONFNAME) $(SSL_INSTALL)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_INCLUDE_PATH)/adapters $(INSTALL_LIBRARY_PATH)
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
$(INSTALL) hiredict.h async.h read.h sds.h alloc.h sockcompat.h $(INSTALL_INCLUDE_PATH)
$(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) shim/adapters/*.h $(SHIM_INSTALL_INCLUDE_PATH)/adapters
$(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)
$(INSTALL) $(STLIBNAME) $(INSTALL_LIBRARY_PATH)
mkdir -p $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(PKGCONFNAME) $(SHIM_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH)
install-ssl: $(SSL_DYLIBNAME) $(SSL_STLIBNAME) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME)
mkdir -p $(INSTALL_INCLUDE_PATH) $(INSTALL_LIBRARY_PATH) $(SHIM_INSTALL_INCLUDE_PATH)
$(INSTALL) hiredict_ssl.h $(INSTALL_INCLUDE_PATH)
$(INSTALL) shim/hiredis_ssl.h $(SHIM_INSTALL_INCLUDE_PATH)
$(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)
$(INSTALL) $(SSL_STLIBNAME) $(INSTALL_LIBRARY_PATH)
mkdir -p $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(SSL_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
$(INSTALL) $(SSL_PKGCONFNAME) $(SSL_SHIM_PKGCONFNAME) $(INSTALL_PKGCONF_PATH)
32bit:
@echo ""

View File

@ -1,5 +1,5 @@
prefix=@CMAKE_INSTALL_PREFIX@
install_libdir=@CMAKE_INSTALL_LIBDIR@
prefix=@PREFIX@
install_libdir=@LIBDIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include

View File

@ -1,5 +1,5 @@
prefix=@CMAKE_INSTALL_PREFIX@
install_libdir=@CMAKE_INSTALL_LIBDIR@
prefix=@PREFIX@
install_libdir=@LIBDIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include

28
shim/adapters/ae.h Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_AE_H__
#define __HIREDIS_AE_H__
#include <hiredict/adapters/ae.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define redisAeEvents redictAeEvents
#define redisAeReadEvent redictAeReadEvent
#define redisAeWriteEvent redictAeWriteEvent
#define redisAeAddRead redictAeAddRead
#define redisAeDelRead redictAeDelRead
#define redisAeAddWrite redisAeAddWrite
#define redisAeDelWrite redictAeDelWrite
#define redisAeCleanup redictAeCleanup
#define redisAeAttach redictAeAttach
#endif

31
shim/adapters/glib.h Normal file
View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_GLIB_H__
#define __HIREDIS_GLIB_H__
#include <hiredict/adapters/glib.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define RedisSource RedictSource
#define redis_source_add_read redict_source_add_read
#define redis_source_del_read redict_source_del_read
#define redis_source_add_write redict_source_add_write
#define redis_source_del_write redict_source_del_write
#define redis_source_cleanup redict_source_cleanup
#define redis_source_prepare redict_source_prepare
#define redis_source_check redict_source_check
#define redis_source_dispatch redict_source_dispatch
#define redis_source_finalize redict_source_finalize
#define redis_source_new redict_source_new
#endif /* __HIREDIS_GLIB_H__ */

28
shim/adapters/ivykis.h Normal file
View File

@ -0,0 +1,28 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_IVYKIS_H__
#define __HIREDIS_IVYKIS_H__
#include <hiredict/adapters/ivykis.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define redisIvykisEvents redictIvykisEvents
#define redisIvykisReadEvent redictIvykisReadEvent
#define redisIvykisWriteEvent redictIvykisWriteEvent
#define redisIvykisAddRead redictIvykisAddRead
#define redisIvykisDelRead redictIvykisDelRead
#define redisIvykisAddWrite redictIvykisAddWrite
#define redisIvykisDelWrite redictIvykisDelWrite
#define redisIvykisCleanup redictIvykisCleanup
#define redisIvykisAttach redictIvykisAttach
#endif

33
shim/adapters/libev.h Normal file
View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
* All rights reserved.
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_LIBEV_H__
#define __HIREDIS_LIBEV_H__
#include <hiredict/adapters/libev.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define redisLibevEvents redictLibevEvents
#define redisLibevReadEvent redictLibevReadEvent
#define redisLibevWriteEvent redictLibevWriteEvent
#define redisLibevAddRead redictLibevAddRead
#define redisLibevDelRead redictLibevDelRead
#define redisLibevAddWrite redictLibevAddWrite
#define redisLibevDelWrite redictLibevDelWrite
#define redisLibevStopTimer redictLibevStopTimer
#define redisLibevCleanup redictLibevCleanup
#define redisLibevTimeout redictLibevTimeout
#define redisLibevSetTimeout redictLibevSetTimeout
#define redisLibevAttach redictLibevAttach
#endif

33
shim/adapters/libevent.h Normal file
View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2010-2011, Pieter Noordhuis <pcnoordhuis at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_LIBEVENT_H__
#define __HIREDIS_LIBEVENT_H__
#include <hiredict/adapters/libevent.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define REDIS_LIBEVENT_DELETED REDICT_LIBEVENT_DELETED
#define REDIS_LIBEVENT_ENTERED REDICT_LIBEVENT_ENTERED
#define redisLibeventEvents redictLibeventEvents
#define redisLibeventDestroy redictLibeventDestroy
#define redisLibeventHandler redictLibeventHandler
#define redisLibeventUpdate redictLibeventUpdate
#define redisLibeventAddRead redictLibeventAddRead
#define redisLibeventDelRead redictLibeventDelRead
#define redisLibeventAddWrite redictLibeventAddWrite
#define redisLibeventDelWrite redictLibeventDelWrite
#define redisLibeventCleanup redictLibeventCleanup
#define redisLibeventSetTimeout redictLibeventSetTimeout
#define redisLibeventAttach redictLibeventAttach
#endif

30
shim/adapters/libhv.h Normal file
View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_LIBHV_H__
#define __HIREDIS_LIBHV_H__
#include <hiredict/adapters/libhv.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define redisLibhvEvents redictLibhvEvents
#define redisLibhvHandleEvents redictLibhvHandleEvents
#define redisLibhvAddRead redictLibhvAddRead
#define redisLibhvDelRead redictLibhvDelRead
#define redisLibhvAddWrite redictLibhvAddWrite
#define redisLibhvDelWrite redictLibhvDelWrite
#define redisLibhvCleanup redictLibhvCleanup
#define redisLibhvTimeout redictLibhvTimeout
#define redisLibhvSetTimeout redictLibhvSetTimeout
#define redisLibhvAttach redictLibhvAttach
#endif

View File

@ -0,0 +1,34 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef HIREDIS_LIBSDEVENT_H
#define HIREDIS_LIBSDEVENT_H
#include <hiredict/adapters/libsdevent.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define REDIS_LIBSDEVENT_DELETED REDICT_LIBSDEVENT_DELETED
#define REDIS_LIBSDEVENT_ENTERED REDICT_LIBSDEVENT_ENTERED
#define redisLibsdeventEvents redictLibsdeventEvents
#define redisLibsdeventDestroy redictLibsdeventDestroy
#define redisLibsdeventTimeoutHandler redictLibsdeventTimeoutHandler
#define redisLibsdeventHandler redictLibsdeventHandler
#define redisLibsdeventAddRead redictLibsdeventAddRead
#define redisLibsdeventDelRead redictLibsdeventDelRead
#define redisLibsdeventAddWrite redictLibsdeventAddWrite
#define redisLibsdeventDelWrite redictLibsdeventDelWrite
#define redisLibsdeventCleanup redictLibsdeventCleanup
#define redisLibsdeventSetTimeout redictLibsdeventSetTimeout
#define redisLibsdeventAttach redictLibsdeventAttach
#endif

30
shim/adapters/libuv.h Normal file
View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_LIBUV_H__
#define __HIREDIS_LIBUV_H__
#include <hiredict/adapters/libuv.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define redisLibuvEvents redictLibuvEvents
#define redisLibuvPoll redictLibuvPoll
#define redisLibuvAddRead redictLibuvAddRead
#define redisLibuvDelRead redictLibuvDelRead
#define redisLibuvAddWrite redictLibuvAddWrite
#define redisLibuvDelWrite redictLibuvDelWrite
#define redisLibuvTimeout redictLibuvTimeout
#define redisLibuvSetTimeout redictLibuvSetTimeout
#define redisLibuvCleanup redictLibuvCleanup
#define redisLibuvAttach redictLibuvAttach
#endif

30
shim/adapters/macosx.h Normal file
View File

@ -0,0 +1,30 @@
/*
* Copyright (c) 2015 Dmitry Bakhvalov
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_MACOSX_H__
#define __HIREDIS_MACOSX_H__
#include <hiredict/adapters/macosx.h>
#include <hiredis/hiredis.h>
#include <hiredis/async.h>
#define RedisRunLoop RedictRunLoop
#define freeRedisRunLoop freeRedictRunLoop
#define redisMacOSAddRead redictMacOSAddRead
#define redisMacOSDelRead redictMacOSDelRead
#define redisMacOSAddWrite redictMacOSAddWrite
#define redisMacOSDelWrite redictMacOSDelWrite
#define redisMacOSCleanup redictMacOSCleanup
#define redisMacOSAsyncCallback redictMacOSAsyncCallback
#define redisMacOSAttach redictMacOSAttach
#endif

38
shim/adapters/poll.h Normal file
View File

@ -0,0 +1,38 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef HIREDIS_POLL_H
#define HIREDIS_POLL_H
#include <hiredict/adapters/poll.h>
#include <hiredis/async.h>
#include <hiredis/sockcompat.h>
/* Values to return from redictPollTick */
#define REDIS_POLL_HANDLED_READ REDICT_POLL_HANDLED_READ
#define REDIS_POLL_HANDLED_WRITE REDICT_POLL_HANDLED_WRITE
#define REDIS_POLL_HANDLED_TIMEOUT REDICT_POLL_HANDLED_TIMEOUT
/* An adapter to allow manual polling of the async context by checking the state
* of the underlying file descriptor. Useful in cases where there is no formal
* IO event loop but regular ticking can be used, such as in game engines. */
#define redisPollEvents redictPollEvents
#define redisPollTimevalToDouble redictPollTimevalToDouble
#define redisPollGetNow redictPollGetNow
#define redisPollTick redictPollTick
#define redisPollAddRead redictPollAddRead
#define redisPollDelRead redictPollDelRead
#define redisPollAddWrite redictPollAddWrite
#define redisPollDelWrite redictPollDelWrite
#define redisPollCleanup redictPollCleanup
#define redisPollAttach redictPollAttach
#endif /* HIREDIS_POLL_H */

25
shim/adapters/qt.h Normal file
View File

@ -0,0 +1,25 @@
/*
* Copyright (C) 2014 Pietro Cerutti <gahr@gahr.ch>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_QT_H__
#define __HIREDIS_QT_H__
#include <hiredict/adapters/qt.h>
#include <hiredis/async.h>
#define RedisQtAddRead RedictQtAddRead
#define RedisQtDelRead RedictQtDelRead
#define RedisQtAddWrite RedictQtAddWrite
#define RedisQtDelWrite RedictQtDelWrite
#define RedisQtCleanup RedictQtCleanup
#define RedisQtAdapter RedictQtAdapter
#endif /* !__HIREDIS_QT_H__ */

View File

@ -0,0 +1,35 @@
/*
* Copyright (c) 2009-2011, Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
* SPDX-FileCopyrightText: 2024 Salvatore Sanfilippo <antirez at gmail dot com>
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_REDICTMODULEAPI_H__
#define __HIREDIS_REDICTMODULEAPI_H__
#include "redictmodule.h"
#include <hiredis/async.h>
#include <hiredis/hiredict.h>
#define redisModuleEvents redictModuleEvents
#define redisModuleReadEvent redictModuleReadEvent
#define redisModuleWriteEvent redictModuleWriteEvent
#define redisModuleAddRead redictModuleAddRead
#define redisModuleDelRead redictModuleDelRead
#define redisModuleAddWrite redictModuleAddWrite
#define redisModuleDelWrite redictModuleDelWrite
#define redisModuleStopTimer redictModuleStopTimer
#define redisModuleCleanup redictModuleCleanup
#define redisModuleTimeout redictModuleTimeout
#define redisModuleSetTimeout redictModuleSetTimeout
#define redisModuleCompatibilityCheck redictModuleCompatibilityCheck
#define redisModuleAttach redictModuleAttach
#endif

24
shim/alloc.h Normal file
View File

@ -0,0 +1,24 @@
/*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_ALLOC_H
#define __HIREDIS_ALLOC_H
#include <hiredict/alloc.h>
/* Structure pointing to our actually configured allocators */
#define hiredisAllocFuncs hiredictAllocFuncs
#define hiredisSetAllocators hiredictSetAllocators
#define hiredisResetAllocators hiredictResetAllocators
#ifndef _WIN32
#define hiredisAllocFns hiredictAllocFns;
#endif
#endif /* HIREDIS_ALLOC_H */

59
shim/async.h Normal file
View File

@ -0,0 +1,59 @@
/*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_ASYNC_H
#define __HIREDIS_ASYNC_H
#include <hiredict/async.h>
#include <hiredis/hiredis.h>
#define redisCallbackFn redictCallbackFn
#define redisCallback redictCallback
/* List of callbacks for either regular replies or pub/sub */
#define redisCallbackList redictCallbackList
/* Connection callback prototypes */
#define redisDisconnectCallback redictDisconnectCallback
#define redisConnectCallback redictConnectCallback
#define redisConnectCallbackNc redictConnectCallbackNC
#define redisTimerCallback redictTimerCallback
/* Context for an async connection to Redict */
#define redisAsyncContext redictAsyncContext
/* Functions that proxy to hiredict */
#define redisAsyncConnectWithOptions redictAsyncConnectWithOptions
#define redisAsyncConnect redictAsyncConnect
#define redisAsyncConnectBind redictAsyncConnectBind
#define redisAsyncConnectBindWithReuse redictAsyncConnectBindWithReuse
#define redisAsyncConnectUnix redictAsyncConnectUnix
#define redisAsyncSetConnectCallback redictAsyncSetConnectCallback
#define redisAsyncSetConnectCallbackNC redictAsyncSetConnectCallbackNC
#define redisAsyncSetDisconnectCallback redictAsyncSetDisconnectCallback
#define redisAsyncSetPushCallback redictAsyncSetPushCallback
#define redisAsyncSetTimeout redictAsyncSetTimeout
#define redisAsyncDisconnect redictAsyncDisconnect
#define redisAsyncFree redictAsyncFree
/* Handle read/write events */
#define redisAsyncHandleRead redictAsyncHandleRead
#define redisAsyncHandleWrite redictAsyncHandleWrite
#define redisAsyncHandleTimeout redictAsyncHandleTimeout
#define redisAsyncRead redictAsyncRead
#define redisAsyncWrite redictAsyncWrite
/* Command functions for an async context. Write the command to the
* output buffer and register the provided callback. */
#define redisvAsyncCommand redictvAsyncCommand
#define redisAsyncCommand redictAsyncCommand
#define redisAsyncCommandArgv redictAsyncCommandArgv
#define redisAsyncFormattedCommand redictAsyncFormattedCommand
#endif

192
shim/hiredis.h Normal file
View File

@ -0,0 +1,192 @@
/*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_H
#define __HIREDIS_H
#include <hiredict/hiredict.h>
#include <hiredis/read.h>
#include <hiredis/sds.h>
#include <hiredis/alloc.h>
#define HIREDIS_MAJOR HIREDICT_MAJOR
#define HIREDIS_MINOR HIREDICT_MINOR
#define HIREDIS_PATCH HIREDICT_PATCH
#define HIREDIS_SONAME HIREDICT_MAJOR
/* Connection type can be blocking or non-blocking and is set in the
* least significant bit of the flags field in redictContext. */
#define REDIS_BLOCK REDICT_BLOCK
/* Connection may be disconnected before being free'd. The second bit
* in the flags field is set when the context is connected. */
#define REDIS_CONNECTED REDICT_CONNECTED
/* The async API might try to disconnect cleanly and flush the output
* buffer and read all subsequent replies before disconnecting.
* This flag means no new commands can come in and the connection
* should be terminated once all replies have been read. */
#define REDIS_DICONNECTING REDICT_DISCONNECTING
/* Flag specific to the async API which means that the context should be clean
* up as soon as possible. */
#define REDIS_FREEING REDICT_FREEING
/* Flag that is set when an async callback is executed. */
#define REDIS_IN_CALLBACK REDICT_IN_CALLBACK
/* Flag that is set when the async context has one or more subscriptions. */
#define REDIS_SUBSCRIBED REDICT_SUBSCRIBED
/* Flag that is set when monitor mode is active */
#define REDIS_MONITORING REDICT_MONITORING
/* Flag that is set when we should set SO_REUSEADDR before calling bind() */
#define REDIS_REUSEADDR REDICT_REUSEADDR
/* Flag that is set when the async connection supports push replies. */
#define REDIS_SUPPORTS_PUSH REDICT_SUPPORTS_PUSH
/**
* Flag that indicates the user does not want the context to
* be automatically freed upon error
*/
#define REDIS_NO_AUTO_FREE REDICT_NO_AUTO_FREE
/* Flag that indicates the user does not want replies to be automatically freed */
#define REDIS_NO_AUTO_FREE_REPLIES REDICT_NO_AUTO_FREE_REPLIES
/* Flags to prefer IPv6 or IPv4 when doing DNS lookup. (If both are set,
* AF_UNSPEC is used.) */
#define REDIS_PREFER_IPV4 REDICT_PREFER_IPV4
#define REDIS_PREFER_IPV6 REDICT_PREFER_IPV6
#define REDIS_KEEPALIVE_INTERVAL REDICT_KEEPALIVE_INTERVAL /* seconds */
/* number of times we retry to connect in the case of EADDRNOTAVAIL and
* SO_REUSEADDR is being used. */
#define REDIS_CONNECT_RETRIES REDICT_CONNECT_RETRIES
/* RESP3 push helpers and callback prototypes */
#define redisIsPushReply(r) redictIsPushReply(r)
#define redisPushFn redictPushFn
#define redisAsyncPushFn redictAsyncPushFn
/* This is the reply object returned by redistCommand() */
#define redisReply redictReply
#define redisReaderCreate redictReaderCreate
/* Functions to format a command according to the protocol. */
#define redisvFormatCommand redictvFormatCommand
#define redisFormatCommand redictFormatCommand
#define redisFormatCommandArgv redictFormatCommandArgv
#define redisFormatSdsCommandArgv redictFormatSdsCommandArgv
#define redisFreeCommand redictFreeCommand
#define redisFreeSdsCommand redictFreeSdsCommand
#define redisConnectionType redictConnectionType
#define redisSsl redictSsl
#define REDIS_OPT_NONBLOCK REDICT_OPT_NONBLOCK
#define REDIS_OPT_REUSEADDR REDICT_OPT_REUSEADDR
#define REDIS_OPT_NOAUTOFREE REDICT_OPT_NOAUTOFREE /* Don't automatically free the async
* object on a connection failure, or
* other implicit conditions. Only free
* on an explicit call to disconnect()
* or free() */
#define REDIS_OPT_NO_PUSH_AUTOFREE REDICT_OPT_NO_PUSH_AUTOFREE /* Don't automatically intercept and
* free RESP3 PUSH replies. */
#define REDIS_OPT_NOAUTOFREEREPLIES REDICT_OPT_NOAUTOFREEREPLIES /* Don't automatically free replies. */
#define REDIS_OPT_PREFER_IPV4 REDICT_OPT_PREFER_IPV4 /* Prefer IPv4 in DNS lookups. */
#define REDIS_OPT_PREFER_IPV6 REDICT_OPT_PREFER_IPV6 /* Prefer IPv6 in DNS lookups. */
#define REDIS_OPT_PREFER_IP_UNSPEC REDICT_OPT_PREFER_IP_UNSPEC
/* In Unix systems a file descriptor is a regular signed int, with -1
* representing an invalid descriptor. In Windows it is a SOCKET
* (32- or 64-bit unsigned integer depending on the architecture), where
* all bits set (~0) is INVALID_SOCKET. */
#define redisFD redictFD
#define REDIS_INVALID_FD REDICT_INVALID_FD
#define redisOptions redictOptions
/**
* Helper macros to initialize options to their specified fields.
*/
#define REDIS_OPTIONS_SET_TCP(opts, ip_, port_) REDICT_OPTIONS_SET_TCP(opts, ip_, port_)
#define REDIS_OPTIONS_SET_UNIX(opts, path) REDICT_OPTIONS_SET_UNIX(opts, path)
#define REDIS_OPTIONS_SET_PRIVDATA(opts, data, dtor) REDICT_OPTIONS_SET_PRIVDATA(opts, data, dtor)
#define redisContextFuncs redictContextFuncs
/* Context for a connection to Redict */
#define redisContext redictContext
#define redisConnectWithOptions redictConnectWithOptions
#define redisConnect redictConnect
#define redisConnectWithTimeout redictConnectWithTimeout
#define redisConnectNonBlock redictConnectNonBlock
#define redisConnectBindNonBlock redictConnectBindNonBlock
#define redisConnectBindNonBlockWithReuse redictConnectBindNonBlockWithReuse
#define redisConnectUnix redictConnectUnix
#define redisConnectUnixWithTimeout redictConnectUnixWithTimeout
#define redisConnectUnixNonBlock redictConnectUnixNonBlock
#define redisConnectFd redictConnectFd
/**
* Reconnect the given context using the saved information.
*
* This re-uses the exact same connect options as in the initial connection.
* host, ip (or path), timeout and bind address are reused,
* flags are used unmodified from the existing context.
*
* Returns REDICT_OK on successful connect or REDICT_ERR otherwise.
*/
#define redisReconnect redictReconnect
#define redisSetPushCallback redictSetPushCallback
#define redisSetTimeout redictSetTimeout
#define redisEnableKeepAlive redictEnableKeepAlive
#define redisEnableKeepAliveWithInterval redictEnableKeepAliveWithInterval
#define redisSetTcpUserTimeout redictSetTcpUserTimeout
#define redisFree redictFree
#define redisFreeKeepFd redictFreeKeepFd
#define redisBufferRead redictBufferRead
#define redisBufferWrite redictBufferWrite
/* In a blocking context, this function first checks if there are unconsumed
* replies to return and returns one if so. Otherwise, it flushes the output
* buffer to the socket and reads until it has a reply. In a non-blocking
* context, it will return unconsumed replies until there are no more. */
#define redisGetReply redictGetReply
#define redisGetReplyFromReader redictGetReplyFromReader
/* Write a formatted command to the output buffer. Use these functions in blocking mode
* to get a pipeline of commands. */
#define redisAppendFormattedCommand redictAppendFormattedCommand
/* Write a command to the output buffer. Use these functions in blocking mode
* to get a pipeline of commands. */
#define redisvAppendCommand redictvAppendCommand
#define redisAppendCommand redictAppendCommand
#define redisAppendCommandArgv redictAppendCommandArgv
/* Issue a command to Redict. In a blocking context, it is identical to calling
* redictAppendCommand, followed by redictGetReply. The function will return
* NULL if there was an error in performing the request, otherwise it will
* return the reply. In a non-blocking context, it is identical to calling
* only redictAppendCommand and will always return NULL. */
#define redisvCommand redictvCommand
#define redisCommand redictCommand
#define redisCommandArgv redictCommandArgv
#endif

12
shim/hiredis.pc.in Normal file
View File

@ -0,0 +1,12 @@
prefix=@PREFIX@
install_libdir=@LIBDIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include
pkgincludedir=${includedir}/hiredis
Name: hiredis
Description: Minimalistic C client library for Redict, compatibility shim.
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lhiredict
Cflags: -I${pkgincludedir} -I${includedir} -D_FILE_OFFSET_BITS=64

111
shim/hiredis_ssl.h Normal file
View File

@ -0,0 +1,111 @@
/*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_SSL_H
#define __HIREDIS_SSL_H
/* A wrapper around OpenSSL SSL_CTX to allow easy SSL use without directly
* calling OpenSSL.
*/
#define redisSSLContext redictSSLContext
/**
#define redisCreateSSLContext redictCreateSSLContext
*/
#define redisSSLContextError redictSSLContextError
#define REDIS_SSL_CTX_NONE REDICT_SSL_CTX_NONE /* No Error */
#define REDIS_SSL_CTX_CREATE_FAILED REDICT_SSL_CTX_CREATE_FAILED /* Failed to create OpenSSL SSL_CTX */
#define REDIS_SSL_CTX_CERT_KEY_REQUIRED REDICT_SSL_CTX_CERT_KEY_REQUIRED /* Client cert and key must both be specified or skipped */
#define REDIS_SSL_CTX_CA_CERT_LOAD_FAILED REDICT_SSL_CTX_CA_CERT_LOAD_FAILED /* Failed to load CA Certificate or CA Path */
#define REDIS_SSL_CTX_CLIENT_CERT_LOAD_FAILED REDICT_SSL_CTX_CLIENT_CERT_LOAD_FAILED /* Failed to load client certificate */
#define REDIS_SSL_CTX_CLIENT_DEFAULT_CERT_FAILED REDICT_SSL_CTX_CLIENT_DEFAULT_CERT_FAILED /* Failed to set client default certificate directory */
#define REDIS_SSL_CTX_PRIVATE_KEY_LOAD_FAILED REDICT_SSL_CTX_PRIVATE_KEY_LOAD_FAILED /* Failed to load private key */
#define REDIS_SSL_CTX_OS_CERTSTORE_OPEN_FAILED REDICT_SSL_CTX_OS_CERTSTORE_OPEN_FAILED /* Failed to open system certificate store */
#define REDIS_SSL_CTX_OS_CERT_ADD_FAILED REDICT_SSL_CTX_OS_CERT_ADD_FAILED /* Failed to add CA certificates obtained from system to the SSL context */
/* Constants that mirror OpenSSL's verify modes. By default,
#define redisCreateSSLContext redictCreateSSLContext
* Some Redict clients disable peer verification if there are no
* certificates specified.
*/
#define REDIS_SSL_VERIFY_NONE REDICT_SSL_VERIFY_NONE
#define REDIS_SSL_VERIFY_PEER REDICT_SSL_VERIFY_PEER
#define REDIS_SSL_VERIFY_FAIL_IF_NO_PEER_CERT REDICT_SSL_VERIFY_FAIL_IF_NO_PEER_CERT
#define REDIS_SSL_VERIFY_CLIENT_ONCE REDICT_SSL_VERIFY_CLIENT_ONCE
#define REDIS_SSL_VERIFY_POST_HANDSHAKE REDICT_SSL_VERIFY_POST_HANDSHAKE
/* Options to create an OpenSSL context. */
#define redisSSLOptions redictSSLOptions
/**
* Return the error message corresponding with the specified error code.
*/
#define redisSSLContextGetError redictSSLContextGetError
/**
* Helper function to initialize the OpenSSL library.
*
* OpenSSL requires one-time initialization before it can be used. Callers should
* call this function only once, and only if OpenSSL is not directly initialized
* elsewhere.
*/
#define redisInitOpenSSL redictInitOpenSSL
/**
* Helper function to initialize an OpenSSL context that can be used
* to initiate SSL connections.
*
* cacert_filename is an optional name of a CA certificate/bundle file to load
* and use for validation.
*
* capath is an optional directory path where trusted CA certificate files are
* stored in an OpenSSL-compatible structure.
*
* cert_filename and private_key_filename are optional names of a client side
* certificate and private key files to use for authentication. They need to
* be both specified or omitted.
*
* server_name is an optional and will be used as a server name indication
* (SNI) TLS extension.
*
* If error is non-null, it will be populated in case the context creation fails
* (returning a NULL).
*/
#define redisCreateSSLContext redictCreateSSLContext
/**
* Helper function to initialize an OpenSSL context that can be used
#define redisCreateSSLContext redictCreateSSLContext
*
* options contains a structure of SSL options to use.
*
* If error is non-null, it will be populated in case the context creation fails
* (returning a NULL).
*/
#define redisCreateSSLContextWithOptions redictCreateSSLContextWithOptions
/**
* Free a previously created OpenSSL context.
*/
#define redisFreeSSLContext redictFreeSSLContext
/**
* Initiate SSL on an existing redictContext.
*
#define redisInitiateSSL redictInitiateSSL
* to directly interact with OpenSSL, and instead uses a redictSSLContext
#define redisCreateSSLContext redictCreateSSLContext
*/
#define redisInitiateSSLWithContext redictInitiateSSLWithContext
/**
* Initiate SSL/TLS negotiation on a provided OpenSSL SSL object.
*/
#define redisInitiateSSL redictInitiateSSL
#endif /* __HIREDICT_SSL_H */

13
shim/hiredis_ssl.pc.in Normal file
View File

@ -0,0 +1,13 @@
prefix=@PREFIX@
install_libdir=@LIBDIR@
exec_prefix=${prefix}
libdir=${exec_prefix}/${install_libdir}
includedir=${prefix}/include
pkgincludedir=${includedir}/hiredis
Name: hiredis_ssl
Description: SSL Support for hiredict, compatibility shim.
Version: @PROJECT_VERSION@
Requires: hiredis
Libs: -L${libdir} -lhiredict_ssl
Libs.private: -lssl -lcrypto

64
shim/read.h Normal file
View File

@ -0,0 +1,64 @@
/*
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_READ_H
#define __HIREDIS_READ_H
#include <hiredict/read.h>
#define REDIS_ERR REDICT_ERR
#define REDIS_OK REDICT_OK
/* When an error occurs, the err flag in a context is set to hold the type of
* error that occurred. REDICT_ERR_IO means there was an I/O error and you
* should use the "errno" variable to find out what is wrong.
* For other values, the "errstr" field will hold a description. */
#define REDIS_ERR_IO REDICT_ERR_IO /* Error in read or write */
#define REDIS_ERR_EOF REDICT_ERR_EOF /* End of file */
#define REDIS_ERR_PROTOCOL REDICT_ERR_PROTOCOL /* Protocol error */
#define REDIS_ERR_OOM REDICT_ERR_OOM /* Out of memory */
#define REDIS_ERR_TIMEOUT REDICT_ERR_TIMEOUT /* Timed out */
#define REDIS_ERR_OTHER REDICT_ERR_OTHER /* Everything else... */
#define REDIS_REPLY_STRING REDICT_REPLY_STRING
#define REDIS_REPLY_ARRAY REDICT_REPLY_ARRAY
#define REDIS_REPLY_INTEGER REDICT_REPLY_INTEGER
#define REDIS_REPLY_NIL REDICT_REPLY_NIL
#define REDIS_REPLY_STATUS REDICT_REPLY_STATUS
#define REDIS_REPLY_ERROR REDICT_REPLY_ERROR
#define REDIS_REPLY_DOUBLE REDICT_REPLY_DOUBLE
#define REDIS_REPLY_BOOL REDICT_REPLY_BOOL
#define REDIS_REPLY_MAP REDICT_REPLY_MAP
#define REDIS_REPLY_SET REDICT_REPLY_SET
#define REDIS_REPLY_ATTR REDICT_REPLY_ATTR
#define REDIS_REPLY_PUSH REDICT_REPLY_PUSH
#define REDIS_REPLY_BIGNUM REDICT_REPLY_BIGNUM
#define REDIS_REPLY_VERB REDICT_REPLY_VERB
/* Default max unused reader buffer. */
#define REDIS_READER_MAX_BUF REDICT_READER_MAX_BUF
/* Default multi-bulk element limit */
#define REDIS_READER_MAX_ARRAY_ELEMENTS REDICT_READER_MAX_ARRAY_ELEMENTS
#define redisReadTask redictReadTask
#define redisReplyObjectFunctions redictReplyObjectFunctions
#define redisReader redictReader
/* Public API for the protocol parser. */
#define redisReaderCreateWithFunctions redictReaderCreateWithFunctions
#define redisReaderFree redictReaderFree
#define redisReaderFeed redictReaderFeed
#define redisReaderGetReply redictReaderGetReply
#define redisReaderSetPrivdata(_r, _p) redictReaderSetPrivdata(_r, _p)
#define redisReaderGetObject(_r) redictReaderGetObject(_r)
#define redisReaderGetError(_r) redictReaderGetError(_r)
#endif

14
shim/sds.h Normal file
View File

@ -0,0 +1,14 @@
/*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __SDS_H
#define __SDS_H
#include <hiredict/sds.h>
#endif

17
shim/sockcompat.h Normal file
View File

@ -0,0 +1,17 @@
/*
* Copyright (c) 2019, Marcus Geelnard <m at bitsnbites dot eu>
*
* SPDX-FileCopyrightText: 2024 Hiredict Contributors
* SPDX-FileCopyrightText: 2024 Marcus Geelnard <m at bitsnbites dot eu>
*
* SPDX-License-Identifier: BSD-3-Clause
* SPDX-License-Identifier: LGPL-3.0-or-later
*
*/
#ifndef __HIREDIS_SOCKCOMPAT_H
#define __HIREDIS_SOCKCOMPAT_H
#include <hiredict/sockcompat.h>
#endif /* __HIREDIS_SOCKCOMPAT_H */