slidge-whatsapp 0.2.5__cp312-cp312-manylinux_2_36_aarch64.whl → 0.2.7__cp312-cp312-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.
- slidge_whatsapp/config.py +3 -0
- slidge_whatsapp/event.go +31 -26
- slidge_whatsapp/gateway.go +13 -9
- slidge_whatsapp/gateway.py +2 -2
- slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.h +183 -183
- slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +148 -148
- slidge_whatsapp/generated/whatsapp.c +1490 -1490
- slidge_whatsapp/generated/whatsapp.go +1217 -1217
- slidge_whatsapp/generated/whatsapp.py +1210 -1210
- slidge_whatsapp/generated/whatsapp_go.h +183 -183
- slidge_whatsapp/go.mod +15 -12
- slidge_whatsapp/go.sum +35 -29
- slidge_whatsapp/media/media.go +21 -11
- slidge_whatsapp/session.go +73 -66
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn.go +4 -4
- slidge_whatsapp/vendor/github.com/ebitengine/purego/dlfcn_darwin.go +0 -5
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/go_libinit.go +3 -0
- slidge_whatsapp/vendor/github.com/ebitengine/purego/internal/fakecgo/symbols.go +40 -20
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +14 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +2 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/fun.go +10 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_unix.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/lib_windows.go +1 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -7
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/callback.go +2 -1
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +8510 -5090
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +344 -150
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3.go +57 -23
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.c +4 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_unlock_notify.go +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/.gitignore +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/LICENSE +202 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/README.md +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_gccgo.go +26 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.c +23 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.3.go +22 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.go +35 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.4.s +18 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.go +28 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_go1.5.s +44 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/goid_slow.go +24 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_gccgo_go1.8.go +17 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +38 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.5.go +57 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.6.go +43 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.9.go +37 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/CONTRIBUTING.md +43 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/README.md +31 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/console.go +20 -5
- slidge_whatsapp/vendor/github.com/rs/zerolog/log/log.go +131 -0
- slidge_whatsapp/vendor/github.com/rs/zerolog/log.go +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/sampler.go +4 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/writer.go +9 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupCipher.go +17 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/GroupSessionBuilder.go +17 -7
- slidge_whatsapp/vendor/go.mau.fi/libsignal/groups/state/store/SenderKeyStore.go +4 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/chain/ChainKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/keys/identity/IdentityKey.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/libsignal/logger/DefaultLogger.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/FingerprintProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/LocalStorageProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/serialize/WhisperTextProtocol.pb.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/Session.go +41 -17
- slidge_whatsapp/vendor/go.mau.fi/libsignal/session/SessionCipher.go +64 -30
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/IdentityKeyStore.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/MessageKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/PreKeyStore.go +6 -4
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SessionStore.go +8 -6
- slidge_whatsapp/vendor/go.mau.fi/libsignal/state/store/SignedPreKeyStore.go +7 -5
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/connlog.go +257 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/database.go +309 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/iter.go +233 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/json.go +47 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/log.go +129 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/massinsert.go +164 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/queryhelper.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/reflectscan.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/transaction.go +180 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgrades.go +250 -0
- slidge_whatsapp/vendor/go.mau.fi/util/dbutil/upgradetable.go +331 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/dualerror.go +33 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exerrors/must.go +23 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/cors.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +64 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +36 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/middleware.go +30 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +37 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +76 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +88 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/returnonce.go +25 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/ringbuffer.go +139 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncmap.go +94 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/syncset.go +136 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/callermarshal.go +28 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/defaults.go +32 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/generics.go +45 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exzerolog/writer.go +81 -0
- slidge_whatsapp/vendor/go.mau.fi/util/ptr/ptr.go +43 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +27 -26
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/encode.go +4 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/keys.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +27 -25
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +40 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/broadcast.go +5 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +119 -37
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +29 -11
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +63 -30
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +74 -34
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +61 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +188 -152
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaconn.go +5 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/mediaretry.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +444 -135
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +118 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +78 -42
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +7 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair.go +42 -18
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/prekeys.go +9 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/privacysettings.go +10 -11
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.pb.go +983 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.proto +85 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.pb.go +197 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.proto +13 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.pb.go +279 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.proto +21 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.pb.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.proto +10 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.pb.go +313 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.proto +27 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.pb.go +1299 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.proto +112 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.pb.go +514 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.proto +47 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.pb.go +123 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.proto +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.pb.go +720 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.proto +59 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.pb.go +365 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.proto +33 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.pb.go +1238 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.proto +105 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.go +354 -175
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.proto +5 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +170 -15
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.go +29 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.go +13 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.go +344 -31
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.proto +26 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.pb.go → WACompanionReg.pb.go} +184 -89
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/{WAWebProtobufsCompanionReg.proto → WACompanionReg.proto} +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.go +173 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.go +78 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.proto +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +7428 -2151
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +373 -44
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +456 -135
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +14 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.pb.go +198 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.proto +14 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.go +162 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.go +32 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.proto +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.go +192 -52
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.go +60 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.go +39 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.go +61 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +800 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +72 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1344 -438
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +52 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.go +27 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.go +59 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +382 -78
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +563 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +25 -9
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingfields.json +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingtoken.go +176 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +39 -21
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +261 -75
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +28 -16
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +3 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +85 -43
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/signal.go +75 -88
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +86 -65
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/lidmap.go +186 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +291 -167
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +155 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/03-message-secrets.sql +11 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/04-privacy-tokens.sql +8 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/05-account-jid-format.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/06-facebook-uuid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/07-account-lid.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/08-lid-mapping.sql +5 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/09-decryption-buffer.sql +10 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/10-chat-db-lid-migration-ts.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/upgrades.go +22 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +107 -56
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/botmap.go +210 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/group.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +7 -8
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +18 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/update.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/upload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +47 -29
- slidge_whatsapp/vendor/golang.org/x/exp/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/exp/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/exp/constraints/constraints.go +54 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/guts.go +50 -0
- slidge_whatsapp/vendor/golang.org/x/net/http/httpguts/httplex.go +347 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/.gitignore +2 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/ciphers.go +641 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/client_conn_pool.go +311 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +122 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +61 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/databuffer.go +149 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/errors.go +145 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/flow.go +120 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +1702 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +170 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/encode.go +245 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/hpack.go +523 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/huffman.go +226 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/static_table.go +188 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/hpack/tables.go +403 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +432 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/pipe.go +184 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +3350 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +20 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +3287 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/unencrypted.go +32 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/write.go +381 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched.go +251 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_priority.go +451 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_random.go +77 -0
- slidge_whatsapp/vendor/golang.org/x/net/http2/writesched_roundrobin.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/go118.go +13 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna10.0.0.go +769 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/idna9.0.0.go +717 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/pre_go118.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/punycode.go +217 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables10.0.0.go +4559 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables11.0.0.go +4653 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables12.0.0.go +4733 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables13.0.0.go +4959 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables15.0.0.go +5144 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/tables9.0.0.go +4486 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie.go +51 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie12.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trie13.0.0.go +30 -0
- slidge_whatsapp/vendor/golang.org/x/net/idna/trieval.go +119 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/ascii.go +53 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/headermap.go +115 -0
- slidge_whatsapp/vendor/golang.org/x/net/internal/httpcommon/request.go +467 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +148 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_linux.go +16 -26
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +84 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +20 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/security_windows.go +44 -5
- slidge_whatsapp/vendor/golang.org/x/sys/windows/syscall_windows.go +4 -2
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +239 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +9 -0
- slidge_whatsapp/vendor/golang.org/x/text/LICENSE +27 -0
- slidge_whatsapp/vendor/golang.org/x/text/PATENTS +22 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule.go +336 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule10.0.0.go +11 -0
- slidge_whatsapp/vendor/golang.org/x/text/secure/bidirule/bidirule9.0.0.go +14 -0
- slidge_whatsapp/vendor/golang.org/x/text/transform/transform.go +709 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bidi.go +359 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/bracket.go +335 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/core.go +1071 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/prop.go +206 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables10.0.0.go +1815 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables11.0.0.go +1887 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables12.0.0.go +1923 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables13.0.0.go +1955 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables15.0.0.go +2042 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/tables9.0.0.go +1781 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/bidi/trieval.go +48 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/composition.go +512 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/forminfo.go +279 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/input.go +109 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/iter.go +458 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/normalize.go +610 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/readwriter.go +125 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables10.0.0.go +7657 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables11.0.0.go +7693 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables12.0.0.go +7710 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables13.0.0.go +7760 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables15.0.0.go +7907 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/tables9.0.0.go +7637 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/transform.go +88 -0
- slidge_whatsapp/vendor/golang.org/x/text/unicode/norm/trie.go +54 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +3 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +16 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe_go121.go → strings_unsafe.go} +0 -2
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/proto/merge.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +2 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe_go121.go → value_unsafe.go} +0 -2
- slidge_whatsapp/vendor/modules.txt +52 -13
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/METADATA +1 -1
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/RECORD +330 -184
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/WHEEL +1 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/CNAME +0 -1
- slidge_whatsapp/vendor/github.com/rs/zerolog/_config.yml +0 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waAdv/WAAdv.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloApplication/WAArmadilloApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCert/WACert.pb.raw +0 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waChatLockSettings/WAProtobufsChatLockSettings.pb.raw +0 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCommon/WACommon.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WAWebProtobufsCompanionReg.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waConsumerApplication/WAConsumerApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waDeviceCapabilities/WAProtobufsDeviceCapabilities.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMediaTransport/WAMediaTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMmsRetry/WAMmsRetry.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgApplication/WAMsgApplication.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/WAMsgTransport.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMultiDevice/WAMultiDevice.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waServerSync/WAServerSync.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waUserPassword/WAProtobufsUserPassword.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waVnameCert/WAWebProtobufsVnameCert.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.raw +0 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +0 -296
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go +0 -94
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go +0 -98
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/LICENSE +0 -0
- {slidge_whatsapp-0.2.5.dist-info → slidge_whatsapp-0.2.7.dist-info}/entry_points.txt +0 -0
|
@@ -1074,6 +1074,7 @@ const (
|
|
|
1074
1074
|
IP_ADD_MEMBERSHIP = 0xc
|
|
1075
1075
|
IP_DROP_MEMBERSHIP = 0xd
|
|
1076
1076
|
IP_PKTINFO = 0x13
|
|
1077
|
+
IP_MTU_DISCOVER = 0x47
|
|
1077
1078
|
|
|
1078
1079
|
IPV6_V6ONLY = 0x1b
|
|
1079
1080
|
IPV6_UNICAST_HOPS = 0x4
|
|
@@ -1083,6 +1084,7 @@ const (
|
|
|
1083
1084
|
IPV6_JOIN_GROUP = 0xc
|
|
1084
1085
|
IPV6_LEAVE_GROUP = 0xd
|
|
1085
1086
|
IPV6_PKTINFO = 0x13
|
|
1087
|
+
IPV6_MTU_DISCOVER = 0x47
|
|
1086
1088
|
|
|
1087
1089
|
MSG_OOB = 0x1
|
|
1088
1090
|
MSG_PEEK = 0x2
|
|
@@ -1132,6 +1134,15 @@ const (
|
|
|
1132
1134
|
WSASYS_STATUS_LEN = 128
|
|
1133
1135
|
)
|
|
1134
1136
|
|
|
1137
|
+
// enum PMTUD_STATE from ws2ipdef.h
|
|
1138
|
+
const (
|
|
1139
|
+
IP_PMTUDISC_NOT_SET = 0
|
|
1140
|
+
IP_PMTUDISC_DO = 1
|
|
1141
|
+
IP_PMTUDISC_DONT = 2
|
|
1142
|
+
IP_PMTUDISC_PROBE = 3
|
|
1143
|
+
IP_PMTUDISC_MAX = 4
|
|
1144
|
+
)
|
|
1145
|
+
|
|
1135
1146
|
type WSABuf struct {
|
|
1136
1147
|
Len uint32
|
|
1137
1148
|
Buf *byte
|
|
@@ -1146,6 +1157,22 @@ type WSAMsg struct {
|
|
|
1146
1157
|
Flags uint32
|
|
1147
1158
|
}
|
|
1148
1159
|
|
|
1160
|
+
type WSACMSGHDR struct {
|
|
1161
|
+
Len uintptr
|
|
1162
|
+
Level int32
|
|
1163
|
+
Type int32
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
type IN_PKTINFO struct {
|
|
1167
|
+
Addr [4]byte
|
|
1168
|
+
Ifindex uint32
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
type IN6_PKTINFO struct {
|
|
1172
|
+
Addr [16]byte
|
|
1173
|
+
Ifindex uint32
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1149
1176
|
// Flags for WSASocket
|
|
1150
1177
|
const (
|
|
1151
1178
|
WSA_FLAG_OVERLAPPED = 0x01
|
|
@@ -2673,6 +2700,8 @@ type CommTimeouts struct {
|
|
|
2673
2700
|
|
|
2674
2701
|
// NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING.
|
|
2675
2702
|
type NTUnicodeString struct {
|
|
2703
|
+
// Note: Length and MaximumLength are in *bytes*, not uint16s.
|
|
2704
|
+
// They should always be even.
|
|
2676
2705
|
Length uint16
|
|
2677
2706
|
MaximumLength uint16
|
|
2678
2707
|
Buffer *uint16
|
|
@@ -3601,3 +3630,213 @@ const (
|
|
|
3601
3630
|
KLF_NOTELLSHELL = 0x00000080
|
|
3602
3631
|
KLF_SETFORPROCESS = 0x00000100
|
|
3603
3632
|
)
|
|
3633
|
+
|
|
3634
|
+
// Virtual Key codes
|
|
3635
|
+
// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
|
|
3636
|
+
const (
|
|
3637
|
+
VK_LBUTTON = 0x01
|
|
3638
|
+
VK_RBUTTON = 0x02
|
|
3639
|
+
VK_CANCEL = 0x03
|
|
3640
|
+
VK_MBUTTON = 0x04
|
|
3641
|
+
VK_XBUTTON1 = 0x05
|
|
3642
|
+
VK_XBUTTON2 = 0x06
|
|
3643
|
+
VK_BACK = 0x08
|
|
3644
|
+
VK_TAB = 0x09
|
|
3645
|
+
VK_CLEAR = 0x0C
|
|
3646
|
+
VK_RETURN = 0x0D
|
|
3647
|
+
VK_SHIFT = 0x10
|
|
3648
|
+
VK_CONTROL = 0x11
|
|
3649
|
+
VK_MENU = 0x12
|
|
3650
|
+
VK_PAUSE = 0x13
|
|
3651
|
+
VK_CAPITAL = 0x14
|
|
3652
|
+
VK_KANA = 0x15
|
|
3653
|
+
VK_HANGEUL = 0x15
|
|
3654
|
+
VK_HANGUL = 0x15
|
|
3655
|
+
VK_IME_ON = 0x16
|
|
3656
|
+
VK_JUNJA = 0x17
|
|
3657
|
+
VK_FINAL = 0x18
|
|
3658
|
+
VK_HANJA = 0x19
|
|
3659
|
+
VK_KANJI = 0x19
|
|
3660
|
+
VK_IME_OFF = 0x1A
|
|
3661
|
+
VK_ESCAPE = 0x1B
|
|
3662
|
+
VK_CONVERT = 0x1C
|
|
3663
|
+
VK_NONCONVERT = 0x1D
|
|
3664
|
+
VK_ACCEPT = 0x1E
|
|
3665
|
+
VK_MODECHANGE = 0x1F
|
|
3666
|
+
VK_SPACE = 0x20
|
|
3667
|
+
VK_PRIOR = 0x21
|
|
3668
|
+
VK_NEXT = 0x22
|
|
3669
|
+
VK_END = 0x23
|
|
3670
|
+
VK_HOME = 0x24
|
|
3671
|
+
VK_LEFT = 0x25
|
|
3672
|
+
VK_UP = 0x26
|
|
3673
|
+
VK_RIGHT = 0x27
|
|
3674
|
+
VK_DOWN = 0x28
|
|
3675
|
+
VK_SELECT = 0x29
|
|
3676
|
+
VK_PRINT = 0x2A
|
|
3677
|
+
VK_EXECUTE = 0x2B
|
|
3678
|
+
VK_SNAPSHOT = 0x2C
|
|
3679
|
+
VK_INSERT = 0x2D
|
|
3680
|
+
VK_DELETE = 0x2E
|
|
3681
|
+
VK_HELP = 0x2F
|
|
3682
|
+
VK_LWIN = 0x5B
|
|
3683
|
+
VK_RWIN = 0x5C
|
|
3684
|
+
VK_APPS = 0x5D
|
|
3685
|
+
VK_SLEEP = 0x5F
|
|
3686
|
+
VK_NUMPAD0 = 0x60
|
|
3687
|
+
VK_NUMPAD1 = 0x61
|
|
3688
|
+
VK_NUMPAD2 = 0x62
|
|
3689
|
+
VK_NUMPAD3 = 0x63
|
|
3690
|
+
VK_NUMPAD4 = 0x64
|
|
3691
|
+
VK_NUMPAD5 = 0x65
|
|
3692
|
+
VK_NUMPAD6 = 0x66
|
|
3693
|
+
VK_NUMPAD7 = 0x67
|
|
3694
|
+
VK_NUMPAD8 = 0x68
|
|
3695
|
+
VK_NUMPAD9 = 0x69
|
|
3696
|
+
VK_MULTIPLY = 0x6A
|
|
3697
|
+
VK_ADD = 0x6B
|
|
3698
|
+
VK_SEPARATOR = 0x6C
|
|
3699
|
+
VK_SUBTRACT = 0x6D
|
|
3700
|
+
VK_DECIMAL = 0x6E
|
|
3701
|
+
VK_DIVIDE = 0x6F
|
|
3702
|
+
VK_F1 = 0x70
|
|
3703
|
+
VK_F2 = 0x71
|
|
3704
|
+
VK_F3 = 0x72
|
|
3705
|
+
VK_F4 = 0x73
|
|
3706
|
+
VK_F5 = 0x74
|
|
3707
|
+
VK_F6 = 0x75
|
|
3708
|
+
VK_F7 = 0x76
|
|
3709
|
+
VK_F8 = 0x77
|
|
3710
|
+
VK_F9 = 0x78
|
|
3711
|
+
VK_F10 = 0x79
|
|
3712
|
+
VK_F11 = 0x7A
|
|
3713
|
+
VK_F12 = 0x7B
|
|
3714
|
+
VK_F13 = 0x7C
|
|
3715
|
+
VK_F14 = 0x7D
|
|
3716
|
+
VK_F15 = 0x7E
|
|
3717
|
+
VK_F16 = 0x7F
|
|
3718
|
+
VK_F17 = 0x80
|
|
3719
|
+
VK_F18 = 0x81
|
|
3720
|
+
VK_F19 = 0x82
|
|
3721
|
+
VK_F20 = 0x83
|
|
3722
|
+
VK_F21 = 0x84
|
|
3723
|
+
VK_F22 = 0x85
|
|
3724
|
+
VK_F23 = 0x86
|
|
3725
|
+
VK_F24 = 0x87
|
|
3726
|
+
VK_NUMLOCK = 0x90
|
|
3727
|
+
VK_SCROLL = 0x91
|
|
3728
|
+
VK_OEM_NEC_EQUAL = 0x92
|
|
3729
|
+
VK_OEM_FJ_JISHO = 0x92
|
|
3730
|
+
VK_OEM_FJ_MASSHOU = 0x93
|
|
3731
|
+
VK_OEM_FJ_TOUROKU = 0x94
|
|
3732
|
+
VK_OEM_FJ_LOYA = 0x95
|
|
3733
|
+
VK_OEM_FJ_ROYA = 0x96
|
|
3734
|
+
VK_LSHIFT = 0xA0
|
|
3735
|
+
VK_RSHIFT = 0xA1
|
|
3736
|
+
VK_LCONTROL = 0xA2
|
|
3737
|
+
VK_RCONTROL = 0xA3
|
|
3738
|
+
VK_LMENU = 0xA4
|
|
3739
|
+
VK_RMENU = 0xA5
|
|
3740
|
+
VK_BROWSER_BACK = 0xA6
|
|
3741
|
+
VK_BROWSER_FORWARD = 0xA7
|
|
3742
|
+
VK_BROWSER_REFRESH = 0xA8
|
|
3743
|
+
VK_BROWSER_STOP = 0xA9
|
|
3744
|
+
VK_BROWSER_SEARCH = 0xAA
|
|
3745
|
+
VK_BROWSER_FAVORITES = 0xAB
|
|
3746
|
+
VK_BROWSER_HOME = 0xAC
|
|
3747
|
+
VK_VOLUME_MUTE = 0xAD
|
|
3748
|
+
VK_VOLUME_DOWN = 0xAE
|
|
3749
|
+
VK_VOLUME_UP = 0xAF
|
|
3750
|
+
VK_MEDIA_NEXT_TRACK = 0xB0
|
|
3751
|
+
VK_MEDIA_PREV_TRACK = 0xB1
|
|
3752
|
+
VK_MEDIA_STOP = 0xB2
|
|
3753
|
+
VK_MEDIA_PLAY_PAUSE = 0xB3
|
|
3754
|
+
VK_LAUNCH_MAIL = 0xB4
|
|
3755
|
+
VK_LAUNCH_MEDIA_SELECT = 0xB5
|
|
3756
|
+
VK_LAUNCH_APP1 = 0xB6
|
|
3757
|
+
VK_LAUNCH_APP2 = 0xB7
|
|
3758
|
+
VK_OEM_1 = 0xBA
|
|
3759
|
+
VK_OEM_PLUS = 0xBB
|
|
3760
|
+
VK_OEM_COMMA = 0xBC
|
|
3761
|
+
VK_OEM_MINUS = 0xBD
|
|
3762
|
+
VK_OEM_PERIOD = 0xBE
|
|
3763
|
+
VK_OEM_2 = 0xBF
|
|
3764
|
+
VK_OEM_3 = 0xC0
|
|
3765
|
+
VK_OEM_4 = 0xDB
|
|
3766
|
+
VK_OEM_5 = 0xDC
|
|
3767
|
+
VK_OEM_6 = 0xDD
|
|
3768
|
+
VK_OEM_7 = 0xDE
|
|
3769
|
+
VK_OEM_8 = 0xDF
|
|
3770
|
+
VK_OEM_AX = 0xE1
|
|
3771
|
+
VK_OEM_102 = 0xE2
|
|
3772
|
+
VK_ICO_HELP = 0xE3
|
|
3773
|
+
VK_ICO_00 = 0xE4
|
|
3774
|
+
VK_PROCESSKEY = 0xE5
|
|
3775
|
+
VK_ICO_CLEAR = 0xE6
|
|
3776
|
+
VK_OEM_RESET = 0xE9
|
|
3777
|
+
VK_OEM_JUMP = 0xEA
|
|
3778
|
+
VK_OEM_PA1 = 0xEB
|
|
3779
|
+
VK_OEM_PA2 = 0xEC
|
|
3780
|
+
VK_OEM_PA3 = 0xED
|
|
3781
|
+
VK_OEM_WSCTRL = 0xEE
|
|
3782
|
+
VK_OEM_CUSEL = 0xEF
|
|
3783
|
+
VK_OEM_ATTN = 0xF0
|
|
3784
|
+
VK_OEM_FINISH = 0xF1
|
|
3785
|
+
VK_OEM_COPY = 0xF2
|
|
3786
|
+
VK_OEM_AUTO = 0xF3
|
|
3787
|
+
VK_OEM_ENLW = 0xF4
|
|
3788
|
+
VK_OEM_BACKTAB = 0xF5
|
|
3789
|
+
VK_ATTN = 0xF6
|
|
3790
|
+
VK_CRSEL = 0xF7
|
|
3791
|
+
VK_EXSEL = 0xF8
|
|
3792
|
+
VK_EREOF = 0xF9
|
|
3793
|
+
VK_PLAY = 0xFA
|
|
3794
|
+
VK_ZOOM = 0xFB
|
|
3795
|
+
VK_NONAME = 0xFC
|
|
3796
|
+
VK_PA1 = 0xFD
|
|
3797
|
+
VK_OEM_CLEAR = 0xFE
|
|
3798
|
+
)
|
|
3799
|
+
|
|
3800
|
+
// Mouse button constants.
|
|
3801
|
+
// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str
|
|
3802
|
+
const (
|
|
3803
|
+
FROM_LEFT_1ST_BUTTON_PRESSED = 0x0001
|
|
3804
|
+
RIGHTMOST_BUTTON_PRESSED = 0x0002
|
|
3805
|
+
FROM_LEFT_2ND_BUTTON_PRESSED = 0x0004
|
|
3806
|
+
FROM_LEFT_3RD_BUTTON_PRESSED = 0x0008
|
|
3807
|
+
FROM_LEFT_4TH_BUTTON_PRESSED = 0x0010
|
|
3808
|
+
)
|
|
3809
|
+
|
|
3810
|
+
// Control key state constaints.
|
|
3811
|
+
// https://docs.microsoft.com/en-us/windows/console/key-event-record-str
|
|
3812
|
+
// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str
|
|
3813
|
+
const (
|
|
3814
|
+
CAPSLOCK_ON = 0x0080
|
|
3815
|
+
ENHANCED_KEY = 0x0100
|
|
3816
|
+
LEFT_ALT_PRESSED = 0x0002
|
|
3817
|
+
LEFT_CTRL_PRESSED = 0x0008
|
|
3818
|
+
NUMLOCK_ON = 0x0020
|
|
3819
|
+
RIGHT_ALT_PRESSED = 0x0001
|
|
3820
|
+
RIGHT_CTRL_PRESSED = 0x0004
|
|
3821
|
+
SCROLLLOCK_ON = 0x0040
|
|
3822
|
+
SHIFT_PRESSED = 0x0010
|
|
3823
|
+
)
|
|
3824
|
+
|
|
3825
|
+
// Mouse event record event flags.
|
|
3826
|
+
// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str
|
|
3827
|
+
const (
|
|
3828
|
+
MOUSE_MOVED = 0x0001
|
|
3829
|
+
DOUBLE_CLICK = 0x0002
|
|
3830
|
+
MOUSE_WHEELED = 0x0004
|
|
3831
|
+
MOUSE_HWHEELED = 0x0008
|
|
3832
|
+
)
|
|
3833
|
+
|
|
3834
|
+
// Input Record Event Types
|
|
3835
|
+
// https://learn.microsoft.com/en-us/windows/console/input-record-str
|
|
3836
|
+
const (
|
|
3837
|
+
FOCUS_EVENT = 0x0010
|
|
3838
|
+
KEY_EVENT = 0x0001
|
|
3839
|
+
MENU_EVENT = 0x0008
|
|
3840
|
+
MOUSE_EVENT = 0x0002
|
|
3841
|
+
WINDOW_BUFFER_SIZE_EVENT = 0x0004
|
|
3842
|
+
)
|
|
@@ -511,6 +511,7 @@ var (
|
|
|
511
511
|
procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW")
|
|
512
512
|
procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW")
|
|
513
513
|
procWSACleanup = modws2_32.NewProc("WSACleanup")
|
|
514
|
+
procWSADuplicateSocketW = modws2_32.NewProc("WSADuplicateSocketW")
|
|
514
515
|
procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW")
|
|
515
516
|
procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult")
|
|
516
517
|
procWSAIoctl = modws2_32.NewProc("WSAIoctl")
|
|
@@ -4391,6 +4392,14 @@ func WSACleanup() (err error) {
|
|
|
4391
4392
|
return
|
|
4392
4393
|
}
|
|
4393
4394
|
|
|
4395
|
+
func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) {
|
|
4396
|
+
r1, _, e1 := syscall.Syscall(procWSADuplicateSocketW.Addr(), 3, uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info)))
|
|
4397
|
+
if r1 != 0 {
|
|
4398
|
+
err = errnoErr(e1)
|
|
4399
|
+
}
|
|
4400
|
+
return
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4394
4403
|
func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) {
|
|
4395
4404
|
r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength)))
|
|
4396
4405
|
n = int32(r0)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Copyright 2009 The Go Authors.
|
|
2
|
+
|
|
3
|
+
Redistribution and use in source and binary forms, with or without
|
|
4
|
+
modification, are permitted provided that the following conditions are
|
|
5
|
+
met:
|
|
6
|
+
|
|
7
|
+
* Redistributions of source code must retain the above copyright
|
|
8
|
+
notice, this list of conditions and the following disclaimer.
|
|
9
|
+
* Redistributions in binary form must reproduce the above
|
|
10
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
11
|
+
in the documentation and/or other materials provided with the
|
|
12
|
+
distribution.
|
|
13
|
+
* Neither the name of Google LLC nor the names of its
|
|
14
|
+
contributors may be used to endorse or promote products derived from
|
|
15
|
+
this software without specific prior written permission.
|
|
16
|
+
|
|
17
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Additional IP Rights Grant (Patents)
|
|
2
|
+
|
|
3
|
+
"This implementation" means the copyrightable works distributed by
|
|
4
|
+
Google as part of the Go project.
|
|
5
|
+
|
|
6
|
+
Google hereby grants to You a perpetual, worldwide, non-exclusive,
|
|
7
|
+
no-charge, royalty-free, irrevocable (except as stated in this section)
|
|
8
|
+
patent license to make, have made, use, offer to sell, sell, import,
|
|
9
|
+
transfer and otherwise run, modify and propagate the contents of this
|
|
10
|
+
implementation of Go, where such license applies only to those patent
|
|
11
|
+
claims, both currently owned or controlled by Google and acquired in
|
|
12
|
+
the future, licensable by Google that are necessarily infringed by this
|
|
13
|
+
implementation of Go. This grant does not include claims that would be
|
|
14
|
+
infringed only as a consequence of further modification of this
|
|
15
|
+
implementation. If you or your agent or exclusive licensee institute or
|
|
16
|
+
order or agree to the institution of patent litigation against any
|
|
17
|
+
entity (including a cross-claim or counterclaim in a lawsuit) alleging
|
|
18
|
+
that this implementation of Go or any code incorporated within this
|
|
19
|
+
implementation of Go constitutes direct or contributory patent
|
|
20
|
+
infringement, or inducement of patent infringement, then any patent
|
|
21
|
+
rights granted to you under this License for this implementation of Go
|
|
22
|
+
shall terminate as of the date such litigation is filed.
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
// Copyright 2016 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
// Package bidirule implements the Bidi Rule defined by RFC 5893.
|
|
6
|
+
//
|
|
7
|
+
// This package is under development. The API may change without notice and
|
|
8
|
+
// without preserving backward compatibility.
|
|
9
|
+
package bidirule
|
|
10
|
+
|
|
11
|
+
import (
|
|
12
|
+
"errors"
|
|
13
|
+
"unicode/utf8"
|
|
14
|
+
|
|
15
|
+
"golang.org/x/text/transform"
|
|
16
|
+
"golang.org/x/text/unicode/bidi"
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
// This file contains an implementation of RFC 5893: Right-to-Left Scripts for
|
|
20
|
+
// Internationalized Domain Names for Applications (IDNA)
|
|
21
|
+
//
|
|
22
|
+
// A label is an individual component of a domain name. Labels are usually
|
|
23
|
+
// shown separated by dots; for example, the domain name "www.example.com" is
|
|
24
|
+
// composed of three labels: "www", "example", and "com".
|
|
25
|
+
//
|
|
26
|
+
// An RTL label is a label that contains at least one character of class R, AL,
|
|
27
|
+
// or AN. An LTR label is any label that is not an RTL label.
|
|
28
|
+
//
|
|
29
|
+
// A "Bidi domain name" is a domain name that contains at least one RTL label.
|
|
30
|
+
//
|
|
31
|
+
// The following guarantees can be made based on the above:
|
|
32
|
+
//
|
|
33
|
+
// o In a domain name consisting of only labels that satisfy the rule,
|
|
34
|
+
// the requirements of Section 3 are satisfied. Note that even LTR
|
|
35
|
+
// labels and pure ASCII labels have to be tested.
|
|
36
|
+
//
|
|
37
|
+
// o In a domain name consisting of only LDH labels (as defined in the
|
|
38
|
+
// Definitions document [RFC5890]) and labels that satisfy the rule,
|
|
39
|
+
// the requirements of Section 3 are satisfied as long as a label
|
|
40
|
+
// that starts with an ASCII digit does not come after a
|
|
41
|
+
// right-to-left label.
|
|
42
|
+
//
|
|
43
|
+
// No guarantee is given for other combinations.
|
|
44
|
+
|
|
45
|
+
// ErrInvalid indicates a label is invalid according to the Bidi Rule.
|
|
46
|
+
var ErrInvalid = errors.New("bidirule: failed Bidi Rule")
|
|
47
|
+
|
|
48
|
+
type ruleState uint8
|
|
49
|
+
|
|
50
|
+
const (
|
|
51
|
+
ruleInitial ruleState = iota
|
|
52
|
+
ruleLTR
|
|
53
|
+
ruleLTRFinal
|
|
54
|
+
ruleRTL
|
|
55
|
+
ruleRTLFinal
|
|
56
|
+
ruleInvalid
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
type ruleTransition struct {
|
|
60
|
+
next ruleState
|
|
61
|
+
mask uint16
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
var transitions = [...][2]ruleTransition{
|
|
65
|
+
// [2.1] The first character must be a character with Bidi property L, R, or
|
|
66
|
+
// AL. If it has the R or AL property, it is an RTL label; if it has the L
|
|
67
|
+
// property, it is an LTR label.
|
|
68
|
+
ruleInitial: {
|
|
69
|
+
{ruleLTRFinal, 1 << bidi.L},
|
|
70
|
+
{ruleRTLFinal, 1<<bidi.R | 1<<bidi.AL},
|
|
71
|
+
},
|
|
72
|
+
ruleRTL: {
|
|
73
|
+
// [2.3] In an RTL label, the end of the label must be a character with
|
|
74
|
+
// Bidi property R, AL, EN, or AN, followed by zero or more characters
|
|
75
|
+
// with Bidi property NSM.
|
|
76
|
+
{ruleRTLFinal, 1<<bidi.R | 1<<bidi.AL | 1<<bidi.EN | 1<<bidi.AN},
|
|
77
|
+
|
|
78
|
+
// [2.2] In an RTL label, only characters with the Bidi properties R,
|
|
79
|
+
// AL, AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
|
|
80
|
+
// We exclude the entries from [2.3]
|
|
81
|
+
{ruleRTL, 1<<bidi.ES | 1<<bidi.CS | 1<<bidi.ET | 1<<bidi.ON | 1<<bidi.BN | 1<<bidi.NSM},
|
|
82
|
+
},
|
|
83
|
+
ruleRTLFinal: {
|
|
84
|
+
// [2.3] In an RTL label, the end of the label must be a character with
|
|
85
|
+
// Bidi property R, AL, EN, or AN, followed by zero or more characters
|
|
86
|
+
// with Bidi property NSM.
|
|
87
|
+
{ruleRTLFinal, 1<<bidi.R | 1<<bidi.AL | 1<<bidi.EN | 1<<bidi.AN | 1<<bidi.NSM},
|
|
88
|
+
|
|
89
|
+
// [2.2] In an RTL label, only characters with the Bidi properties R,
|
|
90
|
+
// AL, AN, EN, ES, CS, ET, ON, BN, or NSM are allowed.
|
|
91
|
+
// We exclude the entries from [2.3] and NSM.
|
|
92
|
+
{ruleRTL, 1<<bidi.ES | 1<<bidi.CS | 1<<bidi.ET | 1<<bidi.ON | 1<<bidi.BN},
|
|
93
|
+
},
|
|
94
|
+
ruleLTR: {
|
|
95
|
+
// [2.6] In an LTR label, the end of the label must be a character with
|
|
96
|
+
// Bidi property L or EN, followed by zero or more characters with Bidi
|
|
97
|
+
// property NSM.
|
|
98
|
+
{ruleLTRFinal, 1<<bidi.L | 1<<bidi.EN},
|
|
99
|
+
|
|
100
|
+
// [2.5] In an LTR label, only characters with the Bidi properties L,
|
|
101
|
+
// EN, ES, CS, ET, ON, BN, or NSM are allowed.
|
|
102
|
+
// We exclude the entries from [2.6].
|
|
103
|
+
{ruleLTR, 1<<bidi.ES | 1<<bidi.CS | 1<<bidi.ET | 1<<bidi.ON | 1<<bidi.BN | 1<<bidi.NSM},
|
|
104
|
+
},
|
|
105
|
+
ruleLTRFinal: {
|
|
106
|
+
// [2.6] In an LTR label, the end of the label must be a character with
|
|
107
|
+
// Bidi property L or EN, followed by zero or more characters with Bidi
|
|
108
|
+
// property NSM.
|
|
109
|
+
{ruleLTRFinal, 1<<bidi.L | 1<<bidi.EN | 1<<bidi.NSM},
|
|
110
|
+
|
|
111
|
+
// [2.5] In an LTR label, only characters with the Bidi properties L,
|
|
112
|
+
// EN, ES, CS, ET, ON, BN, or NSM are allowed.
|
|
113
|
+
// We exclude the entries from [2.6].
|
|
114
|
+
{ruleLTR, 1<<bidi.ES | 1<<bidi.CS | 1<<bidi.ET | 1<<bidi.ON | 1<<bidi.BN},
|
|
115
|
+
},
|
|
116
|
+
ruleInvalid: {
|
|
117
|
+
{ruleInvalid, 0},
|
|
118
|
+
{ruleInvalid, 0},
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// [2.4] In an RTL label, if an EN is present, no AN may be present, and
|
|
123
|
+
// vice versa.
|
|
124
|
+
const exclusiveRTL = uint16(1<<bidi.EN | 1<<bidi.AN)
|
|
125
|
+
|
|
126
|
+
// From RFC 5893
|
|
127
|
+
// An RTL label is a label that contains at least one character of type
|
|
128
|
+
// R, AL, or AN.
|
|
129
|
+
//
|
|
130
|
+
// An LTR label is any label that is not an RTL label.
|
|
131
|
+
|
|
132
|
+
// Direction reports the direction of the given label as defined by RFC 5893.
|
|
133
|
+
// The Bidi Rule does not have to be applied to labels of the category
|
|
134
|
+
// LeftToRight.
|
|
135
|
+
func Direction(b []byte) bidi.Direction {
|
|
136
|
+
for i := 0; i < len(b); {
|
|
137
|
+
e, sz := bidi.Lookup(b[i:])
|
|
138
|
+
if sz == 0 {
|
|
139
|
+
i++
|
|
140
|
+
}
|
|
141
|
+
c := e.Class()
|
|
142
|
+
if c == bidi.R || c == bidi.AL || c == bidi.AN {
|
|
143
|
+
return bidi.RightToLeft
|
|
144
|
+
}
|
|
145
|
+
i += sz
|
|
146
|
+
}
|
|
147
|
+
return bidi.LeftToRight
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// DirectionString reports the direction of the given label as defined by RFC
|
|
151
|
+
// 5893. The Bidi Rule does not have to be applied to labels of the category
|
|
152
|
+
// LeftToRight.
|
|
153
|
+
func DirectionString(s string) bidi.Direction {
|
|
154
|
+
for i := 0; i < len(s); {
|
|
155
|
+
e, sz := bidi.LookupString(s[i:])
|
|
156
|
+
if sz == 0 {
|
|
157
|
+
i++
|
|
158
|
+
continue
|
|
159
|
+
}
|
|
160
|
+
c := e.Class()
|
|
161
|
+
if c == bidi.R || c == bidi.AL || c == bidi.AN {
|
|
162
|
+
return bidi.RightToLeft
|
|
163
|
+
}
|
|
164
|
+
i += sz
|
|
165
|
+
}
|
|
166
|
+
return bidi.LeftToRight
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// Valid reports whether b conforms to the BiDi rule.
|
|
170
|
+
func Valid(b []byte) bool {
|
|
171
|
+
var t Transformer
|
|
172
|
+
if n, ok := t.advance(b); !ok || n < len(b) {
|
|
173
|
+
return false
|
|
174
|
+
}
|
|
175
|
+
return t.isFinal()
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// ValidString reports whether s conforms to the BiDi rule.
|
|
179
|
+
func ValidString(s string) bool {
|
|
180
|
+
var t Transformer
|
|
181
|
+
if n, ok := t.advanceString(s); !ok || n < len(s) {
|
|
182
|
+
return false
|
|
183
|
+
}
|
|
184
|
+
return t.isFinal()
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// New returns a Transformer that verifies that input adheres to the Bidi Rule.
|
|
188
|
+
func New() *Transformer {
|
|
189
|
+
return &Transformer{}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// Transformer implements transform.Transform.
|
|
193
|
+
type Transformer struct {
|
|
194
|
+
state ruleState
|
|
195
|
+
hasRTL bool
|
|
196
|
+
seen uint16
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// A rule can only be violated for "Bidi Domain names", meaning if one of the
|
|
200
|
+
// following categories has been observed.
|
|
201
|
+
func (t *Transformer) isRTL() bool {
|
|
202
|
+
const isRTL = 1<<bidi.R | 1<<bidi.AL | 1<<bidi.AN
|
|
203
|
+
return t.seen&isRTL != 0
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Reset implements transform.Transformer.
|
|
207
|
+
func (t *Transformer) Reset() { *t = Transformer{} }
|
|
208
|
+
|
|
209
|
+
// Transform implements transform.Transformer. This Transformer has state and
|
|
210
|
+
// needs to be reset between uses.
|
|
211
|
+
func (t *Transformer) Transform(dst, src []byte, atEOF bool) (nDst, nSrc int, err error) {
|
|
212
|
+
if len(dst) < len(src) {
|
|
213
|
+
src = src[:len(dst)]
|
|
214
|
+
atEOF = false
|
|
215
|
+
err = transform.ErrShortDst
|
|
216
|
+
}
|
|
217
|
+
n, err1 := t.Span(src, atEOF)
|
|
218
|
+
copy(dst, src[:n])
|
|
219
|
+
if err == nil || err1 != nil && err1 != transform.ErrShortSrc {
|
|
220
|
+
err = err1
|
|
221
|
+
}
|
|
222
|
+
return n, n, err
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// Span returns the first n bytes of src that conform to the Bidi rule.
|
|
226
|
+
func (t *Transformer) Span(src []byte, atEOF bool) (n int, err error) {
|
|
227
|
+
if t.state == ruleInvalid && t.isRTL() {
|
|
228
|
+
return 0, ErrInvalid
|
|
229
|
+
}
|
|
230
|
+
n, ok := t.advance(src)
|
|
231
|
+
switch {
|
|
232
|
+
case !ok:
|
|
233
|
+
err = ErrInvalid
|
|
234
|
+
case n < len(src):
|
|
235
|
+
if !atEOF {
|
|
236
|
+
err = transform.ErrShortSrc
|
|
237
|
+
break
|
|
238
|
+
}
|
|
239
|
+
err = ErrInvalid
|
|
240
|
+
case !t.isFinal():
|
|
241
|
+
err = ErrInvalid
|
|
242
|
+
}
|
|
243
|
+
return n, err
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Precomputing the ASCII values decreases running time for the ASCII fast path
|
|
247
|
+
// by about 30%.
|
|
248
|
+
var asciiTable [128]bidi.Properties
|
|
249
|
+
|
|
250
|
+
func init() {
|
|
251
|
+
for i := range asciiTable {
|
|
252
|
+
p, _ := bidi.LookupRune(rune(i))
|
|
253
|
+
asciiTable[i] = p
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
func (t *Transformer) advance(s []byte) (n int, ok bool) {
|
|
258
|
+
var e bidi.Properties
|
|
259
|
+
var sz int
|
|
260
|
+
for n < len(s) {
|
|
261
|
+
if s[n] < utf8.RuneSelf {
|
|
262
|
+
e, sz = asciiTable[s[n]], 1
|
|
263
|
+
} else {
|
|
264
|
+
e, sz = bidi.Lookup(s[n:])
|
|
265
|
+
if sz <= 1 {
|
|
266
|
+
if sz == 1 {
|
|
267
|
+
// We always consider invalid UTF-8 to be invalid, even if
|
|
268
|
+
// the string has not yet been determined to be RTL.
|
|
269
|
+
// TODO: is this correct?
|
|
270
|
+
return n, false
|
|
271
|
+
}
|
|
272
|
+
return n, true // incomplete UTF-8 encoding
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
// TODO: using CompactClass would result in noticeable speedup.
|
|
276
|
+
// See unicode/bidi/prop.go:Properties.CompactClass.
|
|
277
|
+
c := uint16(1 << e.Class())
|
|
278
|
+
t.seen |= c
|
|
279
|
+
if t.seen&exclusiveRTL == exclusiveRTL {
|
|
280
|
+
t.state = ruleInvalid
|
|
281
|
+
return n, false
|
|
282
|
+
}
|
|
283
|
+
switch tr := transitions[t.state]; {
|
|
284
|
+
case tr[0].mask&c != 0:
|
|
285
|
+
t.state = tr[0].next
|
|
286
|
+
case tr[1].mask&c != 0:
|
|
287
|
+
t.state = tr[1].next
|
|
288
|
+
default:
|
|
289
|
+
t.state = ruleInvalid
|
|
290
|
+
if t.isRTL() {
|
|
291
|
+
return n, false
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
n += sz
|
|
295
|
+
}
|
|
296
|
+
return n, true
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
func (t *Transformer) advanceString(s string) (n int, ok bool) {
|
|
300
|
+
var e bidi.Properties
|
|
301
|
+
var sz int
|
|
302
|
+
for n < len(s) {
|
|
303
|
+
if s[n] < utf8.RuneSelf {
|
|
304
|
+
e, sz = asciiTable[s[n]], 1
|
|
305
|
+
} else {
|
|
306
|
+
e, sz = bidi.LookupString(s[n:])
|
|
307
|
+
if sz <= 1 {
|
|
308
|
+
if sz == 1 {
|
|
309
|
+
return n, false // invalid UTF-8
|
|
310
|
+
}
|
|
311
|
+
return n, true // incomplete UTF-8 encoding
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// TODO: using CompactClass results in noticeable speedup.
|
|
315
|
+
// See unicode/bidi/prop.go:Properties.CompactClass.
|
|
316
|
+
c := uint16(1 << e.Class())
|
|
317
|
+
t.seen |= c
|
|
318
|
+
if t.seen&exclusiveRTL == exclusiveRTL {
|
|
319
|
+
t.state = ruleInvalid
|
|
320
|
+
return n, false
|
|
321
|
+
}
|
|
322
|
+
switch tr := transitions[t.state]; {
|
|
323
|
+
case tr[0].mask&c != 0:
|
|
324
|
+
t.state = tr[0].next
|
|
325
|
+
case tr[1].mask&c != 0:
|
|
326
|
+
t.state = tr[1].next
|
|
327
|
+
default:
|
|
328
|
+
t.state = ruleInvalid
|
|
329
|
+
if t.isRTL() {
|
|
330
|
+
return n, false
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
n += sz
|
|
334
|
+
}
|
|
335
|
+
return n, true
|
|
336
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Copyright 2016 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build go1.10
|
|
6
|
+
|
|
7
|
+
package bidirule
|
|
8
|
+
|
|
9
|
+
func (t *Transformer) isFinal() bool {
|
|
10
|
+
return t.state == ruleLTRFinal || t.state == ruleRTLFinal || t.state == ruleInitial
|
|
11
|
+
}
|