slidge-whatsapp 0.2.2__cp313-cp313-manylinux_2_36_aarch64.whl → 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of slidge-whatsapp might be problematic. Click here for more details.

Files changed (1250) hide show
  1. slidge_whatsapp/__init__.py +26 -8
  2. slidge_whatsapp/__main__.py +3 -0
  3. slidge_whatsapp/config.py +3 -0
  4. slidge_whatsapp/contact.py +1 -1
  5. slidge_whatsapp/event.go +79 -24
  6. slidge_whatsapp/gateway.go +13 -9
  7. slidge_whatsapp/gateway.py +2 -2
  8. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +194 -157
  9. slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
  10. slidge_whatsapp/generated/build.py +153 -128
  11. slidge_whatsapp/generated/go.py +1 -1
  12. slidge_whatsapp/generated/whatsapp.c +1535 -1064
  13. slidge_whatsapp/generated/whatsapp.go +938 -693
  14. slidge_whatsapp/generated/whatsapp.py +1300 -980
  15. slidge_whatsapp/generated/whatsapp_go.h +194 -157
  16. slidge_whatsapp/go.mod +18 -13
  17. slidge_whatsapp/go.sum +41 -29
  18. slidge_whatsapp/group.py +7 -2
  19. slidge_whatsapp/media/__init__.py +0 -0
  20. slidge_whatsapp/media/media.go +24 -13
  21. slidge_whatsapp/session.go +77 -71
  22. slidge_whatsapp/session.py +53 -31
  23. slidge_whatsapp/vendor/filippo.io/edwards25519/LICENSE +27 -0
  24. slidge_whatsapp/vendor/filippo.io/edwards25519/README.md +14 -0
  25. slidge_whatsapp/vendor/filippo.io/edwards25519/doc.go +20 -0
  26. slidge_whatsapp/vendor/filippo.io/edwards25519/edwards25519.go +427 -0
  27. slidge_whatsapp/vendor/filippo.io/edwards25519/extra.go +349 -0
  28. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe.go +420 -0
  29. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_amd64.go +16 -0
  30. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_amd64.s +379 -0
  31. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_amd64_noasm.go +12 -0
  32. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_arm64.go +16 -0
  33. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_arm64.s +42 -0
  34. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_arm64_noasm.go +12 -0
  35. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_extra.go +50 -0
  36. slidge_whatsapp/vendor/filippo.io/edwards25519/field/fe_generic.go +266 -0
  37. slidge_whatsapp/vendor/filippo.io/edwards25519/scalar.go +343 -0
  38. slidge_whatsapp/vendor/filippo.io/edwards25519/scalar_fiat.go +1147 -0
  39. slidge_whatsapp/vendor/filippo.io/edwards25519/scalarmult.go +214 -0
  40. slidge_whatsapp/vendor/filippo.io/edwards25519/tables.go +129 -0
  41. slidge_whatsapp/vendor/github.com/ebitengine/purego/.gitignore +1 -0
  42. slidge_whatsapp/vendor/github.com/ebitengine/purego/LICENSE +201 -0
  43. slidge_whatsapp/vendor/github.com/ebitengine/purego/README.md +97 -0
  44. slidge_whatsapp/vendor/github.com/ebitengine/purego/abi_amd64.h +99 -0
  45. slidge_whatsapp/vendor/github.com/ebitengine/purego/abi_arm64.h +39 -0
  46. slidge_whatsapp/vendor/github.com/ebitengine/purego/cgo.go +19 -0
  47. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlerror.go +17 -0
  48. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +99 -0
  49. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_android.go +34 -0
  50. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +19 -0
  51. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_freebsd.go +14 -0
  52. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_linux.go +16 -0
  53. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_nocgo_freebsd.go +11 -0
  54. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_nocgo_linux.go +19 -0
  55. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_playground.go +24 -0
  56. slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_stubs.s +26 -0
  57. slidge_whatsapp/vendor/github.com/ebitengine/purego/func.go +436 -0
  58. slidge_whatsapp/vendor/github.com/ebitengine/purego/go_runtime.go +13 -0
  59. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/cgo/dlfcn_cgo_unix.go +56 -0
  60. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/cgo/empty.go +6 -0
  61. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/cgo/syscall_cgo_unix.go +55 -0
  62. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/abi_amd64.h +99 -0
  63. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/abi_arm64.h +39 -0
  64. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/asm_amd64.s +39 -0
  65. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/asm_arm64.s +36 -0
  66. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/callbacks.go +93 -0
  67. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/doc.go +32 -0
  68. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/freebsd.go +27 -0
  69. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_darwin_amd64.go +73 -0
  70. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_darwin_arm64.go +88 -0
  71. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_freebsd_amd64.go +95 -0
  72. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_freebsd_arm64.go +98 -0
  73. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +72 -0
  74. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_linux_amd64.go +95 -0
  75. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_linux_arm64.go +98 -0
  76. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_setenv.go +18 -0
  77. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_util.go +37 -0
  78. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/iscgo.go +19 -0
  79. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/libcgo.go +39 -0
  80. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_darwin.go +22 -0
  81. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_freebsd.go +16 -0
  82. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/libcgo_linux.go +16 -0
  83. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/setenv.go +19 -0
  84. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +221 -0
  85. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols_darwin.go +29 -0
  86. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols_freebsd.go +29 -0
  87. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols_linux.go +29 -0
  88. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_amd64.s +104 -0
  89. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_arm64.s +72 -0
  90. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/trampolines_stubs.s +90 -0
  91. slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/strings/strings.go +40 -0
  92. slidge_whatsapp/vendor/github.com/ebitengine/purego/is_ios.go +13 -0
  93. slidge_whatsapp/vendor/github.com/ebitengine/purego/nocgo.go +25 -0
  94. slidge_whatsapp/vendor/github.com/ebitengine/purego/struct_amd64.go +260 -0
  95. slidge_whatsapp/vendor/github.com/ebitengine/purego/struct_arm64.go +274 -0
  96. slidge_whatsapp/vendor/github.com/ebitengine/purego/struct_other.go +16 -0
  97. slidge_whatsapp/vendor/github.com/ebitengine/purego/sys_amd64.s +164 -0
  98. slidge_whatsapp/vendor/github.com/ebitengine/purego/sys_arm64.s +92 -0
  99. slidge_whatsapp/vendor/github.com/ebitengine/purego/sys_unix_arm64.s +70 -0
  100. slidge_whatsapp/vendor/github.com/ebitengine/purego/syscall.go +53 -0
  101. slidge_whatsapp/vendor/github.com/ebitengine/purego/syscall_cgo_linux.go +21 -0
  102. slidge_whatsapp/vendor/github.com/ebitengine/purego/syscall_sysv.go +223 -0
  103. slidge_whatsapp/vendor/github.com/ebitengine/purego/syscall_windows.go +46 -0
  104. slidge_whatsapp/vendor/github.com/ebitengine/purego/zcallback_amd64.s +2014 -0
  105. slidge_whatsapp/vendor/github.com/ebitengine/purego/zcallback_arm64.s +4014 -0
  106. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/.gitattributes +6 -0
  107. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/AUTHORS +1 -0
  108. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/COPYING +661 -0
  109. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/README.md +71 -0
  110. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +66 -0
  111. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +596 -0
  112. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo_cgo.go +18 -0
  113. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo_extlib.go +11 -0
  114. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo_extlib_pkgconfig.go +9 -0
  115. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_content_types.go +383 -0
  116. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +1098 -0
  117. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_vendor.go +9 -0
  118. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/archive.h +444 -0
  119. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/band-writer.h +117 -0
  120. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/bidi.h +90 -0
  121. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/bitmap.h +175 -0
  122. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/buffer.h +250 -0
  123. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/color.h +427 -0
  124. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/compress.h +88 -0
  125. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/compressed-buffer.h +185 -0
  126. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/config.h +222 -0
  127. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/context.h +1006 -0
  128. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/crypt.h +270 -0
  129. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/device.h +654 -0
  130. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/display-list.h +142 -0
  131. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/document.h +1108 -0
  132. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/export.h +52 -0
  133. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/filter.h +263 -0
  134. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/font.h +815 -0
  135. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/geometry.h +818 -0
  136. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/getopt.h +128 -0
  137. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/glyph-cache.h +96 -0
  138. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/glyph.h +81 -0
  139. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/hash.h +126 -0
  140. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/heap-imp.h +163 -0
  141. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/heap.h +140 -0
  142. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/image.h +443 -0
  143. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/link.h +130 -0
  144. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/log.h +61 -0
  145. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/outline.h +228 -0
  146. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/output-svg.h +64 -0
  147. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/output.h +415 -0
  148. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/path.h +447 -0
  149. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/pixmap.h +501 -0
  150. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/pool.h +68 -0
  151. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/separation.h +138 -0
  152. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/shade.h +233 -0
  153. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/store.h +456 -0
  154. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/story-writer.h +209 -0
  155. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/story.h +232 -0
  156. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/stream.h +646 -0
  157. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/string-util.h +286 -0
  158. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/structured-text.h +365 -0
  159. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/system.h +459 -0
  160. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/text.h +209 -0
  161. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/track-usage.h +57 -0
  162. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/transition.h +76 -0
  163. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/tree.h +62 -0
  164. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/types.h +41 -0
  165. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/util.h +151 -0
  166. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/vendor.go +3 -0
  167. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/version.h +31 -0
  168. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/write-pixmap.h +499 -0
  169. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/writer.h +266 -0
  170. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz/xml.h +397 -0
  171. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/fitz.h +97 -0
  172. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/memento.h +423 -0
  173. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/include/mupdf/vendor.go +3 -0
  174. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/libs/libmupdf_linux_arm64.a +0 -0
  175. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/libs/libmupdfthird_linux_arm64.a +0 -0
  176. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/libs/vendor.go +3 -0
  177. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +23 -0
  178. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +22 -0
  179. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +22 -0
  180. slidge_whatsapp/vendor/github.com/go-python/gopy/LICENSE +23 -0
  181. slidge_whatsapp/vendor/github.com/go-python/gopy/gopyh/handle.go +210 -0
  182. slidge_whatsapp/vendor/github.com/google/uuid/CHANGELOG.md +41 -0
  183. slidge_whatsapp/vendor/github.com/google/uuid/CONTRIBUTING.md +26 -0
  184. slidge_whatsapp/vendor/github.com/google/uuid/CONTRIBUTORS +9 -0
  185. slidge_whatsapp/vendor/github.com/google/uuid/LICENSE +27 -0
  186. slidge_whatsapp/vendor/github.com/google/uuid/README.md +21 -0
  187. slidge_whatsapp/vendor/github.com/google/uuid/dce.go +80 -0
  188. slidge_whatsapp/vendor/github.com/google/uuid/doc.go +12 -0
  189. slidge_whatsapp/vendor/github.com/google/uuid/hash.go +59 -0
  190. slidge_whatsapp/vendor/github.com/google/uuid/marshal.go +38 -0
  191. slidge_whatsapp/vendor/github.com/google/uuid/node.go +90 -0
  192. slidge_whatsapp/vendor/github.com/google/uuid/node_js.go +12 -0
  193. slidge_whatsapp/vendor/github.com/google/uuid/node_net.go +33 -0
  194. slidge_whatsapp/vendor/github.com/google/uuid/null.go +118 -0
  195. slidge_whatsapp/vendor/github.com/google/uuid/sql.go +59 -0
  196. slidge_whatsapp/vendor/github.com/google/uuid/time.go +134 -0
  197. slidge_whatsapp/vendor/github.com/google/uuid/util.go +43 -0
  198. slidge_whatsapp/vendor/github.com/google/uuid/uuid.go +365 -0
  199. slidge_whatsapp/vendor/github.com/google/uuid/version1.go +44 -0
  200. slidge_whatsapp/vendor/github.com/google/uuid/version4.go +76 -0
  201. slidge_whatsapp/vendor/github.com/google/uuid/version6.go +56 -0
  202. slidge_whatsapp/vendor/github.com/google/uuid/version7.go +104 -0
  203. slidge_whatsapp/vendor/github.com/gorilla/websocket/.gitignore +25 -0
  204. slidge_whatsapp/vendor/github.com/gorilla/websocket/AUTHORS +9 -0
  205. slidge_whatsapp/vendor/github.com/gorilla/websocket/LICENSE +22 -0
  206. slidge_whatsapp/vendor/github.com/gorilla/websocket/README.md +33 -0
  207. slidge_whatsapp/vendor/github.com/gorilla/websocket/client.go +434 -0
  208. slidge_whatsapp/vendor/github.com/gorilla/websocket/compression.go +148 -0
  209. slidge_whatsapp/vendor/github.com/gorilla/websocket/conn.go +1238 -0
  210. slidge_whatsapp/vendor/github.com/gorilla/websocket/doc.go +227 -0
  211. slidge_whatsapp/vendor/github.com/gorilla/websocket/join.go +42 -0
  212. slidge_whatsapp/vendor/github.com/gorilla/websocket/json.go +60 -0
  213. slidge_whatsapp/vendor/github.com/gorilla/websocket/mask.go +55 -0
  214. slidge_whatsapp/vendor/github.com/gorilla/websocket/mask_safe.go +16 -0
  215. slidge_whatsapp/vendor/github.com/gorilla/websocket/prepared.go +102 -0
  216. slidge_whatsapp/vendor/github.com/gorilla/websocket/proxy.go +77 -0
  217. slidge_whatsapp/vendor/github.com/gorilla/websocket/server.go +365 -0
  218. slidge_whatsapp/vendor/github.com/gorilla/websocket/tls_handshake.go +21 -0
  219. slidge_whatsapp/vendor/github.com/gorilla/websocket/tls_handshake_116.go +21 -0
  220. slidge_whatsapp/vendor/github.com/gorilla/websocket/util.go +298 -0
  221. slidge_whatsapp/vendor/github.com/gorilla/websocket/x_net_proxy.go +473 -0
  222. slidge_whatsapp/vendor/github.com/h2non/filetype/.editorconfig +12 -0
  223. slidge_whatsapp/vendor/github.com/h2non/filetype/.gitignore +2 -0
  224. slidge_whatsapp/vendor/github.com/h2non/filetype/.travis.yml +16 -0
  225. slidge_whatsapp/vendor/github.com/h2non/filetype/History.md +163 -0
  226. slidge_whatsapp/vendor/github.com/h2non/filetype/LICENSE +24 -0
  227. slidge_whatsapp/vendor/github.com/h2non/filetype/README.md +294 -0
  228. slidge_whatsapp/vendor/github.com/h2non/filetype/filetype.go +102 -0
  229. slidge_whatsapp/vendor/github.com/h2non/filetype/kind.go +91 -0
  230. slidge_whatsapp/vendor/github.com/h2non/filetype/match.go +90 -0
  231. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/application.go +43 -0
  232. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/archive.go +211 -0
  233. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/audio.go +85 -0
  234. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/document.go +197 -0
  235. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/font.go +45 -0
  236. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/image.go +143 -0
  237. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/isobmff/isobmff.go +37 -0
  238. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/matchers.go +51 -0
  239. slidge_whatsapp/vendor/github.com/h2non/filetype/matchers/video.go +145 -0
  240. slidge_whatsapp/vendor/github.com/h2non/filetype/types/defaults.go +4 -0
  241. slidge_whatsapp/vendor/github.com/h2non/filetype/types/mime.go +14 -0
  242. slidge_whatsapp/vendor/github.com/h2non/filetype/types/split.go +11 -0
  243. slidge_whatsapp/vendor/github.com/h2non/filetype/types/type.go +16 -0
  244. slidge_whatsapp/vendor/github.com/h2non/filetype/types/types.go +23 -0
  245. slidge_whatsapp/vendor/github.com/h2non/filetype/version.go +4 -0
  246. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +21 -0
  247. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +69 -0
  248. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +147 -0
  249. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/LICENSE +21 -0
  250. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +162 -0
  251. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +7 -0
  252. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +7 -0
  253. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +272 -0
  254. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +54 -0
  255. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +55 -0
  256. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +82 -0
  257. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +63 -0
  258. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +68 -0
  259. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/tramp_amd64.go +5 -0
  260. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/tramp_arm64.go +5 -0
  261. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/tramp_darwin_arm64.go +5 -0
  262. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/types.go +34 -0
  263. slidge_whatsapp/vendor/github.com/mattn/go-colorable/LICENSE +21 -0
  264. slidge_whatsapp/vendor/github.com/mattn/go-colorable/README.md +48 -0
  265. slidge_whatsapp/vendor/github.com/mattn/go-colorable/colorable_others.go +38 -0
  266. slidge_whatsapp/vendor/github.com/mattn/go-colorable/colorable_windows.go +1047 -0
  267. slidge_whatsapp/vendor/github.com/mattn/go-colorable/go.test.sh +12 -0
  268. slidge_whatsapp/vendor/github.com/mattn/go-colorable/noncolorable.go +57 -0
  269. slidge_whatsapp/vendor/github.com/mattn/go-isatty/LICENSE +9 -0
  270. slidge_whatsapp/vendor/github.com/mattn/go-isatty/README.md +50 -0
  271. slidge_whatsapp/vendor/github.com/mattn/go-isatty/doc.go +2 -0
  272. slidge_whatsapp/vendor/github.com/mattn/go-isatty/go.test.sh +12 -0
  273. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_bsd.go +20 -0
  274. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_others.go +17 -0
  275. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_plan9.go +23 -0
  276. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_solaris.go +21 -0
  277. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_tcgets.go +20 -0
  278. slidge_whatsapp/vendor/github.com/mattn/go-isatty/isatty_windows.go +125 -0
  279. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/.codecov.yml +4 -0
  280. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/.gitignore +14 -0
  281. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/LICENSE +21 -0
  282. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +598 -0
  283. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/backup.go +85 -0
  284. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +412 -0
  285. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/convert.go +299 -0
  286. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/doc.go +134 -0
  287. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/error.go +150 -0
  288. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +261459 -0
  289. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +13720 -0
  290. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +2315 -0
  291. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_context.go +103 -0
  292. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_func_crypt.go +120 -0
  293. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go +54 -0
  294. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_libsqlite3.go +23 -0
  295. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_load_extension.go +85 -0
  296. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_load_extension_omit.go +25 -0
  297. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_allow_uri_authority.go +16 -0
  298. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_app_armor.go +16 -0
  299. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_column_metadata.go +22 -0
  300. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_foreign_keys.go +16 -0
  301. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_fts5.go +15 -0
  302. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_icu.go +20 -0
  303. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_introspect.go +16 -0
  304. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_math_functions.go +15 -0
  305. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_os_trace.go +15 -0
  306. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate.go +21 -0
  307. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate_hook.go +113 -0
  308. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_preupdate_omit.go +22 -0
  309. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete.go +16 -0
  310. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_secure_delete_fast.go +16 -0
  311. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_serialize.go +83 -0
  312. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_serialize_omit.go +21 -0
  313. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_stat4.go +16 -0
  314. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +89 -0
  315. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +97 -0
  316. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +295 -0
  317. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth_omit.go +158 -0
  318. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_full.go +16 -0
  319. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vacuum_incr.go +16 -0
  320. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_vtable.go +721 -0
  321. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_other.go +18 -0
  322. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_solaris.go +15 -0
  323. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_trace.go +288 -0
  324. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_type.go +108 -0
  325. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_usleep_windows.go +42 -0
  326. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_windows.go +18 -0
  327. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +728 -0
  328. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/static_mock.go +38 -0
  329. slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
  330. slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
  331. slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
  332. slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
  333. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
  334. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
  335. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
  336. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
  337. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
  338. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
  339. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
  340. slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
  341. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
  342. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
  343. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
  344. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
  345. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
  346. slidge_whatsapp/vendor/github.com/rs/zerolog/.gitignore +25 -0
  347. slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
  348. slidge_whatsapp/vendor/github.com/rs/zerolog/LICENSE +21 -0
  349. slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +813 -0
  350. slidge_whatsapp/vendor/github.com/rs/zerolog/array.go +240 -0
  351. slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +535 -0
  352. slidge_whatsapp/vendor/github.com/rs/zerolog/context.go +480 -0
  353. slidge_whatsapp/vendor/github.com/rs/zerolog/ctx.go +52 -0
  354. slidge_whatsapp/vendor/github.com/rs/zerolog/encoder.go +56 -0
  355. slidge_whatsapp/vendor/github.com/rs/zerolog/encoder_cbor.go +45 -0
  356. slidge_whatsapp/vendor/github.com/rs/zerolog/encoder_json.go +51 -0
  357. slidge_whatsapp/vendor/github.com/rs/zerolog/event.go +830 -0
  358. slidge_whatsapp/vendor/github.com/rs/zerolog/example.jsonl +7 -0
  359. slidge_whatsapp/vendor/github.com/rs/zerolog/fields.go +292 -0
  360. slidge_whatsapp/vendor/github.com/rs/zerolog/globals.go +190 -0
  361. slidge_whatsapp/vendor/github.com/rs/zerolog/go112.go +7 -0
  362. slidge_whatsapp/vendor/github.com/rs/zerolog/hook.go +64 -0
  363. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/README.md +56 -0
  364. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/base.go +19 -0
  365. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/cbor.go +102 -0
  366. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/decode_stream.go +654 -0
  367. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/string.go +117 -0
  368. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/time.go +93 -0
  369. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/cbor/types.go +486 -0
  370. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/json/base.go +19 -0
  371. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/json/bytes.go +85 -0
  372. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/json/string.go +149 -0
  373. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/json/time.go +113 -0
  374. slidge_whatsapp/vendor/github.com/rs/zerolog/internal/json/types.go +435 -0
  375. slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
  376. slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +518 -0
  377. slidge_whatsapp/vendor/github.com/rs/zerolog/not_go112.go +5 -0
  378. slidge_whatsapp/vendor/github.com/rs/zerolog/pretty.png +0 -0
  379. slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +137 -0
  380. slidge_whatsapp/vendor/github.com/rs/zerolog/syslog.go +89 -0
  381. slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +355 -0
  382. slidge_whatsapp/vendor/go.mau.fi/libsignal/LICENSE +674 -0
  383. slidge_whatsapp/vendor/go.mau.fi/libsignal/cipher/Cbc.go +101 -0
  384. slidge_whatsapp/vendor/go.mau.fi/libsignal/cipher/Cipher.go +105 -0
  385. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/Curve.go +109 -0
  386. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/DjbECPublicKey.go +29 -0
  387. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/DkbECPrivateKey.go +29 -0
  388. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/Doc.go +3 -0
  389. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/ECKeyPair.go +27 -0
  390. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/ECPrivateKey.go +7 -0
  391. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/ECPublicKey.go +11 -0
  392. slidge_whatsapp/vendor/go.mau.fi/libsignal/ecc/SignCurve25519.go +97 -0
  393. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +152 -0
  394. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +94 -0
  395. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/ratchet/Doc.go +3 -0
  396. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/ratchet/SenderChainKey.go +68 -0
  397. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/ratchet/SenderMessageKey.go +89 -0
  398. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/record/Doc.go +2 -0
  399. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/record/SenderKeyRecord.go +149 -0
  400. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/record/SenderKeyState.go +186 -0
  401. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/Doc.go +3 -0
  402. slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +13 -0
  403. slidge_whatsapp/vendor/go.mau.fi/libsignal/kdf/HKDF.go +47 -0
  404. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +128 -0
  405. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +48 -0
  406. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKeyPair.go +39 -0
  407. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/message/MessageKey.go +91 -0
  408. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/prekey/PreKeyBundle.go +86 -0
  409. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/root/RootKey.go +66 -0
  410. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/session/DerivedSecrets.go +29 -0
  411. slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/session/Pair.go +43 -0
  412. slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +85 -0
  413. slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/Logger.go +89 -0
  414. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/CiphertextMessage.go +19 -0
  415. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/Doc.go +3 -0
  416. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/PreKeySignalMessage.go +152 -0
  417. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/SenderKeyDistributionMessage.go +147 -0
  418. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/SenderKeyMessage.go +168 -0
  419. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/SenderKeyName.go +25 -0
  420. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/SignalMessage.go +226 -0
  421. slidge_whatsapp/vendor/go.mau.fi/libsignal/protocol/SignalProtocolAddress.go +38 -0
  422. slidge_whatsapp/vendor/go.mau.fi/libsignal/ratchet/Ratchet.go +197 -0
  423. slidge_whatsapp/vendor/go.mau.fi/libsignal/ratchet/ReceiverParameters.go +106 -0
  424. slidge_whatsapp/vendor/go.mau.fi/libsignal/ratchet/SenderParameters.go +106 -0
  425. slidge_whatsapp/vendor/go.mau.fi/libsignal/ratchet/SymmetricParameters.go +18 -0
  426. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +246 -0
  427. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.proto +14 -0
  428. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/JSONSerializer.go +303 -0
  429. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +1501 -0
  430. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.proto +114 -0
  431. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/ProtoBufferSerializer.go +262 -0
  432. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/Serializer.go +31 -0
  433. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +641 -0
  434. slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.proto +45 -0
  435. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +299 -0
  436. slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +409 -0
  437. slidge_whatsapp/vendor/go.mau.fi/libsignal/signalerror/errors.go +37 -0
  438. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/ChainState.go +157 -0
  439. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/Doc.go +3 -0
  440. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/PendingKeyExchangeState.go +91 -0
  441. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/PendingPreKeyState.go +62 -0
  442. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/PreKeyRecord.go +90 -0
  443. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/SessionRecord.go +197 -0
  444. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/SessionState.go +531 -0
  445. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/SignedPreKeyRecord.go +112 -0
  446. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/record/UnacknowledgedPreKey.go +69 -0
  447. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/Doc.go +3 -0
  448. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +31 -0
  449. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +23 -0
  450. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +23 -0
  451. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +19 -0
  452. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignalProtocolStore.go +15 -0
  453. slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +26 -0
  454. slidge_whatsapp/vendor/go.mau.fi/libsignal/util/bytehelper/ByteHelper.go +97 -0
  455. slidge_whatsapp/vendor/go.mau.fi/libsignal/util/errorhelper/ErrorHelper.go +40 -0
  456. slidge_whatsapp/vendor/go.mau.fi/libsignal/util/keyhelper/KeyHelper.go +95 -0
  457. slidge_whatsapp/vendor/go.mau.fi/libsignal/util/medium/Medium.go +4 -0
  458. slidge_whatsapp/vendor/go.mau.fi/libsignal/util/optional/Integer.go +17 -0
  459. slidge_whatsapp/vendor/go.mau.fi/util/LICENSE +373 -0
  460. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
  461. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
  462. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
  463. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
  464. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
  465. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
  466. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
  467. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
  468. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
  469. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
  470. slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
  471. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
  472. slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
  473. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
  474. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
  475. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +41 -0
  476. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
  477. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
  478. slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
  479. slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
  480. slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
  481. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
  482. slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
  483. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
  484. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
  485. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
  486. slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
  487. slidge_whatsapp/vendor/go.mau.fi/util/fallocate/doc.go +9 -0
  488. slidge_whatsapp/vendor/go.mau.fi/util/fallocate/fallocate_darwin.go +29 -0
  489. slidge_whatsapp/vendor/go.mau.fi/util/fallocate/fallocate_linux.go +24 -0
  490. slidge_whatsapp/vendor/go.mau.fi/util/fallocate/fallocate_unknown.go +17 -0
  491. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/duration.go +155 -0
  492. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/helpers.go +59 -0
  493. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/integer.go +170 -0
  494. slidge_whatsapp/vendor/go.mau.fi/util/jsontime/string.go +95 -0
  495. slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
  496. slidge_whatsapp/vendor/go.mau.fi/util/random/bytes.go +21 -0
  497. slidge_whatsapp/vendor/go.mau.fi/util/random/string.go +87 -0
  498. slidge_whatsapp/vendor/go.mau.fi/util/retryafter/retryafter.go +53 -0
  499. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.editorconfig +13 -0
  500. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.gitattributes +3 -0
  501. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +31 -0
  502. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/LICENSE +374 -0
  503. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/README.md +35 -0
  504. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +312 -0
  505. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +323 -0
  506. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/errors.go +19 -0
  507. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +97 -0
  508. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +138 -0
  509. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/lthash/lthash.go +58 -0
  510. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +409 -0
  511. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +100 -0
  512. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/attrs.go +218 -0
  513. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/decoder.go +406 -0
  514. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +308 -0
  515. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/errors.go +12 -0
  516. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/node.go +139 -0
  517. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/token/token.go +94 -0
  518. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/unpack.go +31 -0
  519. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/xml.go +108 -0
  520. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/broadcast.go +143 -0
  521. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +112 -0
  522. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +896 -0
  523. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +212 -0
  524. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +227 -0
  525. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +394 -0
  526. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +261 -0
  527. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +960 -0
  528. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/handshake.go +165 -0
  529. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +680 -0
  530. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +84 -0
  531. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +98 -0
  532. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +185 -0
  533. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +842 -0
  534. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +374 -0
  535. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +376 -0
  536. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +452 -0
  537. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +245 -0
  538. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +272 -0
  539. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +255 -0
  540. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +139 -0
  541. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +170 -0
  542. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/.gitignore +1 -0
  543. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/armadilloutil/decode.go +32 -0
  544. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +36 -0
  545. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.go +515 -0
  546. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.proto +43 -0
  547. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +2982 -0
  548. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +258 -0
  549. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/extra.go +3 -0
  550. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +1017 -0
  551. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +140 -0
  552. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +412 -0
  553. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.proto +34 -0
  554. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +138 -0
  555. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.proto +10 -0
  556. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +769 -0
  557. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +67 -0
  558. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/legacy.go +11 -0
  559. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +978 -0
  560. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +100 -0
  561. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +2817 -0
  562. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.proto +233 -0
  563. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/extra.go +82 -0
  564. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +247 -0
  565. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +18 -0
  566. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +26597 -0
  567. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +2550 -0
  568. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/legacy.go +31 -0
  569. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +2368 -0
  570. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +231 -0
  571. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/legacy.go +11 -0
  572. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.go +2130 -0
  573. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +191 -0
  574. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +272 -0
  575. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +21 -0
  576. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +1156 -0
  577. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +96 -0
  578. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/extra.go +41 -0
  579. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +859 -0
  580. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.proto +75 -0
  581. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +19 -0
  582. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +732 -0
  583. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.proto +57 -0
  584. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/extra.go +3 -0
  585. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +857 -0
  586. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.proto +72 -0
  587. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/legacy.go +31 -0
  588. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +5344 -0
  589. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +493 -0
  590. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +428 -0
  591. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.proto +33 -0
  592. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +852 -0
  593. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.proto +72 -0
  594. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +2325 -0
  595. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +253 -0
  596. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +4441 -0
  597. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +579 -0
  598. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/legacy.go +1 -0
  599. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/push.go +110 -0
  600. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/qrchan.go +180 -0
  601. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +248 -0
  602. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/request.go +225 -0
  603. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +450 -0
  604. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +1299 -0
  605. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +657 -0
  606. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/socket/constants.go +43 -0
  607. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/socket/framesocket.go +235 -0
  608. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/socket/noisehandshake.go +124 -0
  609. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/socket/noisesocket.go +108 -0
  610. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +187 -0
  611. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +256 -0
  612. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +182 -0
  613. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +288 -0
  614. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
  615. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +897 -0
  616. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +153 -0
  617. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
  618. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
  619. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
  620. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
  621. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
  622. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
  623. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
  624. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/upgrades.go +22 -0
  625. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +243 -0
  626. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
  627. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +21 -0
  628. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/appstate.go +185 -0
  629. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/call.go +77 -0
  630. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +608 -0
  631. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +164 -0
  632. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +262 -0
  633. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +115 -0
  634. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/newsletter.go +201 -0
  635. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/presence.go +78 -0
  636. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +195 -0
  637. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +64 -0
  638. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +251 -0
  639. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +880 -0
  640. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/cbcutil/cbc.go +217 -0
  641. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/gcmutil/gcm.go +41 -0
  642. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/hkdfutil/hkdf.go +28 -0
  643. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/keys/keypair.go +68 -0
  644. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/log/log.go +83 -0
  645. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/util/log/zerolog.go +38 -0
  646. slidge_whatsapp/vendor/golang.org/x/crypto/LICENSE +27 -0
  647. slidge_whatsapp/vendor/golang.org/x/crypto/PATENTS +22 -0
  648. slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +90 -0
  649. slidge_whatsapp/vendor/golang.org/x/crypto/hkdf/hkdf.go +95 -0
  650. slidge_whatsapp/vendor/golang.org/x/crypto/pbkdf2/pbkdf2.go +77 -0
  651. slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
  652. slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
  653. slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
  654. slidge_whatsapp/vendor/golang.org/x/image/LICENSE +27 -0
  655. slidge_whatsapp/vendor/golang.org/x/image/PATENTS +22 -0
  656. slidge_whatsapp/vendor/golang.org/x/image/draw/draw.go +67 -0
  657. slidge_whatsapp/vendor/golang.org/x/image/draw/impl.go +8426 -0
  658. slidge_whatsapp/vendor/golang.org/x/image/draw/scale.go +525 -0
  659. slidge_whatsapp/vendor/golang.org/x/image/math/f64/f64.go +37 -0
  660. slidge_whatsapp/vendor/golang.org/x/image/riff/riff.go +193 -0
  661. slidge_whatsapp/vendor/golang.org/x/image/vp8/decode.go +403 -0
  662. slidge_whatsapp/vendor/golang.org/x/image/vp8/filter.go +273 -0
  663. slidge_whatsapp/vendor/golang.org/x/image/vp8/idct.go +98 -0
  664. slidge_whatsapp/vendor/golang.org/x/image/vp8/partition.go +129 -0
  665. slidge_whatsapp/vendor/golang.org/x/image/vp8/pred.go +201 -0
  666. slidge_whatsapp/vendor/golang.org/x/image/vp8/predfunc.go +553 -0
  667. slidge_whatsapp/vendor/golang.org/x/image/vp8/quant.go +98 -0
  668. slidge_whatsapp/vendor/golang.org/x/image/vp8/reconstruct.go +442 -0
  669. slidge_whatsapp/vendor/golang.org/x/image/vp8/token.go +381 -0
  670. slidge_whatsapp/vendor/golang.org/x/image/vp8l/decode.go +603 -0
  671. slidge_whatsapp/vendor/golang.org/x/image/vp8l/huffman.go +245 -0
  672. slidge_whatsapp/vendor/golang.org/x/image/vp8l/transform.go +299 -0
  673. slidge_whatsapp/vendor/golang.org/x/image/webp/decode.go +276 -0
  674. slidge_whatsapp/vendor/golang.org/x/image/webp/doc.go +9 -0
  675. slidge_whatsapp/vendor/golang.org/x/net/LICENSE +27 -0
  676. slidge_whatsapp/vendor/golang.org/x/net/PATENTS +22 -0
  677. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
  678. slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
  679. slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
  680. slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
  681. slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
  682. slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
  683. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
  684. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
  685. slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
  686. slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
  687. slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
  688. slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
  689. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
  690. slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
  691. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
  692. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
  693. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
  694. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
  695. slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
  696. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
  697. slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
  698. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
  699. slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
  700. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
  701. slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
  702. slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
  703. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
  704. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
  705. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
  706. slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
  707. slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
  708. slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
  709. slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
  710. slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
  711. slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
  712. slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
  713. slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
  714. slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
  715. slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
  716. slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
  717. slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
  718. slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
  719. slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
  720. slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
  721. slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
  722. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
  723. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
  724. slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
  725. slidge_whatsapp/vendor/golang.org/x/net/internal/socks/client.go +168 -0
  726. slidge_whatsapp/vendor/golang.org/x/net/internal/socks/socks.go +317 -0
  727. slidge_whatsapp/vendor/golang.org/x/net/proxy/dial.go +54 -0
  728. slidge_whatsapp/vendor/golang.org/x/net/proxy/direct.go +31 -0
  729. slidge_whatsapp/vendor/golang.org/x/net/proxy/per_host.go +153 -0
  730. slidge_whatsapp/vendor/golang.org/x/net/proxy/proxy.go +149 -0
  731. slidge_whatsapp/vendor/golang.org/x/net/proxy/socks5.go +42 -0
  732. slidge_whatsapp/vendor/golang.org/x/sys/LICENSE +27 -0
  733. slidge_whatsapp/vendor/golang.org/x/sys/PATENTS +22 -0
  734. slidge_whatsapp/vendor/golang.org/x/sys/unix/.gitignore +2 -0
  735. slidge_whatsapp/vendor/golang.org/x/sys/unix/README.md +184 -0
  736. slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +86 -0
  737. slidge_whatsapp/vendor/golang.org/x/sys/unix/aliases.go +13 -0
  738. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_aix_ppc64.s +17 -0
  739. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_386.s +27 -0
  740. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_amd64.s +27 -0
  741. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_arm.s +27 -0
  742. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_arm64.s +27 -0
  743. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s +29 -0
  744. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s +27 -0
  745. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_386.s +65 -0
  746. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_amd64.s +57 -0
  747. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_arm.s +56 -0
  748. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_arm64.s +50 -0
  749. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_loong64.s +51 -0
  750. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_mips64x.s +54 -0
  751. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_mipsx.s +52 -0
  752. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s +42 -0
  753. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_riscv64.s +47 -0
  754. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_linux_s390x.s +54 -0
  755. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s +29 -0
  756. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_solaris_amd64.s +17 -0
  757. slidge_whatsapp/vendor/golang.org/x/sys/unix/asm_zos_s390x.s +382 -0
  758. slidge_whatsapp/vendor/golang.org/x/sys/unix/auxv.go +36 -0
  759. slidge_whatsapp/vendor/golang.org/x/sys/unix/auxv_unsupported.go +13 -0
  760. slidge_whatsapp/vendor/golang.org/x/sys/unix/bluetooth_linux.go +36 -0
  761. slidge_whatsapp/vendor/golang.org/x/sys/unix/bpxsvc_zos.go +657 -0
  762. slidge_whatsapp/vendor/golang.org/x/sys/unix/bpxsvc_zos.s +192 -0
  763. slidge_whatsapp/vendor/golang.org/x/sys/unix/cap_freebsd.go +195 -0
  764. slidge_whatsapp/vendor/golang.org/x/sys/unix/constants.go +13 -0
  765. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_aix_ppc.go +26 -0
  766. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_aix_ppc64.go +28 -0
  767. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_darwin.go +24 -0
  768. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_dragonfly.go +30 -0
  769. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_freebsd.go +30 -0
  770. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_linux.go +42 -0
  771. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_netbsd.go +29 -0
  772. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_openbsd.go +29 -0
  773. slidge_whatsapp/vendor/golang.org/x/sys/unix/dev_zos.go +28 -0
  774. slidge_whatsapp/vendor/golang.org/x/sys/unix/dirent.go +102 -0
  775. slidge_whatsapp/vendor/golang.org/x/sys/unix/endian_big.go +9 -0
  776. slidge_whatsapp/vendor/golang.org/x/sys/unix/endian_little.go +9 -0
  777. slidge_whatsapp/vendor/golang.org/x/sys/unix/env_unix.go +31 -0
  778. slidge_whatsapp/vendor/golang.org/x/sys/unix/fcntl.go +36 -0
  779. slidge_whatsapp/vendor/golang.org/x/sys/unix/fcntl_darwin.go +24 -0
  780. slidge_whatsapp/vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go +13 -0
  781. slidge_whatsapp/vendor/golang.org/x/sys/unix/fdset.go +29 -0
  782. slidge_whatsapp/vendor/golang.org/x/sys/unix/gccgo.go +59 -0
  783. slidge_whatsapp/vendor/golang.org/x/sys/unix/gccgo_c.c +44 -0
  784. slidge_whatsapp/vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go +20 -0
  785. slidge_whatsapp/vendor/golang.org/x/sys/unix/ifreq_linux.go +141 -0
  786. slidge_whatsapp/vendor/golang.org/x/sys/unix/ioctl_linux.go +334 -0
  787. slidge_whatsapp/vendor/golang.org/x/sys/unix/ioctl_signed.go +69 -0
  788. slidge_whatsapp/vendor/golang.org/x/sys/unix/ioctl_unsigned.go +69 -0
  789. slidge_whatsapp/vendor/golang.org/x/sys/unix/ioctl_zos.go +71 -0
  790. slidge_whatsapp/vendor/golang.org/x/sys/unix/mkall.sh +249 -0
  791. slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +805 -0
  792. slidge_whatsapp/vendor/golang.org/x/sys/unix/mmap_nomremap.go +13 -0
  793. slidge_whatsapp/vendor/golang.org/x/sys/unix/mremap.go +57 -0
  794. slidge_whatsapp/vendor/golang.org/x/sys/unix/pagesize_unix.go +15 -0
  795. slidge_whatsapp/vendor/golang.org/x/sys/unix/pledge_openbsd.go +111 -0
  796. slidge_whatsapp/vendor/golang.org/x/sys/unix/ptrace_darwin.go +11 -0
  797. slidge_whatsapp/vendor/golang.org/x/sys/unix/ptrace_ios.go +11 -0
  798. slidge_whatsapp/vendor/golang.org/x/sys/unix/race.go +30 -0
  799. slidge_whatsapp/vendor/golang.org/x/sys/unix/race0.go +25 -0
  800. slidge_whatsapp/vendor/golang.org/x/sys/unix/readdirent_getdents.go +12 -0
  801. slidge_whatsapp/vendor/golang.org/x/sys/unix/readdirent_getdirentries.go +19 -0
  802. slidge_whatsapp/vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go +16 -0
  803. slidge_whatsapp/vendor/golang.org/x/sys/unix/sockcmsg_linux.go +85 -0
  804. slidge_whatsapp/vendor/golang.org/x/sys/unix/sockcmsg_unix.go +106 -0
  805. slidge_whatsapp/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go +46 -0
  806. slidge_whatsapp/vendor/golang.org/x/sys/unix/sockcmsg_zos.go +58 -0
  807. slidge_whatsapp/vendor/golang.org/x/sys/unix/symaddr_zos_s390x.s +75 -0
  808. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall.go +86 -0
  809. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_aix.go +582 -0
  810. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_aix_ppc.go +52 -0
  811. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_aix_ppc64.go +83 -0
  812. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_bsd.go +609 -0
  813. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +854 -0
  814. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin_amd64.go +50 -0
  815. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go +50 -0
  816. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go +26 -0
  817. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_dragonfly.go +359 -0
  818. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_dragonfly_amd64.go +56 -0
  819. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd.go +455 -0
  820. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd_386.go +64 -0
  821. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd_amd64.go +64 -0
  822. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd_arm.go +60 -0
  823. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.go +60 -0
  824. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go +60 -0
  825. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_hurd.go +30 -0
  826. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_hurd_386.go +28 -0
  827. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_illumos.go +78 -0
  828. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +2647 -0
  829. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_386.go +314 -0
  830. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_alarm.go +12 -0
  831. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_amd64.go +145 -0
  832. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go +12 -0
  833. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_arm.go +216 -0
  834. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_arm64.go +186 -0
  835. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_gc.go +14 -0
  836. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go +16 -0
  837. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go +13 -0
  838. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go +30 -0
  839. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go +20 -0
  840. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_loong64.go +218 -0
  841. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_mips64x.go +188 -0
  842. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_mipsx.go +174 -0
  843. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_ppc.go +204 -0
  844. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_ppc64x.go +115 -0
  845. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_riscv64.go +191 -0
  846. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_s390x.go +296 -0
  847. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux_sparc64.go +112 -0
  848. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd.go +371 -0
  849. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd_386.go +37 -0
  850. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go +37 -0
  851. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go +37 -0
  852. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go +37 -0
  853. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd.go +342 -0
  854. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_386.go +41 -0
  855. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go +41 -0
  856. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go +41 -0
  857. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go +41 -0
  858. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go +26 -0
  859. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go +39 -0
  860. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go +41 -0
  861. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go +41 -0
  862. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1191 -0
  863. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go +27 -0
  864. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_unix.go +615 -0
  865. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_unix_gc.go +14 -0
  866. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go +22 -0
  867. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +3213 -0
  868. slidge_whatsapp/vendor/golang.org/x/sys/unix/sysvshm_linux.go +20 -0
  869. slidge_whatsapp/vendor/golang.org/x/sys/unix/sysvshm_unix.go +51 -0
  870. slidge_whatsapp/vendor/golang.org/x/sys/unix/sysvshm_unix_other.go +13 -0
  871. slidge_whatsapp/vendor/golang.org/x/sys/unix/timestruct.go +76 -0
  872. slidge_whatsapp/vendor/golang.org/x/sys/unix/unveil_openbsd.go +51 -0
  873. slidge_whatsapp/vendor/golang.org/x/sys/unix/vgetrandom_linux.go +13 -0
  874. slidge_whatsapp/vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go +11 -0
  875. slidge_whatsapp/vendor/golang.org/x/sys/unix/xattr_bsd.go +280 -0
  876. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_aix_ppc.go +1384 -0
  877. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_aix_ppc64.go +1385 -0
  878. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_darwin_amd64.go +1922 -0
  879. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_darwin_arm64.go +1922 -0
  880. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_dragonfly_amd64.go +1737 -0
  881. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_freebsd_386.go +2042 -0
  882. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_freebsd_amd64.go +2039 -0
  883. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm.go +2033 -0
  884. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_freebsd_arm64.go +2033 -0
  885. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go +2147 -0
  886. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +3752 -0
  887. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +873 -0
  888. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +873 -0
  889. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +878 -0
  890. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +875 -0
  891. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +865 -0
  892. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +879 -0
  893. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +879 -0
  894. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +879 -0
  895. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +879 -0
  896. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +931 -0
  897. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +935 -0
  898. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +935 -0
  899. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +862 -0
  900. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +934 -0
  901. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +977 -0
  902. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_netbsd_386.go +1779 -0
  903. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_netbsd_amd64.go +1769 -0
  904. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm.go +1758 -0
  905. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_netbsd_arm64.go +1769 -0
  906. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_386.go +1905 -0
  907. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_amd64.go +1905 -0
  908. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm.go +1905 -0
  909. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_arm64.go +1905 -0
  910. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_mips64.go +1905 -0
  911. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_ppc64.go +1904 -0
  912. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_openbsd_riscv64.go +1903 -0
  913. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_solaris_amd64.go +1556 -0
  914. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_zos_s390x.go +990 -0
  915. slidge_whatsapp/vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go +40 -0
  916. slidge_whatsapp/vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go +17 -0
  917. slidge_whatsapp/vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go +49 -0
  918. slidge_whatsapp/vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go +49 -0
  919. slidge_whatsapp/vendor/golang.org/x/sys/unix/zptrace_x86_linux.go +79 -0
  920. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsymaddr_zos_s390x.s +364 -0
  921. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc.go +1461 -0
  922. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64.go +1420 -0
  923. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gc.go +1188 -0
  924. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_aix_ppc64_gccgo.go +1069 -0
  925. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +2728 -0
  926. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +799 -0
  927. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +2728 -0
  928. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +799 -0
  929. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_dragonfly_amd64.go +1666 -0
  930. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_freebsd_386.go +1886 -0
  931. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_freebsd_amd64.go +1886 -0
  932. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm.go +1886 -0
  933. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_freebsd_arm64.go +1886 -0
  934. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go +1886 -0
  935. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_illumos_amd64.go +101 -0
  936. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux.go +2240 -0
  937. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_386.go +486 -0
  938. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_amd64.go +653 -0
  939. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_arm.go +601 -0
  940. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_arm64.go +552 -0
  941. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_loong64.go +486 -0
  942. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_mips.go +653 -0
  943. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64.go +647 -0
  944. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_mips64le.go +636 -0
  945. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_mipsle.go +653 -0
  946. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc.go +658 -0
  947. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64.go +704 -0
  948. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_ppc64le.go +704 -0
  949. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_riscv64.go +548 -0
  950. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_s390x.go +495 -0
  951. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_linux_sparc64.go +648 -0
  952. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_netbsd_386.go +1848 -0
  953. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_netbsd_amd64.go +1848 -0
  954. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm.go +1848 -0
  955. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_netbsd_arm64.go +1848 -0
  956. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +2323 -0
  957. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +699 -0
  958. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +2323 -0
  959. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +699 -0
  960. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +2323 -0
  961. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +699 -0
  962. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +2323 -0
  963. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +699 -0
  964. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +2323 -0
  965. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +699 -0
  966. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +2323 -0
  967. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +838 -0
  968. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +2323 -0
  969. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +699 -0
  970. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +2217 -0
  971. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_zos_s390x.go +3458 -0
  972. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_386.go +280 -0
  973. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_amd64.go +280 -0
  974. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm.go +280 -0
  975. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_arm64.go +280 -0
  976. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_mips64.go +280 -0
  977. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_ppc64.go +280 -0
  978. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysctl_openbsd_riscv64.go +281 -0
  979. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_darwin_amd64.go +439 -0
  980. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_darwin_arm64.go +437 -0
  981. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_dragonfly_amd64.go +316 -0
  982. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_freebsd_386.go +393 -0
  983. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_freebsd_amd64.go +393 -0
  984. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm.go +393 -0
  985. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_freebsd_arm64.go +393 -0
  986. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go +393 -0
  987. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +465 -0
  988. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +388 -0
  989. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +429 -0
  990. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +332 -0
  991. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +328 -0
  992. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +449 -0
  993. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +379 -0
  994. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +379 -0
  995. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +449 -0
  996. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +456 -0
  997. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +428 -0
  998. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +428 -0
  999. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +333 -0
  1000. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +394 -0
  1001. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +407 -0
  1002. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_netbsd_386.go +274 -0
  1003. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_netbsd_amd64.go +274 -0
  1004. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm.go +274 -0
  1005. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_netbsd_arm64.go +274 -0
  1006. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_386.go +219 -0
  1007. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_amd64.go +219 -0
  1008. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm.go +219 -0
  1009. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_arm64.go +218 -0
  1010. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_mips64.go +221 -0
  1011. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_ppc64.go +217 -0
  1012. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_openbsd_riscv64.go +218 -0
  1013. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_zos_s390x.go +2852 -0
  1014. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_aix_ppc.go +353 -0
  1015. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_aix_ppc64.go +357 -0
  1016. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_darwin_amd64.go +878 -0
  1017. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_darwin_arm64.go +878 -0
  1018. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_dragonfly_amd64.go +473 -0
  1019. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_freebsd_386.go +651 -0
  1020. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_freebsd_amd64.go +656 -0
  1021. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm.go +642 -0
  1022. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_freebsd_arm64.go +636 -0
  1023. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go +638 -0
  1024. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +6178 -0
  1025. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +689 -0
  1026. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +703 -0
  1027. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +683 -0
  1028. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +682 -0
  1029. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +683 -0
  1030. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +688 -0
  1031. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +685 -0
  1032. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +685 -0
  1033. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +688 -0
  1034. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +696 -0
  1035. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +691 -0
  1036. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +691 -0
  1037. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +770 -0
  1038. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +705 -0
  1039. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +686 -0
  1040. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_netbsd_386.go +585 -0
  1041. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_netbsd_amd64.go +593 -0
  1042. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm.go +590 -0
  1043. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_netbsd_arm64.go +593 -0
  1044. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_386.go +568 -0
  1045. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_amd64.go +568 -0
  1046. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm.go +575 -0
  1047. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_arm64.go +568 -0
  1048. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_mips64.go +568 -0
  1049. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_ppc64.go +570 -0
  1050. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_openbsd_riscv64.go +570 -0
  1051. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_solaris_amd64.go +516 -0
  1052. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_zos_s390x.go +552 -0
  1053. slidge_whatsapp/vendor/golang.org/x/sys/windows/aliases.go +12 -0
  1054. slidge_whatsapp/vendor/golang.org/x/sys/windows/dll_windows.go +415 -0
  1055. slidge_whatsapp/vendor/golang.org/x/sys/windows/env_windows.go +57 -0
  1056. slidge_whatsapp/vendor/golang.org/x/sys/windows/eventlog.go +20 -0
  1057. slidge_whatsapp/vendor/golang.org/x/sys/windows/exec_windows.go +248 -0
  1058. slidge_whatsapp/vendor/golang.org/x/sys/windows/memory_windows.go +48 -0
  1059. slidge_whatsapp/vendor/golang.org/x/sys/windows/mkerrors.bash +70 -0
  1060. slidge_whatsapp/vendor/golang.org/x/sys/windows/mkknownfolderids.bash +27 -0
  1061. slidge_whatsapp/vendor/golang.org/x/sys/windows/mksyscall.go +9 -0
  1062. slidge_whatsapp/vendor/golang.org/x/sys/windows/race.go +30 -0
  1063. slidge_whatsapp/vendor/golang.org/x/sys/windows/race0.go +25 -0
  1064. slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +1497 -0
  1065. slidge_whatsapp/vendor/golang.org/x/sys/windows/service.go +257 -0
  1066. slidge_whatsapp/vendor/golang.org/x/sys/windows/setupapi_windows.go +1425 -0
  1067. slidge_whatsapp/vendor/golang.org/x/sys/windows/str.go +22 -0
  1068. slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall.go +104 -0
  1069. slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +1934 -0
  1070. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +3842 -0
  1071. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows_386.go +35 -0
  1072. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows_amd64.go +34 -0
  1073. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows_arm.go +35 -0
  1074. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows_arm64.go +34 -0
  1075. slidge_whatsapp/vendor/golang.org/x/sys/windows/zerrors_windows.go +9468 -0
  1076. slidge_whatsapp/vendor/golang.org/x/sys/windows/zknownfolderids_windows.go +149 -0
  1077. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +4695 -0
  1078. slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
  1079. slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
  1080. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
  1081. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
  1082. slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
  1083. slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
  1084. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
  1085. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
  1086. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
  1087. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
  1088. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
  1089. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
  1090. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
  1091. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
  1092. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
  1093. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
  1094. slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
  1095. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
  1096. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
  1097. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
  1098. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
  1099. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
  1100. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
  1101. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
  1102. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
  1103. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
  1104. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
  1105. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
  1106. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
  1107. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
  1108. slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
  1109. slidge_whatsapp/vendor/google.golang.org/protobuf/LICENSE +27 -0
  1110. slidge_whatsapp/vendor/google.golang.org/protobuf/PATENTS +22 -0
  1111. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +767 -0
  1112. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/prototext/doc.go +7 -0
  1113. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +380 -0
  1114. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +547 -0
  1115. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +414 -0
  1116. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/descopts/options.go +29 -0
  1117. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/detrand/rand.go +69 -0
  1118. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/defaults.go +12 -0
  1119. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
  1120. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/defval/default.go +213 -0
  1121. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/messageset/messageset.go +242 -0
  1122. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/tag/tag.go +201 -0
  1123. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/decode.go +686 -0
  1124. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/decode_number.go +211 -0
  1125. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/decode_string.go +161 -0
  1126. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/decode_token.go +373 -0
  1127. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/doc.go +29 -0
  1128. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/encoding/text/encode.go +272 -0
  1129. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/errors/errors.go +104 -0
  1130. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/build.go +157 -0
  1131. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +748 -0
  1132. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/desc_init.go +560 -0
  1133. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/desc_lazy.go +694 -0
  1134. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/desc_list.go +457 -0
  1135. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/desc_list_gen.go +367 -0
  1136. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +167 -0
  1137. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/placeholder.go +110 -0
  1138. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filetype/build.go +296 -0
  1139. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/flags/flags.go +24 -0
  1140. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_disable.go +10 -0
  1141. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/flags/proto_legacy_enable.go +10 -0
  1142. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/any_gen.go +34 -0
  1143. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +106 -0
  1144. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +1286 -0
  1145. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/doc.go +11 -0
  1146. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/duration_gen.go +34 -0
  1147. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/empty_gen.go +19 -0
  1148. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/field_mask_gen.go +31 -0
  1149. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/go_features_gen.go +70 -0
  1150. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/goname.go +20 -0
  1151. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/map_entry.go +16 -0
  1152. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/name.go +12 -0
  1153. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/source_context_gen.go +31 -0
  1154. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/struct_gen.go +121 -0
  1155. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/timestamp_gen.go +34 -0
  1156. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/type_gen.go +228 -0
  1157. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/wrappers.go +13 -0
  1158. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/wrappers_gen.go +175 -0
  1159. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/api_export.go +177 -0
  1160. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/api_export_opaque.go +128 -0
  1161. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/bitmap.go +34 -0
  1162. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/bitmap_race.go +126 -0
  1163. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/checkinit.go +174 -0
  1164. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_extension.go +228 -0
  1165. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_field.go +788 -0
  1166. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_field_opaque.go +264 -0
  1167. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +5724 -0
  1168. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_map.go +399 -0
  1169. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message.go +230 -0
  1170. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +153 -0
  1171. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_messageset.go +145 -0
  1172. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_tables.go +557 -0
  1173. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_unsafe.go +15 -0
  1174. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/convert.go +495 -0
  1175. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/convert_list.go +141 -0
  1176. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/convert_map.go +121 -0
  1177. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/decode.go +333 -0
  1178. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/encode.go +315 -0
  1179. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/enum.go +21 -0
  1180. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/equal.go +224 -0
  1181. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/extension.go +156 -0
  1182. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/lazy.go +433 -0
  1183. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/legacy_enum.go +219 -0
  1184. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/legacy_export.go +92 -0
  1185. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/legacy_extension.go +177 -0
  1186. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/legacy_file.go +81 -0
  1187. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +569 -0
  1188. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/merge.go +203 -0
  1189. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/merge_gen.go +209 -0
  1190. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message.go +283 -0
  1191. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +627 -0
  1192. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque_gen.go +132 -0
  1193. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_reflect.go +462 -0
  1194. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field.go +423 -0
  1195. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_reflect_field_gen.go +273 -0
  1196. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_reflect_gen.go +271 -0
  1197. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +220 -0
  1198. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe_opaque.go +42 -0
  1199. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +142 -0
  1200. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/validate.go +570 -0
  1201. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/order/order.go +89 -0
  1202. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/order/range.go +115 -0
  1203. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/pragma/pragma.go +29 -0
  1204. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/protolazy/bufferreader.go +364 -0
  1205. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/protolazy/lazy.go +359 -0
  1206. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/protolazy/pointer_unsafe.go +17 -0
  1207. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/set/ints.go +58 -0
  1208. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings.go +196 -0
  1209. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +71 -0
  1210. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +79 -0
  1211. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/checkinit.go +71 -0
  1212. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/decode.go +307 -0
  1213. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/decode_gen.go +603 -0
  1214. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/doc.go +86 -0
  1215. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/encode.go +355 -0
  1216. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/encode_gen.go +97 -0
  1217. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/equal.go +66 -0
  1218. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/extension.go +166 -0
  1219. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +145 -0
  1220. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/messageset.go +98 -0
  1221. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/proto.go +45 -0
  1222. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/proto_methods.go +20 -0
  1223. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/proto_reflect.go +20 -0
  1224. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/reset.go +43 -0
  1225. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/size.go +111 -0
  1226. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/size_gen.go +55 -0
  1227. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/wrapperopaque.go +80 -0
  1228. slidge_whatsapp/vendor/google.golang.org/protobuf/proto/wrappers.go +29 -0
  1229. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/methods.go +88 -0
  1230. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +513 -0
  1231. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source.go +129 -0
  1232. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +575 -0
  1233. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +666 -0
  1234. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +285 -0
  1235. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go +168 -0
  1236. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +438 -0
  1237. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +84 -0
  1238. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +882 -0
  1239. slidge_whatsapp/vendor/google.golang.org/protobuf/runtime/protoiface/legacy.go +15 -0
  1240. slidge_whatsapp/vendor/google.golang.org/protobuf/runtime/protoiface/methods.go +202 -0
  1241. slidge_whatsapp/vendor/google.golang.org/protobuf/runtime/protoimpl/impl.go +48 -0
  1242. slidge_whatsapp/vendor/google.golang.org/protobuf/runtime/protoimpl/version.go +60 -0
  1243. slidge_whatsapp/vendor/modules.txt +198 -0
  1244. slidge_whatsapp-0.2.6.dist-info/METADATA +63 -0
  1245. slidge_whatsapp-0.2.6.dist-info/RECORD +1253 -0
  1246. {slidge_whatsapp-0.2.2.dist-info → slidge_whatsapp-0.2.6.dist-info}/WHEEL +1 -1
  1247. slidge_whatsapp-0.2.2.dist-info/METADATA +0 -744
  1248. slidge_whatsapp-0.2.2.dist-info/RECORD +0 -31
  1249. {slidge_whatsapp-0.2.2.dist-info → slidge_whatsapp-0.2.6.dist-info}/LICENSE +0 -0
  1250. {slidge_whatsapp-0.2.2.dist-info → slidge_whatsapp-0.2.6.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,2315 @@
1
+ // Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
2
+ // Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.
3
+ //
4
+ // Use of this source code is governed by an MIT-style
5
+ // license that can be found in the LICENSE file.
6
+
7
+ //go:build cgo
8
+ // +build cgo
9
+
10
+ package sqlite3
11
+
12
+ /*
13
+ #cgo CFLAGS: -std=gnu99
14
+ #cgo CFLAGS: -DSQLITE_ENABLE_RTREE
15
+ #cgo CFLAGS: -DSQLITE_THREADSAFE=1
16
+ #cgo CFLAGS: -DHAVE_USLEEP=1
17
+ #cgo CFLAGS: -DSQLITE_ENABLE_FTS3
18
+ #cgo CFLAGS: -DSQLITE_ENABLE_FTS3_PARENTHESIS
19
+ #cgo CFLAGS: -DSQLITE_TRACE_SIZE_LIMIT=15
20
+ #cgo CFLAGS: -DSQLITE_OMIT_DEPRECATED
21
+ #cgo CFLAGS: -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1
22
+ #cgo CFLAGS: -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT
23
+ #cgo CFLAGS: -Wno-deprecated-declarations
24
+ #cgo openbsd CFLAGS: -I/usr/local/include
25
+ #cgo openbsd LDFLAGS: -L/usr/local/lib
26
+ #ifndef USE_LIBSQLITE3
27
+ #include "sqlite3-binding.h"
28
+ #else
29
+ #include <sqlite3.h>
30
+ #endif
31
+ #include <stdlib.h>
32
+ #include <string.h>
33
+
34
+ #ifdef __CYGWIN__
35
+ # include <errno.h>
36
+ #endif
37
+
38
+ #ifndef SQLITE_OPEN_READWRITE
39
+ # define SQLITE_OPEN_READWRITE 0
40
+ #endif
41
+
42
+ #ifndef SQLITE_OPEN_FULLMUTEX
43
+ # define SQLITE_OPEN_FULLMUTEX 0
44
+ #endif
45
+
46
+ #ifndef SQLITE_DETERMINISTIC
47
+ # define SQLITE_DETERMINISTIC 0
48
+ #endif
49
+
50
+ #if defined(HAVE_PREAD64) && defined(HAVE_PWRITE64)
51
+ # undef USE_PREAD
52
+ # undef USE_PWRITE
53
+ # define USE_PREAD64 1
54
+ # define USE_PWRITE64 1
55
+ #elif defined(HAVE_PREAD) && defined(HAVE_PWRITE)
56
+ # undef USE_PREAD
57
+ # undef USE_PWRITE
58
+ # define USE_PREAD64 1
59
+ # define USE_PWRITE64 1
60
+ #endif
61
+
62
+ static int
63
+ _sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) {
64
+ #ifdef SQLITE_OPEN_URI
65
+ return sqlite3_open_v2(filename, ppDb, flags | SQLITE_OPEN_URI, zVfs);
66
+ #else
67
+ return sqlite3_open_v2(filename, ppDb, flags, zVfs);
68
+ #endif
69
+ }
70
+
71
+ static int
72
+ _sqlite3_bind_text(sqlite3_stmt *stmt, int n, char *p, int np) {
73
+ return sqlite3_bind_text(stmt, n, p, np, SQLITE_TRANSIENT);
74
+ }
75
+
76
+ static int
77
+ _sqlite3_bind_blob(sqlite3_stmt *stmt, int n, void *p, int np) {
78
+ return sqlite3_bind_blob(stmt, n, p, np, SQLITE_TRANSIENT);
79
+ }
80
+
81
+ #include <stdio.h>
82
+ #include <stdint.h>
83
+
84
+ static int
85
+ _sqlite3_exec(sqlite3* db, const char* pcmd, long long* rowid, long long* changes)
86
+ {
87
+ int rv = sqlite3_exec(db, pcmd, 0, 0, 0);
88
+ *rowid = (long long) sqlite3_last_insert_rowid(db);
89
+ *changes = (long long) sqlite3_changes(db);
90
+ return rv;
91
+ }
92
+
93
+ #ifdef SQLITE_ENABLE_UNLOCK_NOTIFY
94
+ extern int _sqlite3_step_blocking(sqlite3_stmt *stmt);
95
+ extern int _sqlite3_step_row_blocking(sqlite3_stmt* stmt, long long* rowid, long long* changes);
96
+ extern int _sqlite3_prepare_v2_blocking(sqlite3 *db, const char *zSql, int nBytes, sqlite3_stmt **ppStmt, const char **pzTail);
97
+
98
+ static int
99
+ _sqlite3_step_internal(sqlite3_stmt *stmt)
100
+ {
101
+ return _sqlite3_step_blocking(stmt);
102
+ }
103
+
104
+ static int
105
+ _sqlite3_step_row_internal(sqlite3_stmt* stmt, long long* rowid, long long* changes)
106
+ {
107
+ return _sqlite3_step_row_blocking(stmt, rowid, changes);
108
+ }
109
+
110
+ static int
111
+ _sqlite3_prepare_v2_internal(sqlite3 *db, const char *zSql, int nBytes, sqlite3_stmt **ppStmt, const char **pzTail)
112
+ {
113
+ return _sqlite3_prepare_v2_blocking(db, zSql, nBytes, ppStmt, pzTail);
114
+ }
115
+
116
+ #else
117
+ static int
118
+ _sqlite3_step_internal(sqlite3_stmt *stmt)
119
+ {
120
+ return sqlite3_step(stmt);
121
+ }
122
+
123
+ static int
124
+ _sqlite3_step_row_internal(sqlite3_stmt* stmt, long long* rowid, long long* changes)
125
+ {
126
+ int rv = sqlite3_step(stmt);
127
+ sqlite3* db = sqlite3_db_handle(stmt);
128
+ *rowid = (long long) sqlite3_last_insert_rowid(db);
129
+ *changes = (long long) sqlite3_changes(db);
130
+ return rv;
131
+ }
132
+
133
+ static int
134
+ _sqlite3_prepare_v2_internal(sqlite3 *db, const char *zSql, int nBytes, sqlite3_stmt **ppStmt, const char **pzTail)
135
+ {
136
+ return sqlite3_prepare_v2(db, zSql, nBytes, ppStmt, pzTail);
137
+ }
138
+ #endif
139
+
140
+ void _sqlite3_result_text(sqlite3_context* ctx, const char* s) {
141
+ sqlite3_result_text(ctx, s, -1, &free);
142
+ }
143
+
144
+ void _sqlite3_result_blob(sqlite3_context* ctx, const void* b, int l) {
145
+ sqlite3_result_blob(ctx, b, l, SQLITE_TRANSIENT);
146
+ }
147
+
148
+
149
+ int _sqlite3_create_function(
150
+ sqlite3 *db,
151
+ const char *zFunctionName,
152
+ int nArg,
153
+ int eTextRep,
154
+ uintptr_t pApp,
155
+ void (*xFunc)(sqlite3_context*,int,sqlite3_value**),
156
+ void (*xStep)(sqlite3_context*,int,sqlite3_value**),
157
+ void (*xFinal)(sqlite3_context*)
158
+ ) {
159
+ return sqlite3_create_function(db, zFunctionName, nArg, eTextRep, (void*) pApp, xFunc, xStep, xFinal);
160
+ }
161
+
162
+ void callbackTrampoline(sqlite3_context*, int, sqlite3_value**);
163
+ void stepTrampoline(sqlite3_context*, int, sqlite3_value**);
164
+ void doneTrampoline(sqlite3_context*);
165
+
166
+ int compareTrampoline(void*, int, char*, int, char*);
167
+ int commitHookTrampoline(void*);
168
+ void rollbackHookTrampoline(void*);
169
+ void updateHookTrampoline(void*, int, char*, char*, sqlite3_int64);
170
+
171
+ int authorizerTrampoline(void*, int, char*, char*, char*, char*);
172
+
173
+ #ifdef SQLITE_LIMIT_WORKER_THREADS
174
+ # define _SQLITE_HAS_LIMIT
175
+ # define SQLITE_LIMIT_LENGTH 0
176
+ # define SQLITE_LIMIT_SQL_LENGTH 1
177
+ # define SQLITE_LIMIT_COLUMN 2
178
+ # define SQLITE_LIMIT_EXPR_DEPTH 3
179
+ # define SQLITE_LIMIT_COMPOUND_SELECT 4
180
+ # define SQLITE_LIMIT_VDBE_OP 5
181
+ # define SQLITE_LIMIT_FUNCTION_ARG 6
182
+ # define SQLITE_LIMIT_ATTACHED 7
183
+ # define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8
184
+ # define SQLITE_LIMIT_VARIABLE_NUMBER 9
185
+ # define SQLITE_LIMIT_TRIGGER_DEPTH 10
186
+ # define SQLITE_LIMIT_WORKER_THREADS 11
187
+ # else
188
+ # define SQLITE_LIMIT_WORKER_THREADS 11
189
+ #endif
190
+
191
+ static int _sqlite3_limit(sqlite3* db, int limitId, int newLimit) {
192
+ #ifndef _SQLITE_HAS_LIMIT
193
+ return -1;
194
+ #else
195
+ return sqlite3_limit(db, limitId, newLimit);
196
+ #endif
197
+ }
198
+
199
+ #if SQLITE_VERSION_NUMBER < 3012000
200
+ static int sqlite3_system_errno(sqlite3 *db) {
201
+ return 0;
202
+ }
203
+ #endif
204
+ */
205
+ import "C"
206
+ import (
207
+ "context"
208
+ "database/sql"
209
+ "database/sql/driver"
210
+ "errors"
211
+ "fmt"
212
+ "io"
213
+ "net/url"
214
+ "reflect"
215
+ "runtime"
216
+ "strconv"
217
+ "strings"
218
+ "sync"
219
+ "syscall"
220
+ "time"
221
+ "unsafe"
222
+ )
223
+
224
+ // SQLiteTimestampFormats is timestamp formats understood by both this module
225
+ // and SQLite. The first format in the slice will be used when saving time
226
+ // values into the database. When parsing a string from a timestamp or datetime
227
+ // column, the formats are tried in order.
228
+ var SQLiteTimestampFormats = []string{
229
+ // By default, store timestamps with whatever timezone they come with.
230
+ // When parsed, they will be returned with the same timezone.
231
+ "2006-01-02 15:04:05.999999999-07:00",
232
+ "2006-01-02T15:04:05.999999999-07:00",
233
+ "2006-01-02 15:04:05.999999999",
234
+ "2006-01-02T15:04:05.999999999",
235
+ "2006-01-02 15:04:05",
236
+ "2006-01-02T15:04:05",
237
+ "2006-01-02 15:04",
238
+ "2006-01-02T15:04",
239
+ "2006-01-02",
240
+ }
241
+
242
+ const (
243
+ columnDate string = "date"
244
+ columnDatetime string = "datetime"
245
+ columnTimestamp string = "timestamp"
246
+ )
247
+
248
+ // This variable can be replaced with -ldflags like below:
249
+ // go build -ldflags="-X 'github.com/mattn/go-sqlite3.driverName=my-sqlite3'"
250
+ var driverName = "sqlite3"
251
+
252
+ func init() {
253
+ if driverName != "" {
254
+ sql.Register(driverName, &SQLiteDriver{})
255
+ }
256
+ }
257
+
258
+ // Version returns SQLite library version information.
259
+ func Version() (libVersion string, libVersionNumber int, sourceID string) {
260
+ libVersion = C.GoString(C.sqlite3_libversion())
261
+ libVersionNumber = int(C.sqlite3_libversion_number())
262
+ sourceID = C.GoString(C.sqlite3_sourceid())
263
+ return libVersion, libVersionNumber, sourceID
264
+ }
265
+
266
+ const (
267
+ // used by authorizer and pre_update_hook
268
+ SQLITE_DELETE = C.SQLITE_DELETE
269
+ SQLITE_INSERT = C.SQLITE_INSERT
270
+ SQLITE_UPDATE = C.SQLITE_UPDATE
271
+
272
+ // used by authorzier - as return value
273
+ SQLITE_OK = C.SQLITE_OK
274
+ SQLITE_IGNORE = C.SQLITE_IGNORE
275
+ SQLITE_DENY = C.SQLITE_DENY
276
+
277
+ // different actions query tries to do - passed as argument to authorizer
278
+ SQLITE_CREATE_INDEX = C.SQLITE_CREATE_INDEX
279
+ SQLITE_CREATE_TABLE = C.SQLITE_CREATE_TABLE
280
+ SQLITE_CREATE_TEMP_INDEX = C.SQLITE_CREATE_TEMP_INDEX
281
+ SQLITE_CREATE_TEMP_TABLE = C.SQLITE_CREATE_TEMP_TABLE
282
+ SQLITE_CREATE_TEMP_TRIGGER = C.SQLITE_CREATE_TEMP_TRIGGER
283
+ SQLITE_CREATE_TEMP_VIEW = C.SQLITE_CREATE_TEMP_VIEW
284
+ SQLITE_CREATE_TRIGGER = C.SQLITE_CREATE_TRIGGER
285
+ SQLITE_CREATE_VIEW = C.SQLITE_CREATE_VIEW
286
+ SQLITE_CREATE_VTABLE = C.SQLITE_CREATE_VTABLE
287
+ SQLITE_DROP_INDEX = C.SQLITE_DROP_INDEX
288
+ SQLITE_DROP_TABLE = C.SQLITE_DROP_TABLE
289
+ SQLITE_DROP_TEMP_INDEX = C.SQLITE_DROP_TEMP_INDEX
290
+ SQLITE_DROP_TEMP_TABLE = C.SQLITE_DROP_TEMP_TABLE
291
+ SQLITE_DROP_TEMP_TRIGGER = C.SQLITE_DROP_TEMP_TRIGGER
292
+ SQLITE_DROP_TEMP_VIEW = C.SQLITE_DROP_TEMP_VIEW
293
+ SQLITE_DROP_TRIGGER = C.SQLITE_DROP_TRIGGER
294
+ SQLITE_DROP_VIEW = C.SQLITE_DROP_VIEW
295
+ SQLITE_DROP_VTABLE = C.SQLITE_DROP_VTABLE
296
+ SQLITE_PRAGMA = C.SQLITE_PRAGMA
297
+ SQLITE_READ = C.SQLITE_READ
298
+ SQLITE_SELECT = C.SQLITE_SELECT
299
+ SQLITE_TRANSACTION = C.SQLITE_TRANSACTION
300
+ SQLITE_ATTACH = C.SQLITE_ATTACH
301
+ SQLITE_DETACH = C.SQLITE_DETACH
302
+ SQLITE_ALTER_TABLE = C.SQLITE_ALTER_TABLE
303
+ SQLITE_REINDEX = C.SQLITE_REINDEX
304
+ SQLITE_ANALYZE = C.SQLITE_ANALYZE
305
+ SQLITE_FUNCTION = C.SQLITE_FUNCTION
306
+ SQLITE_SAVEPOINT = C.SQLITE_SAVEPOINT
307
+ SQLITE_COPY = C.SQLITE_COPY
308
+ /*SQLITE_RECURSIVE = C.SQLITE_RECURSIVE*/
309
+ )
310
+
311
+ // Standard File Control Opcodes
312
+ // See: https://www.sqlite.org/c3ref/c_fcntl_begin_atomic_write.html
313
+ const (
314
+ SQLITE_FCNTL_LOCKSTATE = int(1)
315
+ SQLITE_FCNTL_GET_LOCKPROXYFILE = int(2)
316
+ SQLITE_FCNTL_SET_LOCKPROXYFILE = int(3)
317
+ SQLITE_FCNTL_LAST_ERRNO = int(4)
318
+ SQLITE_FCNTL_SIZE_HINT = int(5)
319
+ SQLITE_FCNTL_CHUNK_SIZE = int(6)
320
+ SQLITE_FCNTL_FILE_POINTER = int(7)
321
+ SQLITE_FCNTL_SYNC_OMITTED = int(8)
322
+ SQLITE_FCNTL_WIN32_AV_RETRY = int(9)
323
+ SQLITE_FCNTL_PERSIST_WAL = int(10)
324
+ SQLITE_FCNTL_OVERWRITE = int(11)
325
+ SQLITE_FCNTL_VFSNAME = int(12)
326
+ SQLITE_FCNTL_POWERSAFE_OVERWRITE = int(13)
327
+ SQLITE_FCNTL_PRAGMA = int(14)
328
+ SQLITE_FCNTL_BUSYHANDLER = int(15)
329
+ SQLITE_FCNTL_TEMPFILENAME = int(16)
330
+ SQLITE_FCNTL_MMAP_SIZE = int(18)
331
+ SQLITE_FCNTL_TRACE = int(19)
332
+ SQLITE_FCNTL_HAS_MOVED = int(20)
333
+ SQLITE_FCNTL_SYNC = int(21)
334
+ SQLITE_FCNTL_COMMIT_PHASETWO = int(22)
335
+ SQLITE_FCNTL_WIN32_SET_HANDLE = int(23)
336
+ SQLITE_FCNTL_WAL_BLOCK = int(24)
337
+ SQLITE_FCNTL_ZIPVFS = int(25)
338
+ SQLITE_FCNTL_RBU = int(26)
339
+ SQLITE_FCNTL_VFS_POINTER = int(27)
340
+ SQLITE_FCNTL_JOURNAL_POINTER = int(28)
341
+ SQLITE_FCNTL_WIN32_GET_HANDLE = int(29)
342
+ SQLITE_FCNTL_PDB = int(30)
343
+ SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = int(31)
344
+ SQLITE_FCNTL_COMMIT_ATOMIC_WRITE = int(32)
345
+ SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE = int(33)
346
+ SQLITE_FCNTL_LOCK_TIMEOUT = int(34)
347
+ SQLITE_FCNTL_DATA_VERSION = int(35)
348
+ SQLITE_FCNTL_SIZE_LIMIT = int(36)
349
+ SQLITE_FCNTL_CKPT_DONE = int(37)
350
+ SQLITE_FCNTL_RESERVE_BYTES = int(38)
351
+ SQLITE_FCNTL_CKPT_START = int(39)
352
+ SQLITE_FCNTL_EXTERNAL_READER = int(40)
353
+ SQLITE_FCNTL_CKSM_FILE = int(41)
354
+ )
355
+
356
+ // SQLiteDriver implements driver.Driver.
357
+ type SQLiteDriver struct {
358
+ Extensions []string
359
+ ConnectHook func(*SQLiteConn) error
360
+ }
361
+
362
+ // SQLiteConn implements driver.Conn.
363
+ type SQLiteConn struct {
364
+ mu sync.Mutex
365
+ db *C.sqlite3
366
+ loc *time.Location
367
+ txlock string
368
+ funcs []*functionInfo
369
+ aggregators []*aggInfo
370
+ }
371
+
372
+ // SQLiteTx implements driver.Tx.
373
+ type SQLiteTx struct {
374
+ c *SQLiteConn
375
+ }
376
+
377
+ // SQLiteStmt implements driver.Stmt.
378
+ type SQLiteStmt struct {
379
+ mu sync.Mutex
380
+ c *SQLiteConn
381
+ s *C.sqlite3_stmt
382
+ t string
383
+ closed bool
384
+ cls bool // True if the statement was created by SQLiteConn.Query
385
+ }
386
+
387
+ // SQLiteResult implements sql.Result.
388
+ type SQLiteResult struct {
389
+ id int64
390
+ changes int64
391
+ }
392
+
393
+ // SQLiteRows implements driver.Rows.
394
+ type SQLiteRows struct {
395
+ s *SQLiteStmt
396
+ nc int32 // Number of columns
397
+ cls bool // True if we need to close the parent statement in Close
398
+ cols []string
399
+ decltype []string
400
+ ctx context.Context // no better alternative to pass context into Next() method
401
+ closemu sync.Mutex
402
+ }
403
+
404
+ type functionInfo struct {
405
+ f reflect.Value
406
+ argConverters []callbackArgConverter
407
+ variadicConverter callbackArgConverter
408
+ retConverter callbackRetConverter
409
+ }
410
+
411
+ func (fi *functionInfo) Call(ctx *C.sqlite3_context, argv []*C.sqlite3_value) {
412
+ args, err := callbackConvertArgs(argv, fi.argConverters, fi.variadicConverter)
413
+ if err != nil {
414
+ callbackError(ctx, err)
415
+ return
416
+ }
417
+
418
+ ret := fi.f.Call(args)
419
+
420
+ if len(ret) == 2 && ret[1].Interface() != nil {
421
+ callbackError(ctx, ret[1].Interface().(error))
422
+ return
423
+ }
424
+
425
+ err = fi.retConverter(ctx, ret[0])
426
+ if err != nil {
427
+ callbackError(ctx, err)
428
+ return
429
+ }
430
+ }
431
+
432
+ type aggInfo struct {
433
+ constructor reflect.Value
434
+
435
+ // Active aggregator objects for aggregations in flight. The
436
+ // aggregators are indexed by a counter stored in the aggregation
437
+ // user data space provided by sqlite.
438
+ active map[int64]reflect.Value
439
+ next int64
440
+
441
+ stepArgConverters []callbackArgConverter
442
+ stepVariadicConverter callbackArgConverter
443
+
444
+ doneRetConverter callbackRetConverter
445
+ }
446
+
447
+ func (ai *aggInfo) agg(ctx *C.sqlite3_context) (int64, reflect.Value, error) {
448
+ aggIdx := (*int64)(C.sqlite3_aggregate_context(ctx, C.int(8)))
449
+ if *aggIdx == 0 {
450
+ *aggIdx = ai.next
451
+ ret := ai.constructor.Call(nil)
452
+ if len(ret) == 2 && ret[1].Interface() != nil {
453
+ return 0, reflect.Value{}, ret[1].Interface().(error)
454
+ }
455
+ if ret[0].IsNil() {
456
+ return 0, reflect.Value{}, errors.New("aggregator constructor returned nil state")
457
+ }
458
+ ai.next++
459
+ ai.active[*aggIdx] = ret[0]
460
+ }
461
+ return *aggIdx, ai.active[*aggIdx], nil
462
+ }
463
+
464
+ func (ai *aggInfo) Step(ctx *C.sqlite3_context, argv []*C.sqlite3_value) {
465
+ _, agg, err := ai.agg(ctx)
466
+ if err != nil {
467
+ callbackError(ctx, err)
468
+ return
469
+ }
470
+
471
+ args, err := callbackConvertArgs(argv, ai.stepArgConverters, ai.stepVariadicConverter)
472
+ if err != nil {
473
+ callbackError(ctx, err)
474
+ return
475
+ }
476
+
477
+ ret := agg.MethodByName("Step").Call(args)
478
+ if len(ret) == 1 && ret[0].Interface() != nil {
479
+ callbackError(ctx, ret[0].Interface().(error))
480
+ return
481
+ }
482
+ }
483
+
484
+ func (ai *aggInfo) Done(ctx *C.sqlite3_context) {
485
+ idx, agg, err := ai.agg(ctx)
486
+ if err != nil {
487
+ callbackError(ctx, err)
488
+ return
489
+ }
490
+ defer func() { delete(ai.active, idx) }()
491
+
492
+ ret := agg.MethodByName("Done").Call(nil)
493
+ if len(ret) == 2 && ret[1].Interface() != nil {
494
+ callbackError(ctx, ret[1].Interface().(error))
495
+ return
496
+ }
497
+
498
+ err = ai.doneRetConverter(ctx, ret[0])
499
+ if err != nil {
500
+ callbackError(ctx, err)
501
+ return
502
+ }
503
+ }
504
+
505
+ // Commit transaction.
506
+ func (tx *SQLiteTx) Commit() error {
507
+ _, err := tx.c.exec(context.Background(), "COMMIT", nil)
508
+ if err != nil {
509
+ // sqlite3 may leave the transaction open in this scenario.
510
+ // However, database/sql considers the transaction complete once we
511
+ // return from Commit() - we must clean up to honour its semantics.
512
+ // We don't know if the ROLLBACK is strictly necessary, but according
513
+ // to sqlite's docs, there is no harm in calling ROLLBACK unnecessarily.
514
+ tx.c.exec(context.Background(), "ROLLBACK", nil)
515
+ }
516
+ return err
517
+ }
518
+
519
+ // Rollback transaction.
520
+ func (tx *SQLiteTx) Rollback() error {
521
+ _, err := tx.c.exec(context.Background(), "ROLLBACK", nil)
522
+ return err
523
+ }
524
+
525
+ // RegisterCollation makes a Go function available as a collation.
526
+ //
527
+ // cmp receives two UTF-8 strings, a and b. The result should be 0 if
528
+ // a==b, -1 if a < b, and +1 if a > b.
529
+ //
530
+ // cmp must always return the same result given the same
531
+ // inputs. Additionally, it must have the following properties for all
532
+ // strings A, B and C: if A==B then B==A; if A==B and B==C then A==C;
533
+ // if A<B then B>A; if A<B and B<C then A<C.
534
+ //
535
+ // If cmp does not obey these constraints, sqlite3's behavior is
536
+ // undefined when the collation is used.
537
+ func (c *SQLiteConn) RegisterCollation(name string, cmp func(string, string) int) error {
538
+ handle := newHandle(c, cmp)
539
+ cname := C.CString(name)
540
+ defer C.free(unsafe.Pointer(cname))
541
+ rv := C.sqlite3_create_collation(c.db, cname, C.SQLITE_UTF8, handle, (*[0]byte)(unsafe.Pointer(C.compareTrampoline)))
542
+ if rv != C.SQLITE_OK {
543
+ return c.lastError()
544
+ }
545
+ return nil
546
+ }
547
+
548
+ // RegisterCommitHook sets the commit hook for a connection.
549
+ //
550
+ // If the callback returns non-zero the transaction will become a rollback.
551
+ //
552
+ // If there is an existing commit hook for this connection, it will be
553
+ // removed. If callback is nil the existing hook (if any) will be removed
554
+ // without creating a new one.
555
+ func (c *SQLiteConn) RegisterCommitHook(callback func() int) {
556
+ if callback == nil {
557
+ C.sqlite3_commit_hook(c.db, nil, nil)
558
+ } else {
559
+ C.sqlite3_commit_hook(c.db, (*[0]byte)(C.commitHookTrampoline), newHandle(c, callback))
560
+ }
561
+ }
562
+
563
+ // RegisterRollbackHook sets the rollback hook for a connection.
564
+ //
565
+ // If there is an existing rollback hook for this connection, it will be
566
+ // removed. If callback is nil the existing hook (if any) will be removed
567
+ // without creating a new one.
568
+ func (c *SQLiteConn) RegisterRollbackHook(callback func()) {
569
+ if callback == nil {
570
+ C.sqlite3_rollback_hook(c.db, nil, nil)
571
+ } else {
572
+ C.sqlite3_rollback_hook(c.db, (*[0]byte)(C.rollbackHookTrampoline), newHandle(c, callback))
573
+ }
574
+ }
575
+
576
+ // RegisterUpdateHook sets the update hook for a connection.
577
+ //
578
+ // The parameters to the callback are the operation (one of the constants
579
+ // SQLITE_INSERT, SQLITE_DELETE, or SQLITE_UPDATE), the database name, the
580
+ // table name, and the rowid.
581
+ //
582
+ // If there is an existing update hook for this connection, it will be
583
+ // removed. If callback is nil the existing hook (if any) will be removed
584
+ // without creating a new one.
585
+ func (c *SQLiteConn) RegisterUpdateHook(callback func(int, string, string, int64)) {
586
+ if callback == nil {
587
+ C.sqlite3_update_hook(c.db, nil, nil)
588
+ } else {
589
+ C.sqlite3_update_hook(c.db, (*[0]byte)(C.updateHookTrampoline), newHandle(c, callback))
590
+ }
591
+ }
592
+
593
+ // RegisterAuthorizer sets the authorizer for connection.
594
+ //
595
+ // The parameters to the callback are the operation (one of the constants
596
+ // SQLITE_INSERT, SQLITE_DELETE, or SQLITE_UPDATE), and 1 to 3 arguments,
597
+ // depending on operation. More details see:
598
+ // https://www.sqlite.org/c3ref/c_alter_table.html
599
+ func (c *SQLiteConn) RegisterAuthorizer(callback func(int, string, string, string) int) {
600
+ if callback == nil {
601
+ C.sqlite3_set_authorizer(c.db, nil, nil)
602
+ } else {
603
+ C.sqlite3_set_authorizer(c.db, (*[0]byte)(C.authorizerTrampoline), newHandle(c, callback))
604
+ }
605
+ }
606
+
607
+ // RegisterFunc makes a Go function available as a SQLite function.
608
+ //
609
+ // The Go function can have arguments of the following types: any
610
+ // numeric type except complex, bool, []byte, string and any.
611
+ // any arguments are given the direct translation of the SQLite data type:
612
+ // int64 for INTEGER, float64 for FLOAT, []byte for BLOB, string for TEXT.
613
+ //
614
+ // The function can additionally be variadic, as long as the type of
615
+ // the variadic argument is one of the above.
616
+ //
617
+ // If pure is true. SQLite will assume that the function's return
618
+ // value depends only on its inputs, and make more aggressive
619
+ // optimizations in its queries.
620
+ //
621
+ // See _example/go_custom_funcs for a detailed example.
622
+ func (c *SQLiteConn) RegisterFunc(name string, impl any, pure bool) error {
623
+ var fi functionInfo
624
+ fi.f = reflect.ValueOf(impl)
625
+ t := fi.f.Type()
626
+ if t.Kind() != reflect.Func {
627
+ return errors.New("Non-function passed to RegisterFunc")
628
+ }
629
+ if t.NumOut() != 1 && t.NumOut() != 2 {
630
+ return errors.New("SQLite functions must return 1 or 2 values")
631
+ }
632
+ if t.NumOut() == 2 && !t.Out(1).Implements(reflect.TypeOf((*error)(nil)).Elem()) {
633
+ return errors.New("Second return value of SQLite function must be error")
634
+ }
635
+
636
+ numArgs := t.NumIn()
637
+ if t.IsVariadic() {
638
+ numArgs--
639
+ }
640
+
641
+ for i := 0; i < numArgs; i++ {
642
+ conv, err := callbackArg(t.In(i))
643
+ if err != nil {
644
+ return err
645
+ }
646
+ fi.argConverters = append(fi.argConverters, conv)
647
+ }
648
+
649
+ if t.IsVariadic() {
650
+ conv, err := callbackArg(t.In(numArgs).Elem())
651
+ if err != nil {
652
+ return err
653
+ }
654
+ fi.variadicConverter = conv
655
+ // Pass -1 to sqlite so that it allows any number of
656
+ // arguments. The call helper verifies that the minimum number
657
+ // of arguments is present for variadic functions.
658
+ numArgs = -1
659
+ }
660
+
661
+ conv, err := callbackRet(t.Out(0))
662
+ if err != nil {
663
+ return err
664
+ }
665
+ fi.retConverter = conv
666
+
667
+ // fi must outlast the database connection, or we'll have dangling pointers.
668
+ c.funcs = append(c.funcs, &fi)
669
+
670
+ cname := C.CString(name)
671
+ defer C.free(unsafe.Pointer(cname))
672
+ opts := C.SQLITE_UTF8
673
+ if pure {
674
+ opts |= C.SQLITE_DETERMINISTIC
675
+ }
676
+ rv := sqlite3CreateFunction(c.db, cname, C.int(numArgs), C.int(opts), newHandle(c, &fi), C.callbackTrampoline, nil, nil)
677
+ if rv != C.SQLITE_OK {
678
+ return c.lastError()
679
+ }
680
+ return nil
681
+ }
682
+
683
+ func sqlite3CreateFunction(db *C.sqlite3, zFunctionName *C.char, nArg C.int, eTextRep C.int, pApp unsafe.Pointer, xFunc unsafe.Pointer, xStep unsafe.Pointer, xFinal unsafe.Pointer) C.int {
684
+ return C._sqlite3_create_function(db, zFunctionName, nArg, eTextRep, C.uintptr_t(uintptr(pApp)), (*[0]byte)(xFunc), (*[0]byte)(xStep), (*[0]byte)(xFinal))
685
+ }
686
+
687
+ // RegisterAggregator makes a Go type available as a SQLite aggregation function.
688
+ //
689
+ // Because aggregation is incremental, it's implemented in Go with a
690
+ // type that has 2 methods: func Step(values) accumulates one row of
691
+ // data into the accumulator, and func Done() ret finalizes and
692
+ // returns the aggregate value. "values" and "ret" may be any type
693
+ // supported by RegisterFunc.
694
+ //
695
+ // RegisterAggregator takes as implementation a constructor function
696
+ // that constructs an instance of the aggregator type each time an
697
+ // aggregation begins. The constructor must return a pointer to a
698
+ // type, or an interface that implements Step() and Done().
699
+ //
700
+ // The constructor function and the Step/Done methods may optionally
701
+ // return an error in addition to their other return values.
702
+ //
703
+ // See _example/go_custom_funcs for a detailed example.
704
+ func (c *SQLiteConn) RegisterAggregator(name string, impl any, pure bool) error {
705
+ var ai aggInfo
706
+ ai.constructor = reflect.ValueOf(impl)
707
+ t := ai.constructor.Type()
708
+ if t.Kind() != reflect.Func {
709
+ return errors.New("non-function passed to RegisterAggregator")
710
+ }
711
+ if t.NumOut() != 1 && t.NumOut() != 2 {
712
+ return errors.New("SQLite aggregator constructors must return 1 or 2 values")
713
+ }
714
+ if t.NumOut() == 2 && !t.Out(1).Implements(reflect.TypeOf((*error)(nil)).Elem()) {
715
+ return errors.New("Second return value of SQLite function must be error")
716
+ }
717
+ if t.NumIn() != 0 {
718
+ return errors.New("SQLite aggregator constructors must not have arguments")
719
+ }
720
+
721
+ agg := t.Out(0)
722
+ switch agg.Kind() {
723
+ case reflect.Ptr, reflect.Interface:
724
+ default:
725
+ return errors.New("SQlite aggregator constructor must return a pointer object")
726
+ }
727
+ stepFn, found := agg.MethodByName("Step")
728
+ if !found {
729
+ return errors.New("SQlite aggregator doesn't have a Step() function")
730
+ }
731
+ step := stepFn.Type
732
+ if step.NumOut() != 0 && step.NumOut() != 1 {
733
+ return errors.New("SQlite aggregator Step() function must return 0 or 1 values")
734
+ }
735
+ if step.NumOut() == 1 && !step.Out(0).Implements(reflect.TypeOf((*error)(nil)).Elem()) {
736
+ return errors.New("type of SQlite aggregator Step() return value must be error")
737
+ }
738
+
739
+ stepNArgs := step.NumIn()
740
+ start := 0
741
+ if agg.Kind() == reflect.Ptr {
742
+ // Skip over the method receiver
743
+ stepNArgs--
744
+ start++
745
+ }
746
+ if step.IsVariadic() {
747
+ stepNArgs--
748
+ }
749
+ for i := start; i < start+stepNArgs; i++ {
750
+ conv, err := callbackArg(step.In(i))
751
+ if err != nil {
752
+ return err
753
+ }
754
+ ai.stepArgConverters = append(ai.stepArgConverters, conv)
755
+ }
756
+ if step.IsVariadic() {
757
+ conv, err := callbackArg(step.In(start + stepNArgs).Elem())
758
+ if err != nil {
759
+ return err
760
+ }
761
+ ai.stepVariadicConverter = conv
762
+ // Pass -1 to sqlite so that it allows any number of
763
+ // arguments. The call helper verifies that the minimum number
764
+ // of arguments is present for variadic functions.
765
+ stepNArgs = -1
766
+ }
767
+
768
+ doneFn, found := agg.MethodByName("Done")
769
+ if !found {
770
+ return errors.New("SQlite aggregator doesn't have a Done() function")
771
+ }
772
+ done := doneFn.Type
773
+ doneNArgs := done.NumIn()
774
+ if agg.Kind() == reflect.Ptr {
775
+ // Skip over the method receiver
776
+ doneNArgs--
777
+ }
778
+ if doneNArgs != 0 {
779
+ return errors.New("SQlite aggregator Done() function must have no arguments")
780
+ }
781
+ if done.NumOut() != 1 && done.NumOut() != 2 {
782
+ return errors.New("SQLite aggregator Done() function must return 1 or 2 values")
783
+ }
784
+ if done.NumOut() == 2 && !done.Out(1).Implements(reflect.TypeOf((*error)(nil)).Elem()) {
785
+ return errors.New("second return value of SQLite aggregator Done() function must be error")
786
+ }
787
+
788
+ conv, err := callbackRet(done.Out(0))
789
+ if err != nil {
790
+ return err
791
+ }
792
+ ai.doneRetConverter = conv
793
+ ai.active = make(map[int64]reflect.Value)
794
+ ai.next = 1
795
+
796
+ // ai must outlast the database connection, or we'll have dangling pointers.
797
+ c.aggregators = append(c.aggregators, &ai)
798
+
799
+ cname := C.CString(name)
800
+ defer C.free(unsafe.Pointer(cname))
801
+ opts := C.SQLITE_UTF8
802
+ if pure {
803
+ opts |= C.SQLITE_DETERMINISTIC
804
+ }
805
+ rv := sqlite3CreateFunction(c.db, cname, C.int(stepNArgs), C.int(opts), newHandle(c, &ai), nil, C.stepTrampoline, C.doneTrampoline)
806
+ if rv != C.SQLITE_OK {
807
+ return c.lastError()
808
+ }
809
+ return nil
810
+ }
811
+
812
+ // AutoCommit return which currently auto commit or not.
813
+ func (c *SQLiteConn) AutoCommit() bool {
814
+ c.mu.Lock()
815
+ defer c.mu.Unlock()
816
+ return int(C.sqlite3_get_autocommit(c.db)) != 0
817
+ }
818
+
819
+ func (c *SQLiteConn) lastError() error {
820
+ return lastError(c.db)
821
+ }
822
+
823
+ // Note: may be called with db == nil
824
+ func lastError(db *C.sqlite3) error {
825
+ rv := C.sqlite3_errcode(db) // returns SQLITE_NOMEM if db == nil
826
+ if rv == C.SQLITE_OK {
827
+ return nil
828
+ }
829
+ extrv := C.sqlite3_extended_errcode(db) // returns SQLITE_NOMEM if db == nil
830
+ errStr := C.GoString(C.sqlite3_errmsg(db)) // returns "out of memory" if db == nil
831
+
832
+ // https://www.sqlite.org/c3ref/system_errno.html
833
+ // sqlite3_system_errno is only meaningful if the error code was SQLITE_CANTOPEN,
834
+ // or it was SQLITE_IOERR and the extended code was not SQLITE_IOERR_NOMEM
835
+ var systemErrno syscall.Errno
836
+ if rv == C.SQLITE_CANTOPEN || (rv == C.SQLITE_IOERR && extrv != C.SQLITE_IOERR_NOMEM) {
837
+ systemErrno = syscall.Errno(C.sqlite3_system_errno(db))
838
+ }
839
+
840
+ return Error{
841
+ Code: ErrNo(rv),
842
+ ExtendedCode: ErrNoExtended(extrv),
843
+ SystemErrno: systemErrno,
844
+ err: errStr,
845
+ }
846
+ }
847
+
848
+ // Exec implements Execer.
849
+ func (c *SQLiteConn) Exec(query string, args []driver.Value) (driver.Result, error) {
850
+ list := make([]driver.NamedValue, len(args))
851
+ for i, v := range args {
852
+ list[i] = driver.NamedValue{
853
+ Ordinal: i + 1,
854
+ Value: v,
855
+ }
856
+ }
857
+ return c.exec(context.Background(), query, list)
858
+ }
859
+
860
+ func (c *SQLiteConn) exec(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error) {
861
+ start := 0
862
+ for {
863
+ s, err := c.prepare(ctx, query)
864
+ if err != nil {
865
+ return nil, err
866
+ }
867
+ var res driver.Result
868
+ if s.(*SQLiteStmt).s != nil {
869
+ stmtArgs := make([]driver.NamedValue, 0, len(args))
870
+ na := s.NumInput()
871
+ if len(args)-start < na {
872
+ s.Close()
873
+ return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args))
874
+ }
875
+ // consume the number of arguments used in the current
876
+ // statement and append all named arguments not
877
+ // contained therein
878
+ if len(args[start:start+na]) > 0 {
879
+ stmtArgs = append(stmtArgs, args[start:start+na]...)
880
+ for i := range args {
881
+ if (i < start || i >= na) && args[i].Name != "" {
882
+ stmtArgs = append(stmtArgs, args[i])
883
+ }
884
+ }
885
+ for i := range stmtArgs {
886
+ stmtArgs[i].Ordinal = i + 1
887
+ }
888
+ }
889
+ res, err = s.(*SQLiteStmt).exec(ctx, stmtArgs)
890
+ if err != nil && err != driver.ErrSkip {
891
+ s.Close()
892
+ return nil, err
893
+ }
894
+ start += na
895
+ }
896
+ tail := s.(*SQLiteStmt).t
897
+ s.Close()
898
+ if tail == "" {
899
+ if res == nil {
900
+ // https://github.com/mattn/go-sqlite3/issues/963
901
+ res = &SQLiteResult{0, 0}
902
+ }
903
+ return res, nil
904
+ }
905
+ query = tail
906
+ }
907
+ }
908
+
909
+ // Query implements Queryer.
910
+ func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, error) {
911
+ list := make([]driver.NamedValue, len(args))
912
+ for i, v := range args {
913
+ list[i] = driver.NamedValue{
914
+ Ordinal: i + 1,
915
+ Value: v,
916
+ }
917
+ }
918
+ return c.query(context.Background(), query, list)
919
+ }
920
+
921
+ func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error) {
922
+ start := 0
923
+ for {
924
+ stmtArgs := make([]driver.NamedValue, 0, len(args))
925
+ s, err := c.prepare(ctx, query)
926
+ if err != nil {
927
+ return nil, err
928
+ }
929
+ s.(*SQLiteStmt).cls = true
930
+ na := s.NumInput()
931
+ if len(args)-start < na {
932
+ s.Close()
933
+ return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start)
934
+ }
935
+ // consume the number of arguments used in the current
936
+ // statement and append all named arguments not contained
937
+ // therein
938
+ stmtArgs = append(stmtArgs, args[start:start+na]...)
939
+ for i := range args {
940
+ if (i < start || i >= na) && args[i].Name != "" {
941
+ stmtArgs = append(stmtArgs, args[i])
942
+ }
943
+ }
944
+ for i := range stmtArgs {
945
+ stmtArgs[i].Ordinal = i + 1
946
+ }
947
+ rows, err := s.(*SQLiteStmt).query(ctx, stmtArgs)
948
+ if err != nil && err != driver.ErrSkip {
949
+ s.Close()
950
+ return rows, err
951
+ }
952
+ start += na
953
+ tail := s.(*SQLiteStmt).t
954
+ if tail == "" {
955
+ return rows, nil
956
+ }
957
+ rows.Close()
958
+ s.Close()
959
+ query = tail
960
+ }
961
+ }
962
+
963
+ // Begin transaction.
964
+ func (c *SQLiteConn) Begin() (driver.Tx, error) {
965
+ return c.begin(context.Background())
966
+ }
967
+
968
+ func (c *SQLiteConn) begin(ctx context.Context) (driver.Tx, error) {
969
+ if _, err := c.exec(ctx, c.txlock, nil); err != nil {
970
+ return nil, err
971
+ }
972
+ return &SQLiteTx{c}, nil
973
+ }
974
+
975
+ // Open database and return a new connection.
976
+ //
977
+ // A pragma can take either zero or one argument.
978
+ // The argument is may be either in parentheses or it may be separated from
979
+ // the pragma name by an equal sign. The two syntaxes yield identical results.
980
+ // In many pragmas, the argument is a boolean. The boolean can be one of:
981
+ //
982
+ // 1 yes true on
983
+ // 0 no false off
984
+ //
985
+ // You can specify a DSN string using a URI as the filename.
986
+ //
987
+ // test.db
988
+ // file:test.db?cache=shared&mode=memory
989
+ // :memory:
990
+ // file::memory:
991
+ //
992
+ // mode
993
+ // Access mode of the database.
994
+ // https://www.sqlite.org/c3ref/open.html
995
+ // Values:
996
+ // - ro
997
+ // - rw
998
+ // - rwc
999
+ // - memory
1000
+ //
1001
+ // cache
1002
+ // SQLite Shared-Cache Mode
1003
+ // https://www.sqlite.org/sharedcache.html
1004
+ // Values:
1005
+ // - shared
1006
+ // - private
1007
+ //
1008
+ // immutable=Boolean
1009
+ // The immutable parameter is a boolean query parameter that indicates
1010
+ // that the database file is stored on read-only media. When immutable is set,
1011
+ // SQLite assumes that the database file cannot be changed,
1012
+ // even by a process with higher privilege,
1013
+ // and so the database is opened read-only and all locking and change detection is disabled.
1014
+ // Caution: Setting the immutable property on a database file that
1015
+ // does in fact change can result in incorrect query results and/or SQLITE_CORRUPT errors.
1016
+ //
1017
+ // go-sqlite3 adds the following query parameters to those used by SQLite:
1018
+ //
1019
+ // _loc=XXX
1020
+ // Specify location of time format. It's possible to specify "auto".
1021
+ //
1022
+ // _mutex=XXX
1023
+ // Specify mutex mode. XXX can be "no", "full".
1024
+ //
1025
+ // _txlock=XXX
1026
+ // Specify locking behavior for transactions. XXX can be "immediate",
1027
+ // "deferred", "exclusive".
1028
+ //
1029
+ // _auto_vacuum=X | _vacuum=X
1030
+ // 0 | none - Auto Vacuum disabled
1031
+ // 1 | full - Auto Vacuum FULL
1032
+ // 2 | incremental - Auto Vacuum Incremental
1033
+ //
1034
+ // _busy_timeout=XXX"| _timeout=XXX
1035
+ // Specify value for sqlite3_busy_timeout.
1036
+ //
1037
+ // _case_sensitive_like=Boolean | _cslike=Boolean
1038
+ // https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
1039
+ // Default or disabled the LIKE operation is case-insensitive.
1040
+ // When enabling this options behaviour of LIKE will become case-sensitive.
1041
+ //
1042
+ // _defer_foreign_keys=Boolean | _defer_fk=Boolean
1043
+ // Defer Foreign Keys until outermost transaction is committed.
1044
+ //
1045
+ // _foreign_keys=Boolean | _fk=Boolean
1046
+ // Enable or disable enforcement of foreign keys.
1047
+ //
1048
+ // _ignore_check_constraints=Boolean
1049
+ // This pragma enables or disables the enforcement of CHECK constraints.
1050
+ // The default setting is off, meaning that CHECK constraints are enforced by default.
1051
+ //
1052
+ // _journal_mode=MODE | _journal=MODE
1053
+ // Set journal mode for the databases associated with the current connection.
1054
+ // https://www.sqlite.org/pragma.html#pragma_journal_mode
1055
+ //
1056
+ // _locking_mode=X | _locking=X
1057
+ // Sets the database connection locking-mode.
1058
+ // The locking-mode is either NORMAL or EXCLUSIVE.
1059
+ // https://www.sqlite.org/pragma.html#pragma_locking_mode
1060
+ //
1061
+ // _query_only=Boolean
1062
+ // The query_only pragma prevents all changes to database files when enabled.
1063
+ //
1064
+ // _recursive_triggers=Boolean | _rt=Boolean
1065
+ // Enable or disable recursive triggers.
1066
+ //
1067
+ // _secure_delete=Boolean|FAST
1068
+ // When secure_delete is on, SQLite overwrites deleted content with zeros.
1069
+ // https://www.sqlite.org/pragma.html#pragma_secure_delete
1070
+ //
1071
+ // _synchronous=X | _sync=X
1072
+ // Change the setting of the "synchronous" flag.
1073
+ // https://www.sqlite.org/pragma.html#pragma_synchronous
1074
+ //
1075
+ // _writable_schema=Boolean
1076
+ // When this pragma is on, the SQLITE_MASTER tables in which database
1077
+ // can be changed using ordinary UPDATE, INSERT, and DELETE statements.
1078
+ // Warning: misuse of this pragma can easily result in a corrupt database file.
1079
+ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
1080
+ if C.sqlite3_threadsafe() == 0 {
1081
+ return nil, errors.New("sqlite library was not compiled for thread-safe operation")
1082
+ }
1083
+
1084
+ var pkey string
1085
+
1086
+ // Options
1087
+ var loc *time.Location
1088
+ authCreate := false
1089
+ authUser := ""
1090
+ authPass := ""
1091
+ authCrypt := ""
1092
+ authSalt := ""
1093
+ mutex := C.int(C.SQLITE_OPEN_FULLMUTEX)
1094
+ txlock := "BEGIN"
1095
+
1096
+ // PRAGMA's
1097
+ autoVacuum := -1
1098
+ busyTimeout := 5000
1099
+ caseSensitiveLike := -1
1100
+ deferForeignKeys := -1
1101
+ foreignKeys := -1
1102
+ ignoreCheckConstraints := -1
1103
+ var journalMode string
1104
+ lockingMode := "NORMAL"
1105
+ queryOnly := -1
1106
+ recursiveTriggers := -1
1107
+ secureDelete := "DEFAULT"
1108
+ synchronousMode := "NORMAL"
1109
+ writableSchema := -1
1110
+ vfsName := ""
1111
+ var cacheSize *int64
1112
+
1113
+ pos := strings.IndexRune(dsn, '?')
1114
+ if pos >= 1 {
1115
+ params, err := url.ParseQuery(dsn[pos+1:])
1116
+ if err != nil {
1117
+ return nil, err
1118
+ }
1119
+
1120
+ // Authentication
1121
+ if _, ok := params["_auth"]; ok {
1122
+ authCreate = true
1123
+ }
1124
+ if val := params.Get("_auth_user"); val != "" {
1125
+ authUser = val
1126
+ }
1127
+ if val := params.Get("_auth_pass"); val != "" {
1128
+ authPass = val
1129
+ }
1130
+ if val := params.Get("_auth_crypt"); val != "" {
1131
+ authCrypt = val
1132
+ }
1133
+ if val := params.Get("_auth_salt"); val != "" {
1134
+ authSalt = val
1135
+ }
1136
+
1137
+ // _loc
1138
+ if val := params.Get("_loc"); val != "" {
1139
+ switch strings.ToLower(val) {
1140
+ case "auto":
1141
+ loc = time.Local
1142
+ default:
1143
+ loc, err = time.LoadLocation(val)
1144
+ if err != nil {
1145
+ return nil, fmt.Errorf("Invalid _loc: %v: %v", val, err)
1146
+ }
1147
+ }
1148
+ }
1149
+
1150
+ // _mutex
1151
+ if val := params.Get("_mutex"); val != "" {
1152
+ switch strings.ToLower(val) {
1153
+ case "no":
1154
+ mutex = C.SQLITE_OPEN_NOMUTEX
1155
+ case "full":
1156
+ mutex = C.SQLITE_OPEN_FULLMUTEX
1157
+ default:
1158
+ return nil, fmt.Errorf("Invalid _mutex: %v", val)
1159
+ }
1160
+ }
1161
+
1162
+ // _txlock
1163
+ if val := params.Get("_txlock"); val != "" {
1164
+ switch strings.ToLower(val) {
1165
+ case "immediate":
1166
+ txlock = "BEGIN IMMEDIATE"
1167
+ case "exclusive":
1168
+ txlock = "BEGIN EXCLUSIVE"
1169
+ case "deferred":
1170
+ txlock = "BEGIN"
1171
+ default:
1172
+ return nil, fmt.Errorf("Invalid _txlock: %v", val)
1173
+ }
1174
+ }
1175
+
1176
+ // Auto Vacuum (_vacuum)
1177
+ //
1178
+ // https://www.sqlite.org/pragma.html#pragma_auto_vacuum
1179
+ //
1180
+ pkey = "" // Reset pkey
1181
+ if _, ok := params["_auto_vacuum"]; ok {
1182
+ pkey = "_auto_vacuum"
1183
+ }
1184
+ if _, ok := params["_vacuum"]; ok {
1185
+ pkey = "_vacuum"
1186
+ }
1187
+ if val := params.Get(pkey); val != "" {
1188
+ switch strings.ToLower(val) {
1189
+ case "0", "none":
1190
+ autoVacuum = 0
1191
+ case "1", "full":
1192
+ autoVacuum = 1
1193
+ case "2", "incremental":
1194
+ autoVacuum = 2
1195
+ default:
1196
+ return nil, fmt.Errorf("Invalid _auto_vacuum: %v, expecting value of '0 NONE 1 FULL 2 INCREMENTAL'", val)
1197
+ }
1198
+ }
1199
+
1200
+ // Busy Timeout (_busy_timeout)
1201
+ //
1202
+ // https://www.sqlite.org/pragma.html#pragma_busy_timeout
1203
+ //
1204
+ pkey = "" // Reset pkey
1205
+ if _, ok := params["_busy_timeout"]; ok {
1206
+ pkey = "_busy_timeout"
1207
+ }
1208
+ if _, ok := params["_timeout"]; ok {
1209
+ pkey = "_timeout"
1210
+ }
1211
+ if val := params.Get(pkey); val != "" {
1212
+ iv, err := strconv.ParseInt(val, 10, 64)
1213
+ if err != nil {
1214
+ return nil, fmt.Errorf("Invalid _busy_timeout: %v: %v", val, err)
1215
+ }
1216
+ busyTimeout = int(iv)
1217
+ }
1218
+
1219
+ // Case Sensitive Like (_cslike)
1220
+ //
1221
+ // https://www.sqlite.org/pragma.html#pragma_case_sensitive_like
1222
+ //
1223
+ pkey = "" // Reset pkey
1224
+ if _, ok := params["_case_sensitive_like"]; ok {
1225
+ pkey = "_case_sensitive_like"
1226
+ }
1227
+ if _, ok := params["_cslike"]; ok {
1228
+ pkey = "_cslike"
1229
+ }
1230
+ if val := params.Get(pkey); val != "" {
1231
+ switch strings.ToLower(val) {
1232
+ case "0", "no", "false", "off":
1233
+ caseSensitiveLike = 0
1234
+ case "1", "yes", "true", "on":
1235
+ caseSensitiveLike = 1
1236
+ default:
1237
+ return nil, fmt.Errorf("Invalid _case_sensitive_like: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1238
+ }
1239
+ }
1240
+
1241
+ // Defer Foreign Keys (_defer_foreign_keys | _defer_fk)
1242
+ //
1243
+ // https://www.sqlite.org/pragma.html#pragma_defer_foreign_keys
1244
+ //
1245
+ pkey = "" // Reset pkey
1246
+ if _, ok := params["_defer_foreign_keys"]; ok {
1247
+ pkey = "_defer_foreign_keys"
1248
+ }
1249
+ if _, ok := params["_defer_fk"]; ok {
1250
+ pkey = "_defer_fk"
1251
+ }
1252
+ if val := params.Get(pkey); val != "" {
1253
+ switch strings.ToLower(val) {
1254
+ case "0", "no", "false", "off":
1255
+ deferForeignKeys = 0
1256
+ case "1", "yes", "true", "on":
1257
+ deferForeignKeys = 1
1258
+ default:
1259
+ return nil, fmt.Errorf("Invalid _defer_foreign_keys: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1260
+ }
1261
+ }
1262
+
1263
+ // Foreign Keys (_foreign_keys | _fk)
1264
+ //
1265
+ // https://www.sqlite.org/pragma.html#pragma_foreign_keys
1266
+ //
1267
+ pkey = "" // Reset pkey
1268
+ if _, ok := params["_foreign_keys"]; ok {
1269
+ pkey = "_foreign_keys"
1270
+ }
1271
+ if _, ok := params["_fk"]; ok {
1272
+ pkey = "_fk"
1273
+ }
1274
+ if val := params.Get(pkey); val != "" {
1275
+ switch strings.ToLower(val) {
1276
+ case "0", "no", "false", "off":
1277
+ foreignKeys = 0
1278
+ case "1", "yes", "true", "on":
1279
+ foreignKeys = 1
1280
+ default:
1281
+ return nil, fmt.Errorf("Invalid _foreign_keys: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1282
+ }
1283
+ }
1284
+
1285
+ // Ignore CHECK Constrains (_ignore_check_constraints)
1286
+ //
1287
+ // https://www.sqlite.org/pragma.html#pragma_ignore_check_constraints
1288
+ //
1289
+ if val := params.Get("_ignore_check_constraints"); val != "" {
1290
+ switch strings.ToLower(val) {
1291
+ case "0", "no", "false", "off":
1292
+ ignoreCheckConstraints = 0
1293
+ case "1", "yes", "true", "on":
1294
+ ignoreCheckConstraints = 1
1295
+ default:
1296
+ return nil, fmt.Errorf("Invalid _ignore_check_constraints: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1297
+ }
1298
+ }
1299
+
1300
+ // Journal Mode (_journal_mode | _journal)
1301
+ //
1302
+ // https://www.sqlite.org/pragma.html#pragma_journal_mode
1303
+ //
1304
+ pkey = "" // Reset pkey
1305
+ if _, ok := params["_journal_mode"]; ok {
1306
+ pkey = "_journal_mode"
1307
+ }
1308
+ if _, ok := params["_journal"]; ok {
1309
+ pkey = "_journal"
1310
+ }
1311
+ if val := params.Get(pkey); val != "" {
1312
+ switch strings.ToUpper(val) {
1313
+ case "DELETE", "TRUNCATE", "PERSIST", "MEMORY", "OFF":
1314
+ journalMode = strings.ToUpper(val)
1315
+ case "WAL":
1316
+ journalMode = strings.ToUpper(val)
1317
+
1318
+ // For WAL Mode set Synchronous Mode to 'NORMAL'
1319
+ // See https://www.sqlite.org/pragma.html#pragma_synchronous
1320
+ synchronousMode = "NORMAL"
1321
+ default:
1322
+ return nil, fmt.Errorf("Invalid _journal: %v, expecting value of 'DELETE TRUNCATE PERSIST MEMORY WAL OFF'", val)
1323
+ }
1324
+ }
1325
+
1326
+ // Locking Mode (_locking)
1327
+ //
1328
+ // https://www.sqlite.org/pragma.html#pragma_locking_mode
1329
+ //
1330
+ pkey = "" // Reset pkey
1331
+ if _, ok := params["_locking_mode"]; ok {
1332
+ pkey = "_locking_mode"
1333
+ }
1334
+ if _, ok := params["_locking"]; ok {
1335
+ pkey = "_locking"
1336
+ }
1337
+ if val := params.Get(pkey); val != "" {
1338
+ switch strings.ToUpper(val) {
1339
+ case "NORMAL", "EXCLUSIVE":
1340
+ lockingMode = strings.ToUpper(val)
1341
+ default:
1342
+ return nil, fmt.Errorf("Invalid _locking_mode: %v, expecting value of 'NORMAL EXCLUSIVE", val)
1343
+ }
1344
+ }
1345
+
1346
+ // Query Only (_query_only)
1347
+ //
1348
+ // https://www.sqlite.org/pragma.html#pragma_query_only
1349
+ //
1350
+ if val := params.Get("_query_only"); val != "" {
1351
+ switch strings.ToLower(val) {
1352
+ case "0", "no", "false", "off":
1353
+ queryOnly = 0
1354
+ case "1", "yes", "true", "on":
1355
+ queryOnly = 1
1356
+ default:
1357
+ return nil, fmt.Errorf("Invalid _query_only: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1358
+ }
1359
+ }
1360
+
1361
+ // Recursive Triggers (_recursive_triggers)
1362
+ //
1363
+ // https://www.sqlite.org/pragma.html#pragma_recursive_triggers
1364
+ //
1365
+ pkey = "" // Reset pkey
1366
+ if _, ok := params["_recursive_triggers"]; ok {
1367
+ pkey = "_recursive_triggers"
1368
+ }
1369
+ if _, ok := params["_rt"]; ok {
1370
+ pkey = "_rt"
1371
+ }
1372
+ if val := params.Get(pkey); val != "" {
1373
+ switch strings.ToLower(val) {
1374
+ case "0", "no", "false", "off":
1375
+ recursiveTriggers = 0
1376
+ case "1", "yes", "true", "on":
1377
+ recursiveTriggers = 1
1378
+ default:
1379
+ return nil, fmt.Errorf("Invalid _recursive_triggers: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1380
+ }
1381
+ }
1382
+
1383
+ // Secure Delete (_secure_delete)
1384
+ //
1385
+ // https://www.sqlite.org/pragma.html#pragma_secure_delete
1386
+ //
1387
+ if val := params.Get("_secure_delete"); val != "" {
1388
+ switch strings.ToLower(val) {
1389
+ case "0", "no", "false", "off":
1390
+ secureDelete = "OFF"
1391
+ case "1", "yes", "true", "on":
1392
+ secureDelete = "ON"
1393
+ case "fast":
1394
+ secureDelete = "FAST"
1395
+ default:
1396
+ return nil, fmt.Errorf("Invalid _secure_delete: %v, expecting boolean value of '0 1 false true no yes off on fast'", val)
1397
+ }
1398
+ }
1399
+
1400
+ // Synchronous Mode (_synchronous | _sync)
1401
+ //
1402
+ // https://www.sqlite.org/pragma.html#pragma_synchronous
1403
+ //
1404
+ pkey = "" // Reset pkey
1405
+ if _, ok := params["_synchronous"]; ok {
1406
+ pkey = "_synchronous"
1407
+ }
1408
+ if _, ok := params["_sync"]; ok {
1409
+ pkey = "_sync"
1410
+ }
1411
+ if val := params.Get(pkey); val != "" {
1412
+ switch strings.ToUpper(val) {
1413
+ case "0", "OFF", "1", "NORMAL", "2", "FULL", "3", "EXTRA":
1414
+ synchronousMode = strings.ToUpper(val)
1415
+ default:
1416
+ return nil, fmt.Errorf("Invalid _synchronous: %v, expecting value of '0 OFF 1 NORMAL 2 FULL 3 EXTRA'", val)
1417
+ }
1418
+ }
1419
+
1420
+ // Writable Schema (_writeable_schema)
1421
+ //
1422
+ // https://www.sqlite.org/pragma.html#pragma_writeable_schema
1423
+ //
1424
+ if val := params.Get("_writable_schema"); val != "" {
1425
+ switch strings.ToLower(val) {
1426
+ case "0", "no", "false", "off":
1427
+ writableSchema = 0
1428
+ case "1", "yes", "true", "on":
1429
+ writableSchema = 1
1430
+ default:
1431
+ return nil, fmt.Errorf("Invalid _writable_schema: %v, expecting boolean value of '0 1 false true no yes off on'", val)
1432
+ }
1433
+ }
1434
+
1435
+ // Cache size (_cache_size)
1436
+ //
1437
+ // https://sqlite.org/pragma.html#pragma_cache_size
1438
+ //
1439
+ if val := params.Get("_cache_size"); val != "" {
1440
+ iv, err := strconv.ParseInt(val, 10, 64)
1441
+ if err != nil {
1442
+ return nil, fmt.Errorf("Invalid _cache_size: %v: %v", val, err)
1443
+ }
1444
+ cacheSize = &iv
1445
+ }
1446
+
1447
+ if val := params.Get("vfs"); val != "" {
1448
+ vfsName = val
1449
+ }
1450
+
1451
+ if !strings.HasPrefix(dsn, "file:") {
1452
+ dsn = dsn[:pos]
1453
+ }
1454
+ }
1455
+
1456
+ var db *C.sqlite3
1457
+ name := C.CString(dsn)
1458
+ defer C.free(unsafe.Pointer(name))
1459
+ var vfs *C.char
1460
+ if vfsName != "" {
1461
+ vfs = C.CString(vfsName)
1462
+ defer C.free(unsafe.Pointer(vfs))
1463
+ }
1464
+ rv := C._sqlite3_open_v2(name, &db,
1465
+ mutex|C.SQLITE_OPEN_READWRITE|C.SQLITE_OPEN_CREATE,
1466
+ vfs)
1467
+ if rv != 0 {
1468
+ // Save off the error _before_ closing the database.
1469
+ // This is safe even if db is nil.
1470
+ err := lastError(db)
1471
+ if db != nil {
1472
+ C.sqlite3_close_v2(db)
1473
+ }
1474
+ return nil, err
1475
+ }
1476
+ if db == nil {
1477
+ return nil, errors.New("sqlite succeeded without returning a database")
1478
+ }
1479
+
1480
+ exec := func(s string) error {
1481
+ cs := C.CString(s)
1482
+ rv := C.sqlite3_exec(db, cs, nil, nil, nil)
1483
+ C.free(unsafe.Pointer(cs))
1484
+ if rv != C.SQLITE_OK {
1485
+ return lastError(db)
1486
+ }
1487
+ return nil
1488
+ }
1489
+
1490
+ // Busy timeout
1491
+ if err := exec(fmt.Sprintf("PRAGMA busy_timeout = %d;", busyTimeout)); err != nil {
1492
+ C.sqlite3_close_v2(db)
1493
+ return nil, err
1494
+ }
1495
+
1496
+ // USER AUTHENTICATION
1497
+ //
1498
+ // User Authentication is always performed even when
1499
+ // sqlite_userauth is not compiled in, because without user authentication
1500
+ // the authentication is a no-op.
1501
+ //
1502
+ // Workflow
1503
+ // - Authenticate
1504
+ // ON::SUCCESS => Continue
1505
+ // ON::SQLITE_AUTH => Return error and exit Open(...)
1506
+ //
1507
+ // - Activate User Authentication
1508
+ // Check if the user wants to activate User Authentication.
1509
+ // If so then first create a temporary AuthConn to the database
1510
+ // This is possible because we are already successfully authenticated.
1511
+ //
1512
+ // - Check if `sqlite_user`` table exists
1513
+ // YES => Add the provided user from DSN as Admin User and
1514
+ // activate user authentication.
1515
+ // NO => Continue
1516
+ //
1517
+
1518
+ // Create connection to SQLite
1519
+ conn := &SQLiteConn{db: db, loc: loc, txlock: txlock}
1520
+
1521
+ // Password Cipher has to be registered before authentication
1522
+ if len(authCrypt) > 0 {
1523
+ switch strings.ToUpper(authCrypt) {
1524
+ case "SHA1":
1525
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSHA1, true); err != nil {
1526
+ return nil, fmt.Errorf("CryptEncoderSHA1: %s", err)
1527
+ }
1528
+ case "SSHA1":
1529
+ if len(authSalt) == 0 {
1530
+ return nil, fmt.Errorf("_auth_crypt=ssha1, requires _auth_salt")
1531
+ }
1532
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSSHA1(authSalt), true); err != nil {
1533
+ return nil, fmt.Errorf("CryptEncoderSSHA1: %s", err)
1534
+ }
1535
+ case "SHA256":
1536
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSHA256, true); err != nil {
1537
+ return nil, fmt.Errorf("CryptEncoderSHA256: %s", err)
1538
+ }
1539
+ case "SSHA256":
1540
+ if len(authSalt) == 0 {
1541
+ return nil, fmt.Errorf("_auth_crypt=ssha256, requires _auth_salt")
1542
+ }
1543
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSSHA256(authSalt), true); err != nil {
1544
+ return nil, fmt.Errorf("CryptEncoderSSHA256: %s", err)
1545
+ }
1546
+ case "SHA384":
1547
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSHA384, true); err != nil {
1548
+ return nil, fmt.Errorf("CryptEncoderSHA384: %s", err)
1549
+ }
1550
+ case "SSHA384":
1551
+ if len(authSalt) == 0 {
1552
+ return nil, fmt.Errorf("_auth_crypt=ssha384, requires _auth_salt")
1553
+ }
1554
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSSHA384(authSalt), true); err != nil {
1555
+ return nil, fmt.Errorf("CryptEncoderSSHA384: %s", err)
1556
+ }
1557
+ case "SHA512":
1558
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSHA512, true); err != nil {
1559
+ return nil, fmt.Errorf("CryptEncoderSHA512: %s", err)
1560
+ }
1561
+ case "SSHA512":
1562
+ if len(authSalt) == 0 {
1563
+ return nil, fmt.Errorf("_auth_crypt=ssha512, requires _auth_salt")
1564
+ }
1565
+ if err := conn.RegisterFunc("sqlite_crypt", CryptEncoderSSHA512(authSalt), true); err != nil {
1566
+ return nil, fmt.Errorf("CryptEncoderSSHA512: %s", err)
1567
+ }
1568
+ }
1569
+ }
1570
+
1571
+ // Preform Authentication
1572
+ if err := conn.Authenticate(authUser, authPass); err != nil {
1573
+ return nil, err
1574
+ }
1575
+
1576
+ // Register: authenticate
1577
+ // Authenticate will perform an authentication of the provided username
1578
+ // and password against the database.
1579
+ //
1580
+ // If a database contains the SQLITE_USER table, then the
1581
+ // call to Authenticate must be invoked with an
1582
+ // appropriate username and password prior to enable read and write
1583
+ //access to the database.
1584
+ //
1585
+ // Return SQLITE_OK on success or SQLITE_ERROR if the username/password
1586
+ // combination is incorrect or unknown.
1587
+ //
1588
+ // If the SQLITE_USER table is not present in the database file, then
1589
+ // this interface is a harmless no-op returnning SQLITE_OK.
1590
+ if err := conn.RegisterFunc("authenticate", conn.authenticate, true); err != nil {
1591
+ return nil, err
1592
+ }
1593
+ //
1594
+ // Register: auth_user_add
1595
+ // auth_user_add can be used (by an admin user only)
1596
+ // to create a new user. When called on a no-authentication-required
1597
+ // database, this routine converts the database into an authentication-
1598
+ // required database, automatically makes the added user an
1599
+ // administrator, and logs in the current connection as that user.
1600
+ // The AuthUserAdd only works for the "main" database, not
1601
+ // for any ATTACH-ed databases. Any call to AuthUserAdd by a
1602
+ // non-admin user results in an error.
1603
+ if err := conn.RegisterFunc("auth_user_add", conn.authUserAdd, true); err != nil {
1604
+ return nil, err
1605
+ }
1606
+ //
1607
+ // Register: auth_user_change
1608
+ // auth_user_change can be used to change a users
1609
+ // login credentials or admin privilege. Any user can change their own
1610
+ // login credentials. Only an admin user can change another users login
1611
+ // credentials or admin privilege setting. No user may change their own
1612
+ // admin privilege setting.
1613
+ if err := conn.RegisterFunc("auth_user_change", conn.authUserChange, true); err != nil {
1614
+ return nil, err
1615
+ }
1616
+ //
1617
+ // Register: auth_user_delete
1618
+ // auth_user_delete can be used (by an admin user only)
1619
+ // to delete a user. The currently logged-in user cannot be deleted,
1620
+ // which guarantees that there is always an admin user and hence that
1621
+ // the database cannot be converted into a no-authentication-required
1622
+ // database.
1623
+ if err := conn.RegisterFunc("auth_user_delete", conn.authUserDelete, true); err != nil {
1624
+ return nil, err
1625
+ }
1626
+
1627
+ // Register: auth_enabled
1628
+ // auth_enabled can be used to check if user authentication is enabled
1629
+ if err := conn.RegisterFunc("auth_enabled", conn.authEnabled, true); err != nil {
1630
+ return nil, err
1631
+ }
1632
+
1633
+ // Auto Vacuum
1634
+ // Moved auto_vacuum command, the user preference for auto_vacuum needs to be implemented directly after
1635
+ // the authentication and before the sqlite_user table gets created if the user
1636
+ // decides to activate User Authentication because
1637
+ // auto_vacuum needs to be set before any tables are created
1638
+ // and activating user authentication creates the internal table `sqlite_user`.
1639
+ if autoVacuum > -1 {
1640
+ if err := exec(fmt.Sprintf("PRAGMA auto_vacuum = %d;", autoVacuum)); err != nil {
1641
+ C.sqlite3_close_v2(db)
1642
+ return nil, err
1643
+ }
1644
+ }
1645
+
1646
+ // Check if user wants to activate User Authentication
1647
+ if authCreate {
1648
+ // Before going any further, we need to check that the user
1649
+ // has provided an username and password within the DSN.
1650
+ // We are not allowed to continue.
1651
+ if len(authUser) == 0 {
1652
+ return nil, fmt.Errorf("Missing '_auth_user' while user authentication was requested with '_auth'")
1653
+ }
1654
+ if len(authPass) == 0 {
1655
+ return nil, fmt.Errorf("Missing '_auth_pass' while user authentication was requested with '_auth'")
1656
+ }
1657
+
1658
+ // Check if User Authentication is Enabled
1659
+ authExists := conn.AuthEnabled()
1660
+ if !authExists {
1661
+ if err := conn.AuthUserAdd(authUser, authPass, true); err != nil {
1662
+ return nil, err
1663
+ }
1664
+ }
1665
+ }
1666
+
1667
+ // Case Sensitive LIKE
1668
+ if caseSensitiveLike > -1 {
1669
+ if err := exec(fmt.Sprintf("PRAGMA case_sensitive_like = %d;", caseSensitiveLike)); err != nil {
1670
+ C.sqlite3_close_v2(db)
1671
+ return nil, err
1672
+ }
1673
+ }
1674
+
1675
+ // Defer Foreign Keys
1676
+ if deferForeignKeys > -1 {
1677
+ if err := exec(fmt.Sprintf("PRAGMA defer_foreign_keys = %d;", deferForeignKeys)); err != nil {
1678
+ C.sqlite3_close_v2(db)
1679
+ return nil, err
1680
+ }
1681
+ }
1682
+
1683
+ // Foreign Keys
1684
+ if foreignKeys > -1 {
1685
+ if err := exec(fmt.Sprintf("PRAGMA foreign_keys = %d;", foreignKeys)); err != nil {
1686
+ C.sqlite3_close_v2(db)
1687
+ return nil, err
1688
+ }
1689
+ }
1690
+
1691
+ // Ignore CHECK Constraints
1692
+ if ignoreCheckConstraints > -1 {
1693
+ if err := exec(fmt.Sprintf("PRAGMA ignore_check_constraints = %d;", ignoreCheckConstraints)); err != nil {
1694
+ C.sqlite3_close_v2(db)
1695
+ return nil, err
1696
+ }
1697
+ }
1698
+
1699
+ // Journal Mode
1700
+ if journalMode != "" {
1701
+ if err := exec(fmt.Sprintf("PRAGMA journal_mode = %s;", journalMode)); err != nil {
1702
+ C.sqlite3_close_v2(db)
1703
+ return nil, err
1704
+ }
1705
+ }
1706
+
1707
+ // Locking Mode
1708
+ // Because the default is NORMAL and this is not changed in this package
1709
+ // by using the compile time SQLITE_DEFAULT_LOCKING_MODE this PRAGMA can always be executed
1710
+ if err := exec(fmt.Sprintf("PRAGMA locking_mode = %s;", lockingMode)); err != nil {
1711
+ C.sqlite3_close_v2(db)
1712
+ return nil, err
1713
+ }
1714
+
1715
+ // Query Only
1716
+ if queryOnly > -1 {
1717
+ if err := exec(fmt.Sprintf("PRAGMA query_only = %d;", queryOnly)); err != nil {
1718
+ C.sqlite3_close_v2(db)
1719
+ return nil, err
1720
+ }
1721
+ }
1722
+
1723
+ // Recursive Triggers
1724
+ if recursiveTriggers > -1 {
1725
+ if err := exec(fmt.Sprintf("PRAGMA recursive_triggers = %d;", recursiveTriggers)); err != nil {
1726
+ C.sqlite3_close_v2(db)
1727
+ return nil, err
1728
+ }
1729
+ }
1730
+
1731
+ // Secure Delete
1732
+ //
1733
+ // Because this package can set the compile time flag SQLITE_SECURE_DELETE with a build tag
1734
+ // the default value for secureDelete var is 'DEFAULT' this way
1735
+ // you can compile with secure_delete 'ON' and disable it for a specific database connection.
1736
+ if secureDelete != "DEFAULT" {
1737
+ if err := exec(fmt.Sprintf("PRAGMA secure_delete = %s;", secureDelete)); err != nil {
1738
+ C.sqlite3_close_v2(db)
1739
+ return nil, err
1740
+ }
1741
+ }
1742
+
1743
+ // Synchronous Mode
1744
+ //
1745
+ // Because default is NORMAL this statement is always executed
1746
+ if err := exec(fmt.Sprintf("PRAGMA synchronous = %s;", synchronousMode)); err != nil {
1747
+ conn.Close()
1748
+ return nil, err
1749
+ }
1750
+
1751
+ // Writable Schema
1752
+ if writableSchema > -1 {
1753
+ if err := exec(fmt.Sprintf("PRAGMA writable_schema = %d;", writableSchema)); err != nil {
1754
+ C.sqlite3_close_v2(db)
1755
+ return nil, err
1756
+ }
1757
+ }
1758
+
1759
+ // Cache Size
1760
+ if cacheSize != nil {
1761
+ if err := exec(fmt.Sprintf("PRAGMA cache_size = %d;", *cacheSize)); err != nil {
1762
+ C.sqlite3_close_v2(db)
1763
+ return nil, err
1764
+ }
1765
+ }
1766
+
1767
+ if len(d.Extensions) > 0 {
1768
+ if err := conn.loadExtensions(d.Extensions); err != nil {
1769
+ conn.Close()
1770
+ return nil, err
1771
+ }
1772
+ }
1773
+
1774
+ if d.ConnectHook != nil {
1775
+ if err := d.ConnectHook(conn); err != nil {
1776
+ conn.Close()
1777
+ return nil, err
1778
+ }
1779
+ }
1780
+ runtime.SetFinalizer(conn, (*SQLiteConn).Close)
1781
+ return conn, nil
1782
+ }
1783
+
1784
+ // Close the connection.
1785
+ func (c *SQLiteConn) Close() error {
1786
+ rv := C.sqlite3_close_v2(c.db)
1787
+ if rv != C.SQLITE_OK {
1788
+ return c.lastError()
1789
+ }
1790
+ deleteHandles(c)
1791
+ c.mu.Lock()
1792
+ c.db = nil
1793
+ c.mu.Unlock()
1794
+ runtime.SetFinalizer(c, nil)
1795
+ return nil
1796
+ }
1797
+
1798
+ func (c *SQLiteConn) dbConnOpen() bool {
1799
+ if c == nil {
1800
+ return false
1801
+ }
1802
+ c.mu.Lock()
1803
+ defer c.mu.Unlock()
1804
+ return c.db != nil
1805
+ }
1806
+
1807
+ // Prepare the query string. Return a new statement.
1808
+ func (c *SQLiteConn) Prepare(query string) (driver.Stmt, error) {
1809
+ return c.prepare(context.Background(), query)
1810
+ }
1811
+
1812
+ func (c *SQLiteConn) prepare(ctx context.Context, query string) (driver.Stmt, error) {
1813
+ pquery := C.CString(query)
1814
+ defer C.free(unsafe.Pointer(pquery))
1815
+ var s *C.sqlite3_stmt
1816
+ var tail *C.char
1817
+ rv := C._sqlite3_prepare_v2_internal(c.db, pquery, C.int(-1), &s, &tail)
1818
+ if rv != C.SQLITE_OK {
1819
+ return nil, c.lastError()
1820
+ }
1821
+ var t string
1822
+ if tail != nil && *tail != '\000' {
1823
+ t = strings.TrimSpace(C.GoString(tail))
1824
+ }
1825
+ ss := &SQLiteStmt{c: c, s: s, t: t}
1826
+ runtime.SetFinalizer(ss, (*SQLiteStmt).Close)
1827
+ return ss, nil
1828
+ }
1829
+
1830
+ // Run-Time Limit Categories.
1831
+ // See: http://www.sqlite.org/c3ref/c_limit_attached.html
1832
+ const (
1833
+ SQLITE_LIMIT_LENGTH = C.SQLITE_LIMIT_LENGTH
1834
+ SQLITE_LIMIT_SQL_LENGTH = C.SQLITE_LIMIT_SQL_LENGTH
1835
+ SQLITE_LIMIT_COLUMN = C.SQLITE_LIMIT_COLUMN
1836
+ SQLITE_LIMIT_EXPR_DEPTH = C.SQLITE_LIMIT_EXPR_DEPTH
1837
+ SQLITE_LIMIT_COMPOUND_SELECT = C.SQLITE_LIMIT_COMPOUND_SELECT
1838
+ SQLITE_LIMIT_VDBE_OP = C.SQLITE_LIMIT_VDBE_OP
1839
+ SQLITE_LIMIT_FUNCTION_ARG = C.SQLITE_LIMIT_FUNCTION_ARG
1840
+ SQLITE_LIMIT_ATTACHED = C.SQLITE_LIMIT_ATTACHED
1841
+ SQLITE_LIMIT_LIKE_PATTERN_LENGTH = C.SQLITE_LIMIT_LIKE_PATTERN_LENGTH
1842
+ SQLITE_LIMIT_VARIABLE_NUMBER = C.SQLITE_LIMIT_VARIABLE_NUMBER
1843
+ SQLITE_LIMIT_TRIGGER_DEPTH = C.SQLITE_LIMIT_TRIGGER_DEPTH
1844
+ SQLITE_LIMIT_WORKER_THREADS = C.SQLITE_LIMIT_WORKER_THREADS
1845
+ )
1846
+
1847
+ // GetFilename returns the absolute path to the file containing
1848
+ // the requested schema. When passed an empty string, it will
1849
+ // instead use the database's default schema: "main".
1850
+ // See: sqlite3_db_filename, https://www.sqlite.org/c3ref/db_filename.html
1851
+ func (c *SQLiteConn) GetFilename(schemaName string) string {
1852
+ if schemaName == "" {
1853
+ schemaName = "main"
1854
+ }
1855
+ return C.GoString(C.sqlite3_db_filename(c.db, C.CString(schemaName)))
1856
+ }
1857
+
1858
+ // GetLimit returns the current value of a run-time limit.
1859
+ // See: sqlite3_limit, http://www.sqlite.org/c3ref/limit.html
1860
+ func (c *SQLiteConn) GetLimit(id int) int {
1861
+ return int(C._sqlite3_limit(c.db, C.int(id), C.int(-1)))
1862
+ }
1863
+
1864
+ // SetLimit changes the value of a run-time limits.
1865
+ // Then this method returns the prior value of the limit.
1866
+ // See: sqlite3_limit, http://www.sqlite.org/c3ref/limit.html
1867
+ func (c *SQLiteConn) SetLimit(id int, newVal int) int {
1868
+ return int(C._sqlite3_limit(c.db, C.int(id), C.int(newVal)))
1869
+ }
1870
+
1871
+ // SetFileControlInt invokes the xFileControl method on a given database. The
1872
+ // dbName is the name of the database. It will default to "main" if left blank.
1873
+ // The op is one of the opcodes prefixed by "SQLITE_FCNTL_". The arg argument
1874
+ // and return code are both opcode-specific. Please see the SQLite documentation.
1875
+ //
1876
+ // This method is not thread-safe as the returned error code can be changed by
1877
+ // another call if invoked concurrently.
1878
+ //
1879
+ // Use SetFileControlInt64 instead if the argument for the opcode is documented
1880
+ // as a pointer to a sqlite3_int64.
1881
+ //
1882
+ // See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
1883
+ func (c *SQLiteConn) SetFileControlInt(dbName string, op int, arg int) error {
1884
+ if dbName == "" {
1885
+ dbName = "main"
1886
+ }
1887
+
1888
+ cDBName := C.CString(dbName)
1889
+ defer C.free(unsafe.Pointer(cDBName))
1890
+
1891
+ cArg := C.int(arg)
1892
+ rv := C.sqlite3_file_control(c.db, cDBName, C.int(op), unsafe.Pointer(&cArg))
1893
+ if rv != C.SQLITE_OK {
1894
+ return c.lastError()
1895
+ }
1896
+ return nil
1897
+ }
1898
+
1899
+ // SetFileControlInt64 invokes the xFileControl method on a given database. The
1900
+ // dbName is the name of the database. It will default to "main" if left blank.
1901
+ // The op is one of the opcodes prefixed by "SQLITE_FCNTL_". The arg argument
1902
+ // and return code are both opcode-specific. Please see the SQLite documentation.
1903
+ //
1904
+ // This method is not thread-safe as the returned error code can be changed by
1905
+ // another call if invoked concurrently.
1906
+ //
1907
+ // Only use this method if the argument for the opcode is documented as a pointer
1908
+ // to a sqlite3_int64.
1909
+ //
1910
+ // See: sqlite3_file_control, https://www.sqlite.org/c3ref/file_control.html
1911
+ func (c *SQLiteConn) SetFileControlInt64(dbName string, op int, arg int64) error {
1912
+ if dbName == "" {
1913
+ dbName = "main"
1914
+ }
1915
+
1916
+ cDBName := C.CString(dbName)
1917
+ defer C.free(unsafe.Pointer(cDBName))
1918
+
1919
+ cArg := C.sqlite3_int64(arg)
1920
+ rv := C.sqlite3_file_control(c.db, cDBName, C.int(op), unsafe.Pointer(&cArg))
1921
+ if rv != C.SQLITE_OK {
1922
+ return c.lastError()
1923
+ }
1924
+ return nil
1925
+ }
1926
+
1927
+ // Close the statement.
1928
+ func (s *SQLiteStmt) Close() error {
1929
+ s.mu.Lock()
1930
+ defer s.mu.Unlock()
1931
+ if s.closed {
1932
+ return nil
1933
+ }
1934
+ s.closed = true
1935
+ if !s.c.dbConnOpen() {
1936
+ return errors.New("sqlite statement with already closed database connection")
1937
+ }
1938
+ rv := C.sqlite3_finalize(s.s)
1939
+ s.s = nil
1940
+ if rv != C.SQLITE_OK {
1941
+ return s.c.lastError()
1942
+ }
1943
+ s.c = nil
1944
+ runtime.SetFinalizer(s, nil)
1945
+ return nil
1946
+ }
1947
+
1948
+ // NumInput return a number of parameters.
1949
+ func (s *SQLiteStmt) NumInput() int {
1950
+ return int(C.sqlite3_bind_parameter_count(s.s))
1951
+ }
1952
+
1953
+ var placeHolder = []byte{0}
1954
+
1955
+ func (s *SQLiteStmt) bind(args []driver.NamedValue) error {
1956
+ rv := C.sqlite3_reset(s.s)
1957
+ if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
1958
+ return s.c.lastError()
1959
+ }
1960
+
1961
+ bindIndices := make([][3]int, len(args))
1962
+ prefixes := []string{":", "@", "$"}
1963
+ for i, v := range args {
1964
+ bindIndices[i][0] = args[i].Ordinal
1965
+ if v.Name != "" {
1966
+ for j := range prefixes {
1967
+ cname := C.CString(prefixes[j] + v.Name)
1968
+ bindIndices[i][j] = int(C.sqlite3_bind_parameter_index(s.s, cname))
1969
+ C.free(unsafe.Pointer(cname))
1970
+ }
1971
+ args[i].Ordinal = bindIndices[i][0]
1972
+ }
1973
+ }
1974
+
1975
+ for i, arg := range args {
1976
+ for j := range bindIndices[i] {
1977
+ if bindIndices[i][j] == 0 {
1978
+ continue
1979
+ }
1980
+ n := C.int(bindIndices[i][j])
1981
+ switch v := arg.Value.(type) {
1982
+ case nil:
1983
+ rv = C.sqlite3_bind_null(s.s, n)
1984
+ case string:
1985
+ if len(v) == 0 {
1986
+ rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&placeHolder[0])), C.int(0))
1987
+ } else {
1988
+ b := []byte(v)
1989
+ rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
1990
+ }
1991
+ case int64:
1992
+ rv = C.sqlite3_bind_int64(s.s, n, C.sqlite3_int64(v))
1993
+ case bool:
1994
+ if v {
1995
+ rv = C.sqlite3_bind_int(s.s, n, 1)
1996
+ } else {
1997
+ rv = C.sqlite3_bind_int(s.s, n, 0)
1998
+ }
1999
+ case float64:
2000
+ rv = C.sqlite3_bind_double(s.s, n, C.double(v))
2001
+ case []byte:
2002
+ if v == nil {
2003
+ rv = C.sqlite3_bind_null(s.s, n)
2004
+ } else {
2005
+ ln := len(v)
2006
+ if ln == 0 {
2007
+ v = placeHolder
2008
+ }
2009
+ rv = C._sqlite3_bind_blob(s.s, n, unsafe.Pointer(&v[0]), C.int(ln))
2010
+ }
2011
+ case time.Time:
2012
+ b := []byte(v.Format(SQLiteTimestampFormats[0]))
2013
+ rv = C._sqlite3_bind_text(s.s, n, (*C.char)(unsafe.Pointer(&b[0])), C.int(len(b)))
2014
+ }
2015
+ if rv != C.SQLITE_OK {
2016
+ return s.c.lastError()
2017
+ }
2018
+ }
2019
+ }
2020
+ return nil
2021
+ }
2022
+
2023
+ // Query the statement with arguments. Return records.
2024
+ func (s *SQLiteStmt) Query(args []driver.Value) (driver.Rows, error) {
2025
+ list := make([]driver.NamedValue, len(args))
2026
+ for i, v := range args {
2027
+ list[i] = driver.NamedValue{
2028
+ Ordinal: i + 1,
2029
+ Value: v,
2030
+ }
2031
+ }
2032
+ return s.query(context.Background(), list)
2033
+ }
2034
+
2035
+ func (s *SQLiteStmt) query(ctx context.Context, args []driver.NamedValue) (driver.Rows, error) {
2036
+ if err := s.bind(args); err != nil {
2037
+ return nil, err
2038
+ }
2039
+
2040
+ rows := &SQLiteRows{
2041
+ s: s,
2042
+ nc: int32(C.sqlite3_column_count(s.s)),
2043
+ cls: s.cls,
2044
+ cols: nil,
2045
+ decltype: nil,
2046
+ ctx: ctx,
2047
+ }
2048
+
2049
+ return rows, nil
2050
+ }
2051
+
2052
+ // LastInsertId return last inserted ID.
2053
+ func (r *SQLiteResult) LastInsertId() (int64, error) {
2054
+ return r.id, nil
2055
+ }
2056
+
2057
+ // RowsAffected return how many rows affected.
2058
+ func (r *SQLiteResult) RowsAffected() (int64, error) {
2059
+ return r.changes, nil
2060
+ }
2061
+
2062
+ // Exec execute the statement with arguments. Return result object.
2063
+ func (s *SQLiteStmt) Exec(args []driver.Value) (driver.Result, error) {
2064
+ list := make([]driver.NamedValue, len(args))
2065
+ for i, v := range args {
2066
+ list[i] = driver.NamedValue{
2067
+ Ordinal: i + 1,
2068
+ Value: v,
2069
+ }
2070
+ }
2071
+ return s.exec(context.Background(), list)
2072
+ }
2073
+
2074
+ func isInterruptErr(err error) bool {
2075
+ sqliteErr, ok := err.(Error)
2076
+ if ok {
2077
+ return sqliteErr.Code == ErrInterrupt
2078
+ }
2079
+ return false
2080
+ }
2081
+
2082
+ // exec executes a query that doesn't return rows. Attempts to honor context timeout.
2083
+ func (s *SQLiteStmt) exec(ctx context.Context, args []driver.NamedValue) (driver.Result, error) {
2084
+ if ctx.Done() == nil {
2085
+ return s.execSync(args)
2086
+ }
2087
+
2088
+ type result struct {
2089
+ r driver.Result
2090
+ err error
2091
+ }
2092
+ resultCh := make(chan result)
2093
+ defer close(resultCh)
2094
+ go func() {
2095
+ r, err := s.execSync(args)
2096
+ resultCh <- result{r, err}
2097
+ }()
2098
+ var rv result
2099
+ select {
2100
+ case rv = <-resultCh:
2101
+ case <-ctx.Done():
2102
+ select {
2103
+ case rv = <-resultCh: // no need to interrupt, operation completed in db
2104
+ default:
2105
+ // this is still racy and can be no-op if executed between sqlite3_* calls in execSync.
2106
+ C.sqlite3_interrupt(s.c.db)
2107
+ rv = <-resultCh // wait for goroutine completed
2108
+ if isInterruptErr(rv.err) {
2109
+ return nil, ctx.Err()
2110
+ }
2111
+ }
2112
+ }
2113
+ return rv.r, rv.err
2114
+ }
2115
+
2116
+ func (s *SQLiteStmt) execSync(args []driver.NamedValue) (driver.Result, error) {
2117
+ if err := s.bind(args); err != nil {
2118
+ C.sqlite3_reset(s.s)
2119
+ C.sqlite3_clear_bindings(s.s)
2120
+ return nil, err
2121
+ }
2122
+
2123
+ var rowid, changes C.longlong
2124
+ rv := C._sqlite3_step_row_internal(s.s, &rowid, &changes)
2125
+ if rv != C.SQLITE_ROW && rv != C.SQLITE_OK && rv != C.SQLITE_DONE {
2126
+ err := s.c.lastError()
2127
+ C.sqlite3_reset(s.s)
2128
+ C.sqlite3_clear_bindings(s.s)
2129
+ return nil, err
2130
+ }
2131
+
2132
+ return &SQLiteResult{id: int64(rowid), changes: int64(changes)}, nil
2133
+ }
2134
+
2135
+ // Readonly reports if this statement is considered readonly by SQLite.
2136
+ //
2137
+ // See: https://sqlite.org/c3ref/stmt_readonly.html
2138
+ func (s *SQLiteStmt) Readonly() bool {
2139
+ return C.sqlite3_stmt_readonly(s.s) == 1
2140
+ }
2141
+
2142
+ // Close the rows.
2143
+ func (rc *SQLiteRows) Close() error {
2144
+ rc.closemu.Lock()
2145
+ defer rc.closemu.Unlock()
2146
+ s := rc.s
2147
+ if s == nil {
2148
+ return nil
2149
+ }
2150
+ rc.s = nil // remove reference to SQLiteStmt
2151
+ s.mu.Lock()
2152
+ if s.closed {
2153
+ s.mu.Unlock()
2154
+ return nil
2155
+ }
2156
+ if rc.cls {
2157
+ s.mu.Unlock()
2158
+ return s.Close()
2159
+ }
2160
+ rv := C.sqlite3_reset(s.s)
2161
+ if rv != C.SQLITE_OK {
2162
+ s.mu.Unlock()
2163
+ return s.c.lastError()
2164
+ }
2165
+ s.mu.Unlock()
2166
+ return nil
2167
+ }
2168
+
2169
+ // Columns return column names.
2170
+ func (rc *SQLiteRows) Columns() []string {
2171
+ rc.s.mu.Lock()
2172
+ defer rc.s.mu.Unlock()
2173
+ if rc.s.s != nil && int(rc.nc) != len(rc.cols) {
2174
+ rc.cols = make([]string, rc.nc)
2175
+ for i := 0; i < int(rc.nc); i++ {
2176
+ rc.cols[i] = C.GoString(C.sqlite3_column_name(rc.s.s, C.int(i)))
2177
+ }
2178
+ }
2179
+ return rc.cols
2180
+ }
2181
+
2182
+ func (rc *SQLiteRows) declTypes() []string {
2183
+ if rc.s.s != nil && rc.decltype == nil {
2184
+ rc.decltype = make([]string, rc.nc)
2185
+ for i := 0; i < int(rc.nc); i++ {
2186
+ rc.decltype[i] = strings.ToLower(C.GoString(C.sqlite3_column_decltype(rc.s.s, C.int(i))))
2187
+ }
2188
+ }
2189
+ return rc.decltype
2190
+ }
2191
+
2192
+ // DeclTypes return column types.
2193
+ func (rc *SQLiteRows) DeclTypes() []string {
2194
+ rc.s.mu.Lock()
2195
+ defer rc.s.mu.Unlock()
2196
+ return rc.declTypes()
2197
+ }
2198
+
2199
+ // Next move cursor to next. Attempts to honor context timeout from QueryContext call.
2200
+ func (rc *SQLiteRows) Next(dest []driver.Value) error {
2201
+ rc.s.mu.Lock()
2202
+ defer rc.s.mu.Unlock()
2203
+
2204
+ if rc.s.closed {
2205
+ return io.EOF
2206
+ }
2207
+
2208
+ if rc.ctx.Done() == nil {
2209
+ return rc.nextSyncLocked(dest)
2210
+ }
2211
+ resultCh := make(chan error)
2212
+ defer close(resultCh)
2213
+ go func() {
2214
+ resultCh <- rc.nextSyncLocked(dest)
2215
+ }()
2216
+ select {
2217
+ case err := <-resultCh:
2218
+ return err
2219
+ case <-rc.ctx.Done():
2220
+ select {
2221
+ case <-resultCh: // no need to interrupt
2222
+ default:
2223
+ // this is still racy and can be no-op if executed between sqlite3_* calls in nextSyncLocked.
2224
+ C.sqlite3_interrupt(rc.s.c.db)
2225
+ <-resultCh // ensure goroutine completed
2226
+ }
2227
+ return rc.ctx.Err()
2228
+ }
2229
+ }
2230
+
2231
+ // nextSyncLocked moves cursor to next; must be called with locked mutex.
2232
+ func (rc *SQLiteRows) nextSyncLocked(dest []driver.Value) error {
2233
+ rv := C._sqlite3_step_internal(rc.s.s)
2234
+ if rv == C.SQLITE_DONE {
2235
+ return io.EOF
2236
+ }
2237
+ if rv != C.SQLITE_ROW {
2238
+ rv = C.sqlite3_reset(rc.s.s)
2239
+ if rv != C.SQLITE_OK {
2240
+ return rc.s.c.lastError()
2241
+ }
2242
+ return nil
2243
+ }
2244
+
2245
+ rc.declTypes()
2246
+
2247
+ for i := range dest {
2248
+ switch C.sqlite3_column_type(rc.s.s, C.int(i)) {
2249
+ case C.SQLITE_INTEGER:
2250
+ val := int64(C.sqlite3_column_int64(rc.s.s, C.int(i)))
2251
+ switch rc.decltype[i] {
2252
+ case columnTimestamp, columnDatetime, columnDate:
2253
+ var t time.Time
2254
+ // Assume a millisecond unix timestamp if it's 13 digits -- too
2255
+ // large to be a reasonable timestamp in seconds.
2256
+ if val > 1e12 || val < -1e12 {
2257
+ val *= int64(time.Millisecond) // convert ms to nsec
2258
+ t = time.Unix(0, val)
2259
+ } else {
2260
+ t = time.Unix(val, 0)
2261
+ }
2262
+ t = t.UTC()
2263
+ if rc.s.c.loc != nil {
2264
+ t = t.In(rc.s.c.loc)
2265
+ }
2266
+ dest[i] = t
2267
+ case "boolean":
2268
+ dest[i] = val > 0
2269
+ default:
2270
+ dest[i] = val
2271
+ }
2272
+ case C.SQLITE_FLOAT:
2273
+ dest[i] = float64(C.sqlite3_column_double(rc.s.s, C.int(i)))
2274
+ case C.SQLITE_BLOB:
2275
+ p := C.sqlite3_column_blob(rc.s.s, C.int(i))
2276
+ if p == nil {
2277
+ dest[i] = []byte{}
2278
+ continue
2279
+ }
2280
+ n := C.sqlite3_column_bytes(rc.s.s, C.int(i))
2281
+ dest[i] = C.GoBytes(p, n)
2282
+ case C.SQLITE_NULL:
2283
+ dest[i] = nil
2284
+ case C.SQLITE_TEXT:
2285
+ var err error
2286
+ var timeVal time.Time
2287
+
2288
+ n := int(C.sqlite3_column_bytes(rc.s.s, C.int(i)))
2289
+ s := C.GoStringN((*C.char)(unsafe.Pointer(C.sqlite3_column_text(rc.s.s, C.int(i)))), C.int(n))
2290
+
2291
+ switch rc.decltype[i] {
2292
+ case columnTimestamp, columnDatetime, columnDate:
2293
+ var t time.Time
2294
+ s = strings.TrimSuffix(s, "Z")
2295
+ for _, format := range SQLiteTimestampFormats {
2296
+ if timeVal, err = time.ParseInLocation(format, s, time.UTC); err == nil {
2297
+ t = timeVal
2298
+ break
2299
+ }
2300
+ }
2301
+ if err != nil {
2302
+ // The column is a time value, so return the zero time on parse failure.
2303
+ t = time.Time{}
2304
+ }
2305
+ if rc.s.c.loc != nil {
2306
+ t = t.In(rc.s.c.loc)
2307
+ }
2308
+ dest[i] = t
2309
+ default:
2310
+ dest[i] = s
2311
+ }
2312
+ }
2313
+ }
2314
+ return nil
2315
+ }