@psnext/slingcli 2.4.20260526-1 → 2.4.20260527-3

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.
Files changed (382) hide show
  1. package/bin/sling.js +4 -1
  2. package/node_modules/@aws-sdk/core/package.json +2 -2
  3. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  4. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
  5. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  12. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  13. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  14. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  20. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  21. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
  22. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  23. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
  24. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  25. package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
  26. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +88 -107
  27. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
  29. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
  30. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
  31. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +47 -30
  32. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
  33. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
  34. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
  35. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
  36. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
  37. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  38. package/node_modules/@earendil-works/pi-ai/package.json +4 -3
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
  41. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
  42. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
  44. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
  45. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
  46. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
  47. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
  48. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
  49. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
  50. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  51. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
  52. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
  53. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
  54. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
  56. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
  57. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
  58. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
  59. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
  61. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  62. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  63. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  64. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  65. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
  66. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
  67. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  68. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
  69. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  70. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
  71. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
  84. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
  85. package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
  86. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
  87. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
  88. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
  89. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  90. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  91. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
  92. package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
  93. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  94. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  95. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  96. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  97. package/node_modules/@earendil-works/pi-tui/package.json +3 -5
  98. package/node_modules/@smithy/core/dist-cjs/index.js +3 -4
  99. package/node_modules/@smithy/core/dist-cjs/submodules/client/index.js +3 -11
  100. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.browser.js +2 -2
  101. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.js +2 -2
  102. package/node_modules/@smithy/core/dist-cjs/submodules/config/index.native.js +2 -2
  103. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.browser.js +9 -40
  104. package/node_modules/@smithy/core/dist-cjs/submodules/endpoints/index.js +9 -40
  105. package/node_modules/@smithy/core/dist-cjs/submodules/protocols/index.js +12 -142
  106. package/node_modules/@smithy/core/dist-cjs/submodules/schema/index.js +7 -9
  107. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.browser.js +2 -2
  108. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.js +2 -2
  109. package/node_modules/@smithy/core/dist-cjs/submodules/serde/index.native.js +2 -2
  110. package/node_modules/@smithy/core/dist-cjs/submodules/transport/index.js +184 -0
  111. package/node_modules/@smithy/core/dist-es/index.js +6 -6
  112. package/node_modules/@smithy/core/dist-es/submodules/client/index.js +2 -2
  113. package/node_modules/@smithy/core/dist-es/submodules/config/config-resolver/regionConfig/checkRegion.js +1 -1
  114. package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.browser.js +2 -2
  115. package/node_modules/@smithy/core/dist-es/submodules/endpoints/index.js +2 -2
  116. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.js +1 -1
  117. package/node_modules/@smithy/core/dist-es/submodules/endpoints/middleware-endpoint/resolveEndpointConfig.js +1 -1
  118. package/node_modules/@smithy/core/dist-es/submodules/endpoints/util-endpoints/lib/index.js +1 -1
  119. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpBindingProtocol.js +1 -1
  120. package/node_modules/@smithy/core/dist-es/submodules/protocols/HttpProtocol.js +1 -2
  121. package/node_modules/@smithy/core/dist-es/submodules/protocols/RpcProtocol.js +1 -1
  122. package/node_modules/@smithy/core/dist-es/submodules/protocols/index.js +5 -5
  123. package/node_modules/@smithy/core/dist-es/submodules/protocols/middleware-content-length/contentLengthMiddleware.js +1 -1
  124. package/node_modules/@smithy/core/dist-es/submodules/protocols/requestBuilder.js +1 -1
  125. package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaDeserializationMiddleware.js +3 -4
  126. package/node_modules/@smithy/core/dist-es/submodules/schema/middleware/schemaSerializationMiddleware.js +1 -2
  127. package/node_modules/@smithy/core/dist-es/submodules/serde/middleware-serde/deserializerMiddleware.js +1 -1
  128. package/node_modules/@smithy/core/dist-es/submodules/transport/index.js +9 -0
  129. package/node_modules/@smithy/core/dist-es/submodules/{protocols/url-parser → transport}/parseUrl.js +1 -1
  130. package/node_modules/@smithy/core/dist-es/submodules/{endpoints → transport}/toEndpointV1.js +1 -1
  131. package/node_modules/@smithy/core/dist-types/index.d.ts +10 -6
  132. package/node_modules/@smithy/core/dist-types/submodules/client/index.d.ts +2 -2
  133. package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.browser.d.ts +2 -2
  134. package/node_modules/@smithy/core/dist-types/submodules/endpoints/index.d.ts +2 -2
  135. package/node_modules/@smithy/core/dist-types/submodules/endpoints/middleware-endpoint/adaptors/toEndpointV1.d.ts +2 -2
  136. package/node_modules/@smithy/core/dist-types/submodules/endpoints/util-endpoints/lib/index.d.ts +1 -1
  137. package/node_modules/@smithy/core/dist-types/submodules/protocols/HttpBindingProtocol.d.ts +1 -1
  138. package/node_modules/@smithy/core/dist-types/submodules/protocols/index.d.ts +5 -5
  139. package/node_modules/@smithy/core/dist-types/submodules/protocols/protocol-http/httpHandler.d.ts +1 -2
  140. package/node_modules/@smithy/core/dist-types/submodules/protocols/requestBuilder.d.ts +1 -1
  141. package/node_modules/@smithy/core/dist-types/submodules/transport/index.d.ts +9 -0
  142. package/node_modules/@smithy/core/package.json +19 -10
  143. package/node_modules/@smithy/core/transport.d.ts +5 -0
  144. package/node_modules/@smithy/core/transport.js +5 -0
  145. package/node_modules/@smithy/credential-provider-imds/package.json +2 -2
  146. package/node_modules/@smithy/fetch-http-handler/package.json +2 -2
  147. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  148. package/node_modules/@smithy/signature-v4/package.json +2 -2
  149. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts +2 -2
  150. package/node_modules/lru-cache/dist/commonjs/browser/index.d.ts.map +1 -1
  151. package/node_modules/lru-cache/dist/commonjs/browser/index.js.map +1 -1
  152. package/node_modules/lru-cache/dist/commonjs/browser/index.min.js.map +1 -1
  153. package/node_modules/lru-cache/dist/commonjs/index.d.ts +2 -2
  154. package/node_modules/lru-cache/dist/commonjs/index.d.ts.map +1 -1
  155. package/node_modules/lru-cache/dist/commonjs/index.js.map +1 -1
  156. package/node_modules/lru-cache/dist/commonjs/index.min.js.map +1 -1
  157. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts +2 -2
  158. package/node_modules/lru-cache/dist/commonjs/node/index.d.ts.map +1 -1
  159. package/node_modules/lru-cache/dist/commonjs/node/index.js.map +1 -1
  160. package/node_modules/lru-cache/dist/commonjs/node/index.min.js.map +1 -1
  161. package/node_modules/lru-cache/dist/esm/browser/index.d.ts +2 -2
  162. package/node_modules/lru-cache/dist/esm/browser/index.d.ts.map +1 -1
  163. package/node_modules/lru-cache/dist/esm/browser/index.js.map +1 -1
  164. package/node_modules/lru-cache/dist/esm/browser/index.min.js.map +1 -1
  165. package/node_modules/lru-cache/dist/esm/index.d.ts +2 -2
  166. package/node_modules/lru-cache/dist/esm/index.d.ts.map +1 -1
  167. package/node_modules/lru-cache/dist/esm/index.js.map +1 -1
  168. package/node_modules/lru-cache/dist/esm/index.min.js.map +1 -1
  169. package/node_modules/lru-cache/dist/esm/node/index.d.ts +2 -2
  170. package/node_modules/lru-cache/dist/esm/node/index.d.ts.map +1 -1
  171. package/node_modules/lru-cache/dist/esm/node/index.js.map +1 -1
  172. package/node_modules/lru-cache/dist/esm/node/index.min.js.map +1 -1
  173. package/node_modules/lru-cache/package.json +1 -1
  174. package/package.json +6 -6
  175. package/slingshot/index.js +246 -244
  176. package/node_modules/@smithy/core/dist-cjs/getSmithyContext.js +0 -6
  177. package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -21
  178. package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/getHttpAuthSchemePlugin.js +0 -21
  179. package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/httpAuthSchemeMiddleware.js +0 -46
  180. package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/index.js +0 -6
  181. package/node_modules/@smithy/core/dist-cjs/middleware-http-auth-scheme/resolveAuthOptions.js +0 -24
  182. package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/getHttpSigningMiddleware.js +0 -19
  183. package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/httpSigningMiddleware.js +0 -27
  184. package/node_modules/@smithy/core/dist-cjs/middleware-http-signing/index.js +0 -5
  185. package/node_modules/@smithy/core/dist-cjs/normalizeProvider.js +0 -10
  186. package/node_modules/@smithy/core/dist-cjs/pagination/createPaginator.js +0 -44
  187. package/node_modules/@smithy/core/dist-cjs/request-builder/requestBuilder.js +0 -5
  188. package/node_modules/@smithy/core/dist-cjs/setFeature.js +0 -14
  189. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/DefaultIdentityProviderConfig.js +0 -18
  190. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpApiKeyAuth.js +0 -38
  191. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/httpBearerAuth.js +0 -15
  192. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/index.js +0 -6
  193. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/httpAuthSchemes/noAuth.js +0 -9
  194. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/index.js +0 -6
  195. package/node_modules/@smithy/core/dist-cjs/util-identity-and-auth/memoizeIdentityProvider.js +0 -61
  196. package/node_modules/@smithy/core/dist-es/request-builder/requestBuilder.js +0 -1
  197. package/node_modules/@smithy/core/dist-es/submodules/client/util-middleware/getSmithyContext.js +0 -2
  198. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/TestVectors.fixture.js +0 -146
  199. package/node_modules/@smithy/core/dist-es/submodules/event-streams/eventstream-codec/vectorTypes.fixture.js +0 -1
  200. package/node_modules/@smithy/core/dist-types/request-builder/requestBuilder.d.ts +0 -6
  201. package/node_modules/@smithy/core/dist-types/submodules/client/util-middleware/getSmithyContext.d.ts +0 -5
  202. package/node_modules/@smithy/core/dist-types/submodules/event-streams/eventstream-codec/TestVectors.fixture.d.ts +0 -2
  203. package/node_modules/@smithy/core/dist-types/submodules/event-streams/eventstream-codec/vectorTypes.fixture.d.ts +0 -12
  204. package/node_modules/@smithy/credential-provider-imds/dist-es/remoteProvider/index.js +0 -2
  205. package/node_modules/@smithy/credential-provider-imds/dist-types/remoteProvider/index.d.ts +0 -8
  206. package/node_modules/@smithy/signature-v4/dist-es/suite.fixture.js +0 -399
  207. package/node_modules/@smithy/signature-v4/dist-types/suite.fixture.d.ts +0 -14
  208. package/node_modules/koffi/CHANGELOG.md +0 -1093
  209. package/node_modules/koffi/LICENSE.txt +0 -22
  210. package/node_modules/koffi/README.md +0 -43
  211. package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
  212. package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
  213. package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
  214. package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
  215. package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
  216. package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
  217. package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
  218. package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
  219. package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
  220. package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
  221. package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
  222. package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
  223. package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
  224. package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
  225. package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
  226. package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
  227. package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
  228. package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
  229. package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
  230. package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
  231. package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
  232. package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
  233. package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
  234. package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
  235. package/node_modules/koffi/doc/benchmarks.md +0 -126
  236. package/node_modules/koffi/doc/callbacks.md +0 -210
  237. package/node_modules/koffi/doc/contribute.md +0 -148
  238. package/node_modules/koffi/doc/functions.md +0 -250
  239. package/node_modules/koffi/doc/index.md +0 -61
  240. package/node_modules/koffi/doc/input.md +0 -471
  241. package/node_modules/koffi/doc/migration.md +0 -159
  242. package/node_modules/koffi/doc/misc.md +0 -180
  243. package/node_modules/koffi/doc/output.md +0 -305
  244. package/node_modules/koffi/doc/packaging.md +0 -88
  245. package/node_modules/koffi/doc/platforms.md +0 -36
  246. package/node_modules/koffi/doc/pointers.md +0 -328
  247. package/node_modules/koffi/doc/start.md +0 -118
  248. package/node_modules/koffi/doc/unions.md +0 -186
  249. package/node_modules/koffi/doc/variables.md +0 -102
  250. package/node_modules/koffi/index.d.ts +0 -288
  251. package/node_modules/koffi/index.js +0 -634
  252. package/node_modules/koffi/indirect.js +0 -533
  253. package/node_modules/koffi/lib/native/base/base.cc +0 -11015
  254. package/node_modules/koffi/lib/native/base/base.hh +0 -6003
  255. package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
  256. package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
  257. package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
  258. package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
  259. package/node_modules/koffi/lib/native/base/tower.cc +0 -821
  260. package/node_modules/koffi/lib/native/base/tower.hh +0 -81
  261. package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
  262. package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
  263. package/node_modules/koffi/package.json +0 -38
  264. package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
  265. package/node_modules/koffi/src/cnoke/README.md +0 -99
  266. package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
  267. package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
  268. package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
  269. package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
  270. package/node_modules/koffi/src/cnoke/package.json +0 -24
  271. package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
  272. package/node_modules/koffi/src/cnoke/src/index.js +0 -10
  273. package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
  274. package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
  275. package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
  276. package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
  277. package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
  278. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
  279. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
  280. package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
  281. package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
  282. package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
  283. package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
  284. package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
  285. package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
  286. package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
  287. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
  288. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
  289. package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
  290. package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
  291. package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
  292. package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
  293. package/node_modules/koffi/src/koffi/src/call.hh +0 -179
  294. package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
  295. package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
  296. package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
  297. package/node_modules/koffi/src/koffi/src/init.js +0 -105
  298. package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
  299. package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
  300. package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
  301. package/node_modules/koffi/src/koffi/src/util.hh +0 -221
  302. package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
  303. package/node_modules/koffi/src/koffi/src/uv.def +0 -10
  304. package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
  305. package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
  306. package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
  307. package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
  308. package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
  309. package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
  310. package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
  311. package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
  312. package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
  313. package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
  314. package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
  315. package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
  316. package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
  317. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
  318. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
  319. package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
  320. package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
  321. package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
  322. package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
  323. package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
  324. package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
  325. package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
  326. package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
  327. package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
  328. package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
  329. package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
  330. package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
  331. package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
  332. package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
  333. package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
  334. package/node_modules/koffi/vendor/node-api-headers/include/uv.h +0 -1990
  335. /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemeEndpointRuleSetPlugin.js +0 -0
  336. /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemePlugin.js +0 -0
  337. /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/httpAuthSchemeMiddleware.js +0 -0
  338. /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/index.js +0 -0
  339. /package/node_modules/@smithy/core/dist-es/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/resolveAuthOptions.js +0 -0
  340. /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/getHttpSigningMiddleware.js +0 -0
  341. /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/httpSigningMiddleware.js +0 -0
  342. /package/node_modules/@smithy/core/dist-es/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/index.js +0 -0
  343. /package/node_modules/@smithy/core/dist-es/{pagination → legacy-root-exports/pagination}/createPaginator.js +0 -0
  344. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/DefaultIdentityProviderConfig.js +0 -0
  345. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpApiKeyAuth.js +0 -0
  346. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpBearerAuth.js +0 -0
  347. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/index.js +0 -0
  348. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/noAuth.js +0 -0
  349. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/index.js +0 -0
  350. /package/node_modules/@smithy/core/dist-es/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/memoizeIdentityProvider.js +0 -0
  351. /package/node_modules/@smithy/core/dist-es/{getSmithyContext.js → submodules/transport/getSmithyContext.js} +0 -0
  352. /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/httpRequest.js +0 -0
  353. /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/httpResponse.js +0 -0
  354. /package/node_modules/@smithy/core/dist-es/submodules/{endpoints/util-endpoints/lib → transport}/isValidHostLabel.js +0 -0
  355. /package/node_modules/@smithy/core/dist-es/submodules/{protocols/protocol-http → transport}/isValidHostname.js +0 -0
  356. /package/node_modules/@smithy/core/dist-es/submodules/{client/util-middleware → transport}/normalizeProvider.js +0 -0
  357. /package/node_modules/@smithy/core/dist-es/submodules/{protocols/querystring-parser → transport}/parseQueryString.js +0 -0
  358. /package/node_modules/@smithy/core/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemeEndpointRuleSetPlugin.d.ts +0 -0
  359. /package/node_modules/@smithy/core/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/getHttpAuthSchemePlugin.d.ts +0 -0
  360. /package/node_modules/@smithy/core/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/httpAuthSchemeMiddleware.d.ts +0 -0
  361. /package/node_modules/@smithy/core/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/index.d.ts +0 -0
  362. /package/node_modules/@smithy/core/dist-types/{middleware-http-auth-scheme → legacy-root-exports/middleware-http-auth-scheme}/resolveAuthOptions.d.ts +0 -0
  363. /package/node_modules/@smithy/core/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/getHttpSigningMiddleware.d.ts +0 -0
  364. /package/node_modules/@smithy/core/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/httpSigningMiddleware.d.ts +0 -0
  365. /package/node_modules/@smithy/core/dist-types/{middleware-http-signing → legacy-root-exports/middleware-http-signing}/index.d.ts +0 -0
  366. /package/node_modules/@smithy/core/dist-types/{pagination → legacy-root-exports/pagination}/createPaginator.d.ts +0 -0
  367. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/DefaultIdentityProviderConfig.d.ts +0 -0
  368. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpApiKeyAuth.d.ts +0 -0
  369. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/httpBearerAuth.d.ts +0 -0
  370. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/index.d.ts +0 -0
  371. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/httpAuthSchemes/noAuth.d.ts +0 -0
  372. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/index.d.ts +0 -0
  373. /package/node_modules/@smithy/core/dist-types/{util-identity-and-auth → legacy-root-exports/util-identity-and-auth}/memoizeIdentityProvider.d.ts +0 -0
  374. /package/node_modules/@smithy/core/dist-types/{getSmithyContext.d.ts → submodules/transport/getSmithyContext.d.ts} +0 -0
  375. /package/node_modules/@smithy/core/dist-types/submodules/{protocols/protocol-http → transport}/httpRequest.d.ts +0 -0
  376. /package/node_modules/@smithy/core/dist-types/submodules/{protocols/protocol-http → transport}/httpResponse.d.ts +0 -0
  377. /package/node_modules/@smithy/core/dist-types/submodules/{endpoints/util-endpoints/lib → transport}/isValidHostLabel.d.ts +0 -0
  378. /package/node_modules/@smithy/core/dist-types/submodules/{protocols/protocol-http → transport}/isValidHostname.d.ts +0 -0
  379. /package/node_modules/@smithy/core/dist-types/submodules/{client/util-middleware → transport}/normalizeProvider.d.ts +0 -0
  380. /package/node_modules/@smithy/core/dist-types/submodules/{protocols/querystring-parser → transport}/parseQueryString.d.ts +0 -0
  381. /package/node_modules/@smithy/core/dist-types/submodules/{protocols/url-parser → transport}/parseUrl.d.ts +0 -0
  382. /package/node_modules/@smithy/core/dist-types/submodules/{endpoints → transport}/toEndpointV1.d.ts +0 -0
@@ -1,521 +0,0 @@
1
- /*-
2
- * Copyright 2002 Niels Provos <provos@citi.umich.edu>
3
- * All rights reserved.
4
- *
5
- * Redistribution and use in source and binary forms, with or without
6
- * modification, are permitted provided that the following conditions
7
- * are met:
8
- * 1. Redistributions of source code must retain the above copyright
9
- * notice, this list of conditions and the following disclaimer.
10
- * 2. Redistributions in binary form must reproduce the above copyright
11
- * notice, this list of conditions and the following disclaimer in the
12
- * documentation and/or other materials provided with the distribution.
13
- *
14
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
- */
25
-
26
- #ifndef UV_TREE_H_
27
- #define UV_TREE_H_
28
-
29
- #ifndef UV__UNUSED
30
- # if __GNUC__
31
- # define UV__UNUSED __attribute__((unused))
32
- # else
33
- # define UV__UNUSED
34
- # endif
35
- #endif
36
-
37
- /*
38
- * This file defines data structures for red-black trees.
39
- * A red-black tree is a binary search tree with the node color as an
40
- * extra attribute. It fulfills a set of conditions:
41
- * - every search path from the root to a leaf consists of the
42
- * same number of black nodes,
43
- * - each red node (except for the root) has a black parent,
44
- * - each leaf node is black.
45
- *
46
- * Every operation on a red-black tree is bounded as O(lg n).
47
- * The maximum height of a red-black tree is 2lg (n+1).
48
- */
49
-
50
- /* Macros that define a red-black tree */
51
- #define RB_HEAD(name, type) \
52
- struct name { \
53
- struct type *rbh_root; /* root of the tree */ \
54
- }
55
-
56
- #define RB_INITIALIZER(root) \
57
- { NULL }
58
-
59
- #define RB_INIT(root) do { \
60
- (root)->rbh_root = NULL; \
61
- } while (/*CONSTCOND*/ 0)
62
-
63
- #define RB_BLACK 0
64
- #define RB_RED 1
65
- #define RB_ENTRY(type) \
66
- struct { \
67
- struct type *rbe_left; /* left element */ \
68
- struct type *rbe_right; /* right element */ \
69
- struct type *rbe_parent; /* parent element */ \
70
- int rbe_color; /* node color */ \
71
- }
72
-
73
- #define RB_LEFT(elm, field) (elm)->field.rbe_left
74
- #define RB_RIGHT(elm, field) (elm)->field.rbe_right
75
- #define RB_PARENT(elm, field) (elm)->field.rbe_parent
76
- #define RB_COLOR(elm, field) (elm)->field.rbe_color
77
- #define RB_ROOT(head) (head)->rbh_root
78
- #define RB_EMPTY(head) (RB_ROOT(head) == NULL)
79
-
80
- #define RB_SET(elm, parent, field) do { \
81
- RB_PARENT(elm, field) = parent; \
82
- RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \
83
- RB_COLOR(elm, field) = RB_RED; \
84
- } while (/*CONSTCOND*/ 0)
85
-
86
- #define RB_SET_BLACKRED(black, red, field) do { \
87
- RB_COLOR(black, field) = RB_BLACK; \
88
- RB_COLOR(red, field) = RB_RED; \
89
- } while (/*CONSTCOND*/ 0)
90
-
91
- #ifndef RB_AUGMENT
92
- #define RB_AUGMENT(x) do {} while (0)
93
- #endif
94
-
95
- #define RB_ROTATE_LEFT(head, elm, tmp, field) do { \
96
- (tmp) = RB_RIGHT(elm, field); \
97
- if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \
98
- RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \
99
- } \
100
- RB_AUGMENT(elm); \
101
- if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
102
- if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
103
- RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
104
- else \
105
- RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
106
- } else \
107
- (head)->rbh_root = (tmp); \
108
- RB_LEFT(tmp, field) = (elm); \
109
- RB_PARENT(elm, field) = (tmp); \
110
- RB_AUGMENT(tmp); \
111
- if ((RB_PARENT(tmp, field))) \
112
- RB_AUGMENT(RB_PARENT(tmp, field)); \
113
- } while (/*CONSTCOND*/ 0)
114
-
115
- #define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \
116
- (tmp) = RB_LEFT(elm, field); \
117
- if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \
118
- RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \
119
- } \
120
- RB_AUGMENT(elm); \
121
- if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \
122
- if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \
123
- RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \
124
- else \
125
- RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \
126
- } else \
127
- (head)->rbh_root = (tmp); \
128
- RB_RIGHT(tmp, field) = (elm); \
129
- RB_PARENT(elm, field) = (tmp); \
130
- RB_AUGMENT(tmp); \
131
- if ((RB_PARENT(tmp, field))) \
132
- RB_AUGMENT(RB_PARENT(tmp, field)); \
133
- } while (/*CONSTCOND*/ 0)
134
-
135
- /* Generates prototypes and inline functions */
136
- #define RB_PROTOTYPE(name, type, field, cmp) \
137
- RB_PROTOTYPE_INTERNAL(name, type, field, cmp,)
138
- #define RB_PROTOTYPE_STATIC(name, type, field, cmp) \
139
- RB_PROTOTYPE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
140
- #define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \
141
- attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \
142
- attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\
143
- attr struct type *name##_RB_REMOVE(struct name *, struct type *); \
144
- attr struct type *name##_RB_INSERT(struct name *, struct type *); \
145
- attr struct type *name##_RB_FIND(struct name *, struct type *); \
146
- attr struct type *name##_RB_NFIND(struct name *, struct type *); \
147
- attr struct type *name##_RB_NEXT(struct type *); \
148
- attr struct type *name##_RB_PREV(struct type *); \
149
- attr struct type *name##_RB_MINMAX(struct name *, int); \
150
- \
151
-
152
- /* Main rb operation.
153
- * Moves node close to the key of elm to top
154
- */
155
- #define RB_GENERATE(name, type, field, cmp) \
156
- RB_GENERATE_INTERNAL(name, type, field, cmp,)
157
- #define RB_GENERATE_STATIC(name, type, field, cmp) \
158
- RB_GENERATE_INTERNAL(name, type, field, cmp, UV__UNUSED static)
159
- #define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \
160
- attr void \
161
- name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \
162
- { \
163
- struct type *parent, *gparent, *tmp; \
164
- while ((parent = RB_PARENT(elm, field)) != NULL && \
165
- RB_COLOR(parent, field) == RB_RED) { \
166
- gparent = RB_PARENT(parent, field); \
167
- if (parent == RB_LEFT(gparent, field)) { \
168
- tmp = RB_RIGHT(gparent, field); \
169
- if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
170
- RB_COLOR(tmp, field) = RB_BLACK; \
171
- RB_SET_BLACKRED(parent, gparent, field); \
172
- elm = gparent; \
173
- continue; \
174
- } \
175
- if (RB_RIGHT(parent, field) == elm) { \
176
- RB_ROTATE_LEFT(head, parent, tmp, field); \
177
- tmp = parent; \
178
- parent = elm; \
179
- elm = tmp; \
180
- } \
181
- RB_SET_BLACKRED(parent, gparent, field); \
182
- RB_ROTATE_RIGHT(head, gparent, tmp, field); \
183
- } else { \
184
- tmp = RB_LEFT(gparent, field); \
185
- if (tmp && RB_COLOR(tmp, field) == RB_RED) { \
186
- RB_COLOR(tmp, field) = RB_BLACK; \
187
- RB_SET_BLACKRED(parent, gparent, field); \
188
- elm = gparent; \
189
- continue; \
190
- } \
191
- if (RB_LEFT(parent, field) == elm) { \
192
- RB_ROTATE_RIGHT(head, parent, tmp, field); \
193
- tmp = parent; \
194
- parent = elm; \
195
- elm = tmp; \
196
- } \
197
- RB_SET_BLACKRED(parent, gparent, field); \
198
- RB_ROTATE_LEFT(head, gparent, tmp, field); \
199
- } \
200
- } \
201
- RB_COLOR(head->rbh_root, field) = RB_BLACK; \
202
- } \
203
- \
204
- attr void \
205
- name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, \
206
- struct type *elm) \
207
- { \
208
- struct type *tmp; \
209
- while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \
210
- elm != RB_ROOT(head)) { \
211
- if (RB_LEFT(parent, field) == elm) { \
212
- tmp = RB_RIGHT(parent, field); \
213
- if (RB_COLOR(tmp, field) == RB_RED) { \
214
- RB_SET_BLACKRED(tmp, parent, field); \
215
- RB_ROTATE_LEFT(head, parent, tmp, field); \
216
- tmp = RB_RIGHT(parent, field); \
217
- } \
218
- if ((RB_LEFT(tmp, field) == NULL || \
219
- RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
220
- (RB_RIGHT(tmp, field) == NULL || \
221
- RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
222
- RB_COLOR(tmp, field) = RB_RED; \
223
- elm = parent; \
224
- parent = RB_PARENT(elm, field); \
225
- } else { \
226
- if (RB_RIGHT(tmp, field) == NULL || \
227
- RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) { \
228
- struct type *oleft; \
229
- if ((oleft = RB_LEFT(tmp, field)) \
230
- != NULL) \
231
- RB_COLOR(oleft, field) = RB_BLACK; \
232
- RB_COLOR(tmp, field) = RB_RED; \
233
- RB_ROTATE_RIGHT(head, tmp, oleft, field); \
234
- tmp = RB_RIGHT(parent, field); \
235
- } \
236
- RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
237
- RB_COLOR(parent, field) = RB_BLACK; \
238
- if (RB_RIGHT(tmp, field)) \
239
- RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK; \
240
- RB_ROTATE_LEFT(head, parent, tmp, field); \
241
- elm = RB_ROOT(head); \
242
- break; \
243
- } \
244
- } else { \
245
- tmp = RB_LEFT(parent, field); \
246
- if (RB_COLOR(tmp, field) == RB_RED) { \
247
- RB_SET_BLACKRED(tmp, parent, field); \
248
- RB_ROTATE_RIGHT(head, parent, tmp, field); \
249
- tmp = RB_LEFT(parent, field); \
250
- } \
251
- if ((RB_LEFT(tmp, field) == NULL || \
252
- RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) && \
253
- (RB_RIGHT(tmp, field) == NULL || \
254
- RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) { \
255
- RB_COLOR(tmp, field) = RB_RED; \
256
- elm = parent; \
257
- parent = RB_PARENT(elm, field); \
258
- } else { \
259
- if (RB_LEFT(tmp, field) == NULL || \
260
- RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) { \
261
- struct type *oright; \
262
- if ((oright = RB_RIGHT(tmp, field)) \
263
- != NULL) \
264
- RB_COLOR(oright, field) = RB_BLACK; \
265
- RB_COLOR(tmp, field) = RB_RED; \
266
- RB_ROTATE_LEFT(head, tmp, oright, field); \
267
- tmp = RB_LEFT(parent, field); \
268
- } \
269
- RB_COLOR(tmp, field) = RB_COLOR(parent, field); \
270
- RB_COLOR(parent, field) = RB_BLACK; \
271
- if (RB_LEFT(tmp, field)) \
272
- RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK; \
273
- RB_ROTATE_RIGHT(head, parent, tmp, field); \
274
- elm = RB_ROOT(head); \
275
- break; \
276
- } \
277
- } \
278
- } \
279
- if (elm) \
280
- RB_COLOR(elm, field) = RB_BLACK; \
281
- } \
282
- \
283
- attr struct type * \
284
- name##_RB_REMOVE(struct name *head, struct type *elm) \
285
- { \
286
- struct type *child, *parent, *old = elm; \
287
- int color; \
288
- if (RB_LEFT(elm, field) == NULL) \
289
- child = RB_RIGHT(elm, field); \
290
- else if (RB_RIGHT(elm, field) == NULL) \
291
- child = RB_LEFT(elm, field); \
292
- else { \
293
- struct type *left; \
294
- elm = RB_RIGHT(elm, field); \
295
- while ((left = RB_LEFT(elm, field)) != NULL) \
296
- elm = left; \
297
- child = RB_RIGHT(elm, field); \
298
- parent = RB_PARENT(elm, field); \
299
- color = RB_COLOR(elm, field); \
300
- if (child) \
301
- RB_PARENT(child, field) = parent; \
302
- if (parent) { \
303
- if (RB_LEFT(parent, field) == elm) \
304
- RB_LEFT(parent, field) = child; \
305
- else \
306
- RB_RIGHT(parent, field) = child; \
307
- RB_AUGMENT(parent); \
308
- } else \
309
- RB_ROOT(head) = child; \
310
- if (RB_PARENT(elm, field) == old) \
311
- parent = elm; \
312
- (elm)->field = (old)->field; \
313
- if (RB_PARENT(old, field)) { \
314
- if (RB_LEFT(RB_PARENT(old, field), field) == old) \
315
- RB_LEFT(RB_PARENT(old, field), field) = elm; \
316
- else \
317
- RB_RIGHT(RB_PARENT(old, field), field) = elm; \
318
- RB_AUGMENT(RB_PARENT(old, field)); \
319
- } else \
320
- RB_ROOT(head) = elm; \
321
- RB_PARENT(RB_LEFT(old, field), field) = elm; \
322
- if (RB_RIGHT(old, field)) \
323
- RB_PARENT(RB_RIGHT(old, field), field) = elm; \
324
- if (parent) { \
325
- left = parent; \
326
- do { \
327
- RB_AUGMENT(left); \
328
- } while ((left = RB_PARENT(left, field)) != NULL); \
329
- } \
330
- goto color; \
331
- } \
332
- parent = RB_PARENT(elm, field); \
333
- color = RB_COLOR(elm, field); \
334
- if (child) \
335
- RB_PARENT(child, field) = parent; \
336
- if (parent) { \
337
- if (RB_LEFT(parent, field) == elm) \
338
- RB_LEFT(parent, field) = child; \
339
- else \
340
- RB_RIGHT(parent, field) = child; \
341
- RB_AUGMENT(parent); \
342
- } else \
343
- RB_ROOT(head) = child; \
344
- color: \
345
- if (color == RB_BLACK) \
346
- name##_RB_REMOVE_COLOR(head, parent, child); \
347
- return (old); \
348
- } \
349
- \
350
- /* Inserts a node into the RB tree */ \
351
- attr struct type * \
352
- name##_RB_INSERT(struct name *head, struct type *elm) \
353
- { \
354
- struct type *tmp; \
355
- struct type *parent = NULL; \
356
- int comp = 0; \
357
- tmp = RB_ROOT(head); \
358
- while (tmp) { \
359
- parent = tmp; \
360
- comp = (cmp)(elm, parent); \
361
- if (comp < 0) \
362
- tmp = RB_LEFT(tmp, field); \
363
- else if (comp > 0) \
364
- tmp = RB_RIGHT(tmp, field); \
365
- else \
366
- return (tmp); \
367
- } \
368
- RB_SET(elm, parent, field); \
369
- if (parent != NULL) { \
370
- if (comp < 0) \
371
- RB_LEFT(parent, field) = elm; \
372
- else \
373
- RB_RIGHT(parent, field) = elm; \
374
- RB_AUGMENT(parent); \
375
- } else \
376
- RB_ROOT(head) = elm; \
377
- name##_RB_INSERT_COLOR(head, elm); \
378
- return (NULL); \
379
- } \
380
- \
381
- /* Finds the node with the same key as elm */ \
382
- attr struct type * \
383
- name##_RB_FIND(struct name *head, struct type *elm) \
384
- { \
385
- struct type *tmp = RB_ROOT(head); \
386
- int comp; \
387
- while (tmp) { \
388
- comp = cmp(elm, tmp); \
389
- if (comp < 0) \
390
- tmp = RB_LEFT(tmp, field); \
391
- else if (comp > 0) \
392
- tmp = RB_RIGHT(tmp, field); \
393
- else \
394
- return (tmp); \
395
- } \
396
- return (NULL); \
397
- } \
398
- \
399
- /* Finds the first node greater than or equal to the search key */ \
400
- attr struct type * \
401
- name##_RB_NFIND(struct name *head, struct type *elm) \
402
- { \
403
- struct type *tmp = RB_ROOT(head); \
404
- struct type *res = NULL; \
405
- int comp; \
406
- while (tmp) { \
407
- comp = cmp(elm, tmp); \
408
- if (comp < 0) { \
409
- res = tmp; \
410
- tmp = RB_LEFT(tmp, field); \
411
- } \
412
- else if (comp > 0) \
413
- tmp = RB_RIGHT(tmp, field); \
414
- else \
415
- return (tmp); \
416
- } \
417
- return (res); \
418
- } \
419
- \
420
- /* ARGSUSED */ \
421
- attr struct type * \
422
- name##_RB_NEXT(struct type *elm) \
423
- { \
424
- if (RB_RIGHT(elm, field)) { \
425
- elm = RB_RIGHT(elm, field); \
426
- while (RB_LEFT(elm, field)) \
427
- elm = RB_LEFT(elm, field); \
428
- } else { \
429
- if (RB_PARENT(elm, field) && \
430
- (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
431
- elm = RB_PARENT(elm, field); \
432
- else { \
433
- while (RB_PARENT(elm, field) && \
434
- (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \
435
- elm = RB_PARENT(elm, field); \
436
- elm = RB_PARENT(elm, field); \
437
- } \
438
- } \
439
- return (elm); \
440
- } \
441
- \
442
- /* ARGSUSED */ \
443
- attr struct type * \
444
- name##_RB_PREV(struct type *elm) \
445
- { \
446
- if (RB_LEFT(elm, field)) { \
447
- elm = RB_LEFT(elm, field); \
448
- while (RB_RIGHT(elm, field)) \
449
- elm = RB_RIGHT(elm, field); \
450
- } else { \
451
- if (RB_PARENT(elm, field) && \
452
- (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \
453
- elm = RB_PARENT(elm, field); \
454
- else { \
455
- while (RB_PARENT(elm, field) && \
456
- (elm == RB_LEFT(RB_PARENT(elm, field), field))) \
457
- elm = RB_PARENT(elm, field); \
458
- elm = RB_PARENT(elm, field); \
459
- } \
460
- } \
461
- return (elm); \
462
- } \
463
- \
464
- attr struct type * \
465
- name##_RB_MINMAX(struct name *head, int val) \
466
- { \
467
- struct type *tmp = RB_ROOT(head); \
468
- struct type *parent = NULL; \
469
- while (tmp) { \
470
- parent = tmp; \
471
- if (val < 0) \
472
- tmp = RB_LEFT(tmp, field); \
473
- else \
474
- tmp = RB_RIGHT(tmp, field); \
475
- } \
476
- return (parent); \
477
- }
478
-
479
- #define RB_NEGINF -1
480
- #define RB_INF 1
481
-
482
- #define RB_INSERT(name, x, y) name##_RB_INSERT(x, y)
483
- #define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y)
484
- #define RB_FIND(name, x, y) name##_RB_FIND(x, y)
485
- #define RB_NFIND(name, x, y) name##_RB_NFIND(x, y)
486
- #define RB_NEXT(name, x) name##_RB_NEXT(x)
487
- #define RB_PREV(name, x) name##_RB_PREV(x)
488
- #define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF)
489
- #define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF)
490
-
491
- #define RB_FOREACH(x, name, head) \
492
- for ((x) = RB_MIN(name, head); \
493
- (x) != NULL; \
494
- (x) = name##_RB_NEXT(x))
495
-
496
- #define RB_FOREACH_FROM(x, name, y) \
497
- for ((x) = (y); \
498
- ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
499
- (x) = (y))
500
-
501
- #define RB_FOREACH_SAFE(x, name, head, y) \
502
- for ((x) = RB_MIN(name, head); \
503
- ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \
504
- (x) = (y))
505
-
506
- #define RB_FOREACH_REVERSE(x, name, head) \
507
- for ((x) = RB_MAX(name, head); \
508
- (x) != NULL; \
509
- (x) = name##_RB_PREV(x))
510
-
511
- #define RB_FOREACH_REVERSE_FROM(x, name, y) \
512
- for ((x) = (y); \
513
- ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
514
- (x) = (y))
515
-
516
- #define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \
517
- for ((x) = RB_MAX(name, head); \
518
- ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \
519
- (x) = (y))
520
-
521
- #endif /* UV_TREE_H_ */