1/*
2 * Copyright (c) 2020, Michael Grunder <michael dot grunder at gmail dot com>
3 *
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
8 *
9 * * Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of Redis nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without
16 * specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/*
32 * SDS compatibility header.
33 *
34 * This simple file maps sds types and calls to their unique hiredis symbol names.
35 * It's useful when we build Hiredis as a dependency of Redis and want to call
36 * Hiredis' sds symbols rather than the ones built into Redis, as the libraries
37 * have slightly diverged and could cause hard to track down ABI incompatibility
38 * bugs.
39 *
40 */
41
42#ifndef HIREDIS_SDS_COMPAT
43#define HIREDIS_SDS_COMPAT
44
45#define sds hisds
46
47#define sdslen hi_sdslen
48#define sdsavail hi_sdsavail
49#define sdssetlen hi_sdssetlen
50#define sdsinclen hi_sdsinclen
51#define sdsalloc hi_sdsalloc
52#define sdssetalloc hi_sdssetalloc
53
54#define sdsAllocPtr hi_sdsAllocPtr
55#define sdsAllocSize hi_sdsAllocSize
56#define sdscat hi_sdscat
57#define sdscatfmt hi_sdscatfmt
58#define sdscatlen hi_sdscatlen
59#define sdscatprintf hi_sdscatprintf
60#define sdscatrepr hi_sdscatrepr
61#define sdscatsds hi_sdscatsds
62#define sdscatvprintf hi_sdscatvprintf
63#define sdsclear hi_sdsclear
64#define sdscmp hi_sdscmp
65#define sdscpy hi_sdscpy
66#define sdscpylen hi_sdscpylen
67#define sdsdup hi_sdsdup
68#define sdsempty hi_sdsempty
69#define sds_free hi_sds_free
70#define sdsfree hi_sdsfree
71#define sdsfreesplitres hi_sdsfreesplitres
72#define sdsfromlonglong hi_sdsfromlonglong
73#define sdsgrowzero hi_sdsgrowzero
74#define sdsIncrLen hi_sdsIncrLen
75#define sdsjoin hi_sdsjoin
76#define sdsjoinsds hi_sdsjoinsds
77#define sdsll2str hi_sdsll2str
78#define sdsMakeRoomFor hi_sdsMakeRoomFor
79#define sds_malloc hi_sds_malloc
80#define sdsmapchars hi_sdsmapchars
81#define sdsnew hi_sdsnew
82#define sdsnewlen hi_sdsnewlen
83#define sdsrange hi_sdsrange
84#define sds_realloc hi_sds_realloc
85#define sdsRemoveFreeSpace hi_sdsRemoveFreeSpace
86#define sdssplitargs hi_sdssplitargs
87#define sdssplitlen hi_sdssplitlen
88#define sdstolower hi_sdstolower
89#define sdstoupper hi_sdstoupper
90#define sdstrim hi_sdstrim
91#define sdsull2str hi_sdsull2str
92#define sdsupdatelen hi_sdsupdatelen
93
94#endif /* HIREDIS_SDS_COMPAT */
95