2
0

sdscompat.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. * SDS compatibility header.
  32. *
  33. * This simple file maps sds types and calls to their unique hiredis symbol names.
  34. * It's useful when we build Hiredis as a dependency of Redis and want to call
  35. * Hiredis' sds symbols rather than the ones built into Redis, as the libraries
  36. * have slightly diverged and could cause hard to track down ABI incompatibility
  37. * bugs.
  38. *
  39. */
  40. #ifndef HIREDIS_SDS_COMPAT
  41. #define HIREDIS_SDS_COMPAT
  42. #define sds hisds
  43. #define sdslen hi_sdslen
  44. #define sdsavail hi_sdsavail
  45. #define sdssetlen hi_sdssetlen
  46. #define sdsinclen hi_sdsinclen
  47. #define sdsalloc hi_sdsalloc
  48. #define sdssetalloc hi_sdssetalloc
  49. #define sdsAllocPtr hi_sdsAllocPtr
  50. #define sdsAllocSize hi_sdsAllocSize
  51. #define sdscat hi_sdscat
  52. #define sdscatfmt hi_sdscatfmt
  53. #define sdscatlen hi_sdscatlen
  54. #define sdscatprintf hi_sdscatprintf
  55. #define sdscatrepr hi_sdscatrepr
  56. #define sdscatsds hi_sdscatsds
  57. #define sdscatvprintf hi_sdscatvprintf
  58. #define sdsclear hi_sdsclear
  59. #define sdscmp hi_sdscmp
  60. #define sdscpy hi_sdscpy
  61. #define sdscpylen hi_sdscpylen
  62. #define sdsdup hi_sdsdup
  63. #define sdsempty hi_sdsempty
  64. #define sds_free hi_sds_free
  65. #define sdsfree hi_sdsfree
  66. #define sdsfreesplitres hi_sdsfreesplitres
  67. #define sdsfromlonglong hi_sdsfromlonglong
  68. #define sdsgrowzero hi_sdsgrowzero
  69. #define sdsIncrLen hi_sdsIncrLen
  70. #define sdsjoin hi_sdsjoin
  71. #define sdsjoinsds hi_sdsjoinsds
  72. #define sdsll2str hi_sdsll2str
  73. #define sdsMakeRoomFor hi_sdsMakeRoomFor
  74. #define sds_malloc hi_sds_malloc
  75. #define sdsmapchars hi_sdsmapchars
  76. #define sdsnew hi_sdsnew
  77. #define sdsnewlen hi_sdsnewlen
  78. #define sdsrange hi_sdsrange
  79. #define sds_realloc hi_sds_realloc
  80. #define sdsRemoveFreeSpace hi_sdsRemoveFreeSpace
  81. #define sdssplitargs hi_sdssplitargs
  82. #define sdssplitlen hi_sdssplitlen
  83. #define sdstolower hi_sdstolower
  84. #define sdstoupper hi_sdstoupper
  85. #define sdstrim hi_sdstrim
  86. #define sdsull2str hi_sdsull2str
  87. #define sdsupdatelen hi_sdsupdatelen
  88. #endif /* HIREDIS_SDS_COMPAT */