From eea2a27e895a8f45c6dc0ee64bb48464e70a6366 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Thu, 31 Aug 2017 18:20:50 -0300 Subject: [PATCH] Cleanup --- .gitignore | 3 +- Changelog | 7 + Gopkg.lock | 26 +- Gopkg.toml | 4 +- Makefile | 15 +- main.go => pkg/cmd/main.go | 104 +- keepalived.go => pkg/controller/keepalived.go | 12 +- controller.go => pkg/controller/main.go | 165 +- utils.go => pkg/controller/utils.go | 218 +- utils_test.go => pkg/controller/utils_test.go | 2 +- pkg/k8s/main.go | 135 + pkg/k8s/main_test.go | 359 ++ pkg/store/main.go | 51 + pkg/task/main.go | 141 + pkg/task/main_test.go | 133 + Dockerfile => rootfs/Dockerfile | 9 +- .../etc/keepalived/keepalived.conf | 0 haproxy-check.sh => rootfs/haproxy-check.sh | 0 haproxy.cfg => rootfs/haproxy.cfg | 0 haproxy.tmpl => rootfs/haproxy.tmpl | 0 keepalived.tmpl => rootfs/keepalived.tmpl | 4 +- vendor/github.com/golang/protobuf/.travis.yml | 1 + .../googleapis/gnostic/apps/disco/README.md | 33 + .../mailru/easyjson/easyjson/main.go | 7 +- .../mailru/easyjson/gen/generator.go | 8 +- .../mailru/easyjson/parser/parser_windows.go | 7 +- .../github.com/ugorji/go/codec/codec_test.go | 15 + vendor/github.com/ugorji/go/codec/json.go | 35 +- vendor/github.com/ugorji/go/codec/prebuild.sh | 4 +- vendor/github.com/ugorji/go/codec/test.py | 6 +- vendor/golang.org/x/crypto/sha3/sha3.go | 5 +- vendor/golang.org/x/net/http2/transport.go | 190 +- .../golang.org/x/net/http2/transport_test.go | 368 +- vendor/golang.org/x/sys/unix/creds_test.go | 183 +- vendor/golang.org/x/sys/unix/linux/types.go | 55 + vendor/golang.org/x/sys/unix/mkerrors.sh | 4 + vendor/golang.org/x/sys/unix/syscall_linux.go | 14 +- .../x/sys/unix/zerrors_linux_386.go | 20 + .../x/sys/unix/zerrors_linux_amd64.go | 20 + .../x/sys/unix/zerrors_linux_arm.go | 20 + .../x/sys/unix/zerrors_linux_arm64.go | 20 + .../x/sys/unix/zerrors_linux_mips.go | 20 + .../x/sys/unix/zerrors_linux_mips64.go | 20 + .../x/sys/unix/zerrors_linux_mips64le.go | 20 + .../x/sys/unix/zerrors_linux_mipsle.go | 20 + .../x/sys/unix/zerrors_linux_ppc64.go | 20 + .../x/sys/unix/zerrors_linux_ppc64le.go | 20 + .../x/sys/unix/zerrors_linux_s390x.go | 20 + .../golang.org/x/sys/unix/ztypes_linux_386.go | 101 + .../x/sys/unix/ztypes_linux_amd64.go | 101 + .../golang.org/x/sys/unix/ztypes_linux_arm.go | 101 + .../x/sys/unix/ztypes_linux_arm64.go | 101 + .../x/sys/unix/ztypes_linux_mips.go | 101 + .../x/sys/unix/ztypes_linux_mips64.go | 101 + .../x/sys/unix/ztypes_linux_mips64le.go | 101 + .../x/sys/unix/ztypes_linux_mipsle.go | 101 + .../x/sys/unix/ztypes_linux_ppc64.go | 101 + .../x/sys/unix/ztypes_linux_ppc64le.go | 101 + .../x/sys/unix/ztypes_linux_s390x.go | 101 + .../x/text/encoding/htmlindex/htmlindex.go | 2 +- .../x/text/feature/plural/example_test.go | 46 + .../x/text/feature/plural/message.go | 238 + .../x/text/feature/plural/message_test.go | 197 + .../x/text/feature/plural/plural.go | 34 +- .../x/text/feature/plural/plural_test.go | 17 +- .../x/text/internal/catmsg/catmsg.go | 2 +- .../x/text/internal/catmsg/catmsg_test.go | 26 +- .../x/text/internal/catmsg/codec.go | 2 +- .../x/text/internal/number/decimal.go | 188 +- .../x/text/internal/number/decimal_test.go | 47 +- .../x/text/internal/number/format.go | 130 +- .../x/text/internal/number/format_test.go | 62 +- .../x/text/internal/number/pattern.go | 73 +- .../x/text/internal/number/pattern_test.go | 330 +- .../x/text/internal/number/tables.go | 362 +- .../golang.org/x/text/language/data_test.go | 425 -- vendor/golang.org/x/text/language/doc.go | 102 + .../x/text/language/examples_test.go | 21 +- vendor/golang.org/x/text/language/gen.go | 43 +- vendor/golang.org/x/text/language/index.go | 1022 ++-- vendor/golang.org/x/text/language/language.go | 97 +- vendor/golang.org/x/text/language/match.go | 304 +- .../golang.org/x/text/language/match_test.go | 247 +- vendor/golang.org/x/text/language/tables.go | 5061 +++++++++-------- ...cherTest.txt => CLDRLocaleMatcherTest.txt} | 0 .../language/testdata/GoLocaleMatcherTest.txt | 226 + vendor/golang.org/x/text/message/doc.go | 95 + .../x/text/message/examples_test.go | 42 + vendor/golang.org/x/text/message/fmt_test.go | 14 +- vendor/golang.org/x/text/message/message.go | 10 +- vendor/golang.org/x/text/message/print.go | 34 +- .../kubernetes/api/openapi-spec/swagger.json | 2 +- .../google/heapster-controller.yaml | 16 +- .../heapster-controller-combined.yaml | 16 +- .../influxdb/heapster-controller.yaml | 16 +- .../stackdriver/heapster-controller.yaml | 12 +- .../standalone/heapster-controller.yaml | 12 +- .../kubernetes/cluster/gce/config-test.sh | 2 +- vendor/k8s.io/kubernetes/cluster/gce/util.sh | 2 +- .../kubernetes/cluster/log-dump/log-dump.sh | 5 + .../cmd/kube-controller-manager/app/BUILD | 1 + .../app/controllermanager.go | 6 +- .../cmd/kube-controller-manager/app/core.go | 6 +- .../federation/apis/openapi-spec/swagger.json | 2 +- .../k8s.io/kubernetes/hack/.linted_packages | 1 + .../cloudprovider/providers/azure/azure.go | 93 +- .../providers/vsphere/vsphere.go | 7 +- .../pkg/controller/namespace/deletion/BUILD | 1 + .../deletion/namespaced_resources_deleter.go | 6 +- .../statefulset/stateful_pod_control_test.go | 28 - .../statefulset/stateful_set_utils.go | 16 +- .../statefulset/stateful_set_utils_test.go | 28 - .../cache/actual_state_of_world.go | 17 - .../cache/actual_state_of_world_test.go | 83 - .../attachdetach/reconciler/reconciler.go | 5 + .../statusupdater/node_status_updater.go | 4 +- .../pkg/credentialprovider/azure/BUILD | 2 - .../azure/azure_credentials.go | 48 +- .../azure/azure_credentials_test.go | 3 +- .../kubernetes/pkg/kubelet/dockershim/exec.go | 24 +- .../libdocker/kube_docker_client.go | 10 + vendor/k8s.io/kubernetes/pkg/version/base.go | 2 +- .../pkg/volume/flexvolume/unmounter.go | 20 +- .../kubernetes/pkg/volume/scaleio/BUILD | 1 + .../pkg/volume/scaleio/sio_client.go | 9 +- .../kubernetes/pkg/volume/scaleio/sio_mgr.go | 9 +- .../pkg/volume/scaleio/sio_mgr_test.go | 23 +- .../pkg/volume/scaleio/sio_plugin.go | 1 + .../kubernetes/pkg/volume/scaleio/sio_util.go | 20 +- .../pkg/volume/scaleio/sio_util_test.go | 4 +- .../pkg/volume/scaleio/sio_volume.go | 78 +- .../pkg/volume/scaleio/sio_volume_test.go | 114 +- .../pkg/util/strategicpatch/patch.go | 2 +- .../pkg/util/strategicpatch/patch_test.go | 78 +- .../pkg/registry/generic/registry/store.go | 105 +- .../registry/generic/registry/store_test.go | 220 +- .../client-go/discovery/discovery_client.go | 19 +- .../src/k8s.io/client-go/pkg/version/base.go | 2 +- .../test/e2e/framework/firewall_util.go | 2 +- vendor/k8s.io/kubernetes/test/e2e/kubectl.go | 11 + .../test/e2e_node/conformance/run_test.sh | 2 +- .../test/e2e_node/services/kubelet.go | 2 +- vendor/k8s.io/utils/HOWTOMOVE.md | 1 + vip-daemonset-proxy.yaml | 2 +- vip-daemonset.yaml | 2 +- vip-rc.yaml | 2 +- 146 files changed, 8870 insertions(+), 5488 deletions(-) rename main.go => pkg/cmd/main.go (78%) rename keepalived.go => pkg/controller/keepalived.go (95%) rename controller.go => pkg/controller/main.go (69%) rename utils.go => pkg/controller/utils.go (52%) rename utils_test.go => pkg/controller/utils_test.go (98%) create mode 100644 pkg/k8s/main.go create mode 100644 pkg/k8s/main_test.go create mode 100644 pkg/store/main.go create mode 100644 pkg/task/main.go create mode 100644 pkg/task/main_test.go rename Dockerfile => rootfs/Dockerfile (83%) rename keepalived.conf => rootfs/etc/keepalived/keepalived.conf (100%) rename haproxy-check.sh => rootfs/haproxy-check.sh (100%) rename haproxy.cfg => rootfs/haproxy.cfg (100%) rename haproxy.tmpl => rootfs/haproxy.tmpl (100%) rename keepalived.tmpl => rootfs/keepalived.tmpl (95%) create mode 100644 vendor/golang.org/x/text/feature/plural/example_test.go create mode 100755 vendor/golang.org/x/text/feature/plural/message.go create mode 100644 vendor/golang.org/x/text/feature/plural/message_test.go delete mode 100644 vendor/golang.org/x/text/language/data_test.go create mode 100644 vendor/golang.org/x/text/language/doc.go rename vendor/golang.org/x/text/language/testdata/{localeMatcherTest.txt => CLDRLocaleMatcherTest.txt} (100%) create mode 100644 vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt create mode 100644 vendor/golang.org/x/text/message/doc.go create mode 100644 vendor/golang.org/x/text/message/examples_test.go diff --git a/.gitignore b/.gitignore index 915ca18b..2157e6b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -kube-keepalived-vip +rootfs/kube-keepalived-vip +rootfs/keepalived.tar.gz \ No newline at end of file diff --git a/Changelog b/Changelog index f7f656e5..a3287f05 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,11 @@ +## 0.17 +- Cleanup +- Configmap update detection + ## 0.16 +- Fix DR mode issue + +## 0.15 - Update keepalived to 1.3.6 - Update go dependencies - Migrate to client-go diff --git a/Gopkg.lock b/Gopkg.lock index 8f3cb43a..3f130c9c 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -83,7 +83,7 @@ branch = "master" name = "github.com/golang/protobuf" packages = ["proto","ptypes","ptypes/any","ptypes/duration","ptypes/timestamp"] - revision = "ab9f9a6dab164b7d1246e0e688b0ab7b94d8553e" + revision = "83cd65fc365ace80eb6b6ecfc45203e43edfbc70" [[projects]] branch = "master" @@ -95,7 +95,7 @@ branch = "master" name = "github.com/googleapis/gnostic" packages = ["OpenAPIv2","compiler","extensions"] - revision = "2efd131d87c0eee9eff9232a9b1d8e454bf471f1" + revision = "0919c0e45c2684446b7cc76376ee79f4a95d1500" [[projects]] branch = "master" @@ -125,7 +125,7 @@ branch = "master" name = "github.com/mailru/easyjson" packages = ["buffer","jlexer","jwriter"] - revision = "2f5df55504ebc322e4d52d34df6a1f5b503bf26d" + revision = "3b3bbef4e2d9a6f24d7ee73a894afbc064f0e057" [[projects]] name = "github.com/spf13/pflag" @@ -137,31 +137,31 @@ branch = "master" name = "github.com/ugorji/go" packages = ["codec"] - revision = "5efa3251c7f7d05e5d9704a69a984ec9f1386a40" + revision = "8c0409fcbb70099c748d71f714529204975f6c3f" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = ["ssh/terminal"] - revision = "eb71ad9bd329b5ac0fd0148dd99bd62e8be8e035" + revision = "81e90905daefcd6fd217b62423c0908922eadb30" [[projects]] branch = "master" name = "golang.org/x/net" packages = ["http2","http2/hpack","idna","lex/httplex"] - revision = "1c05540f6879653db88113bc4a2b70aec4bd491f" + revision = "66aacef3dd8a676686c7ae3716979581e8b03c47" [[projects]] branch = "master" name = "golang.org/x/sys" packages = ["unix","windows"] - revision = "07c182904dbd53199946ba614a412c61d3c548f5" + revision = "bb24a47a89eac6c1227fbcb2ae37a8b9ed323366" [[projects]] branch = "master" name = "golang.org/x/text" packages = ["internal/gen","internal/triegen","internal/ucd","secure/bidirule","transform","unicode/bidi","unicode/cldr","unicode/norm","unicode/rangetable","width"] - revision = "e56139fd9c5bc7244c76116c68e500765bb6db6b" + revision = "e113a52b01bdd1744681b6ce70c2e3d26b58d389" [[projects]] name = "gopkg.in/inf.v0" @@ -190,24 +190,24 @@ [[projects]] branch = "master" name = "k8s.io/client-go" - packages = ["discovery","kubernetes","kubernetes/scheme","kubernetes/typed/admissionregistration/v1alpha1","kubernetes/typed/apps/v1beta1","kubernetes/typed/apps/v1beta2","kubernetes/typed/authentication/v1","kubernetes/typed/authentication/v1beta1","kubernetes/typed/authorization/v1","kubernetes/typed/authorization/v1beta1","kubernetes/typed/autoscaling/v1","kubernetes/typed/autoscaling/v2alpha1","kubernetes/typed/batch/v1","kubernetes/typed/batch/v2alpha1","kubernetes/typed/certificates/v1beta1","kubernetes/typed/core/v1","kubernetes/typed/extensions/v1beta1","kubernetes/typed/networking/v1","kubernetes/typed/policy/v1beta1","kubernetes/typed/rbac/v1alpha1","kubernetes/typed/rbac/v1beta1","kubernetes/typed/scheduling/v1alpha1","kubernetes/typed/settings/v1alpha1","kubernetes/typed/storage/v1","kubernetes/typed/storage/v1beta1","pkg/version","rest","rest/watch","tools/auth","tools/cache","tools/clientcmd","tools/clientcmd/api","tools/clientcmd/api/latest","tools/clientcmd/api/v1","tools/metrics","tools/reference","transport","util/cert","util/flowcontrol","util/homedir","util/integer","util/workqueue"] + packages = ["discovery","discovery/fake","kubernetes","kubernetes/fake","kubernetes/scheme","kubernetes/typed/admissionregistration/v1alpha1","kubernetes/typed/admissionregistration/v1alpha1/fake","kubernetes/typed/apps/v1beta1","kubernetes/typed/apps/v1beta1/fake","kubernetes/typed/apps/v1beta2","kubernetes/typed/apps/v1beta2/fake","kubernetes/typed/authentication/v1","kubernetes/typed/authentication/v1/fake","kubernetes/typed/authentication/v1beta1","kubernetes/typed/authentication/v1beta1/fake","kubernetes/typed/authorization/v1","kubernetes/typed/authorization/v1/fake","kubernetes/typed/authorization/v1beta1","kubernetes/typed/authorization/v1beta1/fake","kubernetes/typed/autoscaling/v1","kubernetes/typed/autoscaling/v1/fake","kubernetes/typed/autoscaling/v2alpha1","kubernetes/typed/autoscaling/v2alpha1/fake","kubernetes/typed/batch/v1","kubernetes/typed/batch/v1/fake","kubernetes/typed/batch/v2alpha1","kubernetes/typed/batch/v2alpha1/fake","kubernetes/typed/certificates/v1beta1","kubernetes/typed/certificates/v1beta1/fake","kubernetes/typed/core/v1","kubernetes/typed/core/v1/fake","kubernetes/typed/extensions/v1beta1","kubernetes/typed/extensions/v1beta1/fake","kubernetes/typed/networking/v1","kubernetes/typed/networking/v1/fake","kubernetes/typed/policy/v1beta1","kubernetes/typed/policy/v1beta1/fake","kubernetes/typed/rbac/v1alpha1","kubernetes/typed/rbac/v1alpha1/fake","kubernetes/typed/rbac/v1beta1","kubernetes/typed/rbac/v1beta1/fake","kubernetes/typed/scheduling/v1alpha1","kubernetes/typed/scheduling/v1alpha1/fake","kubernetes/typed/settings/v1alpha1","kubernetes/typed/settings/v1alpha1/fake","kubernetes/typed/storage/v1","kubernetes/typed/storage/v1/fake","kubernetes/typed/storage/v1beta1","kubernetes/typed/storage/v1beta1/fake","pkg/version","rest","rest/watch","testing","tools/auth","tools/cache","tools/clientcmd","tools/clientcmd/api","tools/clientcmd/api/latest","tools/clientcmd/api/v1","tools/metrics","tools/reference","transport","util/cert","util/flowcontrol","util/homedir","util/integer","util/workqueue"] revision = "9675d048204baf818bb24f7c74d0e64f6254902e" [[projects]] name = "k8s.io/kubernetes" packages = ["pkg/util/dbus","pkg/util/exec","pkg/util/iptables","pkg/util/sysctl","pkg/util/version"] - revision = "793658f2d7ca7f064d2bdf606519f9fe1229c381" - version = "v1.7.4" + revision = "17d7182a7ccbb167074be7a87f0a68bd00d58d97" + version = "v1.7.5" [[projects]] branch = "master" name = "k8s.io/utils" packages = ["exec"] - revision = "1f5ba483856f60b34bb29864d4129a8065d1c83b" + revision = "4fe312863be2155a7b68acd2aff1c9221b24e68c" [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "875dac9a8f43ef070724a6eafd155224d5b2a88720f1bb1c93ed4354613af929" + inputs-digest = "b986c0e0ab95d373a26bc024c2d8aebe02668253bf9ad528f045a498b480dec1" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index e76d152d..d0aeda74 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -38,12 +38,12 @@ name = "k8s.io/apimachinery" [[constraint]] - name = "k8s.io/client-go" branch = "master" + name = "k8s.io/client-go" [[constraint]] name = "k8s.io/kubernetes" - version = "1.7.4" + version = "1.7.5" [[constraint]] branch = "master" diff --git a/Makefile b/Makefile index 7e2eed05..cbf26476 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,28 @@ all: push -# 0.0 shouldn't clobber any release builds, current "latest" is 0.16 -TAG = 0.16 +# 0.0 shouldn't clobber any release builds, current "latest" is 0.17 +TAG = 0.17 PREFIX = aledbf/kube-keepalived-vip BUILD_IMAGE = build-keepalived +PKG = github.com/aledbf/kube-keepalived-vip controller: clean - CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s -w' -o kube-keepalived-vip + CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-s -w' \ + -o rootfs/kube-keepalived-vip \ + ${PKG}/pkg/cmd container: controller keepalived - docker build -t $(PREFIX):$(TAG) . + docker build -t $(PREFIX):$(TAG) rootfs keepalived: docker build -t $(BUILD_IMAGE):$(TAG) build docker create --name $(BUILD_IMAGE) $(BUILD_IMAGE):$(TAG) true # docker cp semantics changed between 1.7 and 1.8, so we cp the file to cwd and rename it. - docker cp $(BUILD_IMAGE):/keepalived.tar.gz . + docker cp $(BUILD_IMAGE):/keepalived.tar.gz rootfs docker rm -f $(BUILD_IMAGE) push: container - docker -- push $(PREFIX):$(TAG) + docker push $(PREFIX):$(TAG) clean: rm -f kube-keepalived-vip diff --git a/main.go b/pkg/cmd/main.go similarity index 78% rename from main.go rename to pkg/cmd/main.go index b8510162..c938d284 100644 --- a/main.go +++ b/pkg/cmd/main.go @@ -18,24 +18,26 @@ package main import ( "flag" + "fmt" + "io/ioutil" "os" - "os/signal" - "syscall" - "time" "github.com/golang/glog" "github.com/spf13/pflag" apiv1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/kubernetes/pkg/util/sysctl" + k8sexec "k8s.io/utils/exec" + + "github.com/aledbf/kube-keepalived-vip/pkg/controller" ) var ( - flags = pflag.NewFlagSet("", pflag.ContinueOnError) + flags = pflag.NewFlagSet("", pflag.ExitOnError) apiserverHost = flags.String("apiserver-host", "", "The address of the Kubernetes Apiserver "+ "to connect to in the format of protocol://address:port, e.g., "+ @@ -94,12 +96,11 @@ func main() { glog.Info("keepalived will use unicast to sync the nodes") } - kubeClient, err := createApiserverClient(*apiserverHost, *kubeConfigFile) - if err != nil { - handleFatalInitError(err) + if *vrid < 0 || *vrid > 255 { + glog.Fatalf("Error using VRID %d, only values between 0 and 255 are allowed.", vrid) } - err = loadIPVModule() + err := loadIPVModule() if err != nil { glog.Fatalf("unexpected error: %v", err) } @@ -109,10 +110,6 @@ func main() { glog.Fatalf("unexpected error: %v", err) } - if *vrid < 0 || *vrid > 255 { - glog.Fatalf("Error using VRID %d, only values between 0 and 255 are allowed.", vrid) - } - err = resetIPVS() if err != nil { glog.Fatalf("unexpected error: %v", err) @@ -122,34 +119,15 @@ func main() { copyHaproxyCfg() } - glog.Info("starting LVS configuration") - ipvsc := newIPVSController(kubeClient, *watchNamespace, *useUnicast, *configMapName, *vrid, *proxyMode) - - go ipvsc.epController.Run(wait.NeverStop) - go ipvsc.svcController.Run(wait.NeverStop) - - go ipvsc.syncQueue.run(time.Second, ipvsc.stopCh) - - go handleSigterm(ipvsc) - - glog.Info("starting keepalived to announce VIPs") - ipvsc.keepalived.Start() -} - -func handleSigterm(ipvsc *ipvsControllerController) { - signalChan := make(chan os.Signal, 1) - signal.Notify(signalChan, syscall.SIGTERM) - <-signalChan - glog.Infof("Received SIGTERM, shutting down") - - exitCode := 0 - if err := ipvsc.Stop(); err != nil { - glog.Infof("Error during shutdown %v", err) - exitCode = 1 + kubeClient, err := createApiserverClient(*apiserverHost, *kubeConfigFile) + if err != nil { + handleFatalInitError(err) } - glog.Infof("Exiting with %v", exitCode) - os.Exit(exitCode) + glog.Info("starting LVS configuration") + ipvsc := controller.NewIPVSController(kubeClient, *watchNamespace, *useUnicast, *configMapName, *vrid, *proxyMode) + + ipvsc.Start() } const ( @@ -217,3 +195,51 @@ func handleFatalInitError(err error) { "This most likely means that the cluster is misconfigured (e.g., it has "+ "invalid apiserver certificates or service accounts configuration). Reason: %s\n", err) } + +// loadIPVModule load module require to use keepalived +func loadIPVModule() error { + out, err := k8sexec.New().Command("modprobe", "ip_vs").CombinedOutput() + if err != nil { + glog.V(2).Infof("Error loading ip_vip: %s, %v", string(out), err) + return err + } + + _, err = os.Stat("/proc/net/ip_vs") + return err +} + +// changeSysctl changes the required network setting in /proc to get +// keepalived working in the local system. +func changeSysctl() error { + sys := sysctl.New() + for k, v := range sysctlAdjustments { + if err := sys.SetSysctl(k, v); err != nil { + return err + } + } + + return nil +} + +func resetIPVS() error { + glog.Info("cleaning ipvs configuration") + _, err := k8sexec.New().Command("ipvsadm", "-C").CombinedOutput() + if err != nil { + return fmt.Errorf("error removing ipvs configuration: %v", err) + } + + return nil +} + +// copyHaproxyCfg copies the default haproxy configuration file +// to the mounted directory (the mount overwrites the default file) +func copyHaproxyCfg() { + data, err := ioutil.ReadFile("/haproxy.cfg") + if err != nil { + glog.Fatalf("unexpected error reading haproxy.cfg: %v", err) + } + err = ioutil.WriteFile("/etc/haproxy/haproxy.cfg", data, 0644) + if err != nil { + glog.Fatalf("unexpected error writing haproxy.cfg: %v", err) + } +} diff --git a/keepalived.go b/pkg/controller/keepalived.go similarity index 95% rename from keepalived.go rename to pkg/controller/keepalived.go index a8d4e40e..53f6b4f8 100644 --- a/keepalived.go +++ b/pkg/controller/keepalived.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package controller import ( "encoding/json" @@ -183,16 +183,6 @@ func (k *keepalived) Stop() { } } -func resetIPVS() error { - glog.Info("cleaning ipvs configuration") - _, err := k8sexec.New().Command("ipvsadm", "-C").CombinedOutput() - if err != nil { - return fmt.Errorf("error removing ipvs configuration: %v", err) - } - - return nil -} - func (k *keepalived) removeVIP(vip string) error { glog.Infof("removing configured VIP %v", vip) out, err := k8sexec.New().Command("ip", "addr", "del", vip+"/32", "dev", k.iface).CombinedOutput() diff --git a/controller.go b/pkg/controller/main.go similarity index 69% rename from controller.go rename to pkg/controller/main.go index 85b5dce1..b7ef237c 100644 --- a/controller.go +++ b/pkg/controller/main.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package controller import ( "crypto/md5" @@ -22,20 +22,28 @@ import ( "fmt" "io" "os" + "os/signal" "reflect" "sort" "sync" + "syscall" "time" "github.com/golang/glog" + "github.com/aledbf/kube-keepalived-vip/pkg/k8s" + "github.com/aledbf/kube-keepalived-vip/pkg/store" + "github.com/aledbf/kube-keepalived-vip/pkg/task" + apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/util/intstr" + "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/kubernetes" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/flowcontrol" + utildbus "k8s.io/kubernetes/pkg/util/dbus" utilexec "k8s.io/kubernetes/pkg/util/exec" utiliptables "k8s.io/kubernetes/pkg/util/iptables" @@ -104,25 +112,34 @@ func (c vipByNameIPPort) Less(i, j int) bool { // ipvsControllerController watches the kubernetes api and adds/removes // services from LVS throgh ipvsadmin. type ipvsControllerController struct { - client *kubernetes.Clientset - epController cache.Controller - svcController cache.Controller - svcLister StoreToServiceLister - epLister StoreToEndpointsLister + client *kubernetes.Clientset + + epController cache.Controller + mapController cache.Controller + svcController cache.Controller + + svcLister store.ServiceLister + epLister store.EndpointLister + mapLister store.ConfigMapLister + reloadRateLimiter flowcontrol.RateLimiter - keepalived *keepalived - configMapName string - ruCfg []vip - ruMD5 string + + keepalived *keepalived + + configMapName string + + ruMD5 string // stopLock is used to enforce only a single call to Stop is active. // Needed because we allow stopping through an http endpoint and // allowing concurrent stoppers leads to stack traces. stopLock sync.Mutex - shutdown bool - syncQueue *taskQueue - stopCh chan struct{} + shutdown bool + + syncQueue *task.Queue + + stopCh chan struct{} } // getEndpoints returns a list of : for a given service/target port combination. @@ -178,7 +195,7 @@ func (ipvsc *ipvsControllerController) getServices(cfgMap *apiv1.ConfigMap) []vi } nsSvc := fmt.Sprintf("%v/%v", ns, svc) - svcObj, svcExists, err := ipvsc.svcLister.Indexer.GetByKey(nsSvc) + svcObj, svcExists, err := ipvsc.svcLister.Store.GetByKey(nsSvc) if err != nil { glog.Warningf("error getting service %v: %v", nsSvc, err) continue @@ -216,19 +233,10 @@ func (ipvsc *ipvsControllerController) getServices(cfgMap *apiv1.ConfigMap) []vi return svcs } -func (ipvsc *ipvsControllerController) getConfigMap(ns, name string) (*apiv1.ConfigMap, error) { - return ipvsc.client.CoreV1().ConfigMaps(ns).Get(name, metav1.GetOptions{}) -} - // sync all services with the -func (ipvsc *ipvsControllerController) sync(key string) error { +func (ipvsc *ipvsControllerController) sync(key interface{}) error { ipvsc.reloadRateLimiter.Accept() - if !ipvsc.epController.HasSynced() || !ipvsc.svcController.HasSynced() { - time.Sleep(100 * time.Millisecond) - return fmt.Errorf("deferring sync till endpoints controller has synced") - } - ns, name, err := parseNsName(ipvsc.configMapName) if err != nil { glog.Warningf("%v", err) @@ -240,12 +248,12 @@ func (ipvsc *ipvsControllerController) sync(key string) error { } svc := ipvsc.getServices(cfgMap) - ipvsc.ruCfg = svc err = ipvsc.keepalived.WriteCfg(svc) if err != nil { return err } + glog.V(2).Infof("services: %v", svc) md5, err := checksum(keepalivedCfg) @@ -262,18 +270,54 @@ func (ipvsc *ipvsControllerController) sync(key string) error { return nil } +// Stop stops the loadbalancer controller. +func (ipvsc *ipvsControllerController) Start() { + go ipvsc.epController.Run(ipvsc.stopCh) + go ipvsc.svcController.Run(ipvsc.stopCh) + go ipvsc.mapController.Run(ipvsc.stopCh) + + go ipvsc.syncQueue.Run(time.Second, ipvsc.stopCh) + + go handleSigterm(ipvsc) + + // Wait for all involved caches to be synced, before processing items from the queue is started + if !cache.WaitForCacheSync(ipvsc.stopCh, + ipvsc.epController.HasSynced, + ipvsc.svcController.HasSynced, + ipvsc.mapController.HasSynced, + ) { + runtime.HandleError(fmt.Errorf("timed out waiting for caches to sync")) + } + + glog.Info("starting keepalived to announce VIPs") + ipvsc.keepalived.Start() +} + +func handleSigterm(ipvsc *ipvsControllerController) { + signalChan := make(chan os.Signal, 1) + signal.Notify(signalChan, syscall.SIGTERM) + <-signalChan + glog.Infof("Received SIGTERM, shutting down") + + exitCode := 0 + if err := ipvsc.Stop(); err != nil { + glog.Infof("Error during shutdown %v", err) + exitCode = 1 + } + + glog.Infof("Exiting with %v", exitCode) + os.Exit(exitCode) +} + // Stop stops the loadbalancer controller. func (ipvsc *ipvsControllerController) Stop() error { ipvsc.stopLock.Lock() defer ipvsc.stopLock.Unlock() - // Only try draining the workqueue if we haven't already. - if !ipvsc.shutdown { - ipvsc.shutdown = true + if !ipvsc.syncQueue.IsShuttingDown() { + glog.Infof("shutting down controller queues") close(ipvsc.stopCh) - - glog.Infof("Shutting down controller queue") - ipvsc.syncQueue.shutdown() + go ipvsc.syncQueue.Shutdown() ipvsc.keepalived.Stop() @@ -283,24 +327,23 @@ func (ipvsc *ipvsControllerController) Stop() error { return fmt.Errorf("shutdown already in progress") } -// newIPVSController creates a new controller from the given config. -func newIPVSController(kubeClient *kubernetes.Clientset, namespace string, useUnicast bool, configMapName string, vrid int, proxyMode bool) *ipvsControllerController { +// NewIPVSController creates a new controller from the given config. +func NewIPVSController(kubeClient *kubernetes.Clientset, namespace string, useUnicast bool, configMapName string, vrid int, proxyMode bool) *ipvsControllerController { ipvsc := ipvsControllerController{ client: kubeClient, reloadRateLimiter: flowcontrol.NewTokenBucketRateLimiter(0.5, 1), - ruCfg: []vip{}, configMapName: configMapName, stopCh: make(chan struct{}), } - podInfo, err := getPodDetails(kubeClient) + podInfo, err := k8s.GetPodDetails(kubeClient) if err != nil { glog.Fatalf("Error getting POD information: %v", err) } - pod, err := kubeClient.Pods(podInfo.PodNamespace).Get(podInfo.PodName, metav1.GetOptions{}) + pod, err := kubeClient.Pods(podInfo.Namespace).Get(podInfo.Name, metav1.GetOptions{}) if err != nil { - glog.Fatalf("Error getting %v: %v", podInfo.PodName, err) + glog.Fatalf("Error getting %v: %v", podInfo.Name, err) } selector := parseNodeSelector(pod.Spec.NodeSelector) @@ -330,42 +373,66 @@ func newIPVSController(kubeClient *kubernetes.Clientset, namespace string, useUn proxyMode: proxyMode, } - ipvsc.syncQueue = NewTaskQueue(ipvsc.sync) + ipvsc.syncQueue = task.NewTaskQueue(ipvsc.sync) err = ipvsc.keepalived.loadTemplates() if err != nil { glog.Fatalf("Error loading templates: %v", err) } + mapEventHandler := cache.ResourceEventHandlerFuncs{ + UpdateFunc: func(old, cur interface{}) { + if !reflect.DeepEqual(old, cur) { + upCmap := cur.(*apiv1.ConfigMap) + mapKey := fmt.Sprintf("%s/%s", upCmap.Namespace, upCmap.Name) + // updates to configuration configmaps can trigger an update + if mapKey == ipvsc.configMapName { + ipvsc.syncQueue.Enqueue(cur) + } + } + }, + } + eventHandlers := cache.ResourceEventHandlerFuncs{ AddFunc: func(obj interface{}) { - ipvsc.syncQueue.enqueue(obj) + ipvsc.syncQueue.Enqueue(obj) }, DeleteFunc: func(obj interface{}) { - ipvsc.syncQueue.enqueue(obj) + ipvsc.syncQueue.Enqueue(obj) }, UpdateFunc: func(old, cur interface{}) { if !reflect.DeepEqual(old, cur) { - ipvsc.syncQueue.enqueue(cur) + ipvsc.syncQueue.Enqueue(cur) } }, } - ipvsc.svcLister.Indexer, ipvsc.svcController = cache.NewIndexerInformer( - cache.NewListWatchFromClient(ipvsc.client.Core().RESTClient(), "services", namespace, fields.Everything()), - &apiv1.Service{}, - resyncPeriod, - eventHandlers, - cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}, - ) + ipvsc.svcLister.Store, ipvsc.svcController = cache.NewInformer( + cache.NewListWatchFromClient(ipvsc.client.CoreV1().RESTClient(), "services", namespace, fields.Everything()), + &apiv1.Service{}, resyncPeriod, cache.ResourceEventHandlerFuncs{}) ipvsc.epLister.Store, ipvsc.epController = cache.NewInformer( - cache.NewListWatchFromClient(ipvsc.client.Core().RESTClient(), "endpoints", namespace, fields.Everything()), + cache.NewListWatchFromClient(ipvsc.client.CoreV1().RESTClient(), "endpoints", namespace, fields.Everything()), &apiv1.Endpoints{}, resyncPeriod, eventHandlers) + ipvsc.mapLister.Store, ipvsc.mapController = cache.NewInformer( + cache.NewListWatchFromClient(ipvsc.client.CoreV1().RESTClient(), "configmaps", namespace, fields.Everything()), + &apiv1.ConfigMap{}, resyncPeriod, mapEventHandler) + return &ipvsc } +func (ipvsc *ipvsControllerController) getConfigMap(ns, name string) (*apiv1.ConfigMap, error) { + s, exists, err := ipvsc.mapLister.Store.GetByKey(fmt.Sprintf("%v/%v", ns, name)) + if err != nil { + return nil, err + } + if !exists { + return nil, fmt.Errorf("configmap %v was not found", name) + } + return s.(*apiv1.ConfigMap), nil +} + func checksum(filename string) (string, error) { var result []byte file, err := os.Open(filename) diff --git a/utils.go b/pkg/controller/utils.go similarity index 52% rename from utils.go rename to pkg/controller/utils.go index 566a6f32..fba84336 100644 --- a/utils.go +++ b/pkg/controller/utils.go @@ -14,31 +14,22 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package controller import ( "errors" "fmt" - "io/ioutil" "net" - "os" "regexp" "sort" "strings" - "time" "github.com/golang/glog" apiv1 "k8s.io/api/core/v1" - apierrs "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" - "k8s.io/apimachinery/pkg/util/wait" "k8s.io/client-go/kubernetes" - "k8s.io/client-go/tools/cache" - "k8s.io/client-go/util/workqueue" - "k8s.io/kubernetes/pkg/util/sysctl" - k8sexec "k8s.io/utils/exec" ) var ( @@ -55,28 +46,6 @@ type nodeInfo struct { netmask int } -// StoreToEndpointsLister makes a Store that lists Endpoints. -type StoreToEndpointsLister struct { - cache.Store -} - -// GetServiceEndpoints returns the endpoints of a service, matched on service name. -func (s *StoreToEndpointsLister) GetServiceEndpoints(svc *apiv1.Service) (ep apiv1.Endpoints, err error) { - for _, m := range s.Store.List() { - ep = *m.(*apiv1.Endpoints) - if svc.Name == ep.Name && svc.Namespace == ep.Namespace { - return ep, nil - } - } - err = fmt.Errorf("could not find endpoints for service: %v", svc.Name) - return -} - -// StoreToServiceLister makes a Store that lists Service. -type StoreToServiceLister struct { - cache.Indexer -} - // getNetworkInfo returns information of the node where the pod is running func getNetworkInfo(ip string) (*nodeInfo, error) { iface, _, mask := interfaceByIP(ip) @@ -87,48 +56,6 @@ func getNetworkInfo(ip string) (*nodeInfo, error) { }, nil } -type podInfo struct { - PodName string - PodNamespace string - NodeIP string -} - -// getPodDetails returns runtime information about the pod: name, namespace and IP of the node -func getPodDetails(kubeClient *kubernetes.Clientset) (*podInfo, error) { - podName := os.Getenv("POD_NAME") - podNs := os.Getenv("POD_NAMESPACE") - - if podName == "" || podNs == "" { - return nil, fmt.Errorf("Please check the manifest (for missing POD_NAME or POD_NAMESPACE env variables)") - } - - err := waitForPodRunning(kubeClient, podNs, podName, time.Millisecond*200, time.Second*30) - if err != nil { - return nil, err - } - - pod, _ := kubeClient.Pods(podNs).Get(podName, metav1.GetOptions{}) - if pod == nil { - return nil, fmt.Errorf("Unable to get POD information") - } - - n, err := kubeClient.Nodes().Get(pod.Spec.NodeName, metav1.GetOptions{}) - if err != nil { - return nil, err - } - - externalIP, err := getNodeHostIP(n) - if err != nil { - return nil, err - } - - return &podInfo{ - PodName: podName, - PodNamespace: podNs, - NodeIP: externalIP.String(), - }, nil -} - // netInterfaces returns a slice containing the local network interfaces // excluding lo, docker0, flannel.1 and veth interfaces. func netInterfaces() []net.Interface { @@ -249,31 +176,6 @@ func getNodePriority(ip string, nodes []string) int { return 100 + stringSlice(nodes).pos(ip) } -// loadIPVModule load module require to use keepalived -func loadIPVModule() error { - out, err := k8sexec.New().Command("modprobe", "ip_vs").CombinedOutput() - if err != nil { - glog.V(2).Infof("Error loading ip_vip: %s, %v", string(out), err) - return err - } - - _, err = os.Stat("/proc/net/ip_vs") - return err -} - -// changeSysctl changes the required network setting in /proc to get -// keepalived working in the local system. -func changeSysctl() error { - sys := sysctl.New() - for k, v := range sysctlAdjustments { - if err := sys.SetSysctl(k, v); err != nil { - return err - } - } - - return nil -} - func appendIfMissing(slice []string, item string) []string { for _, elem := range slice { if elem == item { @@ -336,124 +238,6 @@ func parseNodeSelector(data map[string]string) string { return nodeSelector(data).String() } -func waitForPodRunning(kubeClient *kubernetes.Clientset, ns, podName string, interval, timeout time.Duration) error { - condition := func(pod *apiv1.Pod) (bool, error) { - if pod.Status.Phase == apiv1.PodRunning { - return true, nil - } - return false, nil - } - - return waitForPodCondition(kubeClient, ns, podName, condition, interval, timeout) -} - -// waitForPodCondition waits for a pod in state defined by a condition (func) -func waitForPodCondition(kubeClient *kubernetes.Clientset, ns, podName string, condition func(pod *apiv1.Pod) (bool, error), - interval, timeout time.Duration) error { - err := wait.PollImmediate(interval, timeout, func() (bool, error) { - pod, err := kubeClient.Pods(ns).Get(podName, metav1.GetOptions{}) - if err != nil { - if apierrs.IsNotFound(err) { - return false, nil - } - } - - done, err := condition(pod) - if err != nil { - return false, err - } - if done { - return true, nil - } - - return false, nil - }) - - if err != nil { - return fmt.Errorf("timed out waiting to observe own status as Running") - } - - return nil -} - -// taskQueue manages a work queue through an independent worker that -// invokes the given sync function for every work item inserted. -type taskQueue struct { - // queue is the work queue the worker polls - queue workqueue.RateLimitingInterface - // sync is called for each item in the queue - sync func(string) error - // workerDone is closed when the worker exits - workerDone chan struct{} -} - -func (t *taskQueue) run(period time.Duration, stopCh <-chan struct{}) { - wait.Until(t.worker, period, stopCh) -} - -// enqueue enqueues ns/name of the given api object in the task queue. -func (t *taskQueue) enqueue(obj interface{}) { - key, err := keyFunc(obj) - if err != nil { - glog.Infof("could not get key for object %+v: %v", obj, err) - return - } - t.queue.Add(key) -} - -func (t *taskQueue) requeue(key string) { - t.queue.AddRateLimited(key) -} - -// worker processes work in the queue through sync. -func (t *taskQueue) worker() { - for { - key, quit := t.queue.Get() - if quit { - close(t.workerDone) - return - } - glog.V(3).Infof("syncing %v", key) - if err := t.sync(key.(string)); err != nil { - glog.V(3).Infof("requeuing %v, err %v", key, err) - t.requeue(key.(string)) - } else { - t.queue.Forget(key) - } - - t.queue.Done(key) - } -} - -// shutdown shuts down the work queue and waits for the worker to ACK -func (t *taskQueue) shutdown() { - t.queue.ShutDown() - <-t.workerDone -} - -// NewTaskQueue creates a new task queue with the given sync function. -// The sync function is called for every element inserted into the queue. -func NewTaskQueue(syncFn func(string) error) *taskQueue { - return &taskQueue{ - queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), - sync: syncFn, - workerDone: make(chan struct{}), - } -} - -// copyHaproxyCfg copies the default haproxy configuration file -// to the mounted directory (the mount overwrites the default file) -func copyHaproxyCfg() { - data, err := ioutil.ReadFile("/haproxy.cfg") - if err != nil { - glog.Fatalf("unexpected error reading haproxy.cfg: %v", err) - } - err = ioutil.WriteFile("/etc/haproxy/haproxy.cfg", data, 0644) - if err != nil { - glog.Fatalf("unexpected error writing haproxy.cfg: %v", err) - } -} - // GetNodeHostIP returns the provided node's IP, based on the priority: // 1. NodeInternalIP // 2. NodeExternalIP diff --git a/utils_test.go b/pkg/controller/utils_test.go similarity index 98% rename from utils_test.go rename to pkg/controller/utils_test.go index 7e71d281..39317b61 100644 --- a/utils_test.go +++ b/pkg/controller/utils_test.go @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -package main +package controller import ( "testing" diff --git a/pkg/k8s/main.go b/pkg/k8s/main.go new file mode 100644 index 00000000..82a1ecdc --- /dev/null +++ b/pkg/k8s/main.go @@ -0,0 +1,135 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package k8s + +import ( + "fmt" + "os" + "strings" + + api "k8s.io/api/core/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + clientset "k8s.io/client-go/kubernetes" +) + +// IsValidService checks if exists a service with the specified name +func IsValidService(kubeClient clientset.Interface, name string) (*api.Service, error) { + ns, name, err := ParseNameNS(name) + if err != nil { + return nil, err + } + return kubeClient.Core().Services(ns).Get(name, meta_v1.GetOptions{}) +} + +// IsValidConfigMap check if exists a configmap with the specified name +func IsValidConfigMap(kubeClient clientset.Interface, fullName string) (*api.ConfigMap, error) { + + ns, name, err := ParseNameNS(fullName) + + if err != nil { + return nil, err + } + + configMap, err := kubeClient.Core().ConfigMaps(ns).Get(name, meta_v1.GetOptions{}) + + if err != nil { + return nil, fmt.Errorf("configmap not found: %v", err) + } + + return configMap, nil + +} + +// IsValidNamespace chck if exists a namespace with the specified name +func IsValidNamespace(kubeClient clientset.Interface, name string) (*api.Namespace, error) { + return kubeClient.Core().Namespaces().Get(name, meta_v1.GetOptions{}) +} + +// IsValidSecret checks if exists a secret with the specified name +func IsValidSecret(kubeClient clientset.Interface, name string) (*api.Secret, error) { + ns, name, err := ParseNameNS(name) + if err != nil { + return nil, err + } + return kubeClient.Core().Secrets(ns).Get(name, meta_v1.GetOptions{}) +} + +// ParseNameNS parses a string searching a namespace and name +func ParseNameNS(input string) (string, string, error) { + nsName := strings.Split(input, "/") + if len(nsName) != 2 { + return "", "", fmt.Errorf("invalid format (namespace/name) found in '%v'", input) + } + + return nsName[0], nsName[1], nil +} + +// GetNodeIP returns the IP address of a node in the cluster +func GetNodeIP(kubeClient clientset.Interface, name string) string { + var externalIP string + node, err := kubeClient.Core().Nodes().Get(name, meta_v1.GetOptions{}) + if err != nil { + return externalIP + } + + for _, address := range node.Status.Addresses { + if address.Type == api.NodeExternalIP { + if address.Address != "" { + externalIP = address.Address + break + } + } + + if externalIP == "" && address.Type == api.NodeInternalIP { + externalIP = address.Address + } + } + return externalIP +} + +// PodInfo contains runtime information about the pod running the Ingres controller +type PodInfo struct { + Name string + Namespace string + NodeIP string + // Labels selectors of the running pod + // This is used to search for other Ingress controller pods + Labels map[string]string +} + +// GetPodDetails returns runtime information about the pod: +// name, namespace and IP of the node where it is running +func GetPodDetails(kubeClient clientset.Interface) (*PodInfo, error) { + podName := os.Getenv("POD_NAME") + podNs := os.Getenv("POD_NAMESPACE") + + if podName == "" || podNs == "" { + return nil, fmt.Errorf("unable to get POD information (missing POD_NAME or POD_NAMESPACE environment variable") + } + + pod, _ := kubeClient.Core().Pods(podNs).Get(podName, meta_v1.GetOptions{}) + if pod == nil { + return nil, fmt.Errorf("unable to get POD information") + } + + return &PodInfo{ + Name: podName, + Namespace: podNs, + NodeIP: GetNodeIP(kubeClient, pod.Spec.NodeName), + Labels: pod.GetLabels(), + }, nil +} diff --git a/pkg/k8s/main_test.go b/pkg/k8s/main_test.go new file mode 100644 index 00000000..820b1216 --- /dev/null +++ b/pkg/k8s/main_test.go @@ -0,0 +1,359 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package k8s + +import ( + "os" + "testing" + + api "k8s.io/api/core/v1" + meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + testclient "k8s.io/client-go/kubernetes/fake" +) + +func TestParseNameNS(t *testing.T) { + tests := []struct { + title string + input string + ns string + name string + expErr bool + }{ + {"empty string", "", "", "", true}, + {"demo", "demo", "", "", true}, + {"kube-system", "kube-system", "", "", true}, + {"default/kube-system", "default/kube-system", "default", "kube-system", false}, + } + + for _, test := range tests { + ns, name, err := ParseNameNS(test.input) + if test.expErr { + if err == nil { + t.Errorf("%v: expected error but returned nil", test.title) + } + continue + } + if test.ns != ns { + t.Errorf("%v: expected %v but returned %v", test.title, test.ns, ns) + } + if test.name != name { + t.Errorf("%v: expected %v but returned %v", test.title, test.name, name) + } + } +} + +func TestIsValidService(t *testing.T) { + fk := testclient.NewSimpleClientset(&api.Service{ + ObjectMeta: meta_v1.ObjectMeta{ + Namespace: api.NamespaceDefault, + Name: "demo", + }, + }) + + _, err := IsValidService(fk, "") + if err == nil { + t.Errorf("expected error but returned nil") + } + s, err := IsValidService(fk, "default/demo") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if s == nil { + t.Errorf("expected a Service but returned nil") + } + + fk = testclient.NewSimpleClientset() + s, err = IsValidService(fk, "default/demo") + if err == nil { + t.Errorf("expected an error but returned nil") + } + if s != nil { + t.Errorf("unexpected Service returned: %v", s) + } +} + +func TestIsValidNamespace(t *testing.T) { + + fk := testclient.NewSimpleClientset(&api.Namespace{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "default", + }, + }) + + _, err := IsValidNamespace(fk, "empty") + if err == nil { + t.Errorf("expected error but return nill") + } + + ns, err := IsValidNamespace(fk, "default") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if ns == nil { + t.Errorf("expected a configmap but returned nil") + } + +} + +func TestIsValidConfigMap(t *testing.T) { + + fk := testclient.NewSimpleClientset(&api.ConfigMap{ + ObjectMeta: meta_v1.ObjectMeta{ + Namespace: api.NamespaceDefault, + Name: "demo", + }, + }) + + _, err := IsValidConfigMap(fk, "") + if err == nil { + t.Errorf("expected error but return nill") + } + + s, err := IsValidConfigMap(fk, "default/demo") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + + if s == nil { + t.Errorf("expected a configmap but returned nil") + } + + fk = testclient.NewSimpleClientset() + s, err = IsValidConfigMap(fk, "default/demo") + if err == nil { + t.Errorf("expected an error but returned nil") + } + if s != nil { + t.Errorf("unexpected Configmap returned: %v", s) + } + +} + +func TestIsValidSecret(t *testing.T) { + fk := testclient.NewSimpleClientset(&api.Secret{ + ObjectMeta: meta_v1.ObjectMeta{ + Namespace: api.NamespaceDefault, + Name: "demo", + }, + }) + + _, err := IsValidSecret(fk, "") + if err == nil { + t.Errorf("expected error but returned nil") + } + s, err := IsValidSecret(fk, "default/demo") + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if s == nil { + t.Errorf("expected a Secret but returned nil") + } + + fk = testclient.NewSimpleClientset() + s, err = IsValidSecret(fk, "default/demo") + if err == nil { + t.Errorf("expected an error but returned nil") + } + if s != nil { + t.Errorf("unexpected Secret returned: %v", s) + } +} + +func TestGetNodeIP(t *testing.T) { + fKNodes := []struct { + cs *testclient.Clientset + n string + ea string + }{ + // empty node list + {testclient.NewSimpleClientset(), "demo", ""}, + + // node not exist + {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.1", + }, + }, + }, + }}}), "notexistnode", ""}, + + // node exist + {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.1", + }, + }, + }, + }}}), "demo", "10.0.0.1"}, + + // search the correct node + {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{ + { + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo1", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.1", + }, + }, + }, + }, + { + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo2", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.2", + }, + }, + }, + }, + }}), "demo2", "10.0.0.2"}, + + // get NodeExternalIP + {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.1", + }, { + Type: api.NodeExternalIP, + Address: "10.0.0.2", + }, + }, + }, + }}}), "demo", "10.0.0.2"}, + + // get NodeInternalIP + {testclient.NewSimpleClientset(&api.NodeList{Items: []api.Node{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeExternalIP, + Address: "", + }, { + Type: api.NodeInternalIP, + Address: "10.0.0.2", + }, + }, + }, + }}}), "demo", "10.0.0.2"}, + } + + for _, fk := range fKNodes { + address := GetNodeIP(fk.cs, fk.n) + if address != fk.ea { + t.Errorf("expected %s, but returned %s", fk.ea, address) + } + } +} + +func TestGetPodDetails(t *testing.T) { + // POD_NAME & POD_NAMESPACE not exist + os.Setenv("POD_NAME", "") + os.Setenv("POD_NAMESPACE", "") + _, err1 := GetPodDetails(testclient.NewSimpleClientset()) + if err1 == nil { + t.Errorf("expected an error but returned nil") + } + + // POD_NAME not exist + os.Setenv("POD_NAME", "") + os.Setenv("POD_NAMESPACE", api.NamespaceDefault) + _, err2 := GetPodDetails(testclient.NewSimpleClientset()) + if err2 == nil { + t.Errorf("expected an error but returned nil") + } + + // POD_NAMESPACE not exist + os.Setenv("POD_NAME", "testpod") + os.Setenv("POD_NAMESPACE", "") + _, err3 := GetPodDetails(testclient.NewSimpleClientset()) + if err3 == nil { + t.Errorf("expected an error but returned nil") + } + + // POD not exist + os.Setenv("POD_NAME", "testpod") + os.Setenv("POD_NAMESPACE", api.NamespaceDefault) + _, err4 := GetPodDetails(testclient.NewSimpleClientset()) + if err4 == nil { + t.Errorf("expected an error but returned nil") + } + + // success to get PodInfo + fkClient := testclient.NewSimpleClientset( + &api.PodList{Items: []api.Pod{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "testpod", + Namespace: api.NamespaceDefault, + Labels: map[string]string{ + "first": "first_label", + "second": "second_label", + }, + }, + }}}, + &api.NodeList{Items: []api.Node{{ + ObjectMeta: meta_v1.ObjectMeta{ + Name: "demo", + }, + Status: api.NodeStatus{ + Addresses: []api.NodeAddress{ + { + Type: api.NodeInternalIP, + Address: "10.0.0.1", + }, + }, + }, + }}}) + + epi, err5 := GetPodDetails(fkClient) + if err5 != nil { + t.Errorf("expected a PodInfo but returned error") + return + } + + if epi == nil { + t.Errorf("expected a PodInfo but returned nil") + } +} diff --git a/pkg/store/main.go b/pkg/store/main.go new file mode 100644 index 00000000..a187c234 --- /dev/null +++ b/pkg/store/main.go @@ -0,0 +1,51 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package store + +import ( + "fmt" + + api "k8s.io/api/core/v1" + "k8s.io/client-go/tools/cache" +) + +// ConfigMapLister makes a Store that lists Configmaps. +type ConfigMapLister struct { + cache.Store +} + +// ServiceLister makes a Store that lists Services. +type ServiceLister struct { + cache.Store +} + +// EndpointLister makes a Store that lists Endpoints. +type EndpointLister struct { + cache.Store +} + +// GetServiceEndpoints returns the endpoints of a service, matched on service name. +func (s *EndpointLister) GetServiceEndpoints(svc *api.Service) (ep api.Endpoints, err error) { + for _, m := range s.Store.List() { + ep = *m.(*api.Endpoints) + if svc.Name == ep.Name && svc.Namespace == ep.Namespace { + return ep, nil + } + } + err = fmt.Errorf("could not find endpoints for service: %v", svc.Name) + return +} diff --git a/pkg/task/main.go b/pkg/task/main.go new file mode 100644 index 00000000..34913573 --- /dev/null +++ b/pkg/task/main.go @@ -0,0 +1,141 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import ( + "fmt" + "time" + + "github.com/golang/glog" + + "k8s.io/apimachinery/pkg/util/wait" + "k8s.io/client-go/tools/cache" + "k8s.io/client-go/util/workqueue" +) + +var ( + keyFunc = cache.DeletionHandlingMetaNamespaceKeyFunc +) + +// Queue manages a work queue through an independent worker that +// invokes the given sync function for every work item inserted. +type Queue struct { + // queue is the work queue the worker polls + queue workqueue.RateLimitingInterface + // sync is called for each item in the queue + sync func(interface{}) error + // workerDone is closed when the worker exits + workerDone chan bool + + fn func(obj interface{}) (interface{}, error) +} + +// Run ... +func (t *Queue) Run(period time.Duration, stopCh <-chan struct{}) { + wait.Until(t.worker, period, stopCh) +} + +// Enqueue enqueues ns/name of the given api object in the task queue. +func (t *Queue) Enqueue(obj interface{}) { + if t.IsShuttingDown() { + glog.Errorf("queue has been shutdown, failed to enqueue: %v", obj) + return + } + + glog.V(3).Infof("queuing item %v", obj) + key, err := t.fn(obj) + if err != nil { + glog.Errorf("%v", err) + return + } + t.queue.Add(key) +} + +func (t *Queue) defaultKeyFunc(obj interface{}) (interface{}, error) { + key, err := keyFunc(obj) + if err != nil { + return "", fmt.Errorf("could not get key for object %+v: %v", obj, err) + } + + return key, nil +} + +// worker processes work in the queue through sync. +func (t *Queue) worker() { + for { + key, quit := t.queue.Get() + if quit { + if !isClosed(t.workerDone) { + close(t.workerDone) + } + return + } + + glog.V(3).Infof("syncing %v", key) + if err := t.sync(key); err != nil { + glog.Warningf("requeuing %v, err %v", key, err) + t.queue.AddRateLimited(key) + } else { + t.queue.Forget(key) + } + + t.queue.Done(key) + } +} + +func isClosed(ch <-chan bool) bool { + select { + case <-ch: + return true + default: + } + + return false +} + +// Shutdown shuts down the work queue and waits for the worker to ACK +func (t *Queue) Shutdown() { + t.queue.ShutDown() + <-t.workerDone +} + +// IsShuttingDown returns if the method Shutdown was invoked +func (t *Queue) IsShuttingDown() bool { + return t.queue.ShuttingDown() +} + +// NewTaskQueue creates a new task queue with the given sync function. +// The sync function is called for every element inserted into the queue. +func NewTaskQueue(syncFn func(interface{}) error) *Queue { + return NewCustomTaskQueue(syncFn, nil) +} + +// NewCustomTaskQueue ... +func NewCustomTaskQueue(syncFn func(interface{}) error, fn func(interface{}) (interface{}, error)) *Queue { + q := &Queue{ + queue: workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()), + sync: syncFn, + workerDone: make(chan bool), + fn: fn, + } + + if fn == nil { + q.fn = q.defaultKeyFunc + } + + return q +} diff --git a/pkg/task/main_test.go b/pkg/task/main_test.go new file mode 100644 index 00000000..e9b1fab8 --- /dev/null +++ b/pkg/task/main_test.go @@ -0,0 +1,133 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import ( + "fmt" + "sync/atomic" + "testing" + "time" +) + +var sr uint32 + +type mockEnqueueObj struct { + k string + v string +} + +func mockSynFn(interface{}) error { + // sr will be plus one times after enqueue + atomic.AddUint32(&sr, 1) + return nil +} + +func mockKeyFn(interface{}) (interface{}, error) { + return mockEnqueueObj{ + k: "static_key", + v: "static_value", + }, nil +} + +func mockErrorKeyFn(interface{}) (interface{}, error) { + return nil, fmt.Errorf("failed to get key") +} + +func TestShutdown(t *testing.T) { + q := NewTaskQueue(mockSynFn) + stopCh := make(chan struct{}) + // run queue + go q.Run(10*time.Second, stopCh) + q.Shutdown() + s := q.IsShuttingDown() + if !s { + t.Errorf("queue should be shutdown") + } +} + +func TestEnqueueSuccess(t *testing.T) { + // initialize result + atomic.StoreUint32(&sr, 0) + q := NewCustomTaskQueue(mockSynFn, mockKeyFn) + stopCh := make(chan struct{}) + // run queue + go q.Run(5*time.Second, stopCh) + // mock object whichi will be enqueue + mo := mockEnqueueObj{ + k: "testKey", + v: "testValue", + } + q.Enqueue(mo) + // wait for 'mockSynFn' + time.Sleep(time.Millisecond * 10) + if atomic.LoadUint32(&sr) != 1 { + t.Errorf("sr should be 1, but is %d", sr) + } + + // shutdown queue before exit + q.Shutdown() +} + +func TestEnqueueFailed(t *testing.T) { + // initialize result + atomic.StoreUint32(&sr, 0) + q := NewCustomTaskQueue(mockSynFn, mockKeyFn) + stopCh := make(chan struct{}) + // run queue + go q.Run(5*time.Second, stopCh) + // mock object whichi will be enqueue + mo := mockEnqueueObj{ + k: "testKey", + v: "testValue", + } + + // shutdown queue before enqueue + q.Shutdown() + // wait for shutdown + time.Sleep(time.Millisecond * 10) + q.Enqueue(mo) + // wait for 'mockSynFn' + time.Sleep(time.Millisecond * 10) + // queue is shutdown, so mockSynFn should not be executed, so the result should be 0 + if atomic.LoadUint32(&sr) != 0 { + t.Errorf("queue has been shutdown, so sr should be 0, but is %d", sr) + } +} + +func TestEnqueueKeyError(t *testing.T) { + // initialize result + atomic.StoreUint32(&sr, 0) + q := NewCustomTaskQueue(mockSynFn, mockErrorKeyFn) + stopCh := make(chan struct{}) + // run queue + go q.Run(5*time.Second, stopCh) + // mock object whichi will be enqueue + mo := mockEnqueueObj{ + k: "testKey", + v: "testValue", + } + + q.Enqueue(mo) + // wait for 'mockSynFn' + time.Sleep(time.Millisecond * 10) + // key error, so the result should be 0 + if atomic.LoadUint32(&sr) != 0 { + t.Errorf("error occurs while get key, so sr should be 0, but is %d", sr) + } + // shutdown queue before exit + q.Shutdown() +} diff --git a/Dockerfile b/rootfs/Dockerfile similarity index 83% rename from Dockerfile rename to rootfs/Dockerfile index b8f790f3..d4303944 100644 --- a/Dockerfile +++ b/rootfs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM gcr.io/google_containers/ubuntu-slim:0.11 +FROM gcr.io/google_containers/ubuntu-slim:0.14 RUN apt-get update && apt-get install -y --no-install-recommends \ libssl1.0.0 \ @@ -40,11 +40,6 @@ RUN mkdir -p /etc/keepalived && \ ln -s /keepalived/sbin/keepalived /usr/sbin && \ ln -s /keepalived/bin/genhash /usr/sbin -COPY kube-keepalived-vip / -COPY keepalived.tmpl / -COPY keepalived.conf /etc/keepalived -COPY haproxy.tmpl /haproxy.tmpl -COPY haproxy-check.sh /haproxy-check.sh -COPY haproxy.cfg / +COPY . / ENTRYPOINT ["/kube-keepalived-vip"] diff --git a/keepalived.conf b/rootfs/etc/keepalived/keepalived.conf similarity index 100% rename from keepalived.conf rename to rootfs/etc/keepalived/keepalived.conf diff --git a/haproxy-check.sh b/rootfs/haproxy-check.sh similarity index 100% rename from haproxy-check.sh rename to rootfs/haproxy-check.sh diff --git a/haproxy.cfg b/rootfs/haproxy.cfg similarity index 100% rename from haproxy.cfg rename to rootfs/haproxy.cfg diff --git a/haproxy.tmpl b/rootfs/haproxy.tmpl similarity index 100% rename from haproxy.tmpl rename to rootfs/haproxy.tmpl diff --git a/keepalived.tmpl b/rootfs/keepalived.tmpl similarity index 95% rename from keepalived.tmpl rename to rootfs/keepalived.tmpl index 556f0bca..a7409899 100644 --- a/keepalived.tmpl +++ b/rootfs/keepalived.tmpl @@ -5,10 +5,12 @@ global_defs { vrrp_iptables {{ .iptablesChain }} } +{{ if .proxyMode }} vrrp_script chk_haproxy { script "/haproxy-check.sh" interval 1 } +{{ end }} vrrp_instance vips { state BACKUP @@ -33,7 +35,7 @@ vrrp_instance vips { {{ . }}{{ end }} } -{{ if .proxyMode}} +{{ if .proxyMode }} # In proxy mode there is no need to create virtual servers track_script { chk_haproxy weight 1 diff --git a/vendor/github.com/golang/protobuf/.travis.yml b/vendor/github.com/golang/protobuf/.travis.yml index 24e22f85..93c67805 100644 --- a/vendor/github.com/golang/protobuf/.travis.yml +++ b/vendor/github.com/golang/protobuf/.travis.yml @@ -4,6 +4,7 @@ go: - 1.6.x - 1.7.x - 1.8.x +- 1.9.x install: - go get -v -d -t github.com/golang/protobuf/... diff --git a/vendor/github.com/googleapis/gnostic/apps/disco/README.md b/vendor/github.com/googleapis/gnostic/apps/disco/README.md index 28ada944..82cd51b8 100644 --- a/vendor/github.com/googleapis/gnostic/apps/disco/README.md +++ b/vendor/github.com/googleapis/gnostic/apps/disco/README.md @@ -3,3 +3,36 @@ This directory contains a tool for working with Google's Discovery API and Discovery Format, including the ability to convert Discovery Format descriptions to OpenAPI. +Installation: + + go get github.com/googleapis/gnostic + go install github.com/googleapis/gnostic/apps/disco + + +Usage: + + disco help + +Prints a list of commands and options. + + disco list [--raw] + +Calls the Google Discovery API and lists available APIs. +The `--raw` option prints the raw results of the Discovery List APIs call. + + disco get [] [] [--raw] [--openapi2] [--openapi3] [--features] [--schemas] [--all] + +Gets the specified API and version from the Google Discovery API. +`` can be omitted if it is unique. +The `--raw` option saves the raw Discovery Format description. +The `--openapi2` option rewrites the API description in OpenAPI v2. +The `--openapi3` option rewrites the API description in OpenAPI v3. +The `--features` option displays the contents of the `features` sections of discovery documents. +The `--schemas` option displays information about the schemas defined for the API. +The `--all` option runs the other associated operations for all of the APIs available from the Discovery Service. +When `--all` is specified, `` and `` should be omitted. + + disco [--openapi2] [--openapi3] [--features] [--schemas] + +Applies the specified operations to a local file. See the `get` command for details. + diff --git a/vendor/github.com/mailru/easyjson/easyjson/main.go b/vendor/github.com/mailru/easyjson/easyjson/main.go index 1c394975..1cd30bb3 100644 --- a/vendor/github.com/mailru/easyjson/easyjson/main.go +++ b/vendor/github.com/mailru/easyjson/easyjson/main.go @@ -54,8 +54,13 @@ func generate(fname string) (err error) { outName = *specifiedName } + var trimmedBuildTags string + if *buildTags != "" { + trimmedBuildTags = strings.TrimSpace(*buildTags) + } + g := bootstrap.Generator{ - BuildTags: *buildTags, + BuildTags: trimmedBuildTags, PkgPath: p.PkgPath, PkgName: p.PkgName, Types: p.StructNames, diff --git a/vendor/github.com/mailru/easyjson/gen/generator.go b/vendor/github.com/mailru/easyjson/gen/generator.go index f4312f64..eb0d70ba 100644 --- a/vendor/github.com/mailru/easyjson/gen/generator.go +++ b/vendor/github.com/mailru/easyjson/gen/generator.go @@ -224,6 +224,10 @@ func fixAliasName(alias string) string { "_", -1, ) + + if alias[0] == 'v' { // to void conflicting with var names, say v1 + alias = "_" + alias + } return alias } @@ -380,7 +384,7 @@ func (DefaultFieldNamer) GetJSONFieldName(t reflect.Type, f reflect.StructField) } // LowerCamelCaseFieldNamer -type LowerCamelCaseFieldNamer struct {} +type LowerCamelCaseFieldNamer struct{} func isLower(b byte) bool { return b <= 122 && b >= 97 @@ -407,7 +411,7 @@ func lowerFirst(s string) string { If the following char is upper OR numeric, LOWER it If is the end of string, LEAVE it Else lowercase - */ + */ foundLower := false for i := range s { diff --git a/vendor/github.com/mailru/easyjson/parser/parser_windows.go b/vendor/github.com/mailru/easyjson/parser/parser_windows.go index 64974aa9..a0b26119 100644 --- a/vendor/github.com/mailru/easyjson/parser/parser_windows.go +++ b/vendor/github.com/mailru/easyjson/parser/parser_windows.go @@ -4,15 +4,18 @@ import ( "fmt" "os" "path" + "path/filepath" "strings" ) func normalizePath(path string) string { - return strings.Replace(path, "\\", "/", -1) + // use lower case, as Windows file systems will almost always be case insensitive + return strings.ToLower(strings.Replace(path, "\\", "/", -1)) } func getPkgPath(fname string, isDir bool) (string, error) { - if !path.IsAbs(fname) { + // path.IsAbs doesn't work properly on Windows; use filepath.IsAbs instead + if !filepath.IsAbs(fname) { pwd, err := os.Getwd() if err != nil { return "", err diff --git a/vendor/github.com/ugorji/go/codec/codec_test.go b/vendor/github.com/ugorji/go/codec/codec_test.go index 5157e8b5..b05d1946 100644 --- a/vendor/github.com/ugorji/go/codec/codec_test.go +++ b/vendor/github.com/ugorji/go/codec/codec_test.go @@ -1470,6 +1470,21 @@ func TestJsonLargeInteger(t *testing.T) { } } +func TestJsonDecodeNonStringScalarInStringContext(t *testing.T) { + var b = `{"s.true": "true", "b.true": true, "s.false": "false", "b.false": false, "s.10": "10", "i.10": 10, "i.-10": -10}` + var golden = map[string]string{"s.true": "true", "b.true": "true", "s.false": "false", "b.false": "false", "s.10": "10", "i.10": "10", "i.-10": "-10"} + + var m map[string]string + d := NewDecoderBytes([]byte(b), testJsonH) + d.MustDecode(&m) + if err := deepEqual(golden, m); err == nil { + logT(t, "++++ match: decoded: %#v", m) + } else { + logT(t, "---- mismatch: %v ==> golden: %#v, decoded: %#v", err, golden, m) + failT(t) + } +} + // TODO: // Add Tests for: // - decoding empty list/map in stream into a nil slice/map diff --git a/vendor/github.com/ugorji/go/codec/json.go b/vendor/github.com/ugorji/go/codec/json.go index 463cae3d..df67d68c 100644 --- a/vendor/github.com/ugorji/go/codec/json.go +++ b/vendor/github.com/ugorji/go/codec/json.go @@ -702,7 +702,9 @@ LOOP: switch state { case 0: state = 2 - // do not add sign to the slice ... + if storeBytes { + d.bs = append(d.bs, b) + } b, eof = r.readn1eof() continue case 6: // typ = jsonNumFloat @@ -715,7 +717,9 @@ LOOP: case 0: state = 2 n.neg = true - // do not add sign to the slice ... + if storeBytes { + d.bs = append(d.bs, b) + } b, eof = r.readn1eof() continue case 6: // typ = jsonNumFloat @@ -981,16 +985,28 @@ func (d *jsonDecDriver) appendStringAsBytes() { d.tok = b } - // handle null as a string - if d.tok == 'n' { - d.readStrIdx(10, 13) // ull - d.bs = d.bs[:0] + if d.tok != '"' { + // d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok) + // handle non-string scalar: null, true, false or a number + switch d.tok { + case 'n': + d.readStrIdx(10, 13) // ull + d.bs = d.bs[:0] + case 'f': + d.readStrIdx(5, 9) // alse + d.bs = d.bs[:5] + copy(d.bs, "false") + case 't': + d.readStrIdx(1, 4) // rue + d.bs = d.bs[:4] + copy(d.bs, "true") + default: + // try to parse a valid number + d.decNum(true) + } return } - if d.tok != '"' { - d.d.errorf("json: expect char '%c' but got char '%c'", '"', d.tok) - } d.tok = 0 v := d.bs[:0] @@ -1159,6 +1175,7 @@ func (d *jsonDecDriver) DecodeNaked() { type JsonHandle struct { textEncodingType BasicHandle + // RawBytesExt, if configured, is used to encode and decode raw bytes in a custom way. // If not configured, raw bytes are encoded to/from base64 text. RawBytesExt InterfaceExt diff --git a/vendor/github.com/ugorji/go/codec/prebuild.sh b/vendor/github.com/ugorji/go/codec/prebuild.sh index 422c1a73..04c61e48 100755 --- a/vendor/github.com/ugorji/go/codec/prebuild.sh +++ b/vendor/github.com/ugorji/go/codec/prebuild.sh @@ -155,8 +155,8 @@ _codegenerators() { # remove (M|Unm)arshalJSON implementations, so they don't conflict with encoding/json bench \ if [[ $zexternal == "1" ]] then - sed -i 's+ MarshalJSON(+ _MarshalJSON(+g' values_ffjson${zsfx} && \ - sed -i 's+ UnmarshalJSON(+ _UnmarshalJSON(+g' values_ffjson${zsfx} + sed -i '' -e 's+ MarshalJSON(+ _MarshalJSON(+g' values_ffjson${zsfx} && \ + sed -i '' -e 's+ UnmarshalJSON(+ _UnmarshalJSON(+g' values_ffjson${zsfx} fi && \ echo "generators done!" && \ true diff --git a/vendor/github.com/ugorji/go/codec/test.py b/vendor/github.com/ugorji/go/codec/test.py index f983d9d9..800376f6 100755 --- a/vendor/github.com/ugorji/go/codec/test.py +++ b/vendor/github.com/ugorji/go/codec/test.py @@ -84,7 +84,7 @@ def Echo123(self, msg1, msg2, msg3): def EchoStruct(self, msg): return ("%s" % msg) - addr = msgpackrpc.Address('localhost', port) + addr = msgpackrpc.Address('127.0.0.1', port) server = msgpackrpc.Server(EchoHandler()) server.listen(addr) # run thread to stop it after stopTimeSec seconds if > 0 @@ -96,14 +96,14 @@ def myStopRpcServer(): server.start() def doRpcClientToPythonSvc(port): - address = msgpackrpc.Address('localhost', port) + address = msgpackrpc.Address('127.0.0.1', port) client = msgpackrpc.Client(address, unpack_encoding='utf-8') print client.call("Echo123", "A1", "B2", "C3") print client.call("EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) def doRpcClientToGoSvc(port): # print ">>>> port: ", port, " <<<<<" - address = msgpackrpc.Address('localhost', port) + address = msgpackrpc.Address('127.0.0.1', port) client = msgpackrpc.Client(address, unpack_encoding='utf-8') print client.call("TestRpcInt.Echo123", ["A1", "B2", "C3"]) print client.call("TestRpcInt.EchoStruct", {"A" :"Aa", "B":"Bb", "C":"Cc"}) diff --git a/vendor/golang.org/x/crypto/sha3/sha3.go b/vendor/golang.org/x/crypto/sha3/sha3.go index c86167c0..b12a35c8 100644 --- a/vendor/golang.org/x/crypto/sha3/sha3.go +++ b/vendor/golang.org/x/crypto/sha3/sha3.go @@ -42,9 +42,8 @@ type state struct { storage [maxRate]byte // Specific to SHA-3 and SHAKE. - fixedOutput bool // whether this is a fixed-output-length instance - outputLen int // the default output size in bytes - state spongeDirection // whether the sponge is absorbing or squeezing + outputLen int // the default output size in bytes + state spongeDirection // whether the sponge is absorbing or squeezing } // BlockSize returns the rate of sponge underlying this hash function. diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index e0dfe9f6..adb77ffa 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -87,7 +87,7 @@ type Transport struct { // MaxHeaderListSize is the http2 SETTINGS_MAX_HEADER_LIST_SIZE to // send in the initial settings frame. It is how many bytes - // of response headers are allow. Unlike the http2 spec, zero here + // of response headers are allowed. Unlike the http2 spec, zero here // means to use a default limit (currently 10MB). If you actually // want to advertise an ulimited value to the peer, Transport // interprets the highest possible value here (0xffffffff or 1<<32-1) @@ -172,9 +172,10 @@ type ClientConn struct { fr *Framer lastActive time.Time // Settings from peer: (also guarded by mu) - maxFrameSize uint32 - maxConcurrentStreams uint32 - initialWindowSize uint32 + maxFrameSize uint32 + maxConcurrentStreams uint32 + peerMaxHeaderListSize uint64 + initialWindowSize uint32 hbuf bytes.Buffer // HPACK encoder writes into this henc *hpack.Encoder @@ -519,17 +520,18 @@ func (t *Transport) NewClientConn(c net.Conn) (*ClientConn, error) { func (t *Transport) newClientConn(c net.Conn, singleUse bool) (*ClientConn, error) { cc := &ClientConn{ - t: t, - tconn: c, - readerDone: make(chan struct{}), - nextStreamID: 1, - maxFrameSize: 16 << 10, // spec default - initialWindowSize: 65535, // spec default - maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. - streams: make(map[uint32]*clientStream), - singleUse: singleUse, - wantSettingsAck: true, - pings: make(map[[8]byte]chan struct{}), + t: t, + tconn: c, + readerDone: make(chan struct{}), + nextStreamID: 1, + maxFrameSize: 16 << 10, // spec default + initialWindowSize: 65535, // spec default + maxConcurrentStreams: 1000, // "infinite", per spec. 1000 seems good enough. + peerMaxHeaderListSize: 0xffffffffffffffff, // "infinite", per spec. Use 2^64-1 instead. + streams: make(map[uint32]*clientStream), + singleUse: singleUse, + wantSettingsAck: true, + pings: make(map[[8]byte]chan struct{}), } if d := t.idleConnTimeout(); d != 0 { cc.idleTimeout = d @@ -1085,8 +1087,13 @@ func (cs *clientStream) writeRequestBody(body io.Reader, bodyCloser io.Closer) ( var trls []byte if hasTrailers { cc.mu.Lock() - defer cc.mu.Unlock() - trls = cc.encodeTrailers(req) + trls, err = cc.encodeTrailers(req) + cc.mu.Unlock() + if err != nil { + cc.writeStreamReset(cs.ID, ErrCodeInternal, err) + cc.forgetStreamID(cs.ID) + return err + } } cc.wmu.Lock() @@ -1189,62 +1196,86 @@ func (cc *ClientConn) encodeHeaders(req *http.Request, addGzipHeader bool, trail } } - // 8.1.2.3 Request Pseudo-Header Fields - // The :path pseudo-header field includes the path and query parts of the - // target URI (the path-absolute production and optionally a '?' character - // followed by the query production (see Sections 3.3 and 3.4 of - // [RFC3986]). - cc.writeHeader(":authority", host) - cc.writeHeader(":method", req.Method) - if req.Method != "CONNECT" { - cc.writeHeader(":path", path) - cc.writeHeader(":scheme", req.URL.Scheme) - } - if trailers != "" { - cc.writeHeader("trailer", trailers) - } + enumerateHeaders := func(f func(name, value string)) { + // 8.1.2.3 Request Pseudo-Header Fields + // The :path pseudo-header field includes the path and query parts of the + // target URI (the path-absolute production and optionally a '?' character + // followed by the query production (see Sections 3.3 and 3.4 of + // [RFC3986]). + f(":authority", host) + f(":method", req.Method) + if req.Method != "CONNECT" { + f(":path", path) + f(":scheme", req.URL.Scheme) + } + if trailers != "" { + f("trailer", trailers) + } - var didUA bool - for k, vv := range req.Header { - lowKey := strings.ToLower(k) - switch lowKey { - case "host", "content-length": - // Host is :authority, already sent. - // Content-Length is automatic, set below. - continue - case "connection", "proxy-connection", "transfer-encoding", "upgrade", "keep-alive": - // Per 8.1.2.2 Connection-Specific Header - // Fields, don't send connection-specific - // fields. We have already checked if any - // are error-worthy so just ignore the rest. - continue - case "user-agent": - // Match Go's http1 behavior: at most one - // User-Agent. If set to nil or empty string, - // then omit it. Otherwise if not mentioned, - // include the default (below). - didUA = true - if len(vv) < 1 { + var didUA bool + for k, vv := range req.Header { + if strings.EqualFold(k, "host") || strings.EqualFold(k, "content-length") { + // Host is :authority, already sent. + // Content-Length is automatic, set below. continue - } - vv = vv[:1] - if vv[0] == "" { + } else if strings.EqualFold(k, "connection") || strings.EqualFold(k, "proxy-connection") || + strings.EqualFold(k, "transfer-encoding") || strings.EqualFold(k, "upgrade") || + strings.EqualFold(k, "keep-alive") { + // Per 8.1.2.2 Connection-Specific Header + // Fields, don't send connection-specific + // fields. We have already checked if any + // are error-worthy so just ignore the rest. continue + } else if strings.EqualFold(k, "user-agent") { + // Match Go's http1 behavior: at most one + // User-Agent. If set to nil or empty string, + // then omit it. Otherwise if not mentioned, + // include the default (below). + didUA = true + if len(vv) < 1 { + continue + } + vv = vv[:1] + if vv[0] == "" { + continue + } + + } + + for _, v := range vv { + f(k, v) } } - for _, v := range vv { - cc.writeHeader(lowKey, v) + if shouldSendReqContentLength(req.Method, contentLength) { + f("content-length", strconv.FormatInt(contentLength, 10)) + } + if addGzipHeader { + f("accept-encoding", "gzip") + } + if !didUA { + f("user-agent", defaultUserAgent) } } - if shouldSendReqContentLength(req.Method, contentLength) { - cc.writeHeader("content-length", strconv.FormatInt(contentLength, 10)) - } - if addGzipHeader { - cc.writeHeader("accept-encoding", "gzip") - } - if !didUA { - cc.writeHeader("user-agent", defaultUserAgent) + + // Do a first pass over the headers counting bytes to ensure + // we don't exceed cc.peerMaxHeaderListSize. This is done as a + // separate pass before encoding the headers to prevent + // modifying the hpack state. + hlSize := uint64(0) + enumerateHeaders(func(name, value string) { + hf := hpack.HeaderField{Name: name, Value: value} + hlSize += uint64(hf.Size()) + }) + + if hlSize > cc.peerMaxHeaderListSize { + return nil, errRequestHeaderListSize } + + // Header list size is ok. Write the headers. + enumerateHeaders(func(name, value string) { + cc.writeHeader(strings.ToLower(name), value) + }) + return cc.hbuf.Bytes(), nil } @@ -1271,17 +1302,29 @@ func shouldSendReqContentLength(method string, contentLength int64) bool { } // requires cc.mu be held. -func (cc *ClientConn) encodeTrailers(req *http.Request) []byte { +func (cc *ClientConn) encodeTrailers(req *http.Request) ([]byte, error) { cc.hbuf.Reset() + + hlSize := uint64(0) for k, vv := range req.Trailer { - // Transfer-Encoding, etc.. have already been filter at the + for _, v := range vv { + hf := hpack.HeaderField{Name: k, Value: v} + hlSize += uint64(hf.Size()) + } + } + if hlSize > cc.peerMaxHeaderListSize { + return nil, errRequestHeaderListSize + } + + for k, vv := range req.Trailer { + // Transfer-Encoding, etc.. have already been filtered at the // start of RoundTrip lowKey := strings.ToLower(k) for _, v := range vv { cc.writeHeader(lowKey, v) } } - return cc.hbuf.Bytes() + return cc.hbuf.Bytes(), nil } func (cc *ClientConn) writeHeader(name, value string) { @@ -1789,6 +1832,14 @@ func (rl *clientConnReadLoop) processData(f *DataFrame) error { } return nil } + if !cs.firstByte { + cc.logf("protocol error: received DATA before a HEADERS frame") + rl.endStreamError(cs, StreamError{ + StreamID: f.StreamID, + Code: ErrCodeProtocol, + }) + return nil + } if f.Length > 0 { // Check connection-level flow control. cc.mu.Lock() @@ -1903,6 +1954,8 @@ func (rl *clientConnReadLoop) processSettings(f *SettingsFrame) error { cc.maxFrameSize = s.Val case SettingMaxConcurrentStreams: cc.maxConcurrentStreams = s.Val + case SettingMaxHeaderListSize: + cc.peerMaxHeaderListSize = uint64(s.Val) case SettingInitialWindowSize: // Values above the maximum flow-control // window size of 2^31-1 MUST be treated as a @@ -2069,6 +2122,7 @@ func (cc *ClientConn) writeStreamReset(streamID uint32, code ErrCode, err error) var ( errResponseHeaderListSize = errors.New("http2: response header list larger than advertised limit") + errRequestHeaderListSize = errors.New("http2: request header list larger than peer's advertised limit") errPseudoTrailers = errors.New("http2: invalid pseudo header in trailers") ) diff --git a/vendor/golang.org/x/net/http2/transport_test.go b/vendor/golang.org/x/net/http2/transport_test.go index ac4661f4..0126ff48 100644 --- a/vendor/golang.org/x/net/http2/transport_test.go +++ b/vendor/golang.org/x/net/http2/transport_test.go @@ -16,6 +16,7 @@ import ( "math/rand" "net" "net/http" + "net/http/httptest" "net/url" "os" "reflect" @@ -1370,6 +1371,269 @@ func testInvalidTrailer(t *testing.T, trailers headerType, wantErr error, writeT ct.run() } +// headerListSize returns the HTTP2 header list size of h. +// http://httpwg.org/specs/rfc7540.html#SETTINGS_MAX_HEADER_LIST_SIZE +// http://httpwg.org/specs/rfc7540.html#MaxHeaderBlock +func headerListSize(h http.Header) (size uint32) { + for k, vv := range h { + for _, v := range vv { + hf := hpack.HeaderField{Name: k, Value: v} + size += hf.Size() + } + } + return size +} + +// padHeaders adds data to an http.Header until headerListSize(h) == +// limit. Due to the way header list sizes are calculated, padHeaders +// cannot add fewer than len("Pad-Headers") + 32 bytes to h, and will +// call t.Fatal if asked to do so. PadHeaders first reserves enough +// space for an empty "Pad-Headers" key, then adds as many copies of +// filler as possible. Any remaining bytes necessary to push the +// header list size up to limit are added to h["Pad-Headers"]. +func padHeaders(t *testing.T, h http.Header, limit uint64, filler string) { + if limit > 0xffffffff { + t.Fatalf("padHeaders: refusing to pad to more than 2^32-1 bytes. limit = %v", limit) + } + hf := hpack.HeaderField{Name: "Pad-Headers", Value: ""} + minPadding := uint64(hf.Size()) + size := uint64(headerListSize(h)) + + minlimit := size + minPadding + if limit < minlimit { + t.Fatalf("padHeaders: limit %v < %v", limit, minlimit) + } + + // Use a fixed-width format for name so that fieldSize + // remains constant. + nameFmt := "Pad-Headers-%06d" + hf = hpack.HeaderField{Name: fmt.Sprintf(nameFmt, 1), Value: filler} + fieldSize := uint64(hf.Size()) + + // Add as many complete filler values as possible, leaving + // room for at least one empty "Pad-Headers" key. + limit = limit - minPadding + for i := 0; size+fieldSize < limit; i++ { + name := fmt.Sprintf(nameFmt, i) + h.Add(name, filler) + size += fieldSize + } + + // Add enough bytes to reach limit. + remain := limit - size + lastValue := strings.Repeat("*", int(remain)) + h.Add("Pad-Headers", lastValue) +} + +func TestPadHeaders(t *testing.T) { + check := func(h http.Header, limit uint32, fillerLen int) { + if h == nil { + h = make(http.Header) + } + filler := strings.Repeat("f", fillerLen) + padHeaders(t, h, uint64(limit), filler) + gotSize := headerListSize(h) + if gotSize != limit { + t.Errorf("Got size = %v; want %v", gotSize, limit) + } + } + // Try all possible combinations for small fillerLen and limit. + hf := hpack.HeaderField{Name: "Pad-Headers", Value: ""} + minLimit := hf.Size() + for limit := minLimit; limit <= 128; limit++ { + for fillerLen := 0; uint32(fillerLen) <= limit; fillerLen++ { + check(nil, limit, fillerLen) + } + } + + // Try a few tests with larger limits, plus cumulative + // tests. Since these tests are cumulative, tests[i+1].limit + // must be >= tests[i].limit + minLimit. See the comment on + // padHeaders for more info on why the limit arg has this + // restriction. + tests := []struct { + fillerLen int + limit uint32 + }{ + { + fillerLen: 64, + limit: 1024, + }, + { + fillerLen: 1024, + limit: 1286, + }, + { + fillerLen: 256, + limit: 2048, + }, + { + fillerLen: 1024, + limit: 10 * 1024, + }, + { + fillerLen: 1023, + limit: 11 * 1024, + }, + } + h := make(http.Header) + for _, tc := range tests { + check(nil, tc.limit, tc.fillerLen) + check(h, tc.limit, tc.fillerLen) + } +} + +func TestTransportChecksRequestHeaderListSize(t *testing.T) { + st := newServerTester(t, + func(w http.ResponseWriter, r *http.Request) { + // Consume body & force client to send + // trailers before writing response. + // ioutil.ReadAll returns non-nil err for + // requests that attempt to send greater than + // maxHeaderListSize bytes of trailers, since + // those requests generate a stream reset. + ioutil.ReadAll(r.Body) + r.Body.Close() + }, + func(ts *httptest.Server) { + ts.Config.MaxHeaderBytes = 16 << 10 + }, + optOnlyServer, + optQuiet, + ) + defer st.Close() + + tr := &Transport{TLSClientConfig: tlsConfigInsecure} + defer tr.CloseIdleConnections() + + checkRoundTrip := func(req *http.Request, wantErr error, desc string) { + res, err := tr.RoundTrip(req) + if err != wantErr { + if res != nil { + res.Body.Close() + } + t.Errorf("%v: RoundTrip err = %v; want %v", desc, err, wantErr) + return + } + if err == nil { + if res == nil { + t.Errorf("%v: response nil; want non-nil.", desc) + return + } + defer res.Body.Close() + if res.StatusCode != http.StatusOK { + t.Errorf("%v: response status = %v; want %v", desc, res.StatusCode, http.StatusOK) + } + return + } + if res != nil { + t.Errorf("%v: RoundTrip err = %v but response non-nil", desc, err) + } + } + headerListSizeForRequest := func(req *http.Request) (size uint64) { + contentLen := actualContentLength(req) + trailers, err := commaSeparatedTrailers(req) + if err != nil { + t.Fatalf("headerListSizeForRequest: %v", err) + } + cc := &ClientConn{peerMaxHeaderListSize: 0xffffffffffffffff} + cc.henc = hpack.NewEncoder(&cc.hbuf) + cc.mu.Lock() + hdrs, err := cc.encodeHeaders(req, true, trailers, contentLen) + cc.mu.Unlock() + if err != nil { + t.Fatalf("headerListSizeForRequest: %v", err) + } + hpackDec := hpack.NewDecoder(initialHeaderTableSize, func(hf hpack.HeaderField) { + size += uint64(hf.Size()) + }) + if len(hdrs) > 0 { + if _, err := hpackDec.Write(hdrs); err != nil { + t.Fatalf("headerListSizeForRequest: %v", err) + } + } + return size + } + // Create a new Request for each test, rather than reusing the + // same Request, to avoid a race when modifying req.Headers. + // See https://github.com/golang/go/issues/21316 + newRequest := func() *http.Request { + // Body must be non-nil to enable writing trailers. + body := strings.NewReader("hello") + req, err := http.NewRequest("POST", st.ts.URL, body) + if err != nil { + t.Fatalf("newRequest: NewRequest: %v", err) + } + return req + } + + // Make an arbitrary request to ensure we get the server's + // settings frame and initialize peerMaxHeaderListSize. + req := newRequest() + checkRoundTrip(req, nil, "Initial request") + + // Get the ClientConn associated with the request and validate + // peerMaxHeaderListSize. + addr := authorityAddr(req.URL.Scheme, req.URL.Host) + cc, err := tr.connPool().GetClientConn(req, addr) + if err != nil { + t.Fatalf("GetClientConn: %v", err) + } + cc.mu.Lock() + peerSize := cc.peerMaxHeaderListSize + cc.mu.Unlock() + st.scMu.Lock() + wantSize := uint64(st.sc.maxHeaderListSize()) + st.scMu.Unlock() + if peerSize != wantSize { + t.Errorf("peerMaxHeaderListSize = %v; want %v", peerSize, wantSize) + } + + // Sanity check peerSize. (*serverConn) maxHeaderListSize adds + // 320 bytes of padding. + wantHeaderBytes := uint64(st.ts.Config.MaxHeaderBytes) + 320 + if peerSize != wantHeaderBytes { + t.Errorf("peerMaxHeaderListSize = %v; want %v.", peerSize, wantHeaderBytes) + } + + // Pad headers & trailers, but stay under peerSize. + req = newRequest() + req.Header = make(http.Header) + req.Trailer = make(http.Header) + filler := strings.Repeat("*", 1024) + padHeaders(t, req.Trailer, peerSize, filler) + // cc.encodeHeaders adds some default headers to the request, + // so we need to leave room for those. + defaultBytes := headerListSizeForRequest(req) + padHeaders(t, req.Header, peerSize-defaultBytes, filler) + checkRoundTrip(req, nil, "Headers & Trailers under limit") + + // Add enough header bytes to push us over peerSize. + req = newRequest() + req.Header = make(http.Header) + padHeaders(t, req.Header, peerSize, filler) + checkRoundTrip(req, errRequestHeaderListSize, "Headers over limit") + + // Push trailers over the limit. + req = newRequest() + req.Trailer = make(http.Header) + padHeaders(t, req.Trailer, peerSize+1, filler) + checkRoundTrip(req, errRequestHeaderListSize, "Trailers over limit") + + // Send headers with a single large value. + req = newRequest() + filler = strings.Repeat("*", int(peerSize)) + req.Header = make(http.Header) + req.Header.Set("Big", filler) + checkRoundTrip(req, errRequestHeaderListSize, "Single large header") + + // Send trailers with a single large value. + req = newRequest() + req.Trailer = make(http.Header) + req.Trailer.Set("Big", filler) + checkRoundTrip(req, errRequestHeaderListSize, "Single large trailer") +} + func TestTransportChecksResponseHeaderListSize(t *testing.T) { ct := newClientTester(t) ct.client = func() error { @@ -2662,7 +2926,7 @@ func TestTransportRequestPathPseudo(t *testing.T) { }, } for i, tt := range tests { - cc := &ClientConn{} + cc := &ClientConn{peerMaxHeaderListSize: 0xffffffffffffffff} cc.henc = hpack.NewEncoder(&cc.hbuf) cc.mu.Lock() hdrs, err := cc.encodeHeaders(tt.req, false, "", -1) @@ -3036,6 +3300,60 @@ func TestTransportRetryHasLimit(t *testing.T) { ct.run() } +func TestTransportResponseDataBeforeHeaders(t *testing.T) { + ct := newClientTester(t) + ct.client = func() error { + defer ct.cc.(*net.TCPConn).CloseWrite() + req := httptest.NewRequest("GET", "https://dummy.tld/", nil) + // First request is normal to ensure the check is per stream and not per connection. + _, err := ct.tr.RoundTrip(req) + if err != nil { + return fmt.Errorf("RoundTrip expected no error, got: %v", err) + } + // Second request returns a DATA frame with no HEADERS. + resp, err := ct.tr.RoundTrip(req) + if err == nil { + return fmt.Errorf("RoundTrip expected error, got response: %+v", resp) + } + if err, ok := err.(StreamError); !ok || err.Code != ErrCodeProtocol { + return fmt.Errorf("expected stream PROTOCOL_ERROR, got: %v", err) + } + return nil + } + ct.server = func() error { + ct.greet() + for { + f, err := ct.fr.ReadFrame() + if err == io.EOF { + return nil + } else if err != nil { + return err + } + switch f := f.(type) { + case *WindowUpdateFrame, *SettingsFrame: + case *HeadersFrame: + switch f.StreamID { + case 1: + // Send a valid response to first request. + var buf bytes.Buffer + enc := hpack.NewEncoder(&buf) + enc.WriteField(hpack.HeaderField{Name: ":status", Value: "200"}) + ct.fr.WriteHeaders(HeadersFrameParam{ + StreamID: f.StreamID, + EndHeaders: true, + EndStream: true, + BlockFragment: buf.Bytes(), + }) + case 3: + ct.fr.WriteData(f.StreamID, true, []byte("payload")) + } + default: + return fmt.Errorf("Unexpected client frame %v", f) + } + } + } + ct.run() +} func TestTransportRequestsStallAtServerLimit(t *testing.T) { const maxConcurrent = 2 @@ -3318,3 +3636,51 @@ func TestTransportNoBodyMeansNoDATA(t *testing.T) { } ct.run() } + +func benchSimpleRoundTrip(b *testing.B, nHeaders int) { + defer disableGoroutineTracking()() + b.ReportAllocs() + st := newServerTester(b, + func(w http.ResponseWriter, r *http.Request) { + }, + optOnlyServer, + optQuiet, + ) + defer st.Close() + + tr := &Transport{TLSClientConfig: tlsConfigInsecure} + defer tr.CloseIdleConnections() + + req, err := http.NewRequest("GET", st.ts.URL, nil) + if err != nil { + b.Fatal(err) + } + + for i := 0; i < nHeaders; i++ { + name := fmt.Sprint("A-", i) + req.Header.Set(name, "*") + } + + b.ResetTimer() + + for i := 0; i < b.N; i++ { + res, err := tr.RoundTrip(req) + if err != nil { + if res != nil { + res.Body.Close() + } + b.Fatalf("RoundTrip err = %v; want nil", err) + } + res.Body.Close() + if res.StatusCode != http.StatusOK { + b.Fatalf("Response code = %v; want %v", res.StatusCode, http.StatusOK) + } + } +} + +func BenchmarkClientRequestHeaders(b *testing.B) { + b.Run(" 0 Headers", func(b *testing.B) { benchSimpleRoundTrip(b, 0) }) + b.Run(" 10 Headers", func(b *testing.B) { benchSimpleRoundTrip(b, 10) }) + b.Run(" 100 Headers", func(b *testing.B) { benchSimpleRoundTrip(b, 100) }) + b.Run("1000 Headers", func(b *testing.B) { benchSimpleRoundTrip(b, 1000) }) +} diff --git a/vendor/golang.org/x/sys/unix/creds_test.go b/vendor/golang.org/x/sys/unix/creds_test.go index eaae7c36..7ae33053 100644 --- a/vendor/golang.org/x/sys/unix/creds_test.go +++ b/vendor/golang.org/x/sys/unix/creds_test.go @@ -21,101 +21,116 @@ import ( // sockets. The SO_PASSCRED socket option is enabled on the sending // socket for this to work. func TestSCMCredentials(t *testing.T) { - fds, err := unix.Socketpair(unix.AF_LOCAL, unix.SOCK_STREAM, 0) - if err != nil { - t.Fatalf("Socketpair: %v", err) + socketTypeTests := []struct { + socketType int + dataLen int + }{ + { + unix.SOCK_STREAM, + 1, + }, { + unix.SOCK_DGRAM, + 0, + }, } - defer unix.Close(fds[0]) - defer unix.Close(fds[1]) - err = unix.SetsockoptInt(fds[0], unix.SOL_SOCKET, unix.SO_PASSCRED, 1) - if err != nil { - t.Fatalf("SetsockoptInt: %v", err) - } + for _, tt := range socketTypeTests { + fds, err := unix.Socketpair(unix.AF_LOCAL, tt.socketType, 0) + if err != nil { + t.Fatalf("Socketpair: %v", err) + } + defer unix.Close(fds[0]) + defer unix.Close(fds[1]) - srvFile := os.NewFile(uintptr(fds[0]), "server") - defer srvFile.Close() - srv, err := net.FileConn(srvFile) - if err != nil { - t.Errorf("FileConn: %v", err) - return - } - defer srv.Close() + err = unix.SetsockoptInt(fds[0], unix.SOL_SOCKET, unix.SO_PASSCRED, 1) + if err != nil { + t.Fatalf("SetsockoptInt: %v", err) + } - cliFile := os.NewFile(uintptr(fds[1]), "client") - defer cliFile.Close() - cli, err := net.FileConn(cliFile) - if err != nil { - t.Errorf("FileConn: %v", err) - return - } - defer cli.Close() + srvFile := os.NewFile(uintptr(fds[0]), "server") + defer srvFile.Close() + srv, err := net.FileConn(srvFile) + if err != nil { + t.Errorf("FileConn: %v", err) + return + } + defer srv.Close() + + cliFile := os.NewFile(uintptr(fds[1]), "client") + defer cliFile.Close() + cli, err := net.FileConn(cliFile) + if err != nil { + t.Errorf("FileConn: %v", err) + return + } + defer cli.Close() + + var ucred unix.Ucred + if os.Getuid() != 0 { + ucred.Pid = int32(os.Getpid()) + ucred.Uid = 0 + ucred.Gid = 0 + oob := unix.UnixCredentials(&ucred) + _, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil) + if op, ok := err.(*net.OpError); ok { + err = op.Err + } + if sys, ok := err.(*os.SyscallError); ok { + err = sys.Err + } + if err != syscall.EPERM { + t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err) + } + } - var ucred unix.Ucred - if os.Getuid() != 0 { ucred.Pid = int32(os.Getpid()) - ucred.Uid = 0 - ucred.Gid = 0 + ucred.Uid = uint32(os.Getuid()) + ucred.Gid = uint32(os.Getgid()) oob := unix.UnixCredentials(&ucred) - _, _, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil) - if op, ok := err.(*net.OpError); ok { - err = op.Err + + // On SOCK_STREAM, this is internally going to send a dummy byte + n, oobn, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil) + if err != nil { + t.Fatalf("WriteMsgUnix: %v", err) } - if sys, ok := err.(*os.SyscallError); ok { - err = sys.Err + if n != 0 { + t.Fatalf("WriteMsgUnix n = %d, want 0", n) } - if err != syscall.EPERM { - t.Fatalf("WriteMsgUnix failed with %v, want EPERM", err) + if oobn != len(oob) { + t.Fatalf("WriteMsgUnix oobn = %d, want %d", oobn, len(oob)) } - } - - ucred.Pid = int32(os.Getpid()) - ucred.Uid = uint32(os.Getuid()) - ucred.Gid = uint32(os.Getgid()) - oob := unix.UnixCredentials(&ucred) - - // this is going to send a dummy byte - n, oobn, err := cli.(*net.UnixConn).WriteMsgUnix(nil, oob, nil) - if err != nil { - t.Fatalf("WriteMsgUnix: %v", err) - } - if n != 0 { - t.Fatalf("WriteMsgUnix n = %d, want 0", n) - } - if oobn != len(oob) { - t.Fatalf("WriteMsgUnix oobn = %d, want %d", oobn, len(oob)) - } - oob2 := make([]byte, 10*len(oob)) - n, oobn2, flags, _, err := srv.(*net.UnixConn).ReadMsgUnix(nil, oob2) - if err != nil { - t.Fatalf("ReadMsgUnix: %v", err) - } - if flags != 0 { - t.Fatalf("ReadMsgUnix flags = 0x%x, want 0", flags) - } - if n != 1 { - t.Fatalf("ReadMsgUnix n = %d, want 1 (dummy byte)", n) - } - if oobn2 != oobn { - // without SO_PASSCRED set on the socket, ReadMsgUnix will - // return zero oob bytes - t.Fatalf("ReadMsgUnix oobn = %d, want %d", oobn2, oobn) - } - oob2 = oob2[:oobn2] - if !bytes.Equal(oob, oob2) { - t.Fatal("ReadMsgUnix oob bytes don't match") - } + oob2 := make([]byte, 10*len(oob)) + n, oobn2, flags, _, err := srv.(*net.UnixConn).ReadMsgUnix(nil, oob2) + if err != nil { + t.Fatalf("ReadMsgUnix: %v", err) + } + if flags != 0 { + t.Fatalf("ReadMsgUnix flags = 0x%x, want 0", flags) + } + if n != tt.dataLen { + t.Fatalf("ReadMsgUnix n = %d, want %d", n, tt.dataLen) + } + if oobn2 != oobn { + // without SO_PASSCRED set on the socket, ReadMsgUnix will + // return zero oob bytes + t.Fatalf("ReadMsgUnix oobn = %d, want %d", oobn2, oobn) + } + oob2 = oob2[:oobn2] + if !bytes.Equal(oob, oob2) { + t.Fatal("ReadMsgUnix oob bytes don't match") + } - scm, err := unix.ParseSocketControlMessage(oob2) - if err != nil { - t.Fatalf("ParseSocketControlMessage: %v", err) - } - newUcred, err := unix.ParseUnixCredentials(&scm[0]) - if err != nil { - t.Fatalf("ParseUnixCredentials: %v", err) - } - if *newUcred != ucred { - t.Fatalf("ParseUnixCredentials = %+v, want %+v", newUcred, ucred) + scm, err := unix.ParseSocketControlMessage(oob2) + if err != nil { + t.Fatalf("ParseSocketControlMessage: %v", err) + } + newUcred, err := unix.ParseUnixCredentials(&scm[0]) + if err != nil { + t.Fatalf("ParseUnixCredentials: %v", err) + } + if *newUcred != ucred { + t.Fatalf("ParseUnixCredentials = %+v, want %+v", newUcred, ucred) + } } } diff --git a/vendor/golang.org/x/sys/unix/linux/types.go b/vendor/golang.org/x/sys/unix/linux/types.go index e5769db5..27d9a991 100644 --- a/vendor/golang.org/x/sys/unix/linux/types.go +++ b/vendor/golang.org/x/sys/unix/linux/types.go @@ -62,6 +62,8 @@ package unix #include #include #include +#include +#include // On mips64, the glibc stat and kernel stat do not agree #if (defined(__mips__) && _MIPS_SIM == _MIPS_SIM_ABI64) @@ -550,3 +552,56 @@ const _SC_PAGESIZE = C._SC_PAGESIZE type Termios C.termios_t type Winsize C.struct_winsize + +// Taskstats + +type Taskstats C.struct_taskstats + +const ( + TASKSTATS_CMD_UNSPEC = C.TASKSTATS_CMD_UNSPEC + TASKSTATS_CMD_GET = C.TASKSTATS_CMD_GET + TASKSTATS_CMD_NEW = C.TASKSTATS_CMD_NEW + TASKSTATS_TYPE_UNSPEC = C.TASKSTATS_TYPE_UNSPEC + TASKSTATS_TYPE_PID = C.TASKSTATS_TYPE_PID + TASKSTATS_TYPE_TGID = C.TASKSTATS_TYPE_TGID + TASKSTATS_TYPE_STATS = C.TASKSTATS_TYPE_STATS + TASKSTATS_TYPE_AGGR_PID = C.TASKSTATS_TYPE_AGGR_PID + TASKSTATS_TYPE_AGGR_TGID = C.TASKSTATS_TYPE_AGGR_TGID + TASKSTATS_TYPE_NULL = C.TASKSTATS_TYPE_NULL + TASKSTATS_CMD_ATTR_UNSPEC = C.TASKSTATS_CMD_ATTR_UNSPEC + TASKSTATS_CMD_ATTR_PID = C.TASKSTATS_CMD_ATTR_PID + TASKSTATS_CMD_ATTR_TGID = C.TASKSTATS_CMD_ATTR_TGID + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = C.TASKSTATS_CMD_ATTR_REGISTER_CPUMASK + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = C.TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK +) + +// Generic netlink + +type Genlmsghdr C.struct_genlmsghdr + +const ( + CTRL_CMD_UNSPEC = C.CTRL_CMD_UNSPEC + CTRL_CMD_NEWFAMILY = C.CTRL_CMD_NEWFAMILY + CTRL_CMD_DELFAMILY = C.CTRL_CMD_DELFAMILY + CTRL_CMD_GETFAMILY = C.CTRL_CMD_GETFAMILY + CTRL_CMD_NEWOPS = C.CTRL_CMD_NEWOPS + CTRL_CMD_DELOPS = C.CTRL_CMD_DELOPS + CTRL_CMD_GETOPS = C.CTRL_CMD_GETOPS + CTRL_CMD_NEWMCAST_GRP = C.CTRL_CMD_NEWMCAST_GRP + CTRL_CMD_DELMCAST_GRP = C.CTRL_CMD_DELMCAST_GRP + CTRL_CMD_GETMCAST_GRP = C.CTRL_CMD_GETMCAST_GRP + CTRL_ATTR_UNSPEC = C.CTRL_ATTR_UNSPEC + CTRL_ATTR_FAMILY_ID = C.CTRL_ATTR_FAMILY_ID + CTRL_ATTR_FAMILY_NAME = C.CTRL_ATTR_FAMILY_NAME + CTRL_ATTR_VERSION = C.CTRL_ATTR_VERSION + CTRL_ATTR_HDRSIZE = C.CTRL_ATTR_HDRSIZE + CTRL_ATTR_MAXATTR = C.CTRL_ATTR_MAXATTR + CTRL_ATTR_OPS = C.CTRL_ATTR_OPS + CTRL_ATTR_MCAST_GROUPS = C.CTRL_ATTR_MCAST_GROUPS + CTRL_ATTR_OP_UNSPEC = C.CTRL_ATTR_OP_UNSPEC + CTRL_ATTR_OP_ID = C.CTRL_ATTR_OP_ID + CTRL_ATTR_OP_FLAGS = C.CTRL_ATTR_OP_FLAGS + CTRL_ATTR_MCAST_GRP_UNSPEC = C.CTRL_ATTR_MCAST_GRP_UNSPEC + CTRL_ATTR_MCAST_GRP_NAME = C.CTRL_ATTR_MCAST_GRP_NAME + CTRL_ATTR_MCAST_GRP_ID = C.CTRL_ATTR_MCAST_GRP_ID +) diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 08dd7751..2c434f7a 100755 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -181,6 +181,8 @@ struct ltchars { #include #include #include +#include +#include #include #include @@ -413,6 +415,8 @@ ccflags="$@" $2 ~ /^SECCOMP_MODE_/ || $2 ~ /^SPLICE_/ || $2 ~ /^(VM|VMADDR)_/ || + $2 ~ /^(TASKSTATS|TS)_/ || + $2 ~ /^GENL_/ || $2 ~ /^XATTR_(CREATE|REPLACE)/ || $2 !~ "WMESGLEN" && $2 ~ /^W[A-Z0-9]+$/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 2afe62bf..1b7d59d8 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -931,8 +931,13 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from } var dummy byte if len(oob) > 0 { + var sockType int + sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) + if err != nil { + return + } // receive at least one normal byte - if len(p) == 0 { + if sockType != SOCK_DGRAM && len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } @@ -978,8 +983,13 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) } var dummy byte if len(oob) > 0 { + var sockType int + sockType, err = GetsockoptInt(fd, SOL_SOCKET, SO_TYPE) + if err != nil { + return 0, err + } // send at least one normal byte - if len(p) == 0 { + if sockType != SOCK_DGRAM && len(p) == 0 { iov.Base = &dummy iov.SetLen(1) } diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index a6b3b5f1..33ced1ae 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1626,6 +1639,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 @@ -1765,6 +1784,7 @@ const ( TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x400854d5 TUNDETACHFILTER = 0x400854d6 TUNGETFEATURES = 0x800454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index 4ffc8d29..a6618fc1 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1627,6 +1640,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 @@ -1766,6 +1785,7 @@ const ( TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETFEATURES = 0x800454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index f4b178ef..1adff0b2 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1631,6 +1644,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 @@ -1770,6 +1789,7 @@ const ( TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x400854d5 TUNDETACHFILTER = 0x400854d6 TUNGETFEATURES = 0x800454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 495f13b6..c0ecd47c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -508,6 +508,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1616,6 +1629,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 @@ -1755,6 +1774,7 @@ const ( TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETFEATURES = 0x800454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 59651e41..900f568a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1629,6 +1642,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d @@ -1769,6 +1788,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x800854d5 TUNDETACHFILTER = 0x800854d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index a09bf9b1..4148f277 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1629,6 +1642,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d @@ -1769,6 +1788,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 72a0083c..2310beeb 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1629,6 +1642,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d @@ -1769,6 +1788,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 84c0e3cc..44191b0c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1629,6 +1642,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x5407 TCGETA = 0x5401 TCGETS = 0x540d @@ -1769,6 +1788,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x8000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x800854d5 TUNDETACHFILTER = 0x800854d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 8e4606e0..6772a59b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x4000 @@ -1684,6 +1697,12 @@ const ( TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 @@ -1827,6 +1846,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 16ed1931..ad29c3d3 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x4000 @@ -1684,6 +1697,12 @@ const ( TAB2 = 0x800 TAB3 = 0xc00 TABDLY = 0xc00 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x2000741f TCGETA = 0x40147417 TCGETS = 0x402c7413 @@ -1827,6 +1846,7 @@ const ( TIOCSWINSZ = 0x80087467 TIOCVHANGUP = 0x5437 TOSTOP = 0x400000 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x801054d5 TUNDETACHFILTER = 0x801054d6 TUNGETFEATURES = 0x400454cf diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index bd385f80..3b570754 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -507,6 +507,19 @@ const ( F_ULOCK = 0x0 F_UNLCK = 0x2 F_WRLCK = 0x1 + GENL_ADMIN_PERM = 0x1 + GENL_CMD_CAP_DO = 0x2 + GENL_CMD_CAP_DUMP = 0x4 + GENL_CMD_CAP_HASPOL = 0x8 + GENL_HDRLEN = 0x4 + GENL_ID_CTRL = 0x10 + GENL_ID_PMCRAID = 0x12 + GENL_ID_VFS_DQUOT = 0x11 + GENL_MAX_ID = 0x3ff + GENL_MIN_ID = 0x10 + GENL_NAMSIZ = 0x10 + GENL_START_ALLOC = 0x13 + GENL_UNS_ADMIN_PERM = 0x10 GRND_NONBLOCK = 0x1 GRND_RANDOM = 0x2 HUPCL = 0x400 @@ -1688,6 +1701,12 @@ const ( TAB2 = 0x1000 TAB3 = 0x1800 TABDLY = 0x1800 + TASKSTATS_CMD_ATTR_MAX = 0x4 + TASKSTATS_CMD_MAX = 0x2 + TASKSTATS_GENL_NAME = "TASKSTATS" + TASKSTATS_GENL_VERSION = 0x1 + TASKSTATS_TYPE_MAX = 0x6 + TASKSTATS_VERSION = 0x8 TCFLSH = 0x540b TCGETA = 0x5405 TCGETS = 0x5401 @@ -1827,6 +1846,7 @@ const ( TIOCSWINSZ = 0x5414 TIOCVHANGUP = 0x5437 TOSTOP = 0x100 + TS_COMM_LEN = 0x20 TUNATTACHFILTER = 0x401054d5 TUNDETACHFILTER = 0x401054d6 TUNGETFEATURES = 0x800454cf diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index 0dcebb50..7b36896e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -692,3 +692,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index d70e5434..e54fa984 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -710,3 +710,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index 497f5631..bff6ce25 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -681,3 +681,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]uint8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index f0bdaede..a3d0cc4a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -689,3 +689,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 850a68cb..8fa6603f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -686,3 +686,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 92aac5d9..3e5fc625 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -691,3 +691,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index 623f5812..f9bd1ab0 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -691,3 +691,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index 56598a1b..74c54213 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -686,3 +686,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index acc7c819..2b0b18e9 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -699,3 +699,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]uint8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index b348885c..b2b59992 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -699,3 +699,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + Pad_cgo_0 [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + Pad_cgo_1 [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]uint8 + Ac_sched uint8 + Ac_pad [3]uint8 + Pad_cgo_2 [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + Pad_cgo_3 [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index a706e2f8..5e0aa663 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -716,3 +716,104 @@ type Winsize struct { Xpixel uint16 Ypixel uint16 } + +type Taskstats struct { + Version uint16 + _ [2]byte + Ac_exitcode uint32 + Ac_flag uint8 + Ac_nice uint8 + _ [6]byte + Cpu_count uint64 + Cpu_delay_total uint64 + Blkio_count uint64 + Blkio_delay_total uint64 + Swapin_count uint64 + Swapin_delay_total uint64 + Cpu_run_real_total uint64 + Cpu_run_virtual_total uint64 + Ac_comm [32]int8 + Ac_sched uint8 + Ac_pad [3]uint8 + _ [4]byte + Ac_uid uint32 + Ac_gid uint32 + Ac_pid uint32 + Ac_ppid uint32 + Ac_btime uint32 + _ [4]byte + Ac_etime uint64 + Ac_utime uint64 + Ac_stime uint64 + Ac_minflt uint64 + Ac_majflt uint64 + Coremem uint64 + Virtmem uint64 + Hiwater_rss uint64 + Hiwater_vm uint64 + Read_char uint64 + Write_char uint64 + Read_syscalls uint64 + Write_syscalls uint64 + Read_bytes uint64 + Write_bytes uint64 + Cancelled_write_bytes uint64 + Nvcsw uint64 + Nivcsw uint64 + Ac_utimescaled uint64 + Ac_stimescaled uint64 + Cpu_scaled_run_real_total uint64 + Freepages_count uint64 + Freepages_delay_total uint64 +} + +const ( + TASKSTATS_CMD_UNSPEC = 0x0 + TASKSTATS_CMD_GET = 0x1 + TASKSTATS_CMD_NEW = 0x2 + TASKSTATS_TYPE_UNSPEC = 0x0 + TASKSTATS_TYPE_PID = 0x1 + TASKSTATS_TYPE_TGID = 0x2 + TASKSTATS_TYPE_STATS = 0x3 + TASKSTATS_TYPE_AGGR_PID = 0x4 + TASKSTATS_TYPE_AGGR_TGID = 0x5 + TASKSTATS_TYPE_NULL = 0x6 + TASKSTATS_CMD_ATTR_UNSPEC = 0x0 + TASKSTATS_CMD_ATTR_PID = 0x1 + TASKSTATS_CMD_ATTR_TGID = 0x2 + TASKSTATS_CMD_ATTR_REGISTER_CPUMASK = 0x3 + TASKSTATS_CMD_ATTR_DEREGISTER_CPUMASK = 0x4 +) + +type Genlmsghdr struct { + Cmd uint8 + Version uint8 + Reserved uint16 +} + +const ( + CTRL_CMD_UNSPEC = 0x0 + CTRL_CMD_NEWFAMILY = 0x1 + CTRL_CMD_DELFAMILY = 0x2 + CTRL_CMD_GETFAMILY = 0x3 + CTRL_CMD_NEWOPS = 0x4 + CTRL_CMD_DELOPS = 0x5 + CTRL_CMD_GETOPS = 0x6 + CTRL_CMD_NEWMCAST_GRP = 0x7 + CTRL_CMD_DELMCAST_GRP = 0x8 + CTRL_CMD_GETMCAST_GRP = 0x9 + CTRL_ATTR_UNSPEC = 0x0 + CTRL_ATTR_FAMILY_ID = 0x1 + CTRL_ATTR_FAMILY_NAME = 0x2 + CTRL_ATTR_VERSION = 0x3 + CTRL_ATTR_HDRSIZE = 0x4 + CTRL_ATTR_MAXATTR = 0x5 + CTRL_ATTR_OPS = 0x6 + CTRL_ATTR_MCAST_GROUPS = 0x7 + CTRL_ATTR_OP_UNSPEC = 0x0 + CTRL_ATTR_OP_ID = 0x1 + CTRL_ATTR_OP_FLAGS = 0x2 + CTRL_ATTR_MCAST_GRP_UNSPEC = 0x0 + CTRL_ATTR_MCAST_GRP_NAME = 0x1 + CTRL_ATTR_MCAST_GRP_ID = 0x2 +) diff --git a/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go b/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go index 70f2ac4b..bdc7d15d 100644 --- a/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go +++ b/vendor/golang.org/x/text/encoding/htmlindex/htmlindex.go @@ -50,7 +50,7 @@ func LanguageDefault(tag language.Tag) string { for _, t := range strings.Split(locales, " ") { tags = append(tags, language.MustParse(t)) } - matcher = language.NewMatcher(tags) + matcher = language.NewMatcher(tags, language.PreferSameScript(true)) }) _, i, _ := matcher.Match(tag) return canonical[localeMap[i]] // Default is Windows-1252. diff --git a/vendor/golang.org/x/text/feature/plural/example_test.go b/vendor/golang.org/x/text/feature/plural/example_test.go new file mode 100644 index 00000000..c75408c0 --- /dev/null +++ b/vendor/golang.org/x/text/feature/plural/example_test.go @@ -0,0 +1,46 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package plural_test + +import ( + "golang.org/x/text/feature/plural" + "golang.org/x/text/language" + "golang.org/x/text/message" +) + +func ExampleSelect() { + // Manually set some translations. This is typically done programmatically. + message.Set(language.English, "%d files remaining", + plural.Selectf(1, "%d", + "=0", "done!", + plural.One, "one file remaining", + plural.Other, "%[1]d files remaining", + )) + message.Set(language.Dutch, "%d files remaining", + plural.Selectf(1, "%d", + "=0", "klaar!", + // One can also use a string instead of a Kind + "one", "nog één bestand te gaan", + "other", "nog %[1]d bestanden te gaan", + )) + + p := message.NewPrinter(language.English) + p.Printf("%d files remaining", 5) + p.Println() + p.Printf("%d files remaining", 1) + p.Println() + + p = message.NewPrinter(language.Dutch) + p.Printf("%d files remaining", 1) + p.Println() + p.Printf("%d files remaining", 0) + p.Println() + + // Output: + // 5 files remaining + // one file remaining + // nog één bestand te gaan + // klaar! +} diff --git a/vendor/golang.org/x/text/feature/plural/message.go b/vendor/golang.org/x/text/feature/plural/message.go new file mode 100755 index 00000000..22f5a26d --- /dev/null +++ b/vendor/golang.org/x/text/feature/plural/message.go @@ -0,0 +1,238 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package plural + +import ( + "fmt" + "io/ioutil" + "reflect" + "strconv" + + "golang.org/x/text/internal/catmsg" + "golang.org/x/text/internal/number" + "golang.org/x/text/language" + "golang.org/x/text/message/catalog" +) + +// Interface is used for types that can determine their own plural form. +type Interface interface { + // PluralForm reports the plural form for the given language of the + // underlying value. It also returns the integer value. If the integer value + // is larger than fits in n, PluralForm may return a value modulo + // 10,000,000. + PluralForm(t language.Tag, scale int) (f Form, n int) +} + +// Selectf returns the first case for which its selector is a match for the +// arg-th substitution argument to a formatting call, formatting it as indicated +// by format. +// +// The cases argument are pairs of selectors and messages. Selectors are of type +// string or Form. Messages are of type string or catalog.Message. A selector +// matches an argument if: +// - it is "other" or Other +// - it matches the plural form of the argument: "zero", "one", "two", "few", +// or "many", or the equivalent Form +// - it is of the form "=x" where x is an integer that matches the value of +// the argument. +// - it is of the form " kindDefault { + e.EncodeUint(uint64(m.scale)) + } + + forms := validForms(cardinal, e.Language()) + + for i := 0; i < len(m.cases); { + if err := compileSelector(e, forms, m.cases[i]); err != nil { + return err + } + if i++; i >= len(m.cases) { + return fmt.Errorf("plural: no message defined for selector %v", m.cases[i-1]) + } + var msg catalog.Message + switch x := m.cases[i].(type) { + case string: + msg = catalog.String(x) + case catalog.Message: + msg = x + default: + return fmt.Errorf("plural: message of type %T; must be string or catalog.Message", x) + } + if err := e.EncodeMessage(msg); err != nil { + return err + } + i++ + } + return nil +} + +func compileSelector(e *catmsg.Encoder, valid []Form, selector interface{}) error { + form := Other + switch x := selector.(type) { + case string: + if x == "" { + return fmt.Errorf("plural: empty selector") + } + if c := x[0]; c == '=' || c == '<' { + val, err := strconv.ParseUint(x[1:], 10, 16) + if err != nil { + return fmt.Errorf("plural: invalid number in selector %q: %v", selector, err) + } + e.EncodeUint(uint64(c)) + e.EncodeUint(val) + return nil + } + var ok bool + form, ok = countMap[x] + if !ok { + return fmt.Errorf("plural: invalid plural form %q", selector) + } + case Form: + form = x + default: + return fmt.Errorf("plural: selector of type %T; want string or Form", selector) + } + + ok := false + for _, f := range valid { + if f == form { + ok = true + break + } + } + if !ok { + return fmt.Errorf("plural: form %q not supported for language %q", selector, e.Language()) + } + e.EncodeUint(uint64(form)) + return nil +} + +func execute(d *catmsg.Decoder) bool { + lang := d.Language() + argN := int(d.DecodeUint()) + kind := int(d.DecodeUint()) + scale := -1 // default + if kind > kindDefault { + scale = int(d.DecodeUint()) + } + form := Other + n := -1 + if arg := d.Arg(argN); arg == nil { + // Default to Other. + } else if x, ok := arg.(Interface); ok { + // This covers lists and formatters from the number package. + form, n = x.PluralForm(lang, scale) + } else { + var f number.Formatter + switch kind { + case kindScale: + f.InitDecimal(lang) + f.SetScale(scale) + case kindScientific: + f.InitScientific(lang) + f.SetScale(scale) + case kindPrecision: + f.InitDecimal(lang) + f.SetPrecision(scale) + case kindDefault: + // sensible default + f.InitDecimal(lang) + if k := reflect.TypeOf(arg).Kind(); reflect.Int <= k && k <= reflect.Uintptr { + f.SetScale(0) + } else { + f.SetScale(2) + } + } + var dec number.Decimal // TODO: buffer in Printer + dec.Convert(f.RoundingContext, arg) + v := number.FormatDigits(&dec, f.RoundingContext) + if !v.NaN && !v.Inf { + form, n = cardinal.matchDisplayDigits(d.Language(), &v) + } + } + for !d.Done() { + f := d.DecodeUint() + if (f == '=' && n == int(d.DecodeUint())) || + (f == '<' && 0 <= n && n < int(d.DecodeUint())) || + form == Form(f) || + Other == Form(f) { + return d.ExecuteMessage() + } + d.SkipMessage() + } + return false +} diff --git a/vendor/golang.org/x/text/feature/plural/message_test.go b/vendor/golang.org/x/text/feature/plural/message_test.go new file mode 100644 index 00000000..1a89bd54 --- /dev/null +++ b/vendor/golang.org/x/text/feature/plural/message_test.go @@ -0,0 +1,197 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package plural + +import ( + "fmt" + "strings" + "testing" + + "golang.org/x/text/internal/catmsg" + "golang.org/x/text/language" + "golang.org/x/text/message/catalog" +) + +func TestSelect(t *testing.T) { + lang := language.English + type test struct { + arg interface{} + result string + err string + } + testCases := []struct { + desc string + msg catalog.Message + err string + tests []test + }{{ + desc: "basic", + msg: Selectf(1, "%d", "one", "foo", "other", "bar"), + tests: []test{ + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + {arg: 2, result: "bar"}, + {arg: opposite(1), result: "bar"}, + {arg: opposite(2), result: "foo"}, + {arg: "unknown", result: "bar"}, // other + }, + }, { + desc: "comparisons", + msg: Selectf(1, "%d", + "=0", "zero", + "=1", "one", + "one", "cannot match", // never matches + "<5", "<5", // never matches + "=5", "=5", + Other, "other"), + tests: []test{ + {arg: 0, result: "zero"}, + {arg: 1, result: "one"}, + {arg: 2, result: "<5"}, + {arg: 4, result: "<5"}, + {arg: 5, result: "=5"}, + {arg: 6, result: "other"}, + {arg: "unknown", result: "other"}, + }, + }, { + desc: "fractions", + msg: Selectf(1, "%.2f", "one", "foo", "other", "bar"), + tests: []test{ + // fractions are always plural in english + {arg: 0, result: "bar"}, + {arg: 1, result: "bar"}, + }, + }, { + desc: "decimal without fractions", + msg: Selectf(1, "%.of", "one", "foo", "other", "bar"), + tests: []test{ + // fractions are always plural in english + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + }, + }, { + desc: "scientific", + msg: Selectf(1, "%.0e", "one", "foo", "other", "bar"), + tests: []test{ + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + }, + }, { + desc: "variable", + msg: Selectf(1, "%.1g", "one", "foo", "other", "bar"), + tests: []test{ + // fractions are always plural in english + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + {arg: 2, result: "bar"}, + }, + }, { + desc: "default", + msg: Selectf(1, "", "one", "foo", "other", "bar"), + tests: []test{ + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + {arg: 2, result: "bar"}, + {arg: 1.0, result: "bar"}, + }, + }, { + desc: "nested", + msg: Selectf(1, "", "other", Selectf(2, "", "one", "foo", "other", "bar")), + tests: []test{ + {arg: 0, result: "bar"}, + {arg: 1, result: "foo"}, + {arg: 2, result: "bar"}, + }, + }, { + desc: "arg unavailable", + msg: Selectf(100, "%.2f", "one", "foo", "other", "bar"), + tests: []test{{arg: 1, result: "bar"}}, + }, { + desc: "no match", + msg: Selectf(1, "%.2f", "one", "foo"), + tests: []test{{arg: 0, result: "bar", err: catmsg.ErrNoMatch.Error()}}, + }, { + desc: "error invalid form", + err: `invalid plural form "excessive"`, + msg: Selectf(1, "%d", "excessive", "foo"), + }, { + desc: "error form not used by language", + err: `form "many" not supported for language "en"`, + msg: Selectf(1, "%d", "many", "foo"), + }, { + desc: "error invalid selector", + err: `selector of type int; want string or Form`, + msg: Selectf(1, "%d", 1, "foo"), + }, { + desc: "error missing message", + err: `no message defined for selector one`, + msg: Selectf(1, "%d", "one"), + }, { + desc: "error invalid number", + err: `invalid number in selector "<1.00"`, + msg: Selectf(1, "%d", "<1.00"), + }, { + desc: "error empty selector", + err: `empty selector`, + msg: Selectf(1, "%d", "", "foo"), + }, { + desc: "error invalid message", + err: `message of type int; must be string or catalog.Message`, + msg: Selectf(1, "%d", "one", 3), + }, { + desc: "nested error", + err: `empty selector`, + msg: Selectf(1, "", "other", Selectf(2, "", "")), + }} + for _, tc := range testCases { + t.Run(tc.desc, func(t *testing.T) { + data, err := catmsg.Compile(lang, nil, tc.msg) + chkError(t, err, tc.err) + for _, tx := range tc.tests { + t.Run(fmt.Sprint(tx.arg), func(t *testing.T) { + r := renderer{arg: tx.arg} + d := catmsg.NewDecoder(lang, &r, nil) + err := d.Execute(data) + chkError(t, err, tx.err) + if r.result != tx.result { + t.Errorf("got %q; want %q", r.result, tx.result) + } + }) + } + }) + } +} + +func chkError(t *testing.T, got error, want string) { + if (got == nil && want != "") || + (got != nil && (want == "" || !strings.Contains(got.Error(), want))) { + t.Fatalf("got %v; want %v", got, want) + } + if got != nil { + t.SkipNow() + } +} + +type renderer struct { + arg interface{} + result string +} + +func (r *renderer) Render(s string) { r.result += s } +func (r *renderer) Arg(i int) interface{} { + if i > 10 { // Allow testing "arg unavailable" path + return nil + } + return r.arg +} + +type opposite int + +func (o opposite) PluralForm(lang language.Tag, scale int) (Form, int) { + if o == 1 { + return Other, 1 + } + return One, int(o) +} diff --git a/vendor/golang.org/x/text/feature/plural/plural.go b/vendor/golang.org/x/text/feature/plural/plural.go index 2b4cfe32..61faf187 100644 --- a/vendor/golang.org/x/text/feature/plural/plural.go +++ b/vendor/golang.org/x/text/feature/plural/plural.go @@ -13,6 +13,7 @@ package plural import ( + "golang.org/x/text/internal/number" "golang.org/x/text/language" ) @@ -109,21 +110,25 @@ func getIntApprox(digits []byte, start, end, nMod, big int) (n int) { // 123 []byte{1, 2, 3} 3 0 // 123.4 []byte{1, 2, 3, 4} 3 1 // 123.40 []byte{1, 2, 3, 4} 3 2 -// 100000 []byte{1} 6......0 -// 100000.00 []byte{1} 6......3 +// 100000 []byte{1} 6 0 +// 100000.00 []byte{1} 6 3 func (p *Rules) MatchDigits(t language.Tag, digits []byte, exp, scale int) Form { index, _ := language.CompactIndex(t) - endN := len(digits) + exp // Differentiate up to including mod 1000000 for the integer part. - n := getIntApprox(digits, 0, endN, 6, 1000000) + n := getIntApprox(digits, 0, exp, 6, 1000000) // Differentiate up to including mod 100 for the fractional part. - f := getIntApprox(digits, endN, endN+scale, 2, 100) + f := getIntApprox(digits, exp, exp+scale, 2, 100) return matchPlural(p, index, n, f, scale) } +func (p *Rules) matchDisplayDigits(t language.Tag, d *number.Digits) (Form, int) { + n := getIntApprox(d.Digits, 0, int(d.Exp), 6, 1000000) + return p.MatchDigits(t, d.Digits, int(d.Exp), d.NumFracDigits()), n +} + func validForms(p *Rules, t language.Tag) (forms []Form) { index, _ := language.CompactIndex(t) offset := p.langToIndex[index] @@ -145,6 +150,25 @@ func (p *Rules) matchComponents(t language.Tag, n, f, scale int) Form { return matchPlural(p, index, n, f, scale) } +// MatchPlural returns the plural form for the given language and plural +// operands (as defined in +// http://unicode.org/reports/tr35/tr35-numbers.html#Language_Plural_Rules): +// where +// n absolute value of the source number (integer and decimals) +// input +// i integer digits of n. +// v number of visible fraction digits in n, with trailing zeros. +// w number of visible fraction digits in n, without trailing zeros. +// f visible fractional digits in n, with trailing zeros (f = t * 10^(v-w)) +// t visible fractional digits in n, without trailing zeros. +// +// If any of the operand values is too large to fit in an int, it is okay to +// pass the value modulo 10,000,000. +func (p *Rules) MatchPlural(lang language.Tag, i, v, w, f, t int) Form { + index, _ := language.CompactIndex(lang) + return matchPlural(p, index, i, f, v) +} + func matchPlural(p *Rules, index int, n, f, v int) Form { nMask := p.inclusionMasks[n%maxMod] // Compute the fMask inline in the rules below, as it is relatively rare. diff --git a/vendor/golang.org/x/text/feature/plural/plural_test.go b/vendor/golang.org/x/text/feature/plural/plural_test.go index e5524c59..b3cf4c44 100644 --- a/vendor/golang.org/x/text/feature/plural/plural_test.go +++ b/vendor/golang.org/x/text/feature/plural/plural_test.go @@ -28,6 +28,8 @@ func TestGetIntApprox(t *testing.T) { {"123", 0, 2, 2, 12}, {"123", 3, 4, 2, 0}, {"12345", 3, 4, 2, 4}, + {"40", 0, 1, 2, 4}, + {"1", 0, 7, 2, big}, {"123", 0, 5, 2, big}, {"123", 0, 5, 3, big}, @@ -114,7 +116,7 @@ func testPlurals(t *testing.T, p *Rules, testCases []pluralTest) { for i := range digits { digits[i] -= '0' } - if f := p.MatchDigits(tag, digits, 0, 0); f != Form(tc.form) { + if f := p.MatchDigits(tag, digits, len(digits), 0); f != Form(tc.form) { t.Errorf("MatchDigits: got %v; want %v", f, Form(tc.form)) } }) @@ -139,14 +141,25 @@ func testPlurals(t *testing.T, p *Rules, testCases []pluralTest) { num := fmt.Sprintf("%[1]d.%0[3]*[2]d", n/m, n%m, scale) name := fmt.Sprintf("%s:dec(%s)", loc, num) t.Run(name, func(t *testing.T) { + ff := n % m + tt := ff + w := scale + for tt > 0 && tt%10 == 0 { + w-- + tt /= 10 + } + if f := p.MatchPlural(tag, n/m, scale, w, ff, tt); f != Form(tc.form) { + t.Errorf("MatchPlural: got %v; want %v", f, Form(tc.form)) + } if f := p.matchComponents(tag, n/m, n%m, scale); f != Form(tc.form) { t.Errorf("matchComponents: got %v; want %v", f, Form(tc.form)) } + exp := strings.IndexByte(num, '.') digits := []byte(strings.Replace(num, ".", "", 1)) for i := range digits { digits[i] -= '0' } - if f := p.MatchDigits(tag, digits, -scale, scale); f != Form(tc.form) { + if f := p.MatchDigits(tag, digits, exp, scale); f != Form(tc.form) { t.Errorf("MatchDigits: got %v; want %v", f, Form(tc.form)) } }) diff --git a/vendor/golang.org/x/text/internal/catmsg/catmsg.go b/vendor/golang.org/x/text/internal/catmsg/catmsg.go index 74c039f0..f8abf370 100644 --- a/vendor/golang.org/x/text/internal/catmsg/catmsg.go +++ b/vendor/golang.org/x/text/internal/catmsg/catmsg.go @@ -294,7 +294,7 @@ func (r Raw) Compile(e *Encoder) (err error) { // d.Arg(1) // d.Render(resultOfInvites) // d.Render(" %[2]v to ") -// d.Arg(1) +// d.Arg(2) // d.Render(resultOfTheir) // d.Render(" party.") // where the messages for "invites" and "their" both use a plural.Select diff --git a/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go b/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go index d06502bf..df913a1d 100644 --- a/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go +++ b/vendor/golang.org/x/text/internal/catmsg/catmsg_test.go @@ -110,6 +110,10 @@ func TestCodec(t *testing.T) { }, }, tests: single("foo|BAZ", ""), + }, { + desc: "nested value", + m: nestedLang{nestedLang{empty{}}}, + tests: single("nl|nl", ""), }, { desc: "not shadowed variable", m: seq{ @@ -207,8 +211,9 @@ func TestCodec(t *testing.T) { dec := NewDecoder(language.Und, r, macros) for _, tc := range testCases { t.Run(tc.desc, func(t *testing.T) { - - data, err := Compile(language.Und, macros, tc.m) + // Use a language other than Und so that we can test + // passing the language to nested values. + data, err := Compile(language.Dutch, macros, tc.m) if failErr(err, tc.encErr) { t.Errorf("encoding error: got %+q; want %+q", err, tc.encErr) } @@ -265,6 +270,23 @@ func (incomplete) Compile(e *Encoder) (err error) { return ErrIncomplete } +var msgNested = Register( + "golang.org/x/text/internal/catmsg.nested", + func(d *Decoder) bool { + d.Render(d.DecodeString()) + d.ExecuteMessage() + return true + }) + +type nestedLang struct{ Message } + +func (n nestedLang) Compile(e *Encoder) (err error) { + e.EncodeMessageType(msgNested) + e.EncodeString(e.Language().String()) + e.EncodeMessage(n.Message) + return nil +} + type errorCompileMsg struct{} var errCompileTest = errors.New("catmsg: compile error test") diff --git a/vendor/golang.org/x/text/internal/catmsg/codec.go b/vendor/golang.org/x/text/internal/catmsg/codec.go index e959b08f..ab587f85 100755 --- a/vendor/golang.org/x/text/internal/catmsg/codec.go +++ b/vendor/golang.org/x/text/internal/catmsg/codec.go @@ -99,7 +99,7 @@ func (e *Encoder) EncodeMessageType(h Handle) { // EncodeMessage serializes the given message inline at the current position. func (e *Encoder) EncodeMessage(m Message) error { - e = &Encoder{root: e.root, parent: e} + e = &Encoder{root: e.root, parent: e, tag: e.tag} err := m.Compile(e) if _, ok := m.(*Var); !ok { e.flushTo(e.parent) diff --git a/vendor/golang.org/x/text/internal/number/decimal.go b/vendor/golang.org/x/text/internal/number/decimal.go index 199c7e41..f15b2577 100644 --- a/vendor/golang.org/x/text/internal/number/decimal.go +++ b/vendor/golang.org/x/text/internal/number/decimal.go @@ -25,22 +25,39 @@ const ( numModes ) -// A RoundingContext indicates how a number should be converted to digits. -type RoundingContext struct { - Mode RoundingMode - Increment int32 // if > 0, round to Increment * 10^-Scale +const maxIntDigits = 20 + +// A Decimal represents a floating point number in decimal format. +// Digits represents a number [0, 1.0), and the absolute value represented by +// Decimal is Digits * 10^Exp. Leading and trailing zeros may be omitted and Exp +// may point outside a valid position in Digits. +// +// Examples: +// Number Decimal +// 12345 Digits: [1, 2, 3, 4, 5], Exp: 5 +// 12.345 Digits: [1, 2, 3, 4, 5], Exp: 2 +// 12000 Digits: [1, 2], Exp: 5 +// 12000.00 Digits: [1, 2], Exp: 5 +// 0.00123 Digits: [1, 2, 3], Exp: -2 +// 0 Digits: [], Exp: 0 +type Decimal struct { + digits - Precision int32 // maximum number of significant digits. - Scale int32 // maximum number of decimals after the dot. + buf [maxIntDigits]byte } -const maxIntDigits = 20 +type digits struct { + Digits []byte // mantissa digits, big-endian + Exp int32 // exponent + Neg bool + Inf bool // Takes precedence over Digits and Exp. + NaN bool // Takes precedence over Inf. +} -// A Decimal represents floating point number represented in digits of the base -// in which a number is to be displayed. Digits represents a number [0, 1.0), -// and the absolute value represented by Decimal is Digits * 10^Exp. -// Leading and trailing zeros may be omitted and Exp may point outside a valid -// position in Digits. +// Digits represents a floating point number represented in digits of the +// base in which a number is to be displayed. It is similar to Decimal, but +// keeps track of trailing fraction zeros and the comma placement for +// engineering notation. Digits must have at least one digit. // // Examples: // Number Decimal @@ -51,25 +68,31 @@ const maxIntDigits = 20 // 12000.00 Digits: [1, 2], Exp: 5 End: 7 // 0.00123 Digits: [1, 2, 3], Exp: -2 End: 3 // 0 Digits: [], Exp: 0 End: 1 -// scientific: -// 0 Digits: [], Exp: 0, End: 1, Comma: 0 +// scientific (actual exp is Exp - Comma) +// 0e0 Digits: [0], Exp: 1, End: 1, Comma: 1 +// .0e0 Digits: [0], Exp: 0, End: 1, Comma: 0 +// 0.0e0 Digits: [0], Exp: 1, End: 2, Comma: 1 // 1.23e4 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 1 +// .123e5 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 0 // engineering // 12.3e3 Digits: [1, 2, 3], Exp: 5, End: 3, Comma: 2 -type Decimal struct { - Digits []byte // mantissa digits, big-endian - Exp int32 // exponent +type Digits struct { + digits // End indicates the end position of the number. End int32 // For decimals Exp <= End. For scientific len(Digits) <= End. // Comma is used for the comma position for scientific (always 0 or 1) and // engineering notation (always 0, 1, 2, or 3). Comma uint8 + // IsScientific indicates whether this number is to be rendered as a + // scientific number. + IsScientific bool +} - Neg bool - Inf bool // Takes precedence over Digits and Exp. - NaN bool // Takes precedence over Inf. - - buf [maxIntDigits]byte +func (d *Digits) NumFracDigits() int { + if d.Exp >= d.End { + return 0 + } + return int(d.End - d.Exp) } // normalize returns a new Decimal with leading and trailing zeros removed. @@ -151,7 +174,7 @@ func appendZeros(buf []byte, n int) []byte { return buf } -func (d *Decimal) round(mode RoundingMode, n int) { +func (d *digits) round(mode RoundingMode, n int) { if n >= len(d.Digits) { return } @@ -227,7 +250,7 @@ func (r RoundingMode) roundFloat(x float64) float64 { return i } -func (x *Decimal) roundUp(n int) { +func (x *digits) roundUp(n int) { if n < 0 || n >= len(x.Digits) { return // nothing to do } @@ -248,7 +271,7 @@ func (x *Decimal) roundUp(n int) { // x already trimmed } -func (x *Decimal) roundDown(n int) { +func (x *digits) roundDown(n int) { if n < 0 || n >= len(x.Digits) { return // nothing to do } @@ -258,7 +281,7 @@ func (x *Decimal) roundDown(n int) { // trim cuts off any trailing zeros from x's mantissa; // they are meaningless for the value of x. -func trim(x *Decimal) { +func trim(x *digits) { i := len(x.Digits) for i > 0 && x.Digits[i-1] == 0 { i-- @@ -272,7 +295,7 @@ func trim(x *Decimal) { // A Converter converts a number into decimals according to the given rounding // criteria. type Converter interface { - Convert(d *Decimal, r *RoundingContext) + Convert(d *Decimal, r RoundingContext) } const ( @@ -282,7 +305,7 @@ const ( // Convert converts the given number to the decimal representation using the // supplied RoundingContext. -func (d *Decimal) Convert(r *RoundingContext, number interface{}) { +func (d *Decimal) Convert(r RoundingContext, number interface{}) { switch f := number.(type) { case Converter: d.clear() @@ -312,6 +335,8 @@ func (d *Decimal) Convert(r *RoundingContext, number interface{}) { case uint64: d.ConvertInt(r, unsigned, f) + default: + d.NaN = true // TODO: // case string: if produced by strconv, allows for easy arbitrary pos. // case reflect.Value: @@ -324,7 +349,7 @@ func (d *Decimal) Convert(r *RoundingContext, number interface{}) { } // ConvertInt converts an integer to decimals. -func (d *Decimal) ConvertInt(r *RoundingContext, signed bool, x uint64) { +func (d *Decimal) ConvertInt(r RoundingContext, signed bool, x uint64) { if r.Increment > 0 { // TODO: if uint64 is too large, fall back to float64 if signed { @@ -344,12 +369,30 @@ func (d *Decimal) ConvertInt(r *RoundingContext, signed bool, x uint64) { } // ConvertFloat converts a floating point number to decimals. -func (d *Decimal) ConvertFloat(r *RoundingContext, x float64, size int) { +func (d *Decimal) ConvertFloat(r RoundingContext, x float64, size int) { d.clear() if math.IsNaN(x) { d.NaN = true return } + // Simple case: decimal notation + if r.Increment > 0 { + scale := int(r.IncrementScale) + mult := 1.0 + if scale > len(scales) { + mult = math.Pow(10, float64(scale)) + } else { + mult = scales[scale] + } + // We multiply x instead of dividing inc as it gives less rounding + // issues. + x *= mult + x /= float64(r.Increment) + x = r.Mode.roundFloat(x) + x *= float64(r.Increment) + x /= mult + } + abs := x if x < 0 { d.Neg = true @@ -359,63 +402,64 @@ func (d *Decimal) ConvertFloat(r *RoundingContext, x float64, size int) { d.Inf = true return } - // Simple case: decimal notation - if r.Scale > 0 || r.Increment > 0 || r.Precision == 0 { - if int(r.Scale) > len(scales) { - x *= math.Pow(10, float64(r.Scale)) - } else { - x *= scales[r.Scale] - } - if r.Increment > 0 { - inc := float64(r.Increment) - x /= float64(inc) - x = r.Mode.roundFloat(x) - x *= inc - } else { - x = r.Mode.roundFloat(x) - } - d.fillIntDigits(uint64(math.Abs(x))) - d.Exp = int32(len(d.Digits)) - r.Scale - return - } - // Nasty case (for non-decimal notation). - // Asides from being inefficient, this result is also wrong as it will - // apply ToNearestEven rounding regardless of the user setting. - // TODO: expose functionality in strconv so we can avoid this hack. + // By default we get the exact decimal representation. + verb := byte('g') + prec := -1 + // Determine rounding, if possible. As the strconv API does not return the + // rounding accuracy (exact/rounded up|down), we can only round using + // ToNearestEven. // Something like this would work: // AppendDigits(dst []byte, x float64, base, size, prec int) (digits []byte, exp, accuracy int) - // TODO: This only supports the nearest even rounding mode. - - prec := int(r.Precision) - if prec > 0 { - prec-- + if r.Mode == ToNearestEven { + // We can't round if limitations are placed on both the fraction and + // significant digits. + if r.MaxFractionDigits == 0 && r.MaxSignificantDigits > 0 { + prec = int(r.MaxSignificantDigits) + } else if r.isScientific() { + if r.MaxIntegerDigits == 1 && (r.MaxSignificantDigits == 0 || + int(r.MaxFractionDigits+1) == int(r.MaxSignificantDigits)) { + verb = 'e' + prec = int(r.MaxFractionDigits) + prec += int(r.DigitShift) + } + } else if r.MaxFractionDigits > 0 && r.MaxSignificantDigits == 0 { + verb = 'f' + prec = int(r.MaxFractionDigits) + } } - b := strconv.AppendFloat(d.Digits, abs, 'e', prec, size) + + b := strconv.AppendFloat(d.Digits[:0], abs, verb, prec, size) i := 0 k := 0 - // No need to check i < len(b) as we always have an 'e'. - for { + beforeDot := 1 + for i < len(b) { if c := b[i]; '0' <= c && c <= '9' { b[k] = c - '0' k++ - } else if c != '.' { + d.Exp += int32(beforeDot) + } else if c == '.' { + beforeDot = 0 + d.Exp = int32(k) + } else { break } i++ } d.Digits = b[:k] - i += len("e") - pSign := i - exp := 0 - for i++; i < len(b); i++ { - exp *= 10 - exp += int(b[i] - '0') - } - if b[pSign] == '-' { - exp = -exp + if i != len(b) { + i += len("e") + pSign := i + exp := 0 + for i++; i < len(b); i++ { + exp *= 10 + exp += int(b[i] - '0') + } + if b[pSign] == '-' { + exp = -exp + } + d.Exp = int32(exp) + 1 } - d.Exp = int32(exp) + 1 } func (d *Decimal) fillIntDigits(x uint64) { diff --git a/vendor/golang.org/x/text/internal/number/decimal_test.go b/vendor/golang.org/x/text/internal/number/decimal_test.go index 5c817004..fb856c81 100644 --- a/vendor/golang.org/x/text/internal/number/decimal_test.go +++ b/vendor/golang.org/x/text/internal/number/decimal_test.go @@ -22,6 +22,15 @@ func mkfloat(num string) float64 { // digits are shifted. Numbers may have an additional exponent or be the special // value NaN, Inf, or -Inf. func mkdec(num string) (d Decimal) { + var r RoundingContext + d.Convert(r, dec(num)) + return +} + +type dec string + +func (s dec) Convert(d *Decimal, _ RoundingContext) { + num := string(s) if num[0] == '-' { d.Neg = true num = num[1:] @@ -52,7 +61,7 @@ func mkdec(num string) (d Decimal) { for i := range d.Digits { d.Digits[i] -= '0' } - return d.normalize() + *d = d.normalize() } func byteNum(s string) []byte { @@ -77,11 +86,11 @@ func TestDecimalString(t *testing.T) { want string }{ {want: "0"}, - {Decimal{Digits: nil, Exp: 1000}, "0"}, // exponent of 1000 is ignored - {Decimal{Digits: byteNum("12345"), Exp: 0}, "0.12345"}, - {Decimal{Digits: byteNum("12345"), Exp: -3}, "0.00012345"}, - {Decimal{Digits: byteNum("12345"), Exp: +3}, "123.45"}, - {Decimal{Digits: byteNum("12345"), Exp: +10}, "1234500000"}, + {Decimal{digits: digits{Digits: nil, Exp: 1000}}, "0"}, // exponent of 1000 is ignored + {Decimal{digits: digits{Digits: byteNum("12345"), Exp: 0}}, "0.12345"}, + {Decimal{digits: digits{Digits: byteNum("12345"), Exp: -3}}, "0.00012345"}, + {Decimal{digits: digits{Digits: byteNum("12345"), Exp: +3}}, "123.45"}, + {Decimal{digits: digits{Digits: byteNum("12345"), Exp: +10}}, "1234500000"}, } { if got := test.x.String(); got != test.want { t.Errorf("%v == %q; want %q", test.x, got, test.want) @@ -232,14 +241,18 @@ func TestRounding(t *testing.T) { } func TestConvert(t *testing.T) { - scale2 := &RoundingContext{Scale: 2} - scale2away := &RoundingContext{Scale: 2, Mode: AwayFromZero} - inc0_05 := &RoundingContext{Increment: 5, Scale: 2} - inc50 := &RoundingContext{Increment: 50} - prec3 := &RoundingContext{Precision: 3} + scale2 := RoundingContext{} + scale2.SetScale(2) + scale2away := RoundingContext{Mode: AwayFromZero} + scale2away.SetScale(2) + inc0_05 := RoundingContext{Increment: 5, IncrementScale: 2} + inc0_05.SetScale(2) + inc50 := RoundingContext{Increment: 50} + prec3 := RoundingContext{} + prec3.SetPrecision(3) testCases := []struct { x interface{} - rc *RoundingContext + rc RoundingContext out string }{ {int8(-34), scale2, "-34"}, @@ -252,16 +265,15 @@ func TestConvert(t *testing.T) { {uint32(234), scale2, "234"}, {uint64(234), scale2, "234"}, {uint(234), scale2, "234"}, - {-0.001, scale2, "-0"}, + {-0.001, scale2, "-0.00"}, // not normalized {-1e9, scale2, "-1000000000.00"}, - {0.234, scale2, "0.23"}, - {0.234, scale2away, "0.24"}, + {0.234, scale2away, "0.234"}, // rounding postponed as not ToNearestEven {0.1234, prec3, "0.123"}, {1234.0, prec3, "1230"}, {1.2345e10, prec3, "12300000000"}, {0.03, inc0_05, "0.05"}, - {0.025, inc0_05, "0"}, + {0.025, inc0_05, "0.00"}, // not normalized {0.075, inc0_05, "0.10"}, {325, inc50, "300"}, {375, inc50, "400"}, @@ -271,6 +283,7 @@ func TestConvert(t *testing.T) { {math.Inf(1), inc50, "Inf"}, {math.Inf(-1), inc50, "-Inf"}, {math.NaN(), inc50, "NaN"}, + {"clearly not a number", scale2, "NaN"}, } for _, tc := range testCases { var d Decimal @@ -285,7 +298,7 @@ func TestConvert(t *testing.T) { type converter int -func (c converter) Convert(d *Decimal, r *RoundingContext) { +func (c converter) Convert(d *Decimal, r RoundingContext) { d.Digits = append(d.Digits, 1, 0, 0) d.Exp = 3 } diff --git a/vendor/golang.org/x/text/internal/number/format.go b/vendor/golang.org/x/text/internal/number/format.go index 533a85a2..41047896 100755 --- a/vendor/golang.org/x/text/internal/number/format.go +++ b/vendor/golang.org/x/text/internal/number/format.go @@ -28,7 +28,6 @@ import ( type Formatter struct { Pattern Info - RoundingContext } func (f *Formatter) init(t language.Tag, index []uint8) { @@ -57,12 +56,16 @@ func (f *Formatter) InitDecimal(t language.Tag) { // given language. func (f *Formatter) InitScientific(t language.Tag) { f.init(t, tagToScientific) + f.Pattern.MinFractionDigits = 0 + f.Pattern.MaxFractionDigits = -1 } // InitEngineering initializes a Formatter using the default Pattern for the // given language. func (f *Formatter) InitEngineering(t language.Tag) { f.init(t, tagToScientific) + f.Pattern.MinFractionDigits = 0 + f.Pattern.MaxFractionDigits = -1 f.Pattern.MaxIntegerDigits = 3 f.Pattern.MinIntegerDigits = 1 } @@ -82,17 +85,29 @@ func (f *Formatter) InitPerMille(t language.Tag) { func (f *Formatter) Append(dst []byte, x interface{}) []byte { var d Decimal - d.Convert(&f.RoundingContext, x) - return f.Format(dst, &d) + r := f.RoundingContext + d.Convert(r, x) + return f.Render(dst, FormatDigits(&d, r)) +} + +func FormatDigits(d *Decimal, r RoundingContext) Digits { + if r.isScientific() { + return scientificVisibleDigits(r, d) + } + return decimalVisibleDigits(r, d) } func (f *Formatter) Format(dst []byte, d *Decimal) []byte { + return f.Render(dst, FormatDigits(d, f.RoundingContext)) +} + +func (f *Formatter) Render(dst []byte, d Digits) []byte { var result []byte var postPrefix, preSuffix int - if f.MinExponentDigits > 0 { - result, postPrefix, preSuffix = appendScientific(dst, f, d) + if d.IsScientific { + result, postPrefix, preSuffix = appendScientific(dst, f, &d) } else { - result, postPrefix, preSuffix = appendDecimal(dst, f, d) + result, postPrefix, preSuffix = appendDecimal(dst, f, &d) } if f.PadRune == 0 { return result @@ -131,23 +146,25 @@ func (f *Formatter) Format(dst []byte, d *Decimal) []byte { return result } -// TODO: just return visible digits. -func decimalVisibleDigits(f *Formatter, d *Decimal) Decimal { +// decimalVisibleDigits converts d according to the RoundingContext. Note that +// the exponent may change as a result of this operation. +func decimalVisibleDigits(r RoundingContext, d *Decimal) Digits { if d.NaN || d.Inf { - return *d + return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}} } - n := d.normalize() - if maxSig := int(f.MaxSignificantDigits); maxSig > 0 { + n := Digits{digits: d.normalize().digits} + + if maxSig := int(r.MaxSignificantDigits); maxSig > 0 { // TODO: really round to zero? n.round(ToZero, maxSig) } digits := n.Digits exp := n.Exp - exp += int32(f.Pattern.DigitShift) + exp += int32(r.DigitShift) // Cap integer digits. Remove *most-significant* digits. - if f.MaxIntegerDigits > 0 { - if p := int(exp) - int(f.MaxIntegerDigits); p > 0 { + if r.MaxIntegerDigits > 0 { + if p := int(exp) - int(r.MaxIntegerDigits); p > 0 { if p > len(digits) { p = len(digits) } @@ -166,8 +183,8 @@ func decimalVisibleDigits(f *Formatter, d *Decimal) Decimal { // Rounding usually is done by convert, but we don't rely on it. numFrac := len(digits) - int(exp) - if f.MaxSignificantDigits == 0 && int(f.MaxFractionDigits) < numFrac { - p := int(exp) + int(f.MaxFractionDigits) + if r.MaxSignificantDigits == 0 && int(r.MaxFractionDigits) < numFrac { + p := int(exp) + int(r.MaxFractionDigits) if p <= 0 { p = 0 } else if p >= len(digits) { @@ -179,18 +196,18 @@ func decimalVisibleDigits(f *Formatter, d *Decimal) Decimal { // set End (trailing zeros) n.End = int32(len(digits)) if len(digits) == 0 { - if f.MinFractionDigits > 0 { - n.End = int32(f.MinFractionDigits) + if r.MinFractionDigits > 0 { + n.End = int32(r.MinFractionDigits) } - if p := int32(f.MinSignificantDigits) - 1; p > n.End { + if p := int32(r.MinSignificantDigits) - 1; p > n.End { n.End = p } } else { - if end := exp + int32(f.MinFractionDigits); end > n.End { + if end := exp + int32(r.MinFractionDigits); end > n.End { n.End = end } - if n.End < int32(f.MinSignificantDigits) { - n.End = int32(f.MinSignificantDigits) + if n.End < int32(r.MinSignificantDigits) { + n.End = int32(r.MinSignificantDigits) } } n.Digits = digits @@ -200,11 +217,10 @@ func decimalVisibleDigits(f *Formatter, d *Decimal) Decimal { // appendDecimal appends a formatted number to dst. It returns two possible // insertion points for padding. -func appendDecimal(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, preSuf int) { - if dst, ok := f.renderSpecial(dst, d); ok { +func appendDecimal(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) { + if dst, ok := f.renderSpecial(dst, n); ok { return dst, 0, len(dst) } - n := decimalVisibleDigits(f, d) digits := n.Digits exp := n.Exp @@ -224,7 +240,7 @@ func appendDecimal(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, pre fracDigits = digits } - neg := d.Neg + neg := n.Neg affix, suffix := f.getAffixes(neg) dst = appendAffix(dst, f, affix, neg) savedLen := len(dst) @@ -257,7 +273,7 @@ func appendDecimal(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, pre if numFrac > 0 || f.Flags&AlwaysDecimalSeparator != 0 { dst = append(dst, f.Symbol(SymDecimal)...) } - // Add leading zeros + // Add trailing zeros i = 0 for n := -int(n.Exp); i < n; i++ { dst = f.AppendDigit(dst, 0) @@ -272,69 +288,60 @@ func appendDecimal(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, pre return appendAffix(dst, f, suffix, neg), savedLen, len(dst) } -func scientificVisibleDigits(f *Formatter, d *Decimal) Decimal { +func scientificVisibleDigits(r RoundingContext, d *Decimal) Digits { if d.NaN || d.Inf { - return *d + return Digits{digits: digits{Neg: d.Neg, NaN: d.NaN, Inf: d.Inf}} + } + n := Digits{digits: d.normalize().digits, IsScientific: true} + + // Normalize to have at least one digit. This simplifies engineering + // notation. + if len(n.Digits) == 0 { + n.Digits = append(n.Digits, 0) + n.Exp = 1 } - n := d.normalize() // Significant digits are transformed by the parser for scientific notation // and do not need to be handled here. - maxInt, numInt := int(f.MaxIntegerDigits), int(f.MinIntegerDigits) + maxInt, numInt := int(r.MaxIntegerDigits), int(r.MinIntegerDigits) if numInt == 0 { numInt = 1 } - maxSig := int(f.MaxFractionDigits) + numInt - minSig := int(f.MinFractionDigits) + numInt - - if maxSig > 0 { - // TODO: really round to zero? - n.round(ToZero, maxSig) - } - digits := n.Digits - exp := n.Exp // If a maximum number of integers is specified, the minimum must be 1 // and the exponent is grouped by this number (e.g. for engineering) - if len(digits) == 0 { - exp = 0 - } else if maxInt > numInt { + if maxInt > numInt { // Correct the exponent to reflect a single integer digit. - exp-- numInt = 1 // engineering // 0.01234 ([12345]e-1) -> 1.2345e-2 12.345e-3 // 12345 ([12345]e+5) -> 1.2345e4 12.345e3 - d := int(exp) % maxInt + d := int(n.Exp-1) % maxInt if d < 0 { d += maxInt } - exp -= int32(d) numInt += d - } else { - exp -= int32(numInt) + } + + if maxSig := int(r.MaxFractionDigits); maxSig >= 0 { + n.round(r.Mode, maxSig+numInt) } n.Comma = uint8(numInt) - n.End = int32(len(digits)) - if n.End < int32(minSig) { - n.End = int32(minSig) + n.End = int32(len(n.Digits)) + if minSig := int32(r.MinFractionDigits) + int32(numInt); n.End < minSig { + n.End = minSig } - n.Digits = digits - n.Exp = exp return n } // appendScientific appends a formatted number to dst. It returns two possible // insertion points for padding. -func appendScientific(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, preSuf int) { - if dst, ok := f.renderSpecial(dst, d); ok { +func appendScientific(dst []byte, f *Formatter, n *Digits) (b []byte, postPre, preSuf int) { + if dst, ok := f.renderSpecial(dst, n); ok { return dst, 0, 0 } - // n := d.normalize() - n := scientificVisibleDigits(f, d) digits := n.Digits - exp := n.Exp numInt := int(n.Comma) numFrac := int(n.End) - int(n.Comma) @@ -345,7 +352,7 @@ func appendScientific(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, } else { intDigits = digits } - neg := d.Neg + neg := n.Neg affix, suffix := f.getAffixes(neg) dst = appendAffix(dst, f, affix, neg) savedLen := len(dst) @@ -379,6 +386,7 @@ func appendScientific(dst []byte, f *Formatter, d *Decimal) (b []byte, postPre, buf := [12]byte{} // TODO: use exponential if superscripting is not available (no Latin // numbers or no tags) and use exponential in all other cases. + exp := n.Exp - int32(n.Comma) exponential := f.Symbol(SymExponential) if exponential == "E" { dst = append(dst, "\u202f"...) // NARROW NO-BREAK SPACE @@ -463,7 +471,7 @@ func (f *Formatter) getAffixes(neg bool) (affix, suffix string) { return affix, suffix } -func (f *Formatter) renderSpecial(dst []byte, d *Decimal) (b []byte, ok bool) { +func (f *Formatter) renderSpecial(dst []byte, d *Digits) (b []byte, ok bool) { if d.NaN { return fmtNaN(dst, f), true } @@ -477,7 +485,7 @@ func fmtNaN(dst []byte, f *Formatter) []byte { return append(dst, f.Symbol(SymNan)...) } -func fmtInfinite(dst []byte, f *Formatter, d *Decimal) []byte { +func fmtInfinite(dst []byte, f *Formatter, d *Digits) []byte { affix, suffix := f.getAffixes(d.Neg) dst = appendAffix(dst, f, affix, d.Neg) dst = append(dst, f.Symbol(SymInfinity)...) diff --git a/vendor/golang.org/x/text/internal/number/format_test.go b/vendor/golang.org/x/text/internal/number/format_test.go index 4c47bc56..12738188 100755 --- a/vendor/golang.org/x/text/internal/number/format_test.go +++ b/vendor/golang.org/x/text/internal/number/format_test.go @@ -193,7 +193,9 @@ func TestAppendDecimal(t *testing.T) { }, { pattern: "#,max_int=2", pat: &Pattern{ - MaxIntegerDigits: 2, + RoundingContext: RoundingContext{ + MaxIntegerDigits: 2, + }, }, test: pairs{ "2017": "17", @@ -201,8 +203,10 @@ func TestAppendDecimal(t *testing.T) { }, { pattern: "0,max_int=2", pat: &Pattern{ - MaxIntegerDigits: 2, - MinIntegerDigits: 1, + RoundingContext: RoundingContext{ + MaxIntegerDigits: 2, + MinIntegerDigits: 1, + }, }, test: pairs{ "2000": "0", @@ -212,8 +216,10 @@ func TestAppendDecimal(t *testing.T) { }, { pattern: "00,max_int=2", pat: &Pattern{ - MaxIntegerDigits: 2, - MinIntegerDigits: 2, + RoundingContext: RoundingContext{ + MaxIntegerDigits: 2, + MinIntegerDigits: 2, + }, }, test: pairs{ "2000": "00", @@ -223,8 +229,10 @@ func TestAppendDecimal(t *testing.T) { }, { pattern: "@@@@,max_int=2", pat: &Pattern{ - MaxIntegerDigits: 2, - MinSignificantDigits: 4, + RoundingContext: RoundingContext{ + MaxIntegerDigits: 2, + MinSignificantDigits: 4, + }, }, test: pairs{ "2017": "17.00", @@ -281,22 +289,25 @@ func TestAppendDecimal(t *testing.T) { pattern: "##0E00", test: pairs{ "100": "100\u202f×\u202f10⁰⁰", - "12345": "10\u202f×\u202f10⁰³", - "123.456": "100\u202f×\u202f10⁰⁰", + "12345": "12\u202f×\u202f10⁰³", + "123.456": "123\u202f×\u202f10⁰⁰", }, }, { pattern: "##0.###E00", test: pairs{ - "100": "100\u202f×\u202f10⁰⁰", - "12345": "12.34\u202f×\u202f10⁰³", - "123.456": "123.4\u202f×\u202f10⁰⁰", + "100": "100\u202f×\u202f10⁰⁰", + "12345": "12.345\u202f×\u202f10⁰³", + "123456": "123.456\u202f×\u202f10⁰³", + "123.456": "123.456\u202f×\u202f10⁰⁰", + "123.4567": "123.457\u202f×\u202f10⁰⁰", }, }, { pattern: "##0.000E00", test: pairs{ - "100": "100.0\u202f×\u202f10⁰⁰", - "12345": "12.34\u202f×\u202f10⁰³", - "123.456": "123.4\u202f×\u202f10⁰⁰", + "100": "100.000\u202f×\u202f10⁰⁰", + "12345": "12.345\u202f×\u202f10⁰³", + "123.456": "123.456\u202f×\u202f10⁰⁰", + "12.3456": "12.346\u202f×\u202f10⁰⁰", }, }, { pattern: "@@E0", @@ -441,11 +452,12 @@ func TestAppendDecimal(t *testing.T) { } var f Formatter f.InitPattern(language.English, pat) - for dec, want := range tc.test { + for num, want := range tc.test { buf := make([]byte, 100) - t.Run(tc.pattern+"/"+dec, func(t *testing.T) { - dec := mkdec(dec) - buf = f.Format(buf[:0], &dec) + t.Run(tc.pattern+"/"+num, func(t *testing.T) { + var d Decimal + d.Convert(f.RoundingContext, dec(num)) + buf = f.Format(buf[:0], &d) if got := string(buf); got != want { t.Errorf("\n got %[1]q (%[1]s)\nwant %[2]q (%[2]s)", got, want) } @@ -470,7 +482,8 @@ func TestLocales(t *testing.T) { t.Run(fmt.Sprint(tc.tag, "/", tc.num), func(t *testing.T) { var f Formatter f.InitDecimal(tc.tag) - d := mkdec(tc.num) + var d Decimal + d.Convert(f.RoundingContext, dec(tc.num)) b := f.Format(nil, &d) if got := string(b); got != tc.want { t.Errorf("got %[1]q (%[1]s); want %[2]q (%[2]s)", got, tc.want) @@ -488,7 +501,8 @@ func TestFormatters(t *testing.T) { }{ {f.InitDecimal, "123456.78", "123,456.78"}, {f.InitScientific, "123456.78", "1.23\u202f×\u202f10⁵"}, - {f.InitEngineering, "123456.78", "123\u202f×\u202f10³"}, + {f.InitEngineering, "123456.78", "123.46\u202f×\u202f10³"}, + {f.InitEngineering, "1234", "1.23\u202f×\u202f10³"}, {f.InitPercent, "0.1234", "12.34%"}, {f.InitPerMille, "0.1234", "123.40‰"}, @@ -496,9 +510,9 @@ func TestFormatters(t *testing.T) { for i, tc := range testCases { t.Run(fmt.Sprint(i, "/", tc.num), func(t *testing.T) { tc.init(language.English) - f.Pattern.MinFractionDigits = 2 - f.Pattern.MaxFractionDigits = 2 - d := mkdec(tc.num) + f.SetScale(2) + var d Decimal + d.Convert(f.RoundingContext, dec(tc.num)) b := f.Format(nil, &d) if got := string(b); got != tc.want { t.Errorf("got %[1]q (%[1]s); want %[2]q (%[2]s)", got, tc.want) diff --git a/vendor/golang.org/x/text/internal/number/pattern.go b/vendor/golang.org/x/text/internal/number/pattern.go index ef7f087f..2764cd24 100644 --- a/vendor/golang.org/x/text/internal/number/pattern.go +++ b/vendor/golang.org/x/text/internal/number/pattern.go @@ -39,31 +39,66 @@ import ( // // This type is only intended for internal use. type Pattern struct { - // TODO: this struct can be packed a lot better than it is now. Should be - // possible to make it 32 bytes. - - Affix string // includes prefix and suffix. First byte is prefix length. - Offset uint16 // Offset into Affix for prefix and suffix - NegOffset uint16 // Offset into Affix for negative prefix and suffix or 0. + RoundingContext + Affix string // includes prefix and suffix. First byte is prefix length. + Offset uint16 // Offset into Affix for prefix and suffix + NegOffset uint16 // Offset into Affix for negative prefix and suffix or 0. + PadRune rune FormatWidth uint16 - RoundIncrement uint32 // Use Min*Digits to determine scale - PadRune rune - DigitShift uint8 // Number of decimals to shift. Used for % and ‰. - GroupingSize [2]uint8 Flags PatternFlag +} + +// A RoundingContext indicates how a number should be converted to digits. +// It contains all information needed to determine the "visible digits" as +// required by the pluralization rules. +type RoundingContext struct { + // TODO: unify these two fields so that there is a more unambiguous meaning + // of how precision is handled. + MaxSignificantDigits int16 // -1 is unlimited + MaxFractionDigits int16 // -1 is unlimited + + Increment uint32 + IncrementScale uint8 // May differ from printed scale. + + Mode RoundingMode + + DigitShift uint8 // Number of decimals to shift. Used for % and ‰. // Number of digits. - // TODO: consider using uint32 - MinIntegerDigits uint8 + MinIntegerDigits uint8 + MaxIntegerDigits uint8 MinFractionDigits uint8 - MaxFractionDigits uint8 MinSignificantDigits uint8 - MaxSignificantDigits uint8 - MinExponentDigits uint8 + + MinExponentDigits uint8 +} + +func (r *RoundingContext) scale() int { + // scale is 0 when precision is set. + if r.MaxSignificantDigits != 0 { + return 0 + } + return int(r.MaxFractionDigits) +} + +func (r *RoundingContext) precision() int { return int(r.MaxSignificantDigits) } + +// SetScale fixes the RoundingContext to a fixed number of fraction digits. +func (r *RoundingContext) SetScale(scale int) { + r.MinFractionDigits = uint8(scale) + r.MaxFractionDigits = int16(scale) +} + +func (r *RoundingContext) SetPrecision(prec int) { + r.MaxSignificantDigits = int16(prec) +} + +func (r *RoundingContext) isScientific() bool { + return r.MinExponentDigits > 0 } func (f *Pattern) needsSep(pos int) bool { @@ -177,6 +212,9 @@ func ParsePattern(s string) (f *Pattern, err error) { } else { p.Affix = affix } + if p.Increment == 0 { + p.IncrementScale = 0 + } return p.Pattern, nil } @@ -339,7 +377,7 @@ func (p *parser) integer(r rune) state { p.updateGrouping() return next } - p.RoundIncrement = p.RoundIncrement*10 + uint32(r-'0') + p.Increment = p.Increment*10 + uint32(r-'0') p.groupingCount++ p.MinIntegerDigits++ return p.integer @@ -389,7 +427,8 @@ func (p *parser) normalizeSigDigitsWithExponent() state { func (p *parser) fraction(r rune) state { switch r { case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': - p.RoundIncrement = p.RoundIncrement*10 + uint32(r-'0') + p.Increment = p.Increment*10 + uint32(r-'0') + p.IncrementScale++ p.MinFractionDigits++ p.MaxFractionDigits++ case '#': diff --git a/vendor/golang.org/x/text/internal/number/pattern_test.go b/vendor/golang.org/x/text/internal/number/pattern_test.go index 97ff64d5..3a0b2be3 100644 --- a/vendor/golang.org/x/text/internal/number/pattern_test.go +++ b/vendor/golang.org/x/text/internal/number/pattern_test.go @@ -22,96 +22,122 @@ var testCases = []struct { }, { "0", &Pattern{ - FormatWidth: 1, - MinIntegerDigits: 1, + FormatWidth: 1, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + }, }, }, { "+0", &Pattern{ - Affix: "\x01+\x00", - FormatWidth: 2, - MinIntegerDigits: 1, + Affix: "\x01+\x00", + FormatWidth: 2, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + }, }, }, { "0+", &Pattern{ - Affix: "\x00\x01+", - FormatWidth: 2, - MinIntegerDigits: 1, + Affix: "\x00\x01+", + FormatWidth: 2, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + }, }, }, { "0000", &Pattern{ - FormatWidth: 4, - MinIntegerDigits: 4, + FormatWidth: 4, + RoundingContext: RoundingContext{ + MinIntegerDigits: 4, + }, }, }, { ".#", &Pattern{ - FormatWidth: 2, - MaxFractionDigits: 1, + FormatWidth: 2, + RoundingContext: RoundingContext{ + MaxFractionDigits: 1, + }, }, }, { "#0.###", &Pattern{ - FormatWidth: 6, - MinIntegerDigits: 1, - MaxFractionDigits: 3, + FormatWidth: 6, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 3, + }, }, }, { "#0.######", &Pattern{ - FormatWidth: 9, - MinIntegerDigits: 1, - MaxFractionDigits: 6, + FormatWidth: 9, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 6, + }, }, }, { "#,0", &Pattern{ - FormatWidth: 3, - GroupingSize: [2]uint8{1, 0}, - MinIntegerDigits: 1, + FormatWidth: 3, + GroupingSize: [2]uint8{1, 0}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + }, }, }, { "#,0.00", &Pattern{ - FormatWidth: 6, - GroupingSize: [2]uint8{1, 0}, - MinIntegerDigits: 1, - MinFractionDigits: 2, - MaxFractionDigits: 2, + FormatWidth: 6, + GroupingSize: [2]uint8{1, 0}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MinFractionDigits: 2, + MaxFractionDigits: 2, + }, }, }, { "#,##0.###", &Pattern{ - FormatWidth: 9, - GroupingSize: [2]uint8{3, 0}, - MinIntegerDigits: 1, - MaxFractionDigits: 3, + FormatWidth: 9, + GroupingSize: [2]uint8{3, 0}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 3, + }, }, }, { "#,##,##0.###", &Pattern{ - FormatWidth: 12, - GroupingSize: [2]uint8{3, 2}, - MinIntegerDigits: 1, - MaxFractionDigits: 3, + FormatWidth: 12, + GroupingSize: [2]uint8{3, 2}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 3, + }, }, }, { // Ignore additional separators. "#,####,##,##0.###", &Pattern{ - FormatWidth: 17, - GroupingSize: [2]uint8{3, 2}, - MinIntegerDigits: 1, - MaxFractionDigits: 3, + FormatWidth: 17, + GroupingSize: [2]uint8{3, 2}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 3, + }, }, }, { "#E0", &Pattern{ - FormatWidth: 3, - MaxIntegerDigits: 1, - MinExponentDigits: 1, + FormatWidth: 3, + RoundingContext: RoundingContext{ + MaxIntegerDigits: 1, + MinExponentDigits: 1, + }, }, }, { // At least one exponent digit is required. As long as this is true, one can @@ -121,30 +147,47 @@ var testCases = []struct { }, { "0E0", &Pattern{ - FormatWidth: 3, - MinIntegerDigits: 1, - MinExponentDigits: 1, + FormatWidth: 3, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MinExponentDigits: 1, + }, + }, +}, { + "##0.###E00", + &Pattern{ + FormatWidth: 10, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxIntegerDigits: 3, + MaxFractionDigits: 3, + MinExponentDigits: 2, + }, }, }, { "##00.0#E0", &Pattern{ - FormatWidth: 9, - MinIntegerDigits: 2, - MaxIntegerDigits: 4, - MinFractionDigits: 1, - MaxFractionDigits: 2, - MinExponentDigits: 1, + FormatWidth: 9, + RoundingContext: RoundingContext{ + MinIntegerDigits: 2, + MaxIntegerDigits: 4, + MinFractionDigits: 1, + MaxFractionDigits: 2, + MinExponentDigits: 1, + }, }, }, { "#00.0E+0", &Pattern{ - FormatWidth: 8, - Flags: AlwaysExpSign, - MinIntegerDigits: 2, - MaxIntegerDigits: 3, - MinFractionDigits: 1, - MaxFractionDigits: 1, - MinExponentDigits: 1, + FormatWidth: 8, + Flags: AlwaysExpSign, + RoundingContext: RoundingContext{ + MinIntegerDigits: 2, + MaxIntegerDigits: 3, + MinFractionDigits: 1, + MaxFractionDigits: 1, + MinExponentDigits: 1, + }, }, }, { "0.0E++0", @@ -156,45 +199,55 @@ var testCases = []struct { // significant digits "@", &Pattern{ - FormatWidth: 1, - MinSignificantDigits: 1, - MaxSignificantDigits: 1, + FormatWidth: 1, + RoundingContext: RoundingContext{ + MinSignificantDigits: 1, + MaxSignificantDigits: 1, + }, }, }, { // significant digits "@@@@", &Pattern{ - FormatWidth: 4, - MinSignificantDigits: 4, - MaxSignificantDigits: 4, + FormatWidth: 4, + RoundingContext: RoundingContext{ + MinSignificantDigits: 4, + MaxSignificantDigits: 4, + }, }, }, { "@###", &Pattern{ - FormatWidth: 4, - MinSignificantDigits: 1, - MaxSignificantDigits: 4, + FormatWidth: 4, + RoundingContext: RoundingContext{ + MinSignificantDigits: 1, + MaxSignificantDigits: 4, + }, }, }, { // Exponents in significant digits mode gets normalized. "@@E0", &Pattern{ - FormatWidth: 4, - MinIntegerDigits: 1, - MaxIntegerDigits: 1, - MinFractionDigits: 1, - MaxFractionDigits: 1, - MinExponentDigits: 1, + FormatWidth: 4, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxIntegerDigits: 1, + MinFractionDigits: 1, + MaxFractionDigits: 1, + MinExponentDigits: 1, + }, }, }, { "@###E00", &Pattern{ - FormatWidth: 7, - MinIntegerDigits: 1, - MaxIntegerDigits: 1, - MinFractionDigits: 0, - MaxFractionDigits: 3, - MinExponentDigits: 2, + FormatWidth: 7, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxIntegerDigits: 1, + MinFractionDigits: 0, + MaxFractionDigits: 3, + MinExponentDigits: 2, + }, }, }, { // The significant digits mode does not allow fractions. @@ -204,73 +257,89 @@ var testCases = []struct { //alternative negative pattern "#0.###;(#0.###)", &Pattern{ - Affix: "\x00\x00\x01(\x01)", - NegOffset: 2, - FormatWidth: 6, - MinIntegerDigits: 1, - MaxFractionDigits: 3, + Affix: "\x00\x00\x01(\x01)", + NegOffset: 2, + FormatWidth: 6, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MaxFractionDigits: 3, + }, }, }, { // Rounding increment "1.05", &Pattern{ - RoundIncrement: 105, - FormatWidth: 4, - MinIntegerDigits: 1, - MinFractionDigits: 2, - MaxFractionDigits: 2, + FormatWidth: 4, + RoundingContext: RoundingContext{ + Increment: 105, + IncrementScale: 2, + MinIntegerDigits: 1, + MinFractionDigits: 2, + MaxFractionDigits: 2, + }, }, }, { // Rounding increment with grouping "1,05", &Pattern{ - RoundIncrement: 105, - FormatWidth: 4, - GroupingSize: [2]uint8{2, 0}, - MinIntegerDigits: 3, - MinFractionDigits: 0, - MaxFractionDigits: 0, + FormatWidth: 4, + GroupingSize: [2]uint8{2, 0}, + RoundingContext: RoundingContext{ + Increment: 105, + IncrementScale: 0, + MinIntegerDigits: 3, + MinFractionDigits: 0, + MaxFractionDigits: 0, + }, }, }, { "0.0%", &Pattern{ - Affix: "\x00\x01%", - DigitShift: 2, - FormatWidth: 4, - MinIntegerDigits: 1, - MinFractionDigits: 1, - MaxFractionDigits: 1, + Affix: "\x00\x01%", + FormatWidth: 4, + RoundingContext: RoundingContext{ + DigitShift: 2, + MinIntegerDigits: 1, + MinFractionDigits: 1, + MaxFractionDigits: 1, + }, }, }, { "0.0‰", &Pattern{ - Affix: "\x00\x03‰", - DigitShift: 3, - FormatWidth: 4, - MinIntegerDigits: 1, - MinFractionDigits: 1, - MaxFractionDigits: 1, + Affix: "\x00\x03‰", + FormatWidth: 4, + RoundingContext: RoundingContext{ + DigitShift: 3, + MinIntegerDigits: 1, + MinFractionDigits: 1, + MaxFractionDigits: 1, + }, }, }, { "#,##0.00¤", &Pattern{ - Affix: "\x00\x02¤", - FormatWidth: 9, - GroupingSize: [2]uint8{3, 0}, - MinIntegerDigits: 1, - MinFractionDigits: 2, - MaxFractionDigits: 2, + Affix: "\x00\x02¤", + FormatWidth: 9, + GroupingSize: [2]uint8{3, 0}, + RoundingContext: RoundingContext{ + MinIntegerDigits: 1, + MinFractionDigits: 2, + MaxFractionDigits: 2, + }, }, }, { "#,##0.00 ¤;(#,##0.00 ¤)", &Pattern{Affix: "\x00\x04\u00a0¤\x01(\x05\u00a0¤)", - NegOffset: 6, - DigitShift: 0, - FormatWidth: 10, - GroupingSize: [2]uint8{3, 0}, - MinIntegerDigits: 1, - MinFractionDigits: 2, - MaxFractionDigits: 2, + NegOffset: 6, + FormatWidth: 10, + GroupingSize: [2]uint8{3, 0}, + RoundingContext: RoundingContext{ + DigitShift: 0, + MinIntegerDigits: 1, + MinFractionDigits: 2, + MaxFractionDigits: 2, + }, }, }, { // padding @@ -321,16 +390,21 @@ var testCases = []struct { }, { `* #0 o''clock`, &Pattern{Affix: "\x00\x09 o\\'clock", - FormatWidth: 10, - PadRune: 32, - MinIntegerDigits: 0x1}, + FormatWidth: 10, + PadRune: 32, + RoundingContext: RoundingContext{ + MinIntegerDigits: 0x1, + }, + }, }, { `'123'* #0'456'`, &Pattern{Affix: "\x05'123'\x05'456'", - FormatWidth: 8, - PadRune: 32, - MinIntegerDigits: 0x1, - Flags: PadAfterPrefix}, + FormatWidth: 8, + PadRune: 32, + RoundingContext: RoundingContext{ + MinIntegerDigits: 0x1, + }, + Flags: PadAfterPrefix}, }, { // no duplicate padding "*xpre#suf*x", nil, @@ -354,8 +428,8 @@ func TestParsePattern(t *testing.T) { } func TestPatternSize(t *testing.T) { - if sz := unsafe.Sizeof(Pattern{}); sz > 48 { - t.Errorf("got %d; want <= 48", sz) + if sz := unsafe.Sizeof(Pattern{}); sz > 56 { + t.Errorf("got %d; want <= 56", sz) } } diff --git a/vendor/golang.org/x/text/internal/number/tables.go b/vendor/golang.org/x/text/internal/number/tables.go index b08acc48..2cf16f59 100644 --- a/vendor/golang.org/x/text/internal/number/tables.go +++ b/vendor/golang.org/x/text/internal/number/tables.go @@ -846,277 +846,293 @@ var tagToPercent = []uint8{ // 754 elements 0x04, 0x04, } // Size: 778 bytes -var formats = []Pattern{Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x0, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, - GroupingSize: [2]uint8{0x0, - 0x0}, - Flags: 0x0, +var formats = []Pattern{Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x9, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, - GroupingSize: [2]uint8{0x3, - 0x0}, - Flags: 0x0, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x0, + GroupingSize: [2]uint8{0x0, + 0x0}, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x3, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x3, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x3, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, - GroupingSize: [2]uint8{0x0, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x9, + GroupingSize: [2]uint8{0x3, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x1, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x1}, - Pattern{Affix: "\x00\x03\u00a0%", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x7, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, - GroupingSize: [2]uint8{0x3, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x3, + GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x00\x01%", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x6, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, + Affix: "\x00\x03\u00a0%", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x7, GroupingSize: [2]uint8{0x3, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0xc, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, + Affix: "\x00\x01%", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x6, GroupingSize: [2]uint8{0x3, - 0x2}, - Flags: 0x0, + 0x0}, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x3, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x3, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x00\x01%", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x9, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0xc, GroupingSize: [2]uint8{0x3, 0x2}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x00\x03\u00a0%", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0xa, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, + Affix: "\x00\x01%", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x9, GroupingSize: [2]uint8{0x3, 0x2}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x9, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, - GroupingSize: [2]uint8{0x0, - 0x0}, - Flags: 0x0, + Affix: "\x00\x03\u00a0%", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0xa, + GroupingSize: [2]uint8{0x3, + 0x2}, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x6, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x6, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0xd, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x9, GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x4, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x6, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x6, - MaxFractionDigits: 0x6, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x3}, - Pattern{Affix: "\x00\x01%", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x3, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0xd, GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x0, + Flags: 0x4}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x03%\u00a0\x00", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x7, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, - GroupingSize: [2]uint8{0x3, + Affix: "\x00\x01%", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x3, + GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x03%\u00a0\x00\x04%\u00a0-\x00", - Offset: 0x0, - NegOffset: 0x5, - FormatWidth: 0x7, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, + Affix: "\x03%\u00a0\x00", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x7, GroupingSize: [2]uint8{0x3, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x01[\x01]", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x5, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, - GroupingSize: [2]uint8{0x0, + Affix: "\x03%\u00a0\x00\x04%\u00a0-\x00", + Offset: 0x0, + NegOffset: 0x5, + PadRune: 0, + FormatWidth: 0x7, + GroupingSize: [2]uint8{0x3, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x1, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x1}, - Pattern{Affix: "", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x1, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x0, + Affix: "\x01[\x01]", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x5, GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x0, MinIntegerDigits: 0x0, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, MinExponentDigits: 0x0}, - Pattern{Affix: "\x01%\x00", - Offset: 0x0, - NegOffset: 0x0, - FormatWidth: 0x6, - RoundIncrement: 0x0, - PadRune: 0, - DigitShift: 0x2, - GroupingSize: [2]uint8{0x3, + Affix: "", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x1, + GroupingSize: [2]uint8{0x0, 0x0}, - Flags: 0x0, + Flags: 0x0}, + Pattern{RoundingContext: RoundingContext{Increment: 0x0, + MaxSignificantDigits: 0, + MaxFractionDigits: 0x0, + Mode: 0x0, + DigitShift: 0x2, MinIntegerDigits: 0x1, MaxIntegerDigits: 0x0, MinFractionDigits: 0x0, - MaxFractionDigits: 0x0, MinSignificantDigits: 0x0, - MaxSignificantDigits: 0x0, - MinExponentDigits: 0x0}} + MinExponentDigits: 0x0}, + Affix: "\x01%\x00", + Offset: 0x0, + NegOffset: 0x0, + PadRune: 0, + FormatWidth: 0x6, + GroupingSize: [2]uint8{0x3, + 0x0}, + Flags: 0x0}} // Total table size 7101 bytes (6KiB); checksum: 5190D0B3 diff --git a/vendor/golang.org/x/text/language/data_test.go b/vendor/golang.org/x/text/language/data_test.go deleted file mode 100644 index a1203f2f..00000000 --- a/vendor/golang.org/x/text/language/data_test.go +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package language - -type matchTest struct { - comment string - supported string - test []struct{ match, desired string } -} - -var matchTests = []matchTest{ - { - "basics", - "fr, en-GB, en", - []struct{ match, desired string }{ - {"en-GB", "en-GB"}, - {"en", "en-US"}, - {"fr", "fr-FR"}, - {"fr", "ja-JP"}, - }, - }, - { - "script fallbacks", - "zh-CN, zh-TW, iw", - []struct{ match, desired string }{ - {"zh-TW", "zh-Hant"}, - {"zh-CN", "zh"}, - {"zh-CN", "zh-Hans-CN"}, - {"zh-TW", "zh-Hant-HK"}, - {"iw", "he-IT"}, - }, - }, - { - "language-specific script fallbacks 1", - "en, sr, nl", - []struct{ match, desired string }{ - {"sr", "sr-Latn"}, - {"en", "sh"}, - {"en", "hr"}, - {"en", "bs"}, - // TODO: consider if the following match is a good one. - // Due to new script first rule, which maybe should be an option. - {"sr", "nl-Cyrl"}, - }, - }, - { - "language-specific script fallbacks 2", - "en, sh", - []struct{ match, desired string }{ - {"sh", "sr"}, - {"sh", "sr-Cyrl"}, - {"sh", "hr"}, - }, - }, - { - "both deprecated and not", - "fil, tl, iw, he", - []struct{ match, desired string }{ - {"he", "he-IT"}, - {"he", "he"}, - {"iw", "iw"}, - {"fil", "fil-IT"}, - {"fil", "fil"}, - {"tl", "tl"}, - }, - }, - { - "nearby languages", - "en, fil, ro, nn", - []struct{ match, desired string }{ - {"fil", "tl"}, - {"ro", "mo"}, - {"nn", "nb"}, - {"en", "ja"}, // make sure default works - }, - }, - { - "nearby languages: Nynorsk to Bokmål", - "en, nb", - []struct{ match, desired string }{ - {"nb", "nn"}, - }, - }, - { - "nearby languages: Danish does not match nn", - "en, nn", - []struct{ match, desired string }{ - {"en", "da"}, - }, - }, - { - "nearby languages: Danish matches no", - "en, no", - []struct{ match, desired string }{ - {"no", "da"}, - }, - }, - { - "nearby languages: Danish matches nb", - "en, nb", - []struct{ match, desired string }{ - {"nb", "da"}, - }, - }, - { - "prefer matching languages over language variants.", - "nn, en-GB", - []struct{ match, desired string }{ - {"en-GB", "no, en-US"}, - {"en-GB", "nb, en-US"}, - }, - }, - { - "deprecated version is closer than same language with other differences", - "nl, he, en-GB", - []struct{ match, desired string }{ - {"he", "iw, en-US"}, - }, - }, - { - "macro equivalent is closer than same language with other differences", - "nl, zh, en-GB, no", - []struct{ match, desired string }{ - {"zh", "cmn, en-US"}, - {"no", "nb, en-US"}, - }, - }, - { - "legacy equivalent is closer than same language with other differences", - "nl, fil, en-GB", - []struct{ match, desired string }{ - {"fil", "tl, en-US"}, - }, - }, - { - "exact over equivalent", - "en, ro, mo, ro-MD", - []struct{ match, desired string }{ - {"ro", "ro"}, - {"mo", "mo"}, - {"ro-MD", "ro-MD"}, - }, - }, - { - "maximization of legacy", - "sr-Cyrl, sr-Latn, ro, ro-MD", - []struct{ match, desired string }{ - {"sr-Latn", "sh"}, - {"ro-MD", "mo"}, - }, - }, - { - "empty", - "", - []struct{ match, desired string }{ - {"und", "fr"}, - {"und", "en"}, - }, - }, - { - "private use subtags", - "fr, en-GB, x-bork, es-ES, es-419", - []struct{ match, desired string }{ - {"fr", "x-piglatin"}, - {"x-bork", "x-bork"}, - }, - }, - { - "grandfathered codes", - "fr, i-klingon, en-Latn-US", - []struct{ match, desired string }{ - {"en-Latn-US", "en-GB-oed"}, - {"tlh", "i-klingon"}, - }, - }, - { - "exact match", - "fr, en-GB, ja, es-ES, es-MX", - []struct{ match, desired string }{ - {"ja", "ja, de"}, - }, - }, - { - "simple variant match", - "fr, en-GB, ja, es-ES, es-MX", - []struct{ match, desired string }{ - // Intentionally avoiding a perfect-match or two candidates for variant matches. - {"en-GB", "de, en-US"}, - // Fall back. - {"fr", "de, zh"}, - }, - }, - { - "best match for traditional Chinese", - // Scenario: An application that only supports Simplified Chinese (and some - // other languages), but does not support Traditional Chinese. zh-Hans-CN - // could be replaced with zh-CN, zh, or zh-Hans, it wouldn't make much of - // a difference. - "fr, zh-Hans-CN, en-US", - []struct{ match, desired string }{ - {"zh-Hans-CN", "zh-TW"}, - {"zh-Hans-CN", "zh-Hant"}, - // One can avoid a zh-Hant to zh-Hans match by including a second language - // preference which is a better match. - {"en-US", "zh-TW, en"}, - {"en-US", "zh-Hant-CN, en"}, - {"zh-Hans-CN", "zh-Hans, en"}, - }, - }, - // More specific region and script tie-breakers. - { - "more specific script should win in case regions are identical", - "af, af-Latn, af-Arab", - []struct{ match, desired string }{ - {"af", "af"}, - {"af", "af-ZA"}, - {"af-Latn", "af-Latn-ZA"}, - {"af-Latn", "af-Latn"}, - }, - }, - { - "more specific region should win", - "nl, nl-NL, nl-BE", - []struct{ match, desired string }{ - {"nl", "nl"}, - {"nl", "nl-Latn"}, - {"nl-NL", "nl-Latn-NL"}, - {"nl-NL", "nl-NL"}, - }, - }, - { - "region may replace matched if matched is enclosing", - "es-419,es", - []struct{ match, desired string }{ - {"es-MX", "es-MX"}, - {"es", "es-SG"}, - }, - }, - { - "more specific region wins over more specific script", - "nl, nl-Latn, nl-NL, nl-BE", - []struct{ match, desired string }{ - {"nl", "nl"}, - {"nl-Latn", "nl-Latn"}, - {"nl-NL", "nl-NL"}, - {"nl-NL", "nl-Latn-NL"}, - }, - }, - // Region distance tie-breakers. - { - "region distance Portuguese", - "pt, pt-PT", - []struct{ match, desired string }{ - {"pt-PT", "pt-ES"}, - }, - }, - { - "region distance French", - "en, fr, fr-CA, fr-CH", - []struct{ match, desired string }{ - {"fr-CA", "fr-US"}, - }, - }, - { - "region distance German", - "de-AT, de-DE, de-CH", - []struct{ match, desired string }{ - {"de-DE", "de"}, - }, - }, - { - "en-AU is closer to en-GB than to en (which is en-US)", - "en, en-GB, es-ES, es-419", - []struct{ match, desired string }{ - {"en-GB", "en-AU"}, - {"es-MX", "es-MX"}, - {"es-ES", "es-PT"}, - }, - }, - // Test exceptions with "und". - // When the undefined language doesn't match anything in the list, return the default, as usual. - // max("und") = "en-Latn-US", and since matching is based on maximized tags, the undefined - // language would normally match English. But that would produce the counterintuitive results. - // Matching "und" to "it,en" would be "en" matching "en" to "it,und" would be "und". - // To avoid this max("und") is defined as "und" - { - "undefined", - "it, fr", - []struct{ match, desired string }{ - {"it", "und"}, - }, - }, - { - "und does not match en", - "it, en", - []struct{ match, desired string }{ - {"it", "und"}, - }, - }, - { - "undefined in priority list", - "it, und", - []struct{ match, desired string }{ - {"und", "und"}, - {"it", "en"}, - }, - }, - // Undefined scripts and regions. - { - "undefined", - "it, fr, zh", - []struct{ match, desired string }{ - {"fr", "und-FR"}, - {"zh", "und-CN"}, - {"zh", "und-Hans"}, - {"zh", "und-Hant"}, - {"it", "und-Latn"}, - }, - }, - // Early termination conditions: do not consider all desired strings if - // a match is good enough. - { - "match on maximized tag", - "fr, en-GB, ja, es-ES, es-MX", - []struct{ match, desired string }{ - // ja-JP matches ja on likely subtags, and it's listed first, - // thus it wins over the second preference en-GB. - {"ja", "ja-JP, en-GB"}, - {"ja", "ja-Jpan-JP, en-GB"}, - }, - }, - { - "pick best maximized tag", - "ja, ja-Jpan-US, ja-JP, en, ru", - []struct{ match, desired string }{ - {"ja", "ja-Jpan, ru"}, - {"ja-JP", "ja-JP, ru"}, - {"ja-Jpan-US", "ja-US, ru"}, - }, - }, - { - "termination: pick best maximized match", - "ja, ja-Jpan, ja-JP, en, ru", - []struct{ match, desired string }{ - {"ja-JP", "ja-Jpan-JP, ru"}, - {"ja-Jpan", "ja-Jpan, ru"}, - }, - }, - { - "no match on maximized", - "en, de, fr, ja", - []struct{ match, desired string }{ - // de maximizes to de-DE. - // Pick the exact match for the secondary language instead. - {"fr", "de-CH, fr"}, - }, - }, - - // Test that the CLDR parent relations are correctly preserved by the matcher. - // These matches may change for different CLDR versions. - { - "parent relation preserved", - "en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK", - []struct{ match, desired string }{ - {"en-GB", "en-150"}, - // {"en-GB", "en-001"}, // TODO: currently en, should probably be en-GB - {"en-GB", "en-AU"}, - {"en-GB", "en-BE"}, - {"en-GB", "en-GG"}, - {"en-GB", "en-GI"}, - {"en-GB", "en-HK"}, - {"en-GB", "en-IE"}, - {"en-GB", "en-IM"}, - {"en-GB", "en-IN"}, - {"en-GB", "en-JE"}, - {"en-GB", "en-MT"}, - {"en-GB", "en-NZ"}, - {"en-GB", "en-PK"}, - {"en-GB", "en-SG"}, - {"en-GB", "en-DE"}, - {"en-GB", "en-MT"}, - {"es-AR", "es-AR"}, - {"es-BO", "es-BO"}, - {"es-CL", "es-CL"}, - {"es-CO", "es-CO"}, - {"es-CR", "es-CR"}, - {"es-CU", "es-CU"}, - {"es-DO", "es-DO"}, - {"es-EC", "es-EC"}, - {"es-GT", "es-GT"}, - {"es-HN", "es-HN"}, - {"es-MX", "es-MX"}, - {"es-NI", "es-NI"}, - {"es-PA", "es-PA"}, - {"es-PE", "es-PE"}, - {"es-PR", "es-PR"}, - {"es", "es-PT"}, - {"es-PY", "es-PY"}, - {"es-SV", "es-SV"}, - {"es-419", "es-US"}, // US is not in Latin America, so don't make more specific. - {"es-UY", "es-UY"}, - {"es-VE", "es-VE"}, - {"pt-PT", "pt-AO"}, - {"pt-PT", "pt-CV"}, - {"pt-PT", "pt-GW"}, - {"pt-PT", "pt-MO"}, - {"pt-PT", "pt-MZ"}, - {"pt-PT", "pt-ST"}, - {"pt-PT", "pt-TL"}, - }, - }, - // Options and variants are inherited from user-defined settings. - { - "preserve Unicode extension", - "en, de, sl-nedis", - []struct{ match, desired string }{ - {"de-u-co-phonebk", "de-FR-u-co-phonebk"}, - {"sl-nedis-u-cu-eur", "sl-nedis-u-cu-eur"}, - {"sl-nedis-u-cu-eur", "sl-u-cu-eur"}, - {"sl-nedis-u-cu-eur", "sl-HR-nedis-u-cu-eur"}, - }, - }, -} diff --git a/vendor/golang.org/x/text/language/doc.go b/vendor/golang.org/x/text/language/doc.go new file mode 100644 index 00000000..8afecd50 --- /dev/null +++ b/vendor/golang.org/x/text/language/doc.go @@ -0,0 +1,102 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package language implements BCP 47 language tags and related functionality. +// +// The most important function of package language is to match a list of +// user-preferred languages to a list of supported languages. +// It alleviates the developer of dealing with the complexity of this process +// and provides the user with the best experience +// (see https://blog.golang.org/matchlang). +// +// +// Matching preferred against supported languages +// +// A Matcher for an application that supports English, Australian English, +// Danish, and standard Mandarin can be created as follows: +// +// var matcher = language.NewMatcher([]language.Tag{ +// language.English, // The first language is used as fallback. +// language.MustParse("en-AU"), +// language.Danish, +// language.Chinese, +// }) +// +// This list of supported languages is typically implied by the languages for +// which there exists translations of the user interface. +// +// User-preferred languages usually come as a comma-separated list of BCP 47 +// language tags. +// The MatchString finds best matches for such strings: +// +// handler(w http.ResponseWriter, r *http.Request) { +// lang, _ := r.Cookie("lang") +// accept := r.Header.Get("Accept-Language") +// tag, _ := language.MatchStrings(matcher, lang.String(), accept) +// +// // tag should now be used for the initialization of any +// // locale-specific service. +// } +// +// The Matcher's Match method can be used to match Tags directly. +// +// Matchers are aware of the intricacies of equivalence between languages, such +// as deprecated subtags, legacy tags, macro languages, mutual +// intelligibility between scripts and languages, and transparently passing +// BCP 47 user configuration. +// For instance, it will know that a reader of Bokmål Danish can read Norwegian +// and will know that Cantonese ("yue") is a good match for "zh-HK". +// +// +// Using match results +// +// To guarantee a consistent user experience to the user it is important to +// use the same language tag for the selection of any locale-specific services. +// For example, it is utterly confusing to substitute spelled-out numbers +// or dates in one language in text of another language. +// More subtly confusing is using the wrong sorting order or casing +// algorithm for a certain language. +// +// All the packages in x/text that provide locale-specific services +// (e.g. collate, cases) should be initialized with the tag that was +// obtained at the start of an interaction with the user. +// +// Note that Tag that is returned by Match and MatchString may differ from any +// of the supported languages, as it may contain carried over settings from +// the user tags. +// This may be inconvenient when your application has some additional +// locale-specific data for your supported languages. +// Match and MatchString both return the index of the matched supported tag +// to simplify associating such data with the matched tag. +// +// +// Canonicalization +// +// If one uses the Matcher to compare languages one does not need to +// worry about canonicalization. +// +// The meaning of a Tag varies per application. The language package +// therefore delays canonicalization and preserves information as much +// as possible. The Matcher, however, will always take into account that +// two different tags may represent the same language. +// +// By default, only legacy and deprecated tags are converted into their +// canonical equivalent. All other information is preserved. This approach makes +// the confidence scores more accurate and allows matchers to distinguish +// between variants that are otherwise lost. +// +// As a consequence, two tags that should be treated as identical according to +// BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The +// Matcher handles such distinctions, though, and is aware of the +// equivalence relations. The CanonType type can be used to alter the +// canonicalization form. +// +// References +// +// BCP 47 - Tags for Identifying Languages http://tools.ietf.org/html/bcp47 +// +package language // import "golang.org/x/text/language" + +// TODO: explanation on how to match languages for your own locale-specific +// service. diff --git a/vendor/golang.org/x/text/language/examples_test.go b/vendor/golang.org/x/text/language/examples_test.go index 05e712d7..d5e8176d 100644 --- a/vendor/golang.org/x/text/language/examples_test.go +++ b/vendor/golang.org/x/text/language/examples_test.go @@ -6,6 +6,7 @@ package language_test import ( "fmt" + "net/http" "golang.org/x/text/language" ) @@ -274,7 +275,7 @@ func ExampleMatcher() { fmt.Println("----") - // Croatian speakers will likely understand Serbian written in Latin script. + // Someone specifying sr-Latn is probably fine with getting Croatian. fmt.Println(m.Match(language.Make("sr-Latn"))) // We match SimplifiedChinese, but with Low confidence. @@ -331,11 +332,27 @@ func ExampleMatcher() { // af 3 High // ---- // iw 9 Exact - // iw-IL 8 Exact + // he 10 Exact // ---- // fr-u-cu-frf 2 Exact // fr-u-cu-frf 2 High // en-u-co-phonebk 0 No + + // TODO: "he" should be "he-u-rg-IL High" +} + +func ExampleMatchStrings() { + // languages supported by this service: + matcher := language.NewMatcher([]language.Tag{ + language.English, language.Dutch, language.German, + }) + + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + lang, _ := r.Cookie("lang") + tag, _ := language.MatchStrings(matcher, lang.String(), r.Header.Get("Accept-Language")) + + fmt.Println("User language:", tag) + }) } func ExampleComprehends() { diff --git a/vendor/golang.org/x/text/language/gen.go b/vendor/golang.org/x/text/language/gen.go index 153269bc..7c260e5c 100644 --- a/vendor/golang.org/x/text/language/gen.go +++ b/vendor/golang.org/x/text/language/gen.go @@ -698,8 +698,8 @@ func (b *builder) computeRegionGroups() { b.groups[group] = index(len(b.groups)) } } - if len(b.groups) > 32 { - log.Fatalf("only 32 groups supported, found %d", len(b.groups)) + if len(b.groups) > 64 { + log.Fatalf("only 64 groups supported, found %d", len(b.groups)) } b.writeConst("nRegionGroups", len(b.groups)) } @@ -1417,20 +1417,27 @@ func (b *builder) writeMatchData() { } b.writeSlice("regionToGroups", regionToGroups) + // maps language id to in- and out-of-group region. + paradigmLocales := [][3]uint16{} + locales := strings.Split(lm[0].ParadigmLocales[0].Locales, " ") + for i := 0; i < len(locales); i += 2 { + x := [3]uint16{} + for j := 0; j < 2; j++ { + pc := strings.SplitN(locales[i+j], "-", 2) + x[0] = b.langIndex(pc[0]) + if len(pc) == 2 { + x[1+j] = uint16(b.region.index(pc[1])) + } + } + paradigmLocales = append(paradigmLocales, x) + } + b.writeSlice("paradigmLocales", paradigmLocales) + b.writeType(mutualIntelligibility{}) b.writeType(scriptIntelligibility{}) b.writeType(regionIntelligibility{}) - matchLang := []mutualIntelligibility{{ - // TODO: remove once CLDR is fixed. - want: uint16(b.langIndex("sr")), - have: uint16(b.langIndex("hr")), - distance: uint8(5), - }, { - want: uint16(b.langIndex("sr")), - have: uint16(b.langIndex("bs")), - distance: uint8(5), - }} + matchLang := []mutualIntelligibility{} matchScript := []scriptIntelligibility{} matchRegion := []regionIntelligibility{} // Convert the languageMatch entries in lists keyed by desired language. @@ -1559,7 +1566,7 @@ func (b *builder) writeRegionInclusionData() { } } - regionContainment := make([]uint32, len(b.groups)) + regionContainment := make([]uint64, len(b.groups)) for _, g := range b.groups { l := containment[g] @@ -1577,10 +1584,10 @@ func (b *builder) writeRegionInclusionData() { b.writeSlice("regionContainment", regionContainment) regionInclusion := make([]uint8, len(b.region.s)) - bvs := make(map[uint32]index) + bvs := make(map[uint64]index) // Make the first bitvector positions correspond with the groups. for r, i := range b.groups { - bv := uint32(1 << i) + bv := uint64(1 << i) for _, g := range mm[r] { bv |= 1 << g } @@ -1589,7 +1596,7 @@ func (b *builder) writeRegionInclusionData() { } for r := 1; r < len(b.region.s); r++ { if _, ok := b.groups[r]; !ok { - bv := uint32(0) + bv := uint64(0) for _, g := range mm[r] { bv |= 1 << g } @@ -1604,9 +1611,9 @@ func (b *builder) writeRegionInclusionData() { } } b.writeSlice("regionInclusion", regionInclusion) - regionInclusionBits := make([]uint32, len(bvs)) + regionInclusionBits := make([]uint64, len(bvs)) for k, v := range bvs { - regionInclusionBits[v] = uint32(k) + regionInclusionBits[v] = uint64(k) } // Add bit vectors for increasingly large distances until a fixed point is reached. regionInclusionNext := []uint8{} diff --git a/vendor/golang.org/x/text/language/index.go b/vendor/golang.org/x/text/language/index.go index 973db9fd..69ac557d 100644 --- a/vendor/golang.org/x/text/language/index.go +++ b/vendor/golang.org/x/text/language/index.go @@ -7,763 +7,763 @@ package language const NumCompactTags = 754 var specialTags = []Tag{ // 2 elements - 0: {lang: 0xd7, region: 0x6d, script: 0x0, pVariant: 0x5, pExt: 0xe, str: "ca-ES-valencia"}, - 1: {lang: 0x138, region: 0x134, script: 0x0, pVariant: 0x5, pExt: 0x5, str: "en-US-u-va-posix"}, + 0: {lang: 0xd7, region: 0x6e, script: 0x0, pVariant: 0x5, pExt: 0xe, str: "ca-ES-valencia"}, + 1: {lang: 0x138, region: 0x135, script: 0x0, pVariant: 0x5, pExt: 0x5, str: "en-US-u-va-posix"}, } // Size: 72 bytes var coreTags = map[uint32]uint16{ 0x0: 0, // und 0x01600000: 3, // af - 0x016000d1: 4, // af-NA - 0x01600160: 5, // af-ZA + 0x016000d2: 4, // af-NA + 0x01600161: 5, // af-ZA 0x01c00000: 6, // agq - 0x01c00051: 7, // agq-CM + 0x01c00052: 7, // agq-CM 0x02100000: 8, // ak - 0x0210007f: 9, // ak-GH + 0x02100080: 9, // ak-GH 0x02700000: 10, // am - 0x0270006e: 11, // am-ET + 0x0270006f: 11, // am-ET 0x03a00000: 12, // ar 0x03a00001: 13, // ar-001 - 0x03a00022: 14, // ar-AE - 0x03a00038: 15, // ar-BH - 0x03a00061: 16, // ar-DJ - 0x03a00066: 17, // ar-DZ - 0x03a0006a: 18, // ar-EG - 0x03a0006b: 19, // ar-EH - 0x03a0006c: 20, // ar-ER - 0x03a00096: 21, // ar-IL - 0x03a0009a: 22, // ar-IQ - 0x03a000a0: 23, // ar-JO - 0x03a000a7: 24, // ar-KM - 0x03a000ab: 25, // ar-KW - 0x03a000af: 26, // ar-LB - 0x03a000b8: 27, // ar-LY - 0x03a000b9: 28, // ar-MA - 0x03a000c8: 29, // ar-MR - 0x03a000e0: 30, // ar-OM - 0x03a000ec: 31, // ar-PS - 0x03a000f2: 32, // ar-QA - 0x03a00107: 33, // ar-SA - 0x03a0010a: 34, // ar-SD - 0x03a00114: 35, // ar-SO - 0x03a00116: 36, // ar-SS - 0x03a0011b: 37, // ar-SY - 0x03a0011f: 38, // ar-TD - 0x03a00127: 39, // ar-TN - 0x03a0015d: 40, // ar-YE + 0x03a00023: 14, // ar-AE + 0x03a00039: 15, // ar-BH + 0x03a00062: 16, // ar-DJ + 0x03a00067: 17, // ar-DZ + 0x03a0006b: 18, // ar-EG + 0x03a0006c: 19, // ar-EH + 0x03a0006d: 20, // ar-ER + 0x03a00097: 21, // ar-IL + 0x03a0009b: 22, // ar-IQ + 0x03a000a1: 23, // ar-JO + 0x03a000a8: 24, // ar-KM + 0x03a000ac: 25, // ar-KW + 0x03a000b0: 26, // ar-LB + 0x03a000b9: 27, // ar-LY + 0x03a000ba: 28, // ar-MA + 0x03a000c9: 29, // ar-MR + 0x03a000e1: 30, // ar-OM + 0x03a000ed: 31, // ar-PS + 0x03a000f3: 32, // ar-QA + 0x03a00108: 33, // ar-SA + 0x03a0010b: 34, // ar-SD + 0x03a00115: 35, // ar-SO + 0x03a00117: 36, // ar-SS + 0x03a0011c: 37, // ar-SY + 0x03a00120: 38, // ar-TD + 0x03a00128: 39, // ar-TN + 0x03a0015e: 40, // ar-YE 0x04000000: 41, // ars 0x04300000: 42, // as - 0x04300098: 43, // as-IN + 0x04300099: 43, // as-IN 0x04400000: 44, // asa - 0x0440012e: 45, // asa-TZ + 0x0440012f: 45, // asa-TZ 0x04800000: 46, // ast - 0x0480006d: 47, // ast-ES + 0x0480006e: 47, // ast-ES 0x05800000: 48, // az 0x0581e000: 49, // az-Cyrl - 0x0581e031: 50, // az-Cyrl-AZ - 0x05852000: 51, // az-Latn - 0x05852031: 52, // az-Latn-AZ + 0x0581e032: 50, // az-Cyrl-AZ + 0x05855000: 51, // az-Latn + 0x05855032: 52, // az-Latn-AZ 0x05e00000: 53, // bas - 0x05e00051: 54, // bas-CM + 0x05e00052: 54, // bas-CM 0x07100000: 55, // be - 0x07100046: 56, // be-BY + 0x07100047: 56, // be-BY 0x07500000: 57, // bem - 0x07500161: 58, // bem-ZM + 0x07500162: 58, // bem-ZM 0x07900000: 59, // bez - 0x0790012e: 60, // bez-TZ + 0x0790012f: 60, // bez-TZ 0x07e00000: 61, // bg - 0x07e00037: 62, // bg-BG + 0x07e00038: 62, // bg-BG 0x08200000: 63, // bh 0x0a000000: 64, // bm - 0x0a0000c2: 65, // bm-ML + 0x0a0000c3: 65, // bm-ML 0x0a500000: 66, // bn - 0x0a500034: 67, // bn-BD - 0x0a500098: 68, // bn-IN + 0x0a500035: 67, // bn-BD + 0x0a500099: 68, // bn-IN 0x0a900000: 69, // bo - 0x0a900052: 70, // bo-CN - 0x0a900098: 71, // bo-IN + 0x0a900053: 70, // bo-CN + 0x0a900099: 71, // bo-IN 0x0b200000: 72, // br - 0x0b200077: 73, // br-FR + 0x0b200078: 73, // br-FR 0x0b500000: 74, // brx - 0x0b500098: 75, // brx-IN + 0x0b500099: 75, // brx-IN 0x0b700000: 76, // bs 0x0b71e000: 77, // bs-Cyrl - 0x0b71e032: 78, // bs-Cyrl-BA - 0x0b752000: 79, // bs-Latn - 0x0b752032: 80, // bs-Latn-BA + 0x0b71e033: 78, // bs-Cyrl-BA + 0x0b755000: 79, // bs-Latn + 0x0b755033: 80, // bs-Latn-BA 0x0d700000: 81, // ca - 0x0d700021: 82, // ca-AD - 0x0d70006d: 83, // ca-ES - 0x0d700077: 84, // ca-FR - 0x0d70009d: 85, // ca-IT + 0x0d700022: 82, // ca-AD + 0x0d70006e: 83, // ca-ES + 0x0d700078: 84, // ca-FR + 0x0d70009e: 85, // ca-IT 0x0dc00000: 86, // ce - 0x0dc00105: 87, // ce-RU + 0x0dc00106: 87, // ce-RU 0x0df00000: 88, // cgg - 0x0df00130: 89, // cgg-UG + 0x0df00131: 89, // cgg-UG 0x0e500000: 90, // chr - 0x0e500134: 91, // chr-US + 0x0e500135: 91, // chr-US 0x0e900000: 92, // ckb - 0x0e90009a: 93, // ckb-IQ - 0x0e90009b: 94, // ckb-IR + 0x0e90009b: 93, // ckb-IQ + 0x0e90009c: 94, // ckb-IR 0x0f900000: 95, // cs - 0x0f90005d: 96, // cs-CZ + 0x0f90005e: 96, // cs-CZ 0x0fd00000: 97, // cu - 0x0fd00105: 98, // cu-RU + 0x0fd00106: 98, // cu-RU 0x0ff00000: 99, // cy - 0x0ff0007a: 100, // cy-GB + 0x0ff0007b: 100, // cy-GB 0x10000000: 101, // da - 0x10000062: 102, // da-DK - 0x10000081: 103, // da-GL + 0x10000063: 102, // da-DK + 0x10000082: 103, // da-GL 0x10700000: 104, // dav - 0x107000a3: 105, // dav-KE + 0x107000a4: 105, // dav-KE 0x10c00000: 106, // de - 0x10c0002d: 107, // de-AT - 0x10c00035: 108, // de-BE - 0x10c0004d: 109, // de-CH - 0x10c0005f: 110, // de-DE - 0x10c0009d: 111, // de-IT - 0x10c000b1: 112, // de-LI - 0x10c000b6: 113, // de-LU + 0x10c0002e: 107, // de-AT + 0x10c00036: 108, // de-BE + 0x10c0004e: 109, // de-CH + 0x10c00060: 110, // de-DE + 0x10c0009e: 111, // de-IT + 0x10c000b2: 112, // de-LI + 0x10c000b7: 113, // de-LU 0x11600000: 114, // dje - 0x116000d3: 115, // dje-NE + 0x116000d4: 115, // dje-NE 0x11e00000: 116, // dsb - 0x11e0005f: 117, // dsb-DE + 0x11e00060: 117, // dsb-DE 0x12300000: 118, // dua - 0x12300051: 119, // dua-CM + 0x12300052: 119, // dua-CM 0x12700000: 120, // dv 0x12a00000: 121, // dyo - 0x12a00113: 122, // dyo-SN + 0x12a00114: 122, // dyo-SN 0x12c00000: 123, // dz - 0x12c00042: 124, // dz-BT + 0x12c00043: 124, // dz-BT 0x12e00000: 125, // ebu - 0x12e000a3: 126, // ebu-KE + 0x12e000a4: 126, // ebu-KE 0x12f00000: 127, // ee - 0x12f0007f: 128, // ee-GH - 0x12f00121: 129, // ee-TG + 0x12f00080: 128, // ee-GH + 0x12f00122: 129, // ee-TG 0x13500000: 130, // el - 0x1350005c: 131, // el-CY - 0x13500086: 132, // el-GR + 0x1350005d: 131, // el-CY + 0x13500087: 132, // el-GR 0x13800000: 133, // en 0x13800001: 134, // en-001 0x1380001a: 135, // en-150 - 0x13800024: 136, // en-AG - 0x13800025: 137, // en-AI - 0x1380002c: 138, // en-AS - 0x1380002d: 139, // en-AT - 0x1380002e: 140, // en-AU - 0x13800033: 141, // en-BB - 0x13800035: 142, // en-BE - 0x13800039: 143, // en-BI - 0x1380003c: 144, // en-BM - 0x13800041: 145, // en-BS - 0x13800045: 146, // en-BW - 0x13800047: 147, // en-BZ - 0x13800048: 148, // en-CA - 0x13800049: 149, // en-CC - 0x1380004d: 150, // en-CH - 0x1380004f: 151, // en-CK - 0x13800051: 152, // en-CM - 0x1380005b: 153, // en-CX - 0x1380005c: 154, // en-CY - 0x1380005f: 155, // en-DE - 0x13800060: 156, // en-DG - 0x13800062: 157, // en-DK - 0x13800063: 158, // en-DM - 0x1380006c: 159, // en-ER - 0x13800071: 160, // en-FI - 0x13800072: 161, // en-FJ - 0x13800073: 162, // en-FK - 0x13800074: 163, // en-FM - 0x1380007a: 164, // en-GB - 0x1380007b: 165, // en-GD - 0x1380007e: 166, // en-GG - 0x1380007f: 167, // en-GH - 0x13800080: 168, // en-GI - 0x13800082: 169, // en-GM - 0x13800089: 170, // en-GU - 0x1380008b: 171, // en-GY - 0x1380008c: 172, // en-HK - 0x13800095: 173, // en-IE - 0x13800096: 174, // en-IL - 0x13800097: 175, // en-IM - 0x13800098: 176, // en-IN - 0x13800099: 177, // en-IO - 0x1380009e: 178, // en-JE - 0x1380009f: 179, // en-JM - 0x138000a3: 180, // en-KE - 0x138000a6: 181, // en-KI - 0x138000a8: 182, // en-KN - 0x138000ac: 183, // en-KY - 0x138000b0: 184, // en-LC - 0x138000b3: 185, // en-LR - 0x138000b4: 186, // en-LS - 0x138000be: 187, // en-MG - 0x138000bf: 188, // en-MH - 0x138000c5: 189, // en-MO - 0x138000c6: 190, // en-MP - 0x138000c9: 191, // en-MS - 0x138000ca: 192, // en-MT - 0x138000cb: 193, // en-MU - 0x138000cd: 194, // en-MW - 0x138000cf: 195, // en-MY - 0x138000d1: 196, // en-NA - 0x138000d4: 197, // en-NF - 0x138000d5: 198, // en-NG - 0x138000d8: 199, // en-NL - 0x138000dc: 200, // en-NR - 0x138000de: 201, // en-NU - 0x138000df: 202, // en-NZ - 0x138000e5: 203, // en-PG - 0x138000e6: 204, // en-PH - 0x138000e7: 205, // en-PK - 0x138000ea: 206, // en-PN - 0x138000eb: 207, // en-PR - 0x138000ef: 208, // en-PW - 0x13800106: 209, // en-RW - 0x13800108: 210, // en-SB - 0x13800109: 211, // en-SC - 0x1380010a: 212, // en-SD - 0x1380010b: 213, // en-SE - 0x1380010c: 214, // en-SG - 0x1380010d: 215, // en-SH - 0x1380010e: 216, // en-SI - 0x13800111: 217, // en-SL - 0x13800116: 218, // en-SS - 0x1380011a: 219, // en-SX - 0x1380011c: 220, // en-SZ - 0x1380011e: 221, // en-TC - 0x13800124: 222, // en-TK - 0x13800128: 223, // en-TO - 0x1380012b: 224, // en-TT - 0x1380012c: 225, // en-TV - 0x1380012e: 226, // en-TZ - 0x13800130: 227, // en-UG - 0x13800132: 228, // en-UM - 0x13800134: 229, // en-US - 0x13800138: 230, // en-VC - 0x1380013b: 231, // en-VG - 0x1380013c: 232, // en-VI - 0x1380013e: 233, // en-VU - 0x13800141: 234, // en-WS - 0x13800160: 235, // en-ZA - 0x13800161: 236, // en-ZM - 0x13800163: 237, // en-ZW + 0x13800025: 136, // en-AG + 0x13800026: 137, // en-AI + 0x1380002d: 138, // en-AS + 0x1380002e: 139, // en-AT + 0x1380002f: 140, // en-AU + 0x13800034: 141, // en-BB + 0x13800036: 142, // en-BE + 0x1380003a: 143, // en-BI + 0x1380003d: 144, // en-BM + 0x13800042: 145, // en-BS + 0x13800046: 146, // en-BW + 0x13800048: 147, // en-BZ + 0x13800049: 148, // en-CA + 0x1380004a: 149, // en-CC + 0x1380004e: 150, // en-CH + 0x13800050: 151, // en-CK + 0x13800052: 152, // en-CM + 0x1380005c: 153, // en-CX + 0x1380005d: 154, // en-CY + 0x13800060: 155, // en-DE + 0x13800061: 156, // en-DG + 0x13800063: 157, // en-DK + 0x13800064: 158, // en-DM + 0x1380006d: 159, // en-ER + 0x13800072: 160, // en-FI + 0x13800073: 161, // en-FJ + 0x13800074: 162, // en-FK + 0x13800075: 163, // en-FM + 0x1380007b: 164, // en-GB + 0x1380007c: 165, // en-GD + 0x1380007f: 166, // en-GG + 0x13800080: 167, // en-GH + 0x13800081: 168, // en-GI + 0x13800083: 169, // en-GM + 0x1380008a: 170, // en-GU + 0x1380008c: 171, // en-GY + 0x1380008d: 172, // en-HK + 0x13800096: 173, // en-IE + 0x13800097: 174, // en-IL + 0x13800098: 175, // en-IM + 0x13800099: 176, // en-IN + 0x1380009a: 177, // en-IO + 0x1380009f: 178, // en-JE + 0x138000a0: 179, // en-JM + 0x138000a4: 180, // en-KE + 0x138000a7: 181, // en-KI + 0x138000a9: 182, // en-KN + 0x138000ad: 183, // en-KY + 0x138000b1: 184, // en-LC + 0x138000b4: 185, // en-LR + 0x138000b5: 186, // en-LS + 0x138000bf: 187, // en-MG + 0x138000c0: 188, // en-MH + 0x138000c6: 189, // en-MO + 0x138000c7: 190, // en-MP + 0x138000ca: 191, // en-MS + 0x138000cb: 192, // en-MT + 0x138000cc: 193, // en-MU + 0x138000ce: 194, // en-MW + 0x138000d0: 195, // en-MY + 0x138000d2: 196, // en-NA + 0x138000d5: 197, // en-NF + 0x138000d6: 198, // en-NG + 0x138000d9: 199, // en-NL + 0x138000dd: 200, // en-NR + 0x138000df: 201, // en-NU + 0x138000e0: 202, // en-NZ + 0x138000e6: 203, // en-PG + 0x138000e7: 204, // en-PH + 0x138000e8: 205, // en-PK + 0x138000eb: 206, // en-PN + 0x138000ec: 207, // en-PR + 0x138000f0: 208, // en-PW + 0x13800107: 209, // en-RW + 0x13800109: 210, // en-SB + 0x1380010a: 211, // en-SC + 0x1380010b: 212, // en-SD + 0x1380010c: 213, // en-SE + 0x1380010d: 214, // en-SG + 0x1380010e: 215, // en-SH + 0x1380010f: 216, // en-SI + 0x13800112: 217, // en-SL + 0x13800117: 218, // en-SS + 0x1380011b: 219, // en-SX + 0x1380011d: 220, // en-SZ + 0x1380011f: 221, // en-TC + 0x13800125: 222, // en-TK + 0x13800129: 223, // en-TO + 0x1380012c: 224, // en-TT + 0x1380012d: 225, // en-TV + 0x1380012f: 226, // en-TZ + 0x13800131: 227, // en-UG + 0x13800133: 228, // en-UM + 0x13800135: 229, // en-US + 0x13800139: 230, // en-VC + 0x1380013c: 231, // en-VG + 0x1380013d: 232, // en-VI + 0x1380013f: 233, // en-VU + 0x13800142: 234, // en-WS + 0x13800161: 235, // en-ZA + 0x13800162: 236, // en-ZM + 0x13800164: 237, // en-ZW 0x13b00000: 238, // eo 0x13b00001: 239, // eo-001 0x13d00000: 240, // es - 0x13d0001e: 241, // es-419 - 0x13d0002b: 242, // es-AR - 0x13d0003e: 243, // es-BO - 0x13d00040: 244, // es-BR - 0x13d00047: 245, // es-BZ - 0x13d00050: 246, // es-CL - 0x13d00053: 247, // es-CO - 0x13d00055: 248, // es-CR - 0x13d00058: 249, // es-CU - 0x13d00064: 250, // es-DO - 0x13d00067: 251, // es-EA - 0x13d00068: 252, // es-EC - 0x13d0006d: 253, // es-ES - 0x13d00085: 254, // es-GQ - 0x13d00088: 255, // es-GT - 0x13d0008e: 256, // es-HN - 0x13d00093: 257, // es-IC - 0x13d000ce: 258, // es-MX - 0x13d000d7: 259, // es-NI - 0x13d000e1: 260, // es-PA - 0x13d000e3: 261, // es-PE - 0x13d000e6: 262, // es-PH - 0x13d000eb: 263, // es-PR - 0x13d000f0: 264, // es-PY - 0x13d00119: 265, // es-SV - 0x13d00134: 266, // es-US - 0x13d00135: 267, // es-UY - 0x13d0013a: 268, // es-VE + 0x13d0001f: 241, // es-419 + 0x13d0002c: 242, // es-AR + 0x13d0003f: 243, // es-BO + 0x13d00041: 244, // es-BR + 0x13d00048: 245, // es-BZ + 0x13d00051: 246, // es-CL + 0x13d00054: 247, // es-CO + 0x13d00056: 248, // es-CR + 0x13d00059: 249, // es-CU + 0x13d00065: 250, // es-DO + 0x13d00068: 251, // es-EA + 0x13d00069: 252, // es-EC + 0x13d0006e: 253, // es-ES + 0x13d00086: 254, // es-GQ + 0x13d00089: 255, // es-GT + 0x13d0008f: 256, // es-HN + 0x13d00094: 257, // es-IC + 0x13d000cf: 258, // es-MX + 0x13d000d8: 259, // es-NI + 0x13d000e2: 260, // es-PA + 0x13d000e4: 261, // es-PE + 0x13d000e7: 262, // es-PH + 0x13d000ec: 263, // es-PR + 0x13d000f1: 264, // es-PY + 0x13d0011a: 265, // es-SV + 0x13d00135: 266, // es-US + 0x13d00136: 267, // es-UY + 0x13d0013b: 268, // es-VE 0x13f00000: 269, // et - 0x13f00069: 270, // et-EE + 0x13f0006a: 270, // et-EE 0x14400000: 271, // eu - 0x1440006d: 272, // eu-ES + 0x1440006e: 272, // eu-ES 0x14500000: 273, // ewo - 0x14500051: 274, // ewo-CM + 0x14500052: 274, // ewo-CM 0x14700000: 275, // fa - 0x14700023: 276, // fa-AF - 0x1470009b: 277, // fa-IR + 0x14700024: 276, // fa-AF + 0x1470009c: 277, // fa-IR 0x14d00000: 278, // ff - 0x14d00051: 279, // ff-CM - 0x14d00083: 280, // ff-GN - 0x14d000c8: 281, // ff-MR - 0x14d00113: 282, // ff-SN + 0x14d00052: 279, // ff-CM + 0x14d00084: 280, // ff-GN + 0x14d000c9: 281, // ff-MR + 0x14d00114: 282, // ff-SN 0x15000000: 283, // fi - 0x15000071: 284, // fi-FI + 0x15000072: 284, // fi-FI 0x15200000: 285, // fil - 0x152000e6: 286, // fil-PH + 0x152000e7: 286, // fil-PH 0x15700000: 287, // fo - 0x15700062: 288, // fo-DK - 0x15700075: 289, // fo-FO + 0x15700063: 288, // fo-DK + 0x15700076: 289, // fo-FO 0x15d00000: 290, // fr - 0x15d00035: 291, // fr-BE - 0x15d00036: 292, // fr-BF - 0x15d00039: 293, // fr-BI - 0x15d0003a: 294, // fr-BJ - 0x15d0003b: 295, // fr-BL - 0x15d00048: 296, // fr-CA - 0x15d0004a: 297, // fr-CD - 0x15d0004b: 298, // fr-CF - 0x15d0004c: 299, // fr-CG - 0x15d0004d: 300, // fr-CH - 0x15d0004e: 301, // fr-CI - 0x15d00051: 302, // fr-CM - 0x15d00061: 303, // fr-DJ - 0x15d00066: 304, // fr-DZ - 0x15d00077: 305, // fr-FR - 0x15d00079: 306, // fr-GA - 0x15d0007d: 307, // fr-GF - 0x15d00083: 308, // fr-GN - 0x15d00084: 309, // fr-GP - 0x15d00085: 310, // fr-GQ - 0x15d00090: 311, // fr-HT - 0x15d000a7: 312, // fr-KM - 0x15d000b6: 313, // fr-LU - 0x15d000b9: 314, // fr-MA - 0x15d000ba: 315, // fr-MC - 0x15d000bd: 316, // fr-MF - 0x15d000be: 317, // fr-MG - 0x15d000c2: 318, // fr-ML - 0x15d000c7: 319, // fr-MQ - 0x15d000c8: 320, // fr-MR - 0x15d000cb: 321, // fr-MU - 0x15d000d2: 322, // fr-NC - 0x15d000d3: 323, // fr-NE - 0x15d000e4: 324, // fr-PF - 0x15d000e9: 325, // fr-PM - 0x15d00101: 326, // fr-RE - 0x15d00106: 327, // fr-RW - 0x15d00109: 328, // fr-SC - 0x15d00113: 329, // fr-SN - 0x15d0011b: 330, // fr-SY - 0x15d0011f: 331, // fr-TD - 0x15d00121: 332, // fr-TG - 0x15d00127: 333, // fr-TN - 0x15d0013e: 334, // fr-VU - 0x15d0013f: 335, // fr-WF - 0x15d0015e: 336, // fr-YT + 0x15d00036: 291, // fr-BE + 0x15d00037: 292, // fr-BF + 0x15d0003a: 293, // fr-BI + 0x15d0003b: 294, // fr-BJ + 0x15d0003c: 295, // fr-BL + 0x15d00049: 296, // fr-CA + 0x15d0004b: 297, // fr-CD + 0x15d0004c: 298, // fr-CF + 0x15d0004d: 299, // fr-CG + 0x15d0004e: 300, // fr-CH + 0x15d0004f: 301, // fr-CI + 0x15d00052: 302, // fr-CM + 0x15d00062: 303, // fr-DJ + 0x15d00067: 304, // fr-DZ + 0x15d00078: 305, // fr-FR + 0x15d0007a: 306, // fr-GA + 0x15d0007e: 307, // fr-GF + 0x15d00084: 308, // fr-GN + 0x15d00085: 309, // fr-GP + 0x15d00086: 310, // fr-GQ + 0x15d00091: 311, // fr-HT + 0x15d000a8: 312, // fr-KM + 0x15d000b7: 313, // fr-LU + 0x15d000ba: 314, // fr-MA + 0x15d000bb: 315, // fr-MC + 0x15d000be: 316, // fr-MF + 0x15d000bf: 317, // fr-MG + 0x15d000c3: 318, // fr-ML + 0x15d000c8: 319, // fr-MQ + 0x15d000c9: 320, // fr-MR + 0x15d000cc: 321, // fr-MU + 0x15d000d3: 322, // fr-NC + 0x15d000d4: 323, // fr-NE + 0x15d000e5: 324, // fr-PF + 0x15d000ea: 325, // fr-PM + 0x15d00102: 326, // fr-RE + 0x15d00107: 327, // fr-RW + 0x15d0010a: 328, // fr-SC + 0x15d00114: 329, // fr-SN + 0x15d0011c: 330, // fr-SY + 0x15d00120: 331, // fr-TD + 0x15d00122: 332, // fr-TG + 0x15d00128: 333, // fr-TN + 0x15d0013f: 334, // fr-VU + 0x15d00140: 335, // fr-WF + 0x15d0015f: 336, // fr-YT 0x16800000: 337, // fur - 0x1680009d: 338, // fur-IT + 0x1680009e: 338, // fur-IT 0x16c00000: 339, // fy - 0x16c000d8: 340, // fy-NL + 0x16c000d9: 340, // fy-NL 0x16d00000: 341, // ga - 0x16d00095: 342, // ga-IE + 0x16d00096: 342, // ga-IE 0x17c00000: 343, // gd - 0x17c0007a: 344, // gd-GB + 0x17c0007b: 344, // gd-GB 0x18e00000: 345, // gl - 0x18e0006d: 346, // gl-ES + 0x18e0006e: 346, // gl-ES 0x1a100000: 347, // gsw - 0x1a10004d: 348, // gsw-CH - 0x1a100077: 349, // gsw-FR - 0x1a1000b1: 350, // gsw-LI + 0x1a10004e: 348, // gsw-CH + 0x1a100078: 349, // gsw-FR + 0x1a1000b2: 350, // gsw-LI 0x1a200000: 351, // gu - 0x1a200098: 352, // gu-IN + 0x1a200099: 352, // gu-IN 0x1a700000: 353, // guw 0x1a900000: 354, // guz - 0x1a9000a3: 355, // guz-KE + 0x1a9000a4: 355, // guz-KE 0x1aa00000: 356, // gv - 0x1aa00097: 357, // gv-IM + 0x1aa00098: 357, // gv-IM 0x1b200000: 358, // ha - 0x1b20007f: 359, // ha-GH - 0x1b2000d3: 360, // ha-NE - 0x1b2000d5: 361, // ha-NG + 0x1b200080: 359, // ha-GH + 0x1b2000d4: 360, // ha-NE + 0x1b2000d6: 361, // ha-NG 0x1b600000: 362, // haw - 0x1b600134: 363, // haw-US + 0x1b600135: 363, // haw-US 0x1ba00000: 364, // he - 0x1ba00096: 365, // he-IL + 0x1ba00097: 365, // he-IL 0x1bc00000: 366, // hi - 0x1bc00098: 367, // hi-IN + 0x1bc00099: 367, // hi-IN 0x1cf00000: 368, // hr - 0x1cf00032: 369, // hr-BA - 0x1cf0008f: 370, // hr-HR + 0x1cf00033: 369, // hr-BA + 0x1cf00090: 370, // hr-HR 0x1d000000: 371, // hsb - 0x1d00005f: 372, // hsb-DE + 0x1d000060: 372, // hsb-DE 0x1d300000: 373, // hu - 0x1d300091: 374, // hu-HU + 0x1d300092: 374, // hu-HU 0x1d500000: 375, // hy - 0x1d500027: 376, // hy-AM + 0x1d500028: 376, // hy-AM 0x1df00000: 377, // id - 0x1df00094: 378, // id-ID + 0x1df00095: 378, // id-ID 0x1e500000: 379, // ig - 0x1e5000d5: 380, // ig-NG + 0x1e5000d6: 380, // ig-NG 0x1e800000: 381, // ii - 0x1e800052: 382, // ii-CN + 0x1e800053: 382, // ii-CN 0x1f600000: 383, // is - 0x1f60009c: 384, // is-IS + 0x1f60009d: 384, // is-IS 0x1f700000: 385, // it - 0x1f70004d: 386, // it-CH - 0x1f70009d: 387, // it-IT - 0x1f700112: 388, // it-SM - 0x1f700137: 389, // it-VA + 0x1f70004e: 386, // it-CH + 0x1f70009e: 387, // it-IT + 0x1f700113: 388, // it-SM + 0x1f700138: 389, // it-VA 0x1f800000: 390, // iu 0x1fe00000: 391, // ja - 0x1fe000a1: 392, // ja-JP + 0x1fe000a2: 392, // ja-JP 0x20100000: 393, // jbo 0x20500000: 394, // jgo - 0x20500051: 395, // jgo-CM + 0x20500052: 395, // jgo-CM 0x20800000: 396, // jmc - 0x2080012e: 397, // jmc-TZ + 0x2080012f: 397, // jmc-TZ 0x20c00000: 398, // jv 0x20e00000: 399, // ka - 0x20e0007c: 400, // ka-GE + 0x20e0007d: 400, // ka-GE 0x21000000: 401, // kab - 0x21000066: 402, // kab-DZ + 0x21000067: 402, // kab-DZ 0x21400000: 403, // kaj 0x21500000: 404, // kam - 0x215000a3: 405, // kam-KE + 0x215000a4: 405, // kam-KE 0x21d00000: 406, // kcg 0x22100000: 407, // kde - 0x2210012e: 408, // kde-TZ + 0x2210012f: 408, // kde-TZ 0x22500000: 409, // kea - 0x22500059: 410, // kea-CV + 0x2250005a: 410, // kea-CV 0x23200000: 411, // khq - 0x232000c2: 412, // khq-ML + 0x232000c3: 412, // khq-ML 0x23700000: 413, // ki - 0x237000a3: 414, // ki-KE + 0x237000a4: 414, // ki-KE 0x24000000: 415, // kk - 0x240000ad: 416, // kk-KZ + 0x240000ae: 416, // kk-KZ 0x24200000: 417, // kkj - 0x24200051: 418, // kkj-CM + 0x24200052: 418, // kkj-CM 0x24300000: 419, // kl - 0x24300081: 420, // kl-GL + 0x24300082: 420, // kl-GL 0x24400000: 421, // kln - 0x244000a3: 422, // kln-KE + 0x244000a4: 422, // kln-KE 0x24800000: 423, // km - 0x248000a5: 424, // km-KH + 0x248000a6: 424, // km-KH 0x24f00000: 425, // kn - 0x24f00098: 426, // kn-IN + 0x24f00099: 426, // kn-IN 0x25200000: 427, // ko - 0x252000a9: 428, // ko-KP - 0x252000aa: 429, // ko-KR + 0x252000aa: 428, // ko-KP + 0x252000ab: 429, // ko-KR 0x25400000: 430, // kok - 0x25400098: 431, // kok-IN + 0x25400099: 431, // kok-IN 0x26800000: 432, // ks - 0x26800098: 433, // ks-IN + 0x26800099: 433, // ks-IN 0x26900000: 434, // ksb - 0x2690012e: 435, // ksb-TZ + 0x2690012f: 435, // ksb-TZ 0x26b00000: 436, // ksf - 0x26b00051: 437, // ksf-CM + 0x26b00052: 437, // ksf-CM 0x26c00000: 438, // ksh - 0x26c0005f: 439, // ksh-DE + 0x26c00060: 439, // ksh-DE 0x27200000: 440, // ku 0x27f00000: 441, // kw - 0x27f0007a: 442, // kw-GB + 0x27f0007b: 442, // kw-GB 0x28800000: 443, // ky - 0x288000a4: 444, // ky-KG + 0x288000a5: 444, // ky-KG 0x28f00000: 445, // lag - 0x28f0012e: 446, // lag-TZ + 0x28f0012f: 446, // lag-TZ 0x29300000: 447, // lb - 0x293000b6: 448, // lb-LU + 0x293000b7: 448, // lb-LU 0x2a100000: 449, // lg - 0x2a100130: 450, // lg-UG + 0x2a100131: 450, // lg-UG 0x2ad00000: 451, // lkt - 0x2ad00134: 452, // lkt-US + 0x2ad00135: 452, // lkt-US 0x2b300000: 453, // ln - 0x2b300029: 454, // ln-AO - 0x2b30004a: 455, // ln-CD - 0x2b30004b: 456, // ln-CF - 0x2b30004c: 457, // ln-CG + 0x2b30002a: 454, // ln-AO + 0x2b30004b: 455, // ln-CD + 0x2b30004c: 456, // ln-CF + 0x2b30004d: 457, // ln-CG 0x2b600000: 458, // lo - 0x2b6000ae: 459, // lo-LA + 0x2b6000af: 459, // lo-LA 0x2bd00000: 460, // lrc - 0x2bd0009a: 461, // lrc-IQ - 0x2bd0009b: 462, // lrc-IR + 0x2bd0009b: 461, // lrc-IQ + 0x2bd0009c: 462, // lrc-IR 0x2be00000: 463, // lt - 0x2be000b5: 464, // lt-LT + 0x2be000b6: 464, // lt-LT 0x2c000000: 465, // lu - 0x2c00004a: 466, // lu-CD + 0x2c00004b: 466, // lu-CD 0x2c200000: 467, // luo - 0x2c2000a3: 468, // luo-KE + 0x2c2000a4: 468, // luo-KE 0x2c300000: 469, // luy - 0x2c3000a3: 470, // luy-KE + 0x2c3000a4: 470, // luy-KE 0x2c500000: 471, // lv - 0x2c5000b7: 472, // lv-LV + 0x2c5000b8: 472, // lv-LV 0x2cf00000: 473, // mas - 0x2cf000a3: 474, // mas-KE - 0x2cf0012e: 475, // mas-TZ + 0x2cf000a4: 474, // mas-KE + 0x2cf0012f: 475, // mas-TZ 0x2e700000: 476, // mer - 0x2e7000a3: 477, // mer-KE + 0x2e7000a4: 477, // mer-KE 0x2eb00000: 478, // mfe - 0x2eb000cb: 479, // mfe-MU + 0x2eb000cc: 479, // mfe-MU 0x2ef00000: 480, // mg - 0x2ef000be: 481, // mg-MG + 0x2ef000bf: 481, // mg-MG 0x2f000000: 482, // mgh - 0x2f0000d0: 483, // mgh-MZ + 0x2f0000d1: 483, // mgh-MZ 0x2f200000: 484, // mgo - 0x2f200051: 485, // mgo-CM + 0x2f200052: 485, // mgo-CM 0x2fd00000: 486, // mk - 0x2fd000c1: 487, // mk-MK + 0x2fd000c2: 487, // mk-MK 0x30200000: 488, // ml - 0x30200098: 489, // ml-IN + 0x30200099: 489, // ml-IN 0x30900000: 490, // mn - 0x309000c4: 491, // mn-MN + 0x309000c5: 491, // mn-MN 0x31900000: 492, // mr - 0x31900098: 493, // mr-IN + 0x31900099: 493, // mr-IN 0x31d00000: 494, // ms - 0x31d0003d: 495, // ms-BN - 0x31d000cf: 496, // ms-MY - 0x31d0010c: 497, // ms-SG + 0x31d0003e: 495, // ms-BN + 0x31d000d0: 496, // ms-MY + 0x31d0010d: 497, // ms-SG 0x31e00000: 498, // mt - 0x31e000ca: 499, // mt-MT + 0x31e000cb: 499, // mt-MT 0x32300000: 500, // mua - 0x32300051: 501, // mua-CM + 0x32300052: 501, // mua-CM 0x32f00000: 502, // my - 0x32f000c3: 503, // my-MM + 0x32f000c4: 503, // my-MM 0x33800000: 504, // mzn - 0x3380009b: 505, // mzn-IR + 0x3380009c: 505, // mzn-IR 0x33f00000: 506, // nah 0x34300000: 507, // naq - 0x343000d1: 508, // naq-NA + 0x343000d2: 508, // naq-NA 0x34500000: 509, // nb - 0x345000d9: 510, // nb-NO - 0x3450010f: 511, // nb-SJ + 0x345000da: 510, // nb-NO + 0x34500110: 511, // nb-SJ 0x34c00000: 512, // nd - 0x34c00163: 513, // nd-ZW + 0x34c00164: 513, // nd-ZW 0x34e00000: 514, // nds - 0x34e0005f: 515, // nds-DE - 0x34e000d8: 516, // nds-NL + 0x34e00060: 515, // nds-DE + 0x34e000d9: 516, // nds-NL 0x34f00000: 517, // ne - 0x34f00098: 518, // ne-IN - 0x34f000da: 519, // ne-NP + 0x34f00099: 518, // ne-IN + 0x34f000db: 519, // ne-NP 0x36500000: 520, // nl - 0x3650002f: 521, // nl-AW - 0x36500035: 522, // nl-BE - 0x3650003f: 523, // nl-BQ - 0x3650005a: 524, // nl-CW - 0x365000d8: 525, // nl-NL - 0x36500115: 526, // nl-SR - 0x3650011a: 527, // nl-SX + 0x36500030: 521, // nl-AW + 0x36500036: 522, // nl-BE + 0x36500040: 523, // nl-BQ + 0x3650005b: 524, // nl-CW + 0x365000d9: 525, // nl-NL + 0x36500116: 526, // nl-SR + 0x3650011b: 527, // nl-SX 0x36600000: 528, // nmg - 0x36600051: 529, // nmg-CM + 0x36600052: 529, // nmg-CM 0x36800000: 530, // nn - 0x368000d9: 531, // nn-NO + 0x368000da: 531, // nn-NO 0x36a00000: 532, // nnh - 0x36a00051: 533, // nnh-CM + 0x36a00052: 533, // nnh-CM 0x36d00000: 534, // no 0x37300000: 535, // nqo 0x37400000: 536, // nr 0x37800000: 537, // nso 0x37e00000: 538, // nus - 0x37e00116: 539, // nus-SS + 0x37e00117: 539, // nus-SS 0x38500000: 540, // ny 0x38700000: 541, // nyn - 0x38700130: 542, // nyn-UG + 0x38700131: 542, // nyn-UG 0x38e00000: 543, // om - 0x38e0006e: 544, // om-ET - 0x38e000a3: 545, // om-KE + 0x38e0006f: 544, // om-ET + 0x38e000a4: 545, // om-KE 0x39300000: 546, // or - 0x39300098: 547, // or-IN + 0x39300099: 547, // or-IN 0x39600000: 548, // os - 0x3960007c: 549, // os-GE - 0x39600105: 550, // os-RU + 0x3960007d: 549, // os-GE + 0x39600106: 550, // os-RU 0x39b00000: 551, // pa 0x39b05000: 552, // pa-Arab - 0x39b050e7: 553, // pa-Arab-PK - 0x39b2f000: 554, // pa-Guru - 0x39b2f098: 555, // pa-Guru-IN + 0x39b050e8: 553, // pa-Arab-PK + 0x39b32000: 554, // pa-Guru + 0x39b32099: 555, // pa-Guru-IN 0x39f00000: 556, // pap 0x3b100000: 557, // pl - 0x3b1000e8: 558, // pl-PL + 0x3b1000e9: 558, // pl-PL 0x3bb00000: 559, // prg 0x3bb00001: 560, // prg-001 0x3bc00000: 561, // ps - 0x3bc00023: 562, // ps-AF + 0x3bc00024: 562, // ps-AF 0x3be00000: 563, // pt - 0x3be00029: 564, // pt-AO - 0x3be00040: 565, // pt-BR - 0x3be0004d: 566, // pt-CH - 0x3be00059: 567, // pt-CV - 0x3be00085: 568, // pt-GQ - 0x3be0008a: 569, // pt-GW - 0x3be000b6: 570, // pt-LU - 0x3be000c5: 571, // pt-MO - 0x3be000d0: 572, // pt-MZ - 0x3be000ed: 573, // pt-PT - 0x3be00117: 574, // pt-ST - 0x3be00125: 575, // pt-TL + 0x3be0002a: 564, // pt-AO + 0x3be00041: 565, // pt-BR + 0x3be0004e: 566, // pt-CH + 0x3be0005a: 567, // pt-CV + 0x3be00086: 568, // pt-GQ + 0x3be0008b: 569, // pt-GW + 0x3be000b7: 570, // pt-LU + 0x3be000c6: 571, // pt-MO + 0x3be000d1: 572, // pt-MZ + 0x3be000ee: 573, // pt-PT + 0x3be00118: 574, // pt-ST + 0x3be00126: 575, // pt-TL 0x3c200000: 576, // qu - 0x3c20003e: 577, // qu-BO - 0x3c200068: 578, // qu-EC - 0x3c2000e3: 579, // qu-PE + 0x3c20003f: 577, // qu-BO + 0x3c200069: 578, // qu-EC + 0x3c2000e4: 579, // qu-PE 0x3d200000: 580, // rm - 0x3d20004d: 581, // rm-CH + 0x3d20004e: 581, // rm-CH 0x3d700000: 582, // rn - 0x3d700039: 583, // rn-BI + 0x3d70003a: 583, // rn-BI 0x3da00000: 584, // ro - 0x3da000bb: 585, // ro-MD - 0x3da00103: 586, // ro-RO + 0x3da000bc: 585, // ro-MD + 0x3da00104: 586, // ro-RO 0x3dc00000: 587, // rof - 0x3dc0012e: 588, // rof-TZ + 0x3dc0012f: 588, // rof-TZ 0x3e000000: 589, // ru - 0x3e000046: 590, // ru-BY - 0x3e0000a4: 591, // ru-KG - 0x3e0000ad: 592, // ru-KZ - 0x3e0000bb: 593, // ru-MD - 0x3e000105: 594, // ru-RU - 0x3e00012f: 595, // ru-UA + 0x3e000047: 590, // ru-BY + 0x3e0000a5: 591, // ru-KG + 0x3e0000ae: 592, // ru-KZ + 0x3e0000bc: 593, // ru-MD + 0x3e000106: 594, // ru-RU + 0x3e000130: 595, // ru-UA 0x3e300000: 596, // rw - 0x3e300106: 597, // rw-RW + 0x3e300107: 597, // rw-RW 0x3e400000: 598, // rwk - 0x3e40012e: 599, // rwk-TZ + 0x3e40012f: 599, // rwk-TZ 0x3e900000: 600, // sah - 0x3e900105: 601, // sah-RU + 0x3e900106: 601, // sah-RU 0x3ea00000: 602, // saq - 0x3ea000a3: 603, // saq-KE + 0x3ea000a4: 603, // saq-KE 0x3f100000: 604, // sbp - 0x3f10012e: 605, // sbp-TZ + 0x3f10012f: 605, // sbp-TZ 0x3fa00000: 606, // sdh 0x3fb00000: 607, // se - 0x3fb00071: 608, // se-FI - 0x3fb000d9: 609, // se-NO - 0x3fb0010b: 610, // se-SE + 0x3fb00072: 608, // se-FI + 0x3fb000da: 609, // se-NO + 0x3fb0010c: 610, // se-SE 0x3fd00000: 611, // seh - 0x3fd000d0: 612, // seh-MZ + 0x3fd000d1: 612, // seh-MZ 0x3ff00000: 613, // ses - 0x3ff000c2: 614, // ses-ML + 0x3ff000c3: 614, // ses-ML 0x40000000: 615, // sg - 0x4000004b: 616, // sg-CF + 0x4000004c: 616, // sg-CF 0x40600000: 617, // shi - 0x40652000: 618, // shi-Latn - 0x406520b9: 619, // shi-Latn-MA - 0x406d2000: 620, // shi-Tfng - 0x406d20b9: 621, // shi-Tfng-MA + 0x40655000: 618, // shi-Latn + 0x406550ba: 619, // shi-Latn-MA + 0x406d8000: 620, // shi-Tfng + 0x406d80ba: 621, // shi-Tfng-MA 0x40a00000: 622, // si - 0x40a000b2: 623, // si-LK + 0x40a000b3: 623, // si-LK 0x41000000: 624, // sk - 0x41000110: 625, // sk-SK + 0x41000111: 625, // sk-SK 0x41400000: 626, // sl - 0x4140010e: 627, // sl-SI + 0x4140010f: 627, // sl-SI 0x41a00000: 628, // sma 0x41b00000: 629, // smi 0x41c00000: 630, // smj 0x41d00000: 631, // smn - 0x41d00071: 632, // smn-FI + 0x41d00072: 632, // smn-FI 0x42000000: 633, // sms 0x42100000: 634, // sn - 0x42100163: 635, // sn-ZW + 0x42100164: 635, // sn-ZW 0x42700000: 636, // so - 0x42700061: 637, // so-DJ - 0x4270006e: 638, // so-ET - 0x427000a3: 639, // so-KE - 0x42700114: 640, // so-SO + 0x42700062: 637, // so-DJ + 0x4270006f: 638, // so-ET + 0x427000a4: 639, // so-KE + 0x42700115: 640, // so-SO 0x42f00000: 641, // sq - 0x42f00026: 642, // sq-AL - 0x42f000c1: 643, // sq-MK - 0x42f0014c: 644, // sq-XK + 0x42f00027: 642, // sq-AL + 0x42f000c2: 643, // sq-MK + 0x42f0014d: 644, // sq-XK 0x43000000: 645, // sr 0x4301e000: 646, // sr-Cyrl - 0x4301e032: 647, // sr-Cyrl-BA - 0x4301e0bc: 648, // sr-Cyrl-ME - 0x4301e104: 649, // sr-Cyrl-RS - 0x4301e14c: 650, // sr-Cyrl-XK - 0x43052000: 651, // sr-Latn - 0x43052032: 652, // sr-Latn-BA - 0x430520bc: 653, // sr-Latn-ME - 0x43052104: 654, // sr-Latn-RS - 0x4305214c: 655, // sr-Latn-XK + 0x4301e033: 647, // sr-Cyrl-BA + 0x4301e0bd: 648, // sr-Cyrl-ME + 0x4301e105: 649, // sr-Cyrl-RS + 0x4301e14d: 650, // sr-Cyrl-XK + 0x43055000: 651, // sr-Latn + 0x43055033: 652, // sr-Latn-BA + 0x430550bd: 653, // sr-Latn-ME + 0x43055105: 654, // sr-Latn-RS + 0x4305514d: 655, // sr-Latn-XK 0x43500000: 656, // ss 0x43800000: 657, // ssy 0x43900000: 658, // st 0x44200000: 659, // sv - 0x44200030: 660, // sv-AX - 0x44200071: 661, // sv-FI - 0x4420010b: 662, // sv-SE + 0x44200031: 660, // sv-AX + 0x44200072: 661, // sv-FI + 0x4420010c: 662, // sv-SE 0x44300000: 663, // sw - 0x4430004a: 664, // sw-CD - 0x443000a3: 665, // sw-KE - 0x4430012e: 666, // sw-TZ - 0x44300130: 667, // sw-UG + 0x4430004b: 664, // sw-CD + 0x443000a4: 665, // sw-KE + 0x4430012f: 666, // sw-TZ + 0x44300131: 667, // sw-UG 0x44c00000: 668, // syr 0x44e00000: 669, // ta - 0x44e00098: 670, // ta-IN - 0x44e000b2: 671, // ta-LK - 0x44e000cf: 672, // ta-MY - 0x44e0010c: 673, // ta-SG + 0x44e00099: 670, // ta-IN + 0x44e000b3: 671, // ta-LK + 0x44e000d0: 672, // ta-MY + 0x44e0010d: 673, // ta-SG 0x45f00000: 674, // te - 0x45f00098: 675, // te-IN + 0x45f00099: 675, // te-IN 0x46200000: 676, // teo - 0x462000a3: 677, // teo-KE - 0x46200130: 678, // teo-UG + 0x462000a4: 677, // teo-KE + 0x46200131: 678, // teo-UG 0x46900000: 679, // th - 0x46900122: 680, // th-TH + 0x46900123: 680, // th-TH 0x46d00000: 681, // ti - 0x46d0006c: 682, // ti-ER - 0x46d0006e: 683, // ti-ET + 0x46d0006d: 682, // ti-ER + 0x46d0006f: 683, // ti-ET 0x46f00000: 684, // tig 0x47400000: 685, // tk - 0x47400126: 686, // tk-TM + 0x47400127: 686, // tk-TM 0x47e00000: 687, // tn 0x48000000: 688, // to - 0x48000128: 689, // to-TO + 0x48000129: 689, // to-TO 0x48800000: 690, // tr - 0x4880005c: 691, // tr-CY - 0x4880012a: 692, // tr-TR + 0x4880005d: 691, // tr-CY + 0x4880012b: 692, // tr-TR 0x48c00000: 693, // ts 0x4a200000: 694, // twq - 0x4a2000d3: 695, // twq-NE + 0x4a2000d4: 695, // twq-NE 0x4a700000: 696, // tzm - 0x4a7000b9: 697, // tzm-MA + 0x4a7000ba: 697, // tzm-MA 0x4aa00000: 698, // ug - 0x4aa00052: 699, // ug-CN + 0x4aa00053: 699, // ug-CN 0x4ac00000: 700, // uk - 0x4ac0012f: 701, // uk-UA + 0x4ac00130: 701, // uk-UA 0x4b200000: 702, // ur - 0x4b200098: 703, // ur-IN - 0x4b2000e7: 704, // ur-PK + 0x4b200099: 703, // ur-IN + 0x4b2000e8: 704, // ur-PK 0x4ba00000: 705, // uz 0x4ba05000: 706, // uz-Arab - 0x4ba05023: 707, // uz-Arab-AF + 0x4ba05024: 707, // uz-Arab-AF 0x4ba1e000: 708, // uz-Cyrl - 0x4ba1e136: 709, // uz-Cyrl-UZ - 0x4ba52000: 710, // uz-Latn - 0x4ba52136: 711, // uz-Latn-UZ + 0x4ba1e137: 709, // uz-Cyrl-UZ + 0x4ba55000: 710, // uz-Latn + 0x4ba55137: 711, // uz-Latn-UZ 0x4bc00000: 712, // vai - 0x4bc52000: 713, // vai-Latn - 0x4bc520b3: 714, // vai-Latn-LR - 0x4bcd9000: 715, // vai-Vaii - 0x4bcd90b3: 716, // vai-Vaii-LR + 0x4bc55000: 713, // vai-Latn + 0x4bc550b4: 714, // vai-Latn-LR + 0x4bcdf000: 715, // vai-Vaii + 0x4bcdf0b4: 716, // vai-Vaii-LR 0x4be00000: 717, // ve 0x4c100000: 718, // vi - 0x4c10013d: 719, // vi-VN + 0x4c10013e: 719, // vi-VN 0x4c700000: 720, // vo 0x4c700001: 721, // vo-001 0x4ca00000: 722, // vun - 0x4ca0012e: 723, // vun-TZ + 0x4ca0012f: 723, // vun-TZ 0x4cc00000: 724, // wa 0x4cd00000: 725, // wae - 0x4cd0004d: 726, // wae-CH + 0x4cd0004e: 726, // wae-CH 0x4e300000: 727, // wo 0x4f000000: 728, // xh 0x4f900000: 729, // xog - 0x4f900130: 730, // xog-UG + 0x4f900131: 730, // xog-UG 0x50700000: 731, // yav - 0x50700051: 732, // yav-CM + 0x50700052: 732, // yav-CM 0x51000000: 733, // yi 0x51000001: 734, // yi-001 0x51600000: 735, // yo - 0x5160003a: 736, // yo-BJ - 0x516000d5: 737, // yo-NG + 0x5160003b: 736, // yo-BJ + 0x516000d6: 737, // yo-NG 0x51d00000: 738, // yue - 0x51d0008c: 739, // yue-HK + 0x51d0008d: 739, // yue-HK 0x52600000: 740, // zgh - 0x526000b9: 741, // zgh-MA + 0x526000ba: 741, // zgh-MA 0x52700000: 742, // zh - 0x52734000: 743, // zh-Hans - 0x52734052: 744, // zh-Hans-CN - 0x5273408c: 745, // zh-Hans-HK - 0x527340c5: 746, // zh-Hans-MO - 0x5273410c: 747, // zh-Hans-SG - 0x52735000: 748, // zh-Hant - 0x5273508c: 749, // zh-Hant-HK - 0x527350c5: 750, // zh-Hant-MO - 0x5273512d: 751, // zh-Hant-TW + 0x52737000: 743, // zh-Hans + 0x52737053: 744, // zh-Hans-CN + 0x5273708d: 745, // zh-Hans-HK + 0x527370c6: 746, // zh-Hans-MO + 0x5273710d: 747, // zh-Hans-SG + 0x52738000: 748, // zh-Hant + 0x5273808d: 749, // zh-Hant-HK + 0x527380c6: 750, // zh-Hant-MO + 0x5273812e: 751, // zh-Hant-TW 0x52c00000: 752, // zu - 0x52c00160: 753, // zu-ZA + 0x52c00161: 753, // zu-ZA } // Total table size 4592 bytes (4KiB); checksum: C25F8AFF diff --git a/vendor/golang.org/x/text/language/language.go b/vendor/golang.org/x/text/language/language.go index f1012c95..ed1011f1 100644 --- a/vendor/golang.org/x/text/language/language.go +++ b/vendor/golang.org/x/text/language/language.go @@ -5,102 +5,7 @@ //go:generate go run gen.go gen_common.go -output tables.go //go:generate go run gen_index.go -// Package language implements BCP 47 language tags and related functionality. -// -// The Tag type, which is used to represent languages, is agnostic to the -// meaning of its subtags. Tags are not fully canonicalized to preserve -// information that may be valuable in certain contexts. As a consequence, two -// different tags may represent identical languages. -// -// Initializing language- or locale-specific components usually consists of -// two steps. The first step is to select a display language based on the -// preferred languages of the user and the languages supported by an application. -// The second step is to create the language-specific services based on -// this selection. Each is discussed in more details below. -// -// Matching preferred against supported languages -// -// An application may support various languages. This list is typically limited -// by the languages for which there exists translations of the user interface. -// Similarly, a user may provide a list of preferred languages which is limited -// by the languages understood by this user. -// An application should use a Matcher to find the best supported language based -// on the user's preferred list. -// Matchers are aware of the intricacies of equivalence between languages. -// The default Matcher implementation takes into account things such as -// deprecated subtags, legacy tags, and mutual intelligibility between scripts -// and languages. -// -// A Matcher for English, Australian English, Danish, and standard Mandarin can -// be defined as follows: -// -// var matcher = language.NewMatcher([]language.Tag{ -// language.English, // The first language is used as fallback. -// language.MustParse("en-AU"), -// language.Danish, -// language.Chinese, -// }) -// -// The following code selects the best match for someone speaking Spanish and -// Norwegian: -// -// preferred := []language.Tag{ language.Spanish, language.Norwegian } -// tag, _, _ := matcher.Match(preferred...) -// -// In this case, the best match is Danish, as Danish is sufficiently a match to -// Norwegian to not have to fall back to the default. -// See ParseAcceptLanguage on how to handle the Accept-Language HTTP header. -// -// Selecting language-specific services -// -// One should always use the Tag returned by the Matcher to create an instance -// of any of the language-specific services provided by the text repository. -// This prevents the mixing of languages, such as having a different language for -// messages and display names, as well as improper casing or sorting order for -// the selected language. -// Using the returned Tag also allows user-defined settings, such as collation -// order or numbering system to be transparently passed as options. -// -// If you have language-specific data in your application, however, it will in -// most cases suffice to use the index returned by the matcher to identify -// the user language. -// The following loop provides an alternative in case this is not sufficient: -// -// supported := map[language.Tag]data{ -// language.English: enData, -// language.MustParse("en-AU"): enAUData, -// language.Danish: daData, -// language.Chinese: zhData, -// } -// tag, _, _ := matcher.Match(preferred...) -// for ; tag != language.Und; tag = tag.Parent() { -// if v, ok := supported[tag]; ok { -// return v -// } -// } -// return enData // should not reach here -// -// Repeatedly taking the Parent of the tag returned by Match will eventually -// match one of the tags used to initialize the Matcher. -// -// Canonicalization -// -// By default, only legacy and deprecated tags are converted into their -// canonical equivalent. All other information is preserved. This approach makes -// the confidence scores more accurate and allows matchers to distinguish -// between variants that are otherwise lost. -// -// As a consequence, two tags that should be treated as identical according to -// BCP 47 or CLDR, like "en-Latn" and "en", will be represented differently. The -// Matchers will handle such distinctions, though, and are aware of the -// equivalence relations. The CanonType type can be used to alter the -// canonicalization form. -// -// References -// -// BCP 47 - Tags for Identifying Languages -// http://tools.ietf.org/html/bcp47 -package language // import "golang.org/x/text/language" +package language // TODO: Remove above NOTE after: // - verifying that tables are dropped correctly (most notably matcher tables). diff --git a/vendor/golang.org/x/text/language/match.go b/vendor/golang.org/x/text/language/match.go index 63bc744a..5c7674b6 100644 --- a/vendor/golang.org/x/text/language/match.go +++ b/vendor/golang.org/x/text/language/match.go @@ -16,6 +16,29 @@ func PreferSameScript(preferSame bool) MatchOption { return func(m *matcher) { m.preferSameScript = preferSame } } +// TODO(v1.0.0): consider making Matcher a concrete type, instead of interface. +// There doesn't seem to be too much need for multiple types. +// Making it a concrete type allows MatchStrings to be a method, which will +// improve its discoverability. + +// MatchStrings parses and matches the given strings until one of them matches +// the language in the Matcher. A string may be an Accept-Language header as +// handled by ParseAcceptLanguage. The default language is returned if no +// other language matched. +func MatchStrings(m Matcher, lang ...string) (tag Tag, index int) { + for _, accept := range lang { + desired, _, err := ParseAcceptLanguage(accept) + if err != nil { + continue + } + if tag, index, conf := m.Match(desired...); conf != No { + return tag, index + } + } + tag, index, _ = m.Match() + return +} + // Matcher is the interface that wraps the Match method. // // Match returns the best match for any of the given tags, along with @@ -83,9 +106,8 @@ func (m *matcher) Match(want ...Tag) (t Tag, index int, c Confidence) { // to do after the fact, so we do it here. // TODO: add in alternative variants to -u-va-. // TODO: add preferred region to -u-rg-. - // TODO: add other extensions. Merge with existing extensions. - if u, ok := w.Extension('u'); ok { - t, _ = Raw.Compose(t, u) + if e := w.Extensions(); len(e) > 0 { + t, _ = Raw.Compose(t, e) } return t, index, c } @@ -331,8 +353,9 @@ func minimizeTags(t Tag) (Tag, error) { // 1) compute the match between the two tags. // 2) if the match is better than the previous best match, replace it // with the new match. (see next section) -// b) if the current best match is above a certain threshold, return this -// match without proceeding to the next tag in "desired". [See Note 1] +// b) if the current best match is Exact and pin is true the result will be +// frozen to the language found thusfar, although better matches may +// still be found for the same language. // 3) If the best match so far is below a certain threshold, return "default". // // Ranking: @@ -381,9 +404,6 @@ func minimizeTags(t Tag) (Tag, error) { // found wins. // // Notes: -// [1] Note that even if we may not have a perfect match, if a match is above a -// certain threshold, it is considered a better match than any other match -// to a tag later in the list of preferred language tags. // [2] In practice, as matching of Exact is done in a separate phase from // matching the other levels, we reuse the Exact level to mean MaxExact in // the second phase. As a consequence, we only need the levels defined by @@ -429,8 +449,8 @@ type matcher struct { // matchHeader has the lists of tags for exact matches and matches based on // maximized and canonicalized tags for a given language. type matchHeader struct { - exact []*haveTag - max []*haveTag + haveTags []*haveTag + original bool } // haveTag holds a supported Tag and its maximized script and region. The maximized @@ -460,7 +480,7 @@ type haveTag struct { func makeHaveTag(tag Tag, index int) (haveTag, langID) { max := tag - if tag.lang != 0 { + if tag.lang != 0 || tag.region != 0 || tag.script != 0 { max, _ = max.canonicalize(All) max, _ = addTags(max) max.remakeString() @@ -485,29 +505,27 @@ func altScript(l langID, s scriptID) scriptID { // addIfNew adds a haveTag to the list of tags only if it is a unique tag. // Tags that have the same maximized values are linked by index. func (h *matchHeader) addIfNew(n haveTag, exact bool) { + h.original = h.original || exact // Don't add new exact matches. - for _, v := range h.exact { + for _, v := range h.haveTags { if v.tag.equalsRest(n.tag) { return } } - if exact { - h.exact = append(h.exact, &n) - } // Allow duplicate maximized tags, but create a linked list to allow quickly // comparing the equivalents and bail out. - for i, v := range h.max { + for i, v := range h.haveTags { if v.maxScript == n.maxScript && v.maxRegion == n.maxRegion && v.tag.variantOrPrivateTagStr() == n.tag.variantOrPrivateTagStr() { - for h.max[i].nextMax != 0 { - i = int(h.max[i].nextMax) + for h.haveTags[i].nextMax != 0 { + i = int(h.haveTags[i].nextMax) } - h.max[i].nextMax = uint16(len(h.max)) + h.haveTags[i].nextMax = uint16(len(h.haveTags)) break } } - h.max = append(h.max, &n) + h.haveTags = append(h.haveTags, &n) } // header returns the matchHeader for the given language. It creates one if @@ -553,27 +571,26 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { m.header(tag.lang).addIfNew(pair, true) m.supported = append(m.supported, &pair) } - m.default_ = m.header(supported[0].lang).exact[0] + m.default_ = m.header(supported[0].lang).haveTags[0] + // Keep these in two different loops to support the case that two equivalent + // languages are distinguished, such as iw and he. for i, tag := range supported { pair, max := makeHaveTag(tag, i) if max != tag.lang { - m.header(max).addIfNew(pair, false) + m.header(max).addIfNew(pair, true) } } - // TODO: include alt script. - // - don't replace regions, but allow regions to be made more specific. - // update is used to add indexes in the map for equivalent languages. - // If force is true, the update will also apply to derived entries. To - // avoid applying a "transitive closure", use false. - update := func(want, have uint16, conf Confidence, force bool) { + // update will only add entries to original indexes, thus not computing any + // transitive relations. + update := func(want, have uint16, conf Confidence) { if hh := m.index[langID(have)]; hh != nil { - if !force && len(hh.exact) == 0 { + if !hh.original { return } hw := m.header(langID(want)) - for _, ht := range hh.max { + for _, ht := range hh.haveTags { v := *ht if conf < v.conf { v.conf = conf @@ -582,7 +599,7 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { if v.altScript != 0 { v.altScript = altScript(langID(want), v.maxScript) } - hw.addIfNew(v, conf == Exact && len(hh.exact) > 0) + hw.addIfNew(v, conf == Exact && hh.original) } } } @@ -590,9 +607,9 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { // Add entries for languages with mutual intelligibility as defined by CLDR's // languageMatch data. for _, ml := range matchLang { - update(ml.want, ml.have, toConf(ml.distance), false) + update(ml.want, ml.have, toConf(ml.distance)) if !ml.oneway { - update(ml.have, ml.want, toConf(ml.distance), false) + update(ml.have, ml.want, toConf(ml.distance)) } } @@ -602,10 +619,6 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { // (their canonicalization simply substitutes a different language code, but // nothing else), the match confidence is Exact, otherwise it is High. for i, lm := range langAliasMap { - if lm.from == _sh { - continue - } - // If deprecated codes match and there is no fiddling with the script or // or region, we consider it an exact match. conf := Exact @@ -613,9 +626,9 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { if !isExactEquivalent(langID(lm.from)) { conf = High } - update(lm.to, lm.from, conf, true) + update(lm.to, lm.from, conf) } - update(lm.from, lm.to, conf, true) + update(lm.from, lm.to, conf) } return m } @@ -624,28 +637,29 @@ func newMatcher(supported []Tag, options []MatchOption) *matcher { // account the order of preference of the given tags. func (m *matcher) getBest(want ...Tag) (got *haveTag, orig Tag, c Confidence) { best := bestMatch{} - for _, w := range want { + for i, w := range want { var max Tag // Check for exact match first. h := m.index[w.lang] if w.lang != 0 { - // Base language is defined. if h == nil { continue } - for i := range h.exact { - have := h.exact[i] - if have.tag.equalsRest(w) { - return have, w, Exact - } + // Base language is defined. + max, _ = w.canonicalize(Legacy | Deprecated | Macro) + // A region that is added through canonicalization is stronger than + // a maximized region: set it in the original (e.g. mo -> ro-MD). + if w.region != max.region { + w.region = max.region } - max, _ = w.canonicalize(Legacy | Deprecated) + // TODO: should we do the same for scripts? + // See test case: en, sr, nl ; sh ; sr max, _ = addTags(max) } else { // Base language is not defined. if h != nil { - for i := range h.exact { - have := h.exact[i] + for i := range h.haveTags { + have := h.haveTags[i] if have.tag.equalsRest(w) { return have, w, Exact } @@ -661,16 +675,23 @@ func (m *matcher) getBest(want ...Tag) (got *haveTag, orig Tag, c Confidence) { continue } } + pin := true + for _, t := range want[i+1:] { + if w.lang == t.lang { + pin = false + break + } + } // Check for match based on maximized tag. - for i := range h.max { - have := h.max[i] - best.update(have, w, max.script, max.region) + for i := range h.haveTags { + have := h.haveTags[i] + best.update(have, w, max.script, max.region, pin) if best.conf == Exact { for have.nextMax != 0 { - have = h.max[have.nextMax] - best.update(have, w, max.script, max.region) + have = h.haveTags[have.nextMax] + best.update(have, w, max.script, max.region, pin) } - return best.have, best.want, High + return best.have, best.want, best.conf } } } @@ -685,43 +706,68 @@ func (m *matcher) getBest(want ...Tag) (got *haveTag, orig Tag, c Confidence) { // bestMatch accumulates the best match so far. type bestMatch struct { - have *haveTag - want Tag - conf Confidence + have *haveTag + want Tag + conf Confidence + pinnedRegion regionID + pinLanguage bool + sameRegionGroup bool // Cached results from applying tie-breaking rules. origLang bool origReg bool + paradigmReg bool regGroupDist uint8 - regDist uint8 origScript bool - parentDist uint8 // 255 if have is not an ancestor of want tag. } // update updates the existing best match if the new pair is considered to be a -// better match. -// To determine if the given pair is a better match, it first computes the rough -// confidence level. If this surpasses the current match, it will replace it and -// update the tie-breaker rule cache. If there is a tie, it proceeds with applying -// a series of tie-breaker rules. If there is no conclusive winner after applying -// the tie-breaker rules, it leaves the current match as the preferred match. -func (m *bestMatch) update(have *haveTag, tag Tag, maxScript scriptID, maxRegion regionID) { +// better match. To determine if the given pair is a better match, it first +// computes the rough confidence level. If this surpasses the current match, it +// will replace it and update the tie-breaker rule cache. If there is a tie, it +// proceeds with applying a series of tie-breaker rules. If there is no +// conclusive winner after applying the tie-breaker rules, it leaves the current +// match as the preferred match. +// +// If pin is true and have and tag are a strong match, it will henceforth only +// consider matches for this language. This corresponds to the nothing that most +// users have a strong preference for the first defined language. A user can +// still prefer a second language over a dialect of the preferred language by +// explicitly specifying dialects, e.g. "en, nl, en-GB". In this case pin should +// be false. +func (m *bestMatch) update(have *haveTag, tag Tag, maxScript scriptID, maxRegion regionID, pin bool) { // Bail if the maximum attainable confidence is below that of the current best match. c := have.conf if c < m.conf { return } - if have.maxScript != maxScript { + // Don't change the language once we already have found an exact match. + if m.pinLanguage && tag.lang != m.want.lang { + return + } + // Pin the region group if we are comparing tags for the same language. + if tag.lang == m.want.lang && m.sameRegionGroup { + _, sameGroup := regionGroupDist(m.pinnedRegion, have.maxRegion, have.maxScript, m.want.lang) + if !sameGroup { + return + } + } + if c == Exact && have.maxScript == maxScript { + // If there is another language and then another entry of this language, + // don't pin anything, otherwise pin the language. + m.pinLanguage = pin + } + if have.tag.equalsRest(tag) { + } else if have.maxScript != maxScript { // There is usually very little comprehension between different scripts. - // In a few cases there may still be Low comprehension. This possibility is - // pre-computed and stored in have.altScript. + // In a few cases there may still be Low comprehension. This possibility + // is pre-computed and stored in have.altScript. if Low < m.conf || have.altScript != maxScript { return } c = Low } else if have.maxRegion != maxRegion { - // There is usually a small difference between languages across regions. - // We use the region distance (below) to disambiguate between equal matches. if High < c { + // There is usually a small difference between languages across regions. c = High } } @@ -748,14 +794,6 @@ func (m *bestMatch) update(have *haveTag, tag Tag, maxScript scriptID, maxRegion beaten = true } - regGroupDist := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.lang) - if !beaten && m.regGroupDist != regGroupDist { - if regGroupDist > m.regGroupDist { - return - } - beaten = true - } - // We prefer if the pre-maximized region was specified and identical. origReg := have.tag.region == tag.region && tag.region != 0 if !beaten && m.origReg != origReg { @@ -765,45 +803,26 @@ func (m *bestMatch) update(have *haveTag, tag Tag, maxScript scriptID, maxRegion beaten = true } - // TODO: remove the region distance rule. Region distance has been replaced - // by the region grouping rule. For now we leave it as it still seems to - // have a net positive effect when applied after the grouping rule. - // Possible solutions: - // - apply the primary locale rule first to effectively disable region - // region distance if groups are defined. - // - express the following errors in terms of grouping (if possible) - // - find another method of handling the following cases. - // maximization of legacy: find mo in - // "sr-Cyrl, sr-Latn, ro, ro-MD": have ro; want ro-MD (High) - // region distance French: find fr-US in - // "en, fr, fr-CA, fr-CH": have fr; want fr-CA (High) - - // Next we prefer smaller distances between regions, as defined by - // regionDist. - regDist := uint8(regionDistance(have.maxRegion, maxRegion)) - if !beaten && m.regDist != regDist { - if regDist > m.regDist { + regGroupDist, sameGroup := regionGroupDist(have.maxRegion, maxRegion, maxScript, tag.lang) + if !beaten && m.regGroupDist != regGroupDist { + if regGroupDist > m.regGroupDist { return } beaten = true } - // Next we prefer if the pre-maximized script was specified and identical. - origScript := have.tag.script == tag.script && tag.script != 0 - if !beaten && m.origScript != origScript { - if m.origScript { + paradigmReg := isParadigmLocale(tag.lang, have.maxRegion) + if !beaten && m.paradigmReg != paradigmReg { + if !paradigmReg { return } beaten = true } - // Finally we prefer tags which have a closer parent relationship. - // TODO: the parent relationship no longer seems necessary. It doesn't hurt - // to leave it in as the final tie-breaker, though, especially until the - // grouping data has further matured. - parentDist := parentDistance(have.tag.region, tag) - if !beaten && m.parentDist != parentDist { - if parentDist > m.parentDist { + // Next we prefer if the pre-maximized script was specified and identical. + origScript := have.tag.script == tag.script && tag.script != 0 + if !beaten && m.origScript != origScript { + if m.origScript { return } beaten = true @@ -814,35 +833,30 @@ func (m *bestMatch) update(have *haveTag, tag Tag, maxScript scriptID, maxRegion m.have = have m.want = tag m.conf = c + m.pinnedRegion = maxRegion + m.sameRegionGroup = sameGroup m.origLang = origLang m.origReg = origReg + m.paradigmReg = paradigmReg m.origScript = origScript m.regGroupDist = regGroupDist - m.regDist = regDist - m.parentDist = parentDist } } -// parentDistance returns the number of times Parent must be called before the -// regions match. It is assumed that it has already been checked that lang and -// script are identical. If haveRegion does not occur in the ancestor chain of -// tag, it returns 255. -func parentDistance(haveRegion regionID, tag Tag) uint8 { - p := tag.Parent() - d := uint8(1) - for haveRegion != p.region { - if p.region == 0 { - return 255 +func isParadigmLocale(lang langID, r regionID) bool { + for _, e := range paradigmLocales { + if langID(e[0]) == lang && (r == regionID(e[1]) || r == regionID(e[2])) { + return true } - p = p.Parent() - d++ } - return d + return false } // regionGroupDist computes the distance between two regions based on their // CLDR grouping. -func regionGroupDist(a, b regionID, script scriptID, lang langID) uint8 { +func regionGroupDist(a, b regionID, script scriptID, lang langID) (dist uint8, same bool) { + const defaultDistance = 4 + aGroup := uint(regionToGroups[a]) << 1 bGroup := uint(regionToGroups[b]) << 1 for _, ri := range matchRegion { @@ -850,40 +864,16 @@ func regionGroupDist(a, b regionID, script scriptID, lang langID) uint8 { group := uint(1 << (ri.group &^ 0x80)) if 0x80&ri.group == 0 { if aGroup&bGroup&group != 0 { // Both regions are in the group. - return ri.distance + return ri.distance, ri.distance == defaultDistance } } else { if (aGroup|bGroup)&group == 0 { // Both regions are not in the group. - return ri.distance + return ri.distance, ri.distance == defaultDistance } } } } - const defaultDistance = 4 - return defaultDistance -} - -// regionDistance computes the distance between two regions based on the -// distance in the graph of region containments as defined in CLDR. It iterates -// over increasingly inclusive sets of groups, represented as bit vectors, until -// the source bit vector has bits in common with the destination vector. -func regionDistance(a, b regionID) int { - if a == b { - return 0 - } - p, q := regionInclusion[a], regionInclusion[b] - if p < nRegionGroups { - p, q = q, p - } - set := regionInclusionBits - if q < nRegionGroups && set[p]&(1< is not expanded to the appropriate language. - "en-Hant-TW,und-TW/zh-Hant": true, // match: got "en-Hant-TW"; want "und-TW" - "en-Hant-TW,und-TW/zh": true, // match: got "en-Hant-TW"; want "und-TW" // Honor the wildcard match. This may only be useful to select non-exact // stuff. "mul,af/nl": true, // match: got "af"; want "mul" @@ -63,15 +67,6 @@ var skip = map[string]bool{ // Inconsistencies with Mark Davis' implementation where it is not clear // which is better. - // Go prefers exact matches over less exact preferred ones. - // Preferring desired ones might be better. - "en,de,fr,ja/de-CH,fr": true, // match: got "fr"; want "de" - "en-GB,en,de,fr,ja/de-CH,fr": true, // match: got "fr"; want "de" - "pt-PT,pt-BR,es,es-419/pt-US,pt-PT": true, // match: got "pt-PT"; want "pt-BR" - "pt-PT,pt,es,es-419/pt-US,pt-PT,pt": true, // match: got "pt-PT"; want "pt" - "en,sv/en-GB,sv": true, // match: got "sv"; want "en" - "en-NZ,en-IT/en-US": true, // match: got "en-IT"; want "en-NZ" - // Inconsistencies in combined. I think the Go approach is more appropriate. // We could use -u-rg- and -u-va- as alternative. "und,fr/fr-BE-fonipa": true, // combined: got "fr"; want "fr-BE-fonipa" @@ -80,20 +75,8 @@ var skip = map[string]bool{ "und,no/nn-BE-fonipa": true, // combined: got "no"; want "no-BE-fonipa" "50,und,fr-CA-fonupa/fr-BE-fonipa": true, // combined: got "fr-CA-fonupa"; want "fr-BE-fonipa" - // Spec says prefer primary locales. But what is the benefit? Shouldn't - // the developer just not specify the primary locale first in the list? - // TODO: consider adding a SortByPreferredLocale function to ensure tags - // are ordered such that the preferred locale rule is observed. - // TODO: most of these cases are solved by getting rid of the region - // distance tie-breaker rule (see comments there). - "und,es,es-MA,es-MX,es-419/es-EA": true, // match: got "es-MA"; want "es" - "und,es-MA,es,es-419,es-MX/es-EA": true, // match: got "es-MA"; want "es" - "und,en,en-GU,en-IN,en-GB/en-ZA": true, // match: got "en-IN"; want "en-GB" - "und,en,en-GU,en-IN,en-GB/en-VI": true, // match: got "en-GU"; want "en" - "und,en-GU,en,en-GB,en-IN/en-VI": true, // match: got "en-GU"; want "en" - - // Falling back to the default seems more appropriate than falling back - // on a language with the same script. + // The initial number is a threshold. As we don't use scoring, we will not + // implement this. "50,und,fr-Cyrl-CA-fonupa/fr-BE-fonipa": true, // match: got "und"; want "fr-Cyrl-CA-fonupa" // combined: got "und"; want "fr-Cyrl-BE-fonipa" @@ -106,11 +89,65 @@ var skip = map[string]bool{ func makeTagList(s string) (tags []Tag) { for _, s := range strings.Split(s, ",") { - tags = append(tags, Make(strings.TrimSpace(s))) + tags = append(tags, mk(strings.TrimSpace(s))) } return tags } +func TestMatchStrings(t *testing.T) { + testCases := []struct { + supported string + desired string // strings separted by | + tag string + index int + }{{ + supported: "en", + desired: "", + tag: "en", + index: 0, + }, { + supported: "en", + desired: "nl", + tag: "en", + index: 0, + }, { + supported: "en,nl", + desired: "nl", + tag: "nl", + index: 1, + }, { + supported: "en,nl", + desired: "nl|en", + tag: "nl", + index: 1, + }, { + supported: "en-GB,nl", + desired: "en ; q=0.1,nl", + tag: "nl", + index: 1, + }, { + supported: "en-GB,nl", + desired: "en;q=0.005 | dk; q=0.1,nl ", + tag: "en-GB", + index: 0, + }, { + // do not match faulty tags with und + supported: "en,und", + desired: "|en", + tag: "en", + index: 0, + }} + for _, tc := range testCases { + t.Run(path.Join(tc.supported, tc.desired), func(t *testing.T) { + m := NewMatcher(makeTagList(tc.supported)) + tag, index := MatchStrings(m, strings.Split(tc.desired, "|")...) + if tag.String() != tc.tag || index != tc.index { + t.Errorf("got %v, %d; want %v, %d", tag, index, tc.tag, tc.index) + } + }) + } +} + func TestAddLikelySubtags(t *testing.T) { tests := []struct{ in, out string }{ {"aa", "aa-Latn-ET"}, @@ -132,6 +169,7 @@ func TestAddLikelySubtags(t *testing.T) { {"und-YT", "fr-Latn-YT"}, {"und-Arab", "ar-Arab-EG"}, {"und-AM", "hy-Armn-AM"}, + {"und-TW", "zh-Hant-TW"}, {"und-002", "en-Latn-NG"}, {"und-Latn-002", "en-Latn-NG"}, {"en-Latn-002", "en-Latn-NG"}, @@ -266,6 +304,12 @@ func TestRegionGroups(t *testing.T) { }{ {"zh-TW", "zh-HK", 5}, {"zh-MO", "zh-HK", 4}, + {"es-ES", "es-AR", 5}, + {"es-ES", "es", 4}, + {"es-419", "es-MX", 4}, + {"es-AR", "es-MX", 4}, + {"es-ES", "es-MX", 5}, + {"es-PT", "es-MX", 5}, } for _, tc := range testCases { a := MustParse(tc.a) @@ -277,67 +321,27 @@ func TestRegionGroups(t *testing.T) { t.Errorf("scripts differ: %q vs %q", aScript, bScript) continue } - d := regionGroupDist(a.region, b.region, aScript.scriptID, a.lang) + d, _ := regionGroupDist(a.region, b.region, aScript.scriptID, a.lang) if d != tc.distance { t.Errorf("got %q; want %q", d, tc.distance) } } } -func TestRegionDistance(t *testing.T) { - tests := []struct { - a, b string - d int - }{ - {"NL", "NL", 0}, - {"NL", "EU", 1}, - {"EU", "NL", 1}, - {"005", "005", 0}, - {"NL", "BE", 2}, - {"CO", "005", 1}, - {"005", "CO", 1}, - {"CO", "419", 2}, - {"419", "CO", 2}, - {"005", "419", 1}, - {"419", "005", 1}, - {"001", "013", 2}, - {"013", "001", 2}, - {"CO", "CW", 4}, - {"CO", "PW", 6}, - {"CO", "BV", 6}, - {"ZZ", "QQ", 2}, - } - for i, tt := range tests { - testtext.Run(t, tt.a+"/"+tt.b, func(t *testing.T) { - ra, _ := getRegionID([]byte(tt.a)) - rb, _ := getRegionID([]byte(tt.b)) - if d := regionDistance(ra, rb); d != tt.d { - t.Errorf("%d: d(%s, %s) = %v; want %v", i, tt.a, tt.b, d, tt.d) - } - }) - } -} - -func TestParentDistance(t *testing.T) { - tests := []struct { - parent string - tag string - d uint8 - }{ - {"en-001", "en-AU", 1}, - {"pt-PT", "pt-AO", 1}, - {"pt", "pt-AO", 2}, - {"en-AU", "en-GB", 255}, - {"en-NL", "en-AU", 255}, - // Note that pt-BR and en-US are not automatically minimized. - {"pt-BR", "pt-AO", 255}, - {"en-US", "en-AU", 255}, +func TestIsParadigmLocale(t *testing.T) { + testCases := map[string]bool{ + "en-US": true, + "en-GB": true, + "en-VI": false, + "es-GB": false, + "es-ES": true, + "es-419": true, } - for _, tt := range tests { - r := Raw.MustParse(tt.parent).region - tag := Raw.MustParse(tt.tag) - if d := parentDistance(r, tag); d != tt.d { - t.Errorf("d(%s, %s) was %d; want %d", r, tag, d, tt.d) + for str, want := range testCases { + tag := Make(str) + got := isParadigmLocale(tag.lang, tag.region) + if got != want { + t.Errorf("isPL(%q) = %v; want %v", str, got, want) } } } @@ -355,12 +359,8 @@ func (m *matcher) String() string { func (h *matchHeader) String() string { w := &bytes.Buffer{} - fmt.Fprintf(w, "exact: ") - for _, h := range h.exact { - fmt.Fprintf(w, "%v, ", h) - } - fmt.Fprint(w, "; max: ") - for _, h := range h.max { + fmt.Fprint(w, "haveTag: ") + for _, h := range h.haveTags { fmt.Fprintf(w, "%v, ", h) } return w.String() @@ -370,35 +370,8 @@ func (t haveTag) String() string { return fmt.Sprintf("%v:%d:%v:%v-%v|%v", t.tag, t.index, t.conf, t.maxRegion, t.maxScript, t.altScript) } -func parseSupported(list string) (out []Tag) { - for _, s := range strings.Split(list, ",") { - out = append(out, mk(strings.TrimSpace(s))) - } - return out -} - -// The test set for TestBestMatch is defined in data_test.go. -func TestBestMatch(t *testing.T) { - for _, tt := range matchTests { - supported := parseSupported(tt.supported) - m := newMatcher(supported, nil) - if *verbose { - fmt.Printf("%s:\n%v\n", tt.comment, m) - } - for _, tm := range tt.test { - t.Run(path.Join(tt.comment, tt.supported, tm.desired), func(t *testing.T) { - tag, _, conf := m.Match(parseSupported(tm.desired)...) - if tag.String() != tm.match { - t.Errorf("find %s in %q: have %s; want %s (%v)", tm.desired, tt.supported, tag, tm.match, conf) - } - }) - - } - } -} - func TestBestMatchAlloc(t *testing.T) { - m := NewMatcher(parseSupported("en sr nl")) + m := NewMatcher(makeTagList("en sr nl")) // Go allocates when creating a list of tags from a single tag! list := []Tag{English} avg := testtext.AllocsPerRun(1, func() { diff --git a/vendor/golang.org/x/text/language/tables.go b/vendor/golang.org/x/text/language/tables.go index a108554a..ec17f97a 100644 --- a/vendor/golang.org/x/text/language/tables.go +++ b/vendor/golang.org/x/text/language/tables.go @@ -7,11 +7,11 @@ import "golang.org/x/text/internal/tag" // CLDRVersion is the CLDR version from which the tables in this package are derived. const CLDRVersion = "31" -const numLanguages = 8654 +const numLanguages = 8665 -const numScripts = 230 +const numScripts = 237 -const numRegions = 356 +const numRegions = 357 type fromTo struct { from uint16 @@ -333,7 +333,7 @@ var langNoIndex = [2197]uint8{ // Entry 200 - 23F 0xdf, 0xc3, 0x83, 0x82, 0xc0, 0xfb, 0x57, 0x27, 0xcd, 0x55, 0xe7, 0x01, 0x00, 0x20, 0xb2, 0xc5, - 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xcf, 0xe0, 0xdf, + 0xa4, 0x45, 0x25, 0x9b, 0x02, 0xdf, 0xe0, 0xdf, 0x03, 0x44, 0x08, 0x10, 0x01, 0x04, 0x01, 0xe3, 0x92, 0x54, 0xdb, 0x28, 0xd1, 0x5f, 0xf6, 0x6d, 0x79, 0xed, 0x1c, 0x7d, 0x04, 0x08, 0x00, 0x01, @@ -354,7 +354,7 @@ var langNoIndex = [2197]uint8{ 0xe2, 0xef, 0xfd, 0x3f, 0x05, 0x09, 0x08, 0x05, 0x40, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x60, - 0xe5, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80, + 0xe7, 0x48, 0x00, 0x81, 0x20, 0xc0, 0x05, 0x80, 0x03, 0x00, 0x00, 0x00, 0x8c, 0x50, 0x40, 0x04, 0x84, 0x47, 0x84, 0x40, 0x20, 0x10, 0x00, 0x20, // Entry 2C0 - 2FF @@ -398,7 +398,7 @@ var langNoIndex = [2197]uint8{ 0xf2, 0xff, 0x31, 0xff, 0xf2, 0x1e, 0x90, 0xf7, 0xf1, 0xf9, 0x45, 0x80, 0x01, 0x02, 0x00, 0x00, 0x40, 0x54, 0x9f, 0x8a, 0xd9, 0xd9, 0x0e, 0x11, - 0x84, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x00, 0x01, + 0x86, 0x51, 0xc0, 0xf3, 0xfb, 0x47, 0x00, 0x01, 0x05, 0xd1, 0x50, 0x58, 0x00, 0x00, 0x00, 0x10, 0x04, 0x02, 0x00, 0x00, 0x0a, 0x00, 0x17, 0xd2, 0xb9, 0xfd, 0xfc, 0xba, 0xfe, 0xef, 0xc7, 0xbe, @@ -414,12 +414,12 @@ var langNoIndex = [2197]uint8{ // Entry 440 - 47F 0xfd, 0xfe, 0xfb, 0xff, 0xfe, 0xeb, 0x1f, 0x7d, 0x2f, 0xfd, 0xb6, 0xb5, 0xa5, 0xfc, 0xff, 0xfd, - 0x7f, 0x4e, 0xbf, 0x8e, 0xae, 0xff, 0xee, 0xdf, + 0x7f, 0x4e, 0xbf, 0x8f, 0xae, 0xff, 0xee, 0xdf, 0x7f, 0xf7, 0x73, 0x02, 0x02, 0x04, 0xfc, 0xf7, 0xff, 0xb7, 0xd7, 0xef, 0xfe, 0xcd, 0xf5, 0xce, 0xe2, 0x8e, 0xe7, 0xbf, 0xb7, 0xff, 0x56, 0xbd, 0xcd, 0xff, 0xfb, 0xff, 0xdf, 0xd7, 0xea, 0xff, - 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x04, 0x44, + 0xe5, 0x5f, 0x6d, 0x0f, 0xa7, 0x51, 0x06, 0xc4, // Entry 480 - 4BF 0x13, 0x50, 0x5d, 0xaf, 0xa6, 0xfd, 0x99, 0xfb, 0x63, 0x1d, 0x53, 0xff, 0xef, 0xb7, 0x35, 0x20, @@ -473,7 +473,7 @@ var langNoIndex = [2197]uint8{ 0x31, 0x00, 0x00, 0x00, 0x01, 0x10, 0x02, 0x20, 0x00, 0x00, 0x01, 0x00, 0x42, 0x00, 0x20, 0x00, 0x00, 0x1f, 0xdf, 0xd2, 0xb9, 0xff, 0xfd, 0x3f, - 0x1f, 0x18, 0xcf, 0x9c, 0xbf, 0xaf, 0x5f, 0xfe, + 0x1f, 0x98, 0xcf, 0x9c, 0xbf, 0xaf, 0x5f, 0xfe, // Entry 600 - 63F 0x7b, 0x4b, 0x40, 0x10, 0xe1, 0xfd, 0xaf, 0xd9, 0xb7, 0xf6, 0xfb, 0xb3, 0xc7, 0xff, 0x6f, 0xf1, @@ -484,7 +484,7 @@ var langNoIndex = [2197]uint8{ 0xbe, 0x5f, 0x46, 0x1b, 0xe9, 0x5f, 0x50, 0x18, 0x02, 0xfa, 0xf7, 0x9d, 0x15, 0x97, 0x05, 0x0f, // Entry 640 - 67F - 0x75, 0xc4, 0x7d, 0x81, 0x82, 0xf1, 0x57, 0x6c, + 0x75, 0xc4, 0x7d, 0x81, 0x92, 0xf1, 0x57, 0x6c, 0xff, 0xe4, 0xef, 0x6f, 0xff, 0xfc, 0xdd, 0xde, 0xfc, 0xfd, 0x76, 0x5f, 0x7a, 0x1f, 0x00, 0x98, 0x02, 0xfb, 0xa3, 0xef, 0xf3, 0xd6, 0xf2, 0xff, @@ -500,7 +500,7 @@ var langNoIndex = [2197]uint8{ 0x04, 0x00, 0x00, 0x40, 0xd4, 0x02, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x20, 0x01, 0x06, 0x50, 0x00, 0x08, 0x00, 0x00, 0x00, 0x24, 0x00, - 0x04, 0x00, 0x10, 0x8c, 0x58, 0xd5, 0x0d, 0x0f, + 0x04, 0x00, 0x10, 0xcc, 0x58, 0xd5, 0x0d, 0x0f, // Entry 6C0 - 6FF 0x14, 0x4d, 0xf1, 0x16, 0x44, 0xd1, 0x42, 0x08, 0x40, 0x00, 0x00, 0x40, 0x00, 0x08, 0x00, 0x00, @@ -521,7 +521,7 @@ var langNoIndex = [2197]uint8{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 740 - 77F 0x00, 0x00, 0x00, 0xef, 0xd5, 0xfd, 0xcf, 0x7e, - 0xa0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x44, + 0xb0, 0x11, 0x00, 0x00, 0x00, 0x92, 0x01, 0x44, 0xcd, 0xf9, 0x5c, 0x00, 0x01, 0x00, 0x30, 0x04, 0x04, 0x55, 0x00, 0x01, 0x04, 0xf4, 0x3f, 0x4a, 0x01, 0x00, 0x00, 0xb0, 0x80, 0x00, 0x55, 0x55, @@ -533,7 +533,7 @@ var langNoIndex = [2197]uint8{ 0x00, 0x00, 0x20, 0x00, 0x24, 0x44, 0x00, 0x00, 0x10, 0x03, 0x11, 0x02, 0x01, 0x00, 0x00, 0xf0, 0xf5, 0xff, 0xd5, 0x97, 0xbc, 0x70, 0xd6, 0x78, - 0x78, 0x15, 0x50, 0x00, 0xa4, 0x84, 0xa9, 0x41, + 0x78, 0x15, 0x50, 0x01, 0xa4, 0x84, 0xa9, 0x41, 0x00, 0x00, 0x00, 0x6b, 0x39, 0x52, 0x74, 0x00, 0xe8, 0x30, 0x90, 0x6a, 0x92, 0x00, 0x00, 0x02, 0xff, 0xef, 0xff, 0x4b, 0x85, 0x53, 0xf4, 0xed, @@ -582,8 +582,8 @@ var altLangIndex = [6]uint16{ } // langAliasMap maps langIDs to their suggested replacements. -// Size: 644 bytes, 161 elements -var langAliasMap = [161]fromTo{ +// Size: 656 bytes, 164 elements +var langAliasMap = [164]fromTo{ 0: {from: 0x82, to: 0x88}, 1: {from: 0x185, to: 0x1ac}, 2: {from: 0x1f1, to: 0x1df}, @@ -659,142 +659,145 @@ var langAliasMap = [161]fromTo{ 72: {from: 0x1a87, to: 0x1f6}, 73: {from: 0x1b57, to: 0x1f8}, 74: {from: 0x1b83, to: 0x1512}, - 75: {from: 0x2035, to: 0x37ae}, - 76: {from: 0x203a, to: 0x20da}, - 77: {from: 0x2057, to: 0x309}, - 78: {from: 0x20e0, to: 0x272}, - 79: {from: 0x20eb, to: 0x261}, - 80: {from: 0x20ef, to: 0x22b}, - 81: {from: 0x20f6, to: 0x254}, - 82: {from: 0x210c, to: 0x21e8}, - 83: {from: 0x2132, to: 0x27b}, - 84: {from: 0x2196, to: 0x120}, - 85: {from: 0x21cb, to: 0x155e}, - 86: {from: 0x21e3, to: 0x502}, - 87: {from: 0x21f1, to: 0x49d}, - 88: {from: 0x222a, to: 0x120}, - 89: {from: 0x2234, to: 0x120}, - 90: {from: 0x225f, to: 0x927}, - 91: {from: 0x2313, to: 0x3223}, - 92: {from: 0x237f, to: 0x3362}, - 93: {from: 0x246f, to: 0x2c5}, - 94: {from: 0x24e1, to: 0x2fd}, - 95: {from: 0x24ed, to: 0x2f8}, - 96: {from: 0x24f7, to: 0x31d}, - 97: {from: 0x254d, to: 0xb58}, - 98: {from: 0x25a6, to: 0xe2}, - 99: {from: 0x263b, to: 0x2ce}, - 100: {from: 0x26c6, to: 0x26b1}, - 101: {from: 0x26f6, to: 0x3c6}, - 102: {from: 0x2724, to: 0x3cac}, - 103: {from: 0x2762, to: 0x26b1}, - 104: {from: 0x2786, to: 0x4355}, - 105: {from: 0x28ec, to: 0x2834}, - 106: {from: 0x2911, to: 0x34f}, - 107: {from: 0x2983, to: 0x2da4}, - 108: {from: 0x2b17, to: 0x38b}, - 109: {from: 0x2bf9, to: 0x393}, - 110: {from: 0x2c3c, to: 0x3cac}, - 111: {from: 0x2cf9, to: 0x3bc}, - 112: {from: 0x2d10, to: 0x594}, - 113: {from: 0x2d44, to: 0x147}, - 114: {from: 0x2d45, to: 0x147}, - 115: {from: 0x2dfc, to: 0x2ef}, - 116: {from: 0x2e05, to: 0x19c9}, - 117: {from: 0x2e17, to: 0x2d92}, - 118: {from: 0x2e1e, to: 0x290}, - 119: {from: 0x2e51, to: 0x7d}, - 120: {from: 0x2e62, to: 0x227f}, - 121: {from: 0x2e9d, to: 0x2e98}, - 122: {from: 0x2eec, to: 0x2ed4}, - 123: {from: 0x3190, to: 0x3c2}, - 124: {from: 0x3363, to: 0x338b}, - 125: {from: 0x3427, to: 0x3da}, - 126: {from: 0x34eb, to: 0x18cd}, - 127: {from: 0x35e3, to: 0x410}, - 128: {from: 0x3655, to: 0x244}, - 129: {from: 0x3673, to: 0x3f2}, - 130: {from: 0x36fa, to: 0x443}, - 131: {from: 0x37bd, to: 0x120}, - 132: {from: 0x3813, to: 0x38ef}, - 133: {from: 0x3828, to: 0x2c98}, - 134: {from: 0x382c, to: 0xa9}, - 135: {from: 0x382f, to: 0x3225}, - 136: {from: 0x3869, to: 0x39a3}, - 137: {from: 0x388f, to: 0x3fbd}, - 138: {from: 0x38a2, to: 0x39d4}, - 139: {from: 0x38b1, to: 0x1fa1}, - 140: {from: 0x38b2, to: 0x2e97}, - 141: {from: 0x3959, to: 0x47c}, - 142: {from: 0x3b4b, to: 0xd8e}, - 143: {from: 0x3b75, to: 0x136}, - 144: {from: 0x3c96, to: 0x4ba}, - 145: {from: 0x3fba, to: 0xff}, - 146: {from: 0x4205, to: 0xa8e}, - 147: {from: 0x42bb, to: 0x570}, - 148: {from: 0x42f6, to: 0x3f5d}, - 149: {from: 0x4375, to: 0x258}, - 150: {from: 0x43c8, to: 0x36c8}, - 151: {from: 0x43ca, to: 0x10e}, - 152: {from: 0x44ac, to: 0x331f}, - 153: {from: 0x44e0, to: 0x510}, - 154: {from: 0x45c7, to: 0x2406}, - 155: {from: 0x45da, to: 0x26d9}, - 156: {from: 0x460d, to: 0x48ab}, - 157: {from: 0x46ab, to: 0x469d}, - 158: {from: 0x473b, to: 0x4742}, - 159: {from: 0x4913, to: 0x31d}, - 160: {from: 0x49a4, to: 0x521}, + 75: {from: 0x1d61, to: 0x2c98}, + 76: {from: 0x2035, to: 0x37ae}, + 77: {from: 0x203a, to: 0x20da}, + 78: {from: 0x2057, to: 0x309}, + 79: {from: 0x20e0, to: 0x272}, + 80: {from: 0x20eb, to: 0x261}, + 81: {from: 0x20ef, to: 0x22b}, + 82: {from: 0x20f6, to: 0x254}, + 83: {from: 0x210c, to: 0x21e8}, + 84: {from: 0x2132, to: 0x27b}, + 85: {from: 0x215d, to: 0x910}, + 86: {from: 0x2196, to: 0x120}, + 87: {from: 0x21cb, to: 0x155e}, + 88: {from: 0x21e3, to: 0x502}, + 89: {from: 0x21f1, to: 0x49d}, + 90: {from: 0x222a, to: 0x120}, + 91: {from: 0x2234, to: 0x120}, + 92: {from: 0x225f, to: 0x927}, + 93: {from: 0x2313, to: 0x3223}, + 94: {from: 0x237f, to: 0x3362}, + 95: {from: 0x246f, to: 0x2c5}, + 96: {from: 0x24e1, to: 0x2fd}, + 97: {from: 0x24ed, to: 0x2f8}, + 98: {from: 0x24f7, to: 0x31d}, + 99: {from: 0x254d, to: 0xb58}, + 100: {from: 0x25a6, to: 0xe2}, + 101: {from: 0x263b, to: 0x2ce}, + 102: {from: 0x26c6, to: 0x26b1}, + 103: {from: 0x26f6, to: 0x3c6}, + 104: {from: 0x2724, to: 0x3cac}, + 105: {from: 0x2762, to: 0x26b1}, + 106: {from: 0x2786, to: 0x4355}, + 107: {from: 0x28ec, to: 0x2834}, + 108: {from: 0x2911, to: 0x34f}, + 109: {from: 0x2983, to: 0x2da4}, + 110: {from: 0x2b17, to: 0x38b}, + 111: {from: 0x2bf9, to: 0x393}, + 112: {from: 0x2c3c, to: 0x3cac}, + 113: {from: 0x2cf9, to: 0x3bc}, + 114: {from: 0x2d10, to: 0x594}, + 115: {from: 0x2d44, to: 0x147}, + 116: {from: 0x2d45, to: 0x147}, + 117: {from: 0x2dfc, to: 0x2ef}, + 118: {from: 0x2e05, to: 0x19c9}, + 119: {from: 0x2e17, to: 0x2d92}, + 120: {from: 0x2e1e, to: 0x290}, + 121: {from: 0x2e51, to: 0x7d}, + 122: {from: 0x2e62, to: 0x227f}, + 123: {from: 0x2e9d, to: 0x2e98}, + 124: {from: 0x2eec, to: 0x2ed4}, + 125: {from: 0x3190, to: 0x3c2}, + 126: {from: 0x3363, to: 0x338b}, + 127: {from: 0x3427, to: 0x3da}, + 128: {from: 0x34eb, to: 0x18cd}, + 129: {from: 0x35c5, to: 0x2c98}, + 130: {from: 0x35e3, to: 0x410}, + 131: {from: 0x3655, to: 0x244}, + 132: {from: 0x3673, to: 0x3f2}, + 133: {from: 0x36fa, to: 0x443}, + 134: {from: 0x37bd, to: 0x120}, + 135: {from: 0x3813, to: 0x38ef}, + 136: {from: 0x3828, to: 0x2c98}, + 137: {from: 0x382c, to: 0xa9}, + 138: {from: 0x382f, to: 0x3225}, + 139: {from: 0x3869, to: 0x39a3}, + 140: {from: 0x388f, to: 0x3fbd}, + 141: {from: 0x38a2, to: 0x39d4}, + 142: {from: 0x38b1, to: 0x1fa1}, + 143: {from: 0x38b2, to: 0x2e97}, + 144: {from: 0x3959, to: 0x47c}, + 145: {from: 0x3b4b, to: 0xd8e}, + 146: {from: 0x3b75, to: 0x136}, + 147: {from: 0x3c96, to: 0x4ba}, + 148: {from: 0x3fba, to: 0xff}, + 149: {from: 0x4205, to: 0xa8e}, + 150: {from: 0x42bb, to: 0x570}, + 151: {from: 0x42f6, to: 0x3f5d}, + 152: {from: 0x4375, to: 0x258}, + 153: {from: 0x43c8, to: 0x36c8}, + 154: {from: 0x43ca, to: 0x10e}, + 155: {from: 0x44ac, to: 0x331f}, + 156: {from: 0x44e0, to: 0x510}, + 157: {from: 0x45c7, to: 0x2406}, + 158: {from: 0x45da, to: 0x26d9}, + 159: {from: 0x460d, to: 0x48ab}, + 160: {from: 0x46ab, to: 0x469d}, + 161: {from: 0x473b, to: 0x4742}, + 162: {from: 0x4913, to: 0x31d}, + 163: {from: 0x49a4, to: 0x521}, } -// Size: 161 bytes, 161 elements -var langAliasTypes = [161]langAliasType{ +// Size: 164 bytes, 164 elements +var langAliasTypes = [164]langAliasType{ // Entry 0 - 3F 1, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 1, 0, 0, 1, 2, 1, 1, 2, 0, 1, 0, 1, 2, 1, 1, 0, 0, 2, 1, 1, 0, 2, 0, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 1, 1, 0, 0, 2, 1, 1, 1, 1, 2, 1, 0, 1, 1, 2, 2, 0, 1, 2, 0, // Entry 40 - 7F - 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 0, 1, 1, 1, - 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 2, - 2, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, - 0, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, 0, 2, + 1, 0, 1, 1, 1, 1, 0, 0, 2, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, + 2, 2, 2, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, + 0, 1, 0, 2, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 2, // Entry 80 - BF - 1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 1, 0, - 1, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, - 1, + 0, 0, 2, 1, 1, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, + 1, 1, 0, 1, 2, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, + 0, 1, 1, 1, } const ( - _Latn = 82 - _Hani = 50 - _Hans = 52 - _Hant = 53 - _Qaaa = 131 - _Qaai = 139 - _Qabx = 180 - _Zinh = 224 - _Zyyy = 229 - _Zzzz = 230 + _Latn = 85 + _Hani = 53 + _Hans = 55 + _Hant = 56 + _Qaaa = 136 + _Qaai = 144 + _Qabx = 185 + _Zinh = 231 + _Zyyy = 236 + _Zzzz = 237 ) // script is an alphabetically sorted list of ISO 15924 codes. The index // of the script in the string, divided by 4, is the internal scriptID. -const script tag.Index = "" + // Size: 928 bytes +const script tag.Index = "" + // Size: 956 bytes "----AdlmAfakAghbAhomArabAranArmiArmnAvstBaliBamuBassBatkBengBhksBlisBopo" + - "BrahBraiBugiBuhdCakmCansCariChamCherCirtCoptCprtCyrlCyrsDevaDsrtDuplEgyd" + - "EgyhEgypElbaEthiGeokGeorGlagGothGranGrekGujrGuruHanbHangHaniHanoHansHant" + - "HatrHebrHiraHluwHmngHrktHungIndsItalJamoJavaJpanJurcKaliKanaKharKhmrKhoj" + - "KitlKitsKndaKoreKpelKthiLanaLaooLatfLatgLatnLekeLepcLimbLinaLinbLisuLoma" + - "LyciLydiMahjMandManiMarcMayaMendMercMeroMlymModiMongMoonMrooMteiMultMymr" + - "NarbNbatNewaNkgbNkooNshuOgamOlckOrkhOryaOsgeOsmaPalmPaucPermPhagPhliPhlp" + - "PhlvPhnxPiqdPlrdPrtiQaaaQaabQaacQaadQaaeQaafQaagQaahQaaiQaajQaakQaalQaam" + - "QaanQaaoQaapQaaqQaarQaasQaatQaauQaavQaawQaaxQaayQaazQabaQabbQabcQabdQabe" + - "QabfQabgQabhQabiQabjQabkQablQabmQabnQaboQabpQabqQabrQabsQabtQabuQabvQabw" + - "QabxRjngRoroRunrSamrSaraSarbSaurSgnwShawShrdSiddSindSinhSoraSundSyloSyrc" + - "SyreSyrjSyrnTagbTakrTaleTaluTamlTangTavtTeluTengTfngTglgThaaThaiTibtTirh" + - "UgarVaiiVispWaraWoleXpeoXsuxYiiiZinhZmthZsyeZsymZxxxZyyyZzzz\xff\xff\xff" + - "\xff" + "BrahBraiBugiBuhdCakmCansCariChamCherCirtCoptCprtCyrlCyrsDevaDogrDsrtDupl" + + "EgydEgyhEgypElbaEthiGeokGeorGlagGongGonmGothGranGrekGujrGuruHanbHangHani" + + "HanoHansHantHatrHebrHiraHluwHmngHrktHungIndsItalJamoJavaJpanJurcKaliKana" + + "KharKhmrKhojKitlKitsKndaKoreKpelKthiLanaLaooLatfLatgLatnLekeLepcLimbLina" + + "LinbLisuLomaLyciLydiMahjMakaMandManiMarcMayaMedfMendMercMeroMlymModiMong" + + "MoonMrooMteiMultMymrNarbNbatNewaNkgbNkooNshuOgamOlckOrkhOryaOsgeOsmaPalm" + + "PaucPermPhagPhliPhlpPhlvPhnxPiqdPlrdPrtiQaaaQaabQaacQaadQaaeQaafQaagQaah" + + "QaaiQaajQaakQaalQaamQaanQaaoQaapQaaqQaarQaasQaatQaauQaavQaawQaaxQaayQaaz" + + "QabaQabbQabcQabdQabeQabfQabgQabhQabiQabjQabkQablQabmQabnQaboQabpQabqQabr" + + "QabsQabtQabuQabvQabwQabxRjngRoroRunrSamrSaraSarbSaurSgnwShawShrdSiddSind" + + "SinhSoraSoyoSundSyloSyrcSyreSyrjSyrnTagbTakrTaleTaluTamlTangTavtTeluTeng" + + "TfngTglgThaaThaiTibtTirhUgarVaiiVispWaraWoleXpeoXsuxYiiiZanbZinhZmthZsye" + + "ZsymZxxxZyyyZzzz\xff\xff\xff\xff" // suppressScript is an index from langID to the dominant script for that language, // if it exists. If a script is given, it should be suppressed from the language tag. @@ -803,16 +806,16 @@ var suppressScript = [1327]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 40 - 7F 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -825,56 +828,56 @@ var suppressScript = [1327]uint8{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry C0 - FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, // Entry 100 - 13F - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, - 0x00, 0x00, 0x00, 0x00, 0xd6, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x52, 0x00, 0x52, 0x00, 0x52, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xda, + 0x00, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x55, 0x00, 0x55, 0x00, 0x55, // Entry 140 - 17F - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x52, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x52, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 180 - 1BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x55, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x37, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3a, 0x00, 0x20, 0x00, 0x00, 0x00, // Entry 1C0 - 1FF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x52, 0x00, 0x52, 0x52, 0x00, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x55, 0x00, 0x55, 0x55, 0x00, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x52, 0x52, - 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x41, 0x00, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, + 0x00, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, // Entry 200 - 23F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -882,9 +885,9 @@ var suppressScript = [1327]uint8{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 240 - 27F - 0x1e, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, - 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4a, - 0x00, 0x00, 0x4b, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, + 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, + 0x00, 0x00, 0x4e, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -892,179 +895,179 @@ var suppressScript = [1327]uint8{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 280 - 2BF 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x4f, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, // Entry 2C0 - 2FF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, // Entry 300 - 33F - 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x52, 0x52, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, // Entry 340 - 37F - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x70, 0x52, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x55, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x75, 0x55, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 380 - 3BF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, - 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x2f, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, + 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x52, 0x00, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x55, 0x00, // Entry 3C0 - 3FF - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1e, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1e, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 400 - 43F - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 440 - 47F - 0x00, 0x00, 0x52, 0x52, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcd, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xd5, 0x00, 0x00, 0x00, 0x27, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd6, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xdb, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x55, 0x00, // Entry 480 - 4BF - 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, // Entry 4C0 - 4FF - 0x00, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 500 - 53F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, } const ( _001 = 1 - _419 = 30 - _BR = 64 - _CA = 72 - _ES = 109 - _GB = 122 - _MD = 187 - _PT = 237 - _UK = 305 - _US = 308 - _ZZ = 356 - _XA = 322 - _XC = 324 - _XK = 332 + _419 = 31 + _BR = 65 + _CA = 73 + _ES = 110 + _GB = 123 + _MD = 188 + _PT = 238 + _UK = 306 + _US = 309 + _ZZ = 357 + _XA = 323 + _XC = 325 + _XK = 333 ) // isoRegionOffset needs to be added to the index of regionISO to obtain the regionID // for 2-letter ISO codes. (The first isoRegionOffset regionIDs are reserved for // the UN.M49 codes used for groups.) -const isoRegionOffset = 31 +const isoRegionOffset = 32 // regionTypes defines the status of a region for various standards. -// Size: 357 bytes, 357 elements -var regionTypes = [357]uint8{ +// Size: 358 bytes, 358 elements +var regionTypes = [358]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry 40 - 7F - 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x04, 0x00, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, - 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, + 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x04, + 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, + 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, + 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry 80 - BF 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x00, 0x04, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x00, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry C0 - FF - 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, - 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, 0x06, - 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, - 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, + 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x04, 0x06, + 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, + 0x06, 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, // Entry 100 - 13F - 0x05, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x05, 0x05, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, + 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x02, 0x06, 0x04, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x02, 0x06, 0x04, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, // Entry 140 - 17F - 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, + 0x06, 0x00, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, - 0x05, 0x05, 0x05, 0x05, 0x04, 0x06, 0x06, 0x04, - 0x06, 0x06, 0x04, 0x06, 0x05, + 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x06, 0x06, + 0x04, 0x06, 0x06, 0x04, 0x06, 0x05, } // regionISO holds a list of alphabetically sorted 2-letter ISO region codes. @@ -1102,89 +1105,89 @@ const altRegionISO3 string = "SCGQUUSGSCOMPRKCYMSPMSRBATFMYTATN" // of the 3-letter ISO codes in altRegionISO3. // Size: 22 bytes, 11 elements var altRegionIDs = [11]uint16{ - 0x0056, 0x006f, 0x0087, 0x00a7, 0x00a9, 0x00ac, 0x00e9, 0x0104, - 0x0120, 0x015e, 0x00db, + 0x0057, 0x0070, 0x0088, 0x00a8, 0x00aa, 0x00ad, 0x00ea, 0x0105, + 0x0121, 0x015f, 0x00dc, } // Size: 80 bytes, 20 elements var regionOldMap = [20]fromTo{ - 0: {from: 0x43, to: 0xc3}, - 1: {from: 0x57, to: 0xa6}, - 2: {from: 0x5e, to: 0x5f}, - 3: {from: 0x65, to: 0x3a}, - 4: {from: 0x78, to: 0x77}, - 5: {from: 0x92, to: 0x36}, - 6: {from: 0xa2, to: 0x132}, - 7: {from: 0xc0, to: 0x132}, - 8: {from: 0xd6, to: 0x13e}, - 9: {from: 0xdb, to: 0x2a}, - 10: {from: 0xee, to: 0x132}, - 11: {from: 0xf1, to: 0xe1}, - 12: {from: 0xfb, to: 0x6f}, - 13: {from: 0x102, to: 0x163}, - 14: {from: 0x129, to: 0x125}, - 15: {from: 0x131, to: 0x7a}, - 16: {from: 0x139, to: 0x13d}, - 17: {from: 0x140, to: 0x132}, - 18: {from: 0x15c, to: 0x15d}, - 19: {from: 0x162, to: 0x4a}, + 0: {from: 0x44, to: 0xc4}, + 1: {from: 0x58, to: 0xa7}, + 2: {from: 0x5f, to: 0x60}, + 3: {from: 0x66, to: 0x3b}, + 4: {from: 0x79, to: 0x78}, + 5: {from: 0x93, to: 0x37}, + 6: {from: 0xa3, to: 0x133}, + 7: {from: 0xc1, to: 0x133}, + 8: {from: 0xd7, to: 0x13f}, + 9: {from: 0xdc, to: 0x2b}, + 10: {from: 0xef, to: 0x133}, + 11: {from: 0xf2, to: 0xe2}, + 12: {from: 0xfc, to: 0x70}, + 13: {from: 0x103, to: 0x164}, + 14: {from: 0x12a, to: 0x126}, + 15: {from: 0x132, to: 0x7b}, + 16: {from: 0x13a, to: 0x13e}, + 17: {from: 0x141, to: 0x133}, + 18: {from: 0x15d, to: 0x15e}, + 19: {from: 0x163, to: 0x4b}, } // m49 maps regionIDs to UN.M49 codes. The first isoRegionOffset entries are // codes indicating collections of regions. -// Size: 714 bytes, 357 elements -var m49 = [357]int16{ +// Size: 716 bytes, 358 elements +var m49 = [358]int16{ // Entry 0 - 3F 0, 1, 2, 3, 5, 9, 11, 13, 14, 15, 17, 18, 19, 21, 29, 30, 34, 35, 39, 53, 54, 57, 61, 142, - 143, 145, 150, 151, 154, 155, 419, 958, - 0, 20, 784, 4, 28, 660, 8, 51, - 530, 24, 10, 32, 16, 40, 36, 533, - 248, 31, 70, 52, 50, 56, 854, 100, - 48, 108, 204, 652, 60, 96, 68, 535, + 143, 145, 150, 151, 154, 155, 202, 419, + 958, 0, 20, 784, 4, 28, 660, 8, + 51, 530, 24, 10, 32, 16, 40, 36, + 533, 248, 31, 70, 52, 50, 56, 854, + 100, 48, 108, 204, 652, 60, 96, 68, // Entry 40 - 7F - 76, 44, 64, 104, 74, 72, 112, 84, - 124, 166, 180, 140, 178, 756, 384, 184, - 152, 120, 156, 170, 0, 188, 891, 296, - 192, 132, 531, 162, 196, 203, 278, 276, - 0, 262, 208, 212, 214, 204, 12, 0, - 218, 233, 818, 732, 232, 724, 231, 967, - 0, 246, 242, 238, 583, 234, 0, 250, - 249, 266, 826, 308, 268, 254, 831, 288, + 535, 76, 44, 64, 104, 74, 72, 112, + 84, 124, 166, 180, 140, 178, 756, 384, + 184, 152, 120, 156, 170, 0, 188, 891, + 296, 192, 132, 531, 162, 196, 203, 278, + 276, 0, 262, 208, 212, 214, 204, 12, + 0, 218, 233, 818, 732, 232, 724, 231, + 967, 0, 246, 242, 238, 583, 234, 0, + 250, 249, 266, 826, 308, 268, 254, 831, // Entry 80 - BF - 292, 304, 270, 324, 312, 226, 300, 239, - 320, 316, 624, 328, 344, 334, 340, 191, - 332, 348, 854, 0, 360, 372, 376, 833, - 356, 86, 368, 364, 352, 380, 832, 388, - 400, 392, 581, 404, 417, 116, 296, 174, - 659, 408, 410, 414, 136, 398, 418, 422, - 662, 438, 144, 430, 426, 440, 442, 428, - 434, 504, 492, 498, 499, 663, 450, 584, + 288, 292, 304, 270, 324, 312, 226, 300, + 239, 320, 316, 624, 328, 344, 334, 340, + 191, 332, 348, 854, 0, 360, 372, 376, + 833, 356, 86, 368, 364, 352, 380, 832, + 388, 400, 392, 581, 404, 417, 116, 296, + 174, 659, 408, 410, 414, 136, 398, 418, + 422, 662, 438, 144, 430, 426, 440, 442, + 428, 434, 504, 492, 498, 499, 663, 450, // Entry C0 - FF - 581, 807, 466, 104, 496, 446, 580, 474, - 478, 500, 470, 480, 462, 454, 484, 458, - 508, 516, 540, 562, 574, 566, 548, 558, - 528, 578, 524, 10, 520, 536, 570, 554, - 512, 591, 0, 604, 258, 598, 608, 586, - 616, 666, 612, 630, 275, 620, 581, 585, - 600, 591, 634, 959, 960, 961, 962, 963, - 964, 965, 966, 967, 968, 969, 970, 971, + 584, 581, 807, 466, 104, 496, 446, 580, + 474, 478, 500, 470, 480, 462, 454, 484, + 458, 508, 516, 540, 562, 574, 566, 548, + 558, 528, 578, 524, 10, 520, 536, 570, + 554, 512, 591, 0, 604, 258, 598, 608, + 586, 616, 666, 612, 630, 275, 620, 581, + 585, 600, 591, 634, 959, 960, 961, 962, + 963, 964, 965, 966, 967, 968, 969, 970, // Entry 100 - 13F - 972, 638, 716, 642, 688, 643, 646, 682, - 90, 690, 729, 752, 702, 654, 705, 744, - 703, 694, 674, 686, 706, 740, 728, 678, - 810, 222, 534, 760, 748, 0, 796, 148, - 260, 768, 764, 762, 772, 626, 795, 788, - 776, 626, 792, 780, 798, 158, 834, 804, - 800, 826, 581, 0, 840, 858, 860, 336, - 670, 704, 862, 92, 850, 704, 548, 876, + 971, 972, 638, 716, 642, 688, 643, 646, + 682, 90, 690, 729, 752, 702, 654, 705, + 744, 703, 694, 674, 686, 706, 740, 728, + 678, 810, 222, 534, 760, 748, 0, 796, + 148, 260, 768, 764, 762, 772, 626, 795, + 788, 776, 626, 792, 780, 798, 158, 834, + 804, 800, 826, 581, 0, 840, 858, 860, + 336, 670, 704, 862, 92, 850, 704, 548, // Entry 140 - 17F - 581, 882, 973, 974, 975, 976, 977, 978, - 979, 980, 981, 982, 983, 984, 985, 986, - 987, 988, 989, 990, 991, 992, 993, 994, - 995, 996, 997, 998, 720, 887, 175, 891, - 710, 894, 180, 716, 999, + 876, 581, 882, 973, 974, 975, 976, 977, + 978, 979, 980, 981, 982, 983, 984, 985, + 986, 987, 988, 989, 990, 991, 992, 993, + 994, 995, 996, 997, 998, 720, 887, 175, + 891, 710, 894, 180, 716, 999, } // m49Index gives indexes into fromM49 based on the three most significant bits @@ -1194,149 +1197,157 @@ var m49 = [357]int16{ // The region code is stored in the 9 lsb of the indexed value. // Size: 18 bytes, 9 elements var m49Index = [9]int16{ - 0, 59, 107, 142, 180, 219, 258, 290, - 332, + 0, 59, 108, 143, 181, 220, 259, 291, + 333, } // fromM49 contains entries to map UN.M49 codes to regions. See m49Index for details. -// Size: 664 bytes, 332 elements -var fromM49 = [332]uint16{ +// Size: 666 bytes, 333 elements +var fromM49 = [333]uint16{ // Entry 0 - 3F - 0x0201, 0x0402, 0x0603, 0x0823, 0x0a04, 0x1026, 0x1205, 0x142a, - 0x1606, 0x1866, 0x1a07, 0x1c08, 0x1e09, 0x202c, 0x220a, 0x240b, - 0x260c, 0x2821, 0x2a0d, 0x3029, 0x3824, 0x3a0e, 0x3c0f, 0x3e31, - 0x402b, 0x4410, 0x4611, 0x482e, 0x4e12, 0x502d, 0x5841, 0x6038, - 0x6434, 0x6627, 0x6833, 0x6a13, 0x6c14, 0x7035, 0x7215, 0x783c, - 0x7a16, 0x8042, 0x883e, 0x8c32, 0x9045, 0x9444, 0x9840, 0xa847, - 0xac99, 0xb508, 0xb93b, 0xc03d, 0xc837, 0xd0c3, 0xd839, 0xe046, - 0xe8a5, 0xf051, 0xf848, 0x0859, 0x10ac, 0x184b, 0x1c17, 0x1e18, + 0x0201, 0x0402, 0x0603, 0x0824, 0x0a04, 0x1027, 0x1205, 0x142b, + 0x1606, 0x1867, 0x1a07, 0x1c08, 0x1e09, 0x202d, 0x220a, 0x240b, + 0x260c, 0x2822, 0x2a0d, 0x302a, 0x3825, 0x3a0e, 0x3c0f, 0x3e32, + 0x402c, 0x4410, 0x4611, 0x482f, 0x4e12, 0x502e, 0x5842, 0x6039, + 0x6435, 0x6628, 0x6834, 0x6a13, 0x6c14, 0x7036, 0x7215, 0x783d, + 0x7a16, 0x8043, 0x883f, 0x8c33, 0x9046, 0x9445, 0x9841, 0xa848, + 0xac9a, 0xb509, 0xb93c, 0xc03e, 0xc838, 0xd0c4, 0xd83a, 0xe047, + 0xe8a6, 0xf052, 0xf849, 0x085a, 0x10ad, 0x184c, 0x1c17, 0x1e18, // Entry 40 - 7F - 0x20b2, 0x2219, 0x291f, 0x2c1a, 0x2e1b, 0x3050, 0x341c, 0x361d, - 0x3852, 0x3d2d, 0x445b, 0x4c49, 0x5453, 0x5ca7, 0x5f5e, 0x644c, - 0x684a, 0x704f, 0x7855, 0x7e8f, 0x8058, 0x885c, 0x965d, 0x983a, - 0xa062, 0xa863, 0xac64, 0xb468, 0xbd19, 0xc485, 0xcc6e, 0xce6e, - 0xd06c, 0xd269, 0xd475, 0xdc73, 0xde87, 0xe472, 0xec71, 0xf030, - 0xf278, 0xf477, 0xfc7d, 0x04e4, 0x0920, 0x0c61, 0x1479, 0x187c, - 0x1c82, 0x26ec, 0x285f, 0x2c5e, 0x305f, 0x407f, 0x4880, 0x50a6, - 0x5886, 0x6081, 0x687b, 0x7084, 0x7889, 0x8088, 0x8883, 0x908b, + 0x20b3, 0x2219, 0x2920, 0x2c1a, 0x2e1b, 0x3051, 0x341c, 0x361d, + 0x3853, 0x3d2e, 0x445c, 0x4c4a, 0x5454, 0x5ca8, 0x5f5f, 0x644d, + 0x684b, 0x7050, 0x7856, 0x7e90, 0x8059, 0x885d, 0x941e, 0x965e, + 0x983b, 0xa063, 0xa864, 0xac65, 0xb469, 0xbd1a, 0xc486, 0xcc6f, + 0xce6f, 0xd06d, 0xd26a, 0xd476, 0xdc74, 0xde88, 0xe473, 0xec72, + 0xf031, 0xf279, 0xf478, 0xfc7e, 0x04e5, 0x0921, 0x0c62, 0x147a, + 0x187d, 0x1c83, 0x26ed, 0x2860, 0x2c5f, 0x3060, 0x4080, 0x4881, + 0x50a7, 0x5887, 0x6082, 0x687c, 0x7085, 0x788a, 0x8089, 0x8884, // Entry 80 - BF - 0x9890, 0x9c8d, 0xa137, 0xa88e, 0xb08c, 0xb891, 0xc09c, 0xc898, - 0xd094, 0xd89b, 0xe09a, 0xe895, 0xf096, 0xf89d, 0x004e, 0x089f, - 0x10a1, 0x1cad, 0x20a0, 0x28a3, 0x30a9, 0x34aa, 0x3cab, 0x42a4, - 0x44ae, 0x461e, 0x4caf, 0x54b4, 0x58b7, 0x5cb3, 0x64b8, 0x6cb1, - 0x70b5, 0x74b6, 0x7cc5, 0x84be, 0x8ccd, 0x94cf, 0x9ccc, 0xa4c2, - 0xacca, 0xb4c7, 0xbcc8, 0xc0cb, 0xc8ce, 0xd8ba, 0xe0c4, 0xe4bb, - 0xe6bc, 0xe8c9, 0xf0b9, 0xf8d0, 0x00e0, 0x08d1, 0x10dc, 0x18da, - 0x20d8, 0x2428, 0x265a, 0x2a2f, 0x2d1a, 0x2e3f, 0x30dd, 0x38d2, + 0x908c, 0x9891, 0x9c8e, 0xa138, 0xa88f, 0xb08d, 0xb892, 0xc09d, + 0xc899, 0xd095, 0xd89c, 0xe09b, 0xe896, 0xf097, 0xf89e, 0x004f, + 0x08a0, 0x10a2, 0x1cae, 0x20a1, 0x28a4, 0x30aa, 0x34ab, 0x3cac, + 0x42a5, 0x44af, 0x461f, 0x4cb0, 0x54b5, 0x58b8, 0x5cb4, 0x64b9, + 0x6cb2, 0x70b6, 0x74b7, 0x7cc6, 0x84bf, 0x8cce, 0x94d0, 0x9ccd, + 0xa4c3, 0xaccb, 0xb4c8, 0xbcc9, 0xc0cc, 0xc8cf, 0xd8bb, 0xe0c5, + 0xe4bc, 0xe6bd, 0xe8ca, 0xf0ba, 0xf8d1, 0x00e1, 0x08d2, 0x10dd, + 0x18db, 0x20d9, 0x2429, 0x265b, 0x2a30, 0x2d1b, 0x2e40, 0x30de, // Entry C0 - FF - 0x493e, 0x54df, 0x5cd7, 0x64d3, 0x6cd5, 0x74de, 0x7cd4, 0x84d9, - 0x88c6, 0x8b32, 0x8e74, 0x90bf, 0x92ef, 0x94e7, 0x9ee1, 0xace5, - 0xb0f0, 0xb8e3, 0xc0e6, 0xc8ea, 0xd0e8, 0xd8ed, 0xe08a, 0xe525, - 0xeceb, 0xf4f2, 0xfd01, 0x0503, 0x0705, 0x0d06, 0x183b, 0x1d0d, - 0x26a8, 0x2825, 0x2cb0, 0x2ebd, 0x34e9, 0x3d38, 0x4512, 0x4d17, - 0x5507, 0x5d13, 0x6104, 0x6509, 0x6d11, 0x7d0c, 0x7f10, 0x813d, - 0x830e, 0x8514, 0x8d60, 0x9963, 0xa15c, 0xa86d, 0xb116, 0xb30a, - 0xb86b, 0xc10a, 0xc915, 0xd10f, 0xd91c, 0xe10b, 0xe84d, 0xf11b, + 0x38d3, 0x493f, 0x54e0, 0x5cd8, 0x64d4, 0x6cd6, 0x74df, 0x7cd5, + 0x84da, 0x88c7, 0x8b33, 0x8e75, 0x90c0, 0x92f0, 0x94e8, 0x9ee2, + 0xace6, 0xb0f1, 0xb8e4, 0xc0e7, 0xc8eb, 0xd0e9, 0xd8ee, 0xe08b, + 0xe526, 0xecec, 0xf4f3, 0xfd02, 0x0504, 0x0706, 0x0d07, 0x183c, + 0x1d0e, 0x26a9, 0x2826, 0x2cb1, 0x2ebe, 0x34ea, 0x3d39, 0x4513, + 0x4d18, 0x5508, 0x5d14, 0x6105, 0x650a, 0x6d12, 0x7d0d, 0x7f11, + 0x813e, 0x830f, 0x8515, 0x8d61, 0x9964, 0xa15d, 0xa86e, 0xb117, + 0xb30b, 0xb86c, 0xc10b, 0xc916, 0xd110, 0xd91d, 0xe10c, 0xe84e, // Entry 100 - 13F - 0xf523, 0xf922, 0x0121, 0x0924, 0x1128, 0x192b, 0x2022, 0x2927, - 0x312a, 0x3726, 0x391e, 0x3d2c, 0x4130, 0x492f, 0x4ec1, 0x5518, - 0x646a, 0x747a, 0x7e7e, 0x809e, 0x8297, 0x852e, 0x9134, 0xa53c, - 0xac36, 0xb535, 0xb936, 0xbd3a, 0xd93f, 0xe541, 0xed5d, 0xef5d, - 0xf656, 0xfd61, 0x7c1f, 0x7ef3, 0x80f4, 0x82f5, 0x84f6, 0x86f7, - 0x88f8, 0x8af9, 0x8cfa, 0x8e6f, 0x90fc, 0x92fd, 0x94fe, 0x96ff, - 0x9900, 0x9b42, 0x9d43, 0x9f44, 0xa145, 0xa346, 0xa547, 0xa748, - 0xa949, 0xab4a, 0xad4b, 0xaf4c, 0xb14d, 0xb34e, 0xb54f, 0xb750, + 0xf11c, 0xf524, 0xf923, 0x0122, 0x0925, 0x1129, 0x192c, 0x2023, + 0x2928, 0x312b, 0x3727, 0x391f, 0x3d2d, 0x4131, 0x4930, 0x4ec2, + 0x5519, 0x646b, 0x747b, 0x7e7f, 0x809f, 0x8298, 0x852f, 0x9135, + 0xa53d, 0xac37, 0xb536, 0xb937, 0xbd3b, 0xd940, 0xe542, 0xed5e, + 0xef5e, 0xf657, 0xfd62, 0x7c20, 0x7ef4, 0x80f5, 0x82f6, 0x84f7, + 0x86f8, 0x88f9, 0x8afa, 0x8cfb, 0x8e70, 0x90fd, 0x92fe, 0x94ff, + 0x9700, 0x9901, 0x9b43, 0x9d44, 0x9f45, 0xa146, 0xa347, 0xa548, + 0xa749, 0xa94a, 0xab4b, 0xad4c, 0xaf4d, 0xb14e, 0xb34f, 0xb550, // Entry 140 - 17F - 0xb951, 0xbb52, 0xbd53, 0xbf54, 0xc155, 0xc356, 0xc557, 0xc758, - 0xc959, 0xcb5a, 0xcd5b, 0xcf64, + 0xb751, 0xb952, 0xbb53, 0xbd54, 0xbf55, 0xc156, 0xc357, 0xc558, + 0xc759, 0xc95a, 0xcb5b, 0xcd5c, 0xcf65, } -// Size: 1463 bytes +// Size: 1615 bytes var variantIndex = map[string]uint8{ "1606nict": 0x0, "1694acad": 0x1, "1901": 0x2, "1959acad": 0x3, - "1994": 0x45, + "1994": 0x4d, "1996": 0x4, "abl1943": 0x5, - "alalc97": 0x47, - "aluku": 0x6, - "ao1990": 0x7, - "arevela": 0x8, - "arevmda": 0x9, - "baku1926": 0xa, - "balanka": 0xb, - "barla": 0xc, - "basiceng": 0xd, - "bauddha": 0xe, - "biscayan": 0xf, - "biske": 0x40, - "bohoric": 0x10, - "boont": 0x11, - "colb1945": 0x12, - "cornu": 0x13, - "dajnko": 0x14, - "ekavsk": 0x15, - "emodeng": 0x16, - "fonipa": 0x48, - "fonnapa": 0x49, - "fonupa": 0x4a, - "fonxsamp": 0x4b, - "hepburn": 0x17, - "heploc": 0x46, - "hognorsk": 0x18, - "ijekavsk": 0x19, - "itihasa": 0x1a, - "jauer": 0x1b, - "jyutping": 0x1c, - "kkcor": 0x1d, - "kociewie": 0x1e, - "kscor": 0x1f, - "laukika": 0x20, - "lipaw": 0x41, - "luna1918": 0x21, - "metelko": 0x22, - "monoton": 0x23, - "ndyuka": 0x24, - "nedis": 0x25, - "newfound": 0x26, - "njiva": 0x42, - "nulik": 0x27, - "osojs": 0x43, - "oxendict": 0x28, - "pamaka": 0x29, - "petr1708": 0x2a, - "pinyin": 0x2b, - "polyton": 0x2c, - "puter": 0x2d, - "rigik": 0x2e, - "rozaj": 0x2f, - "rumgr": 0x30, - "scotland": 0x31, - "scouse": 0x32, - "simple": 0x4c, - "solba": 0x44, - "sotav": 0x33, - "surmiran": 0x34, - "sursilv": 0x35, - "sutsilv": 0x36, - "tarask": 0x37, - "uccor": 0x38, - "ucrcor": 0x39, - "ulster": 0x3a, - "unifon": 0x3b, - "vaidika": 0x3c, - "valencia": 0x3d, - "vallader": 0x3e, - "wadegile": 0x3f, + "akuapem": 0x6, + "alalc97": 0x4f, + "aluku": 0x7, + "ao1990": 0x8, + "arevela": 0x9, + "arevmda": 0xa, + "asante": 0xb, + "baku1926": 0xc, + "balanka": 0xd, + "barla": 0xe, + "basiceng": 0xf, + "bauddha": 0x10, + "biscayan": 0x11, + "biske": 0x48, + "bohoric": 0x12, + "boont": 0x13, + "colb1945": 0x14, + "cornu": 0x15, + "dajnko": 0x16, + "ekavsk": 0x17, + "emodeng": 0x18, + "fonipa": 0x50, + "fonnapa": 0x51, + "fonupa": 0x52, + "fonxsamp": 0x53, + "hepburn": 0x19, + "heploc": 0x4e, + "hognorsk": 0x1a, + "hsistemo": 0x1b, + "ijekavsk": 0x1c, + "itihasa": 0x1d, + "jauer": 0x1e, + "jyutping": 0x1f, + "kkcor": 0x20, + "kociewie": 0x21, + "kscor": 0x22, + "laukika": 0x23, + "lipaw": 0x49, + "luna1918": 0x24, + "metelko": 0x25, + "monoton": 0x26, + "ndyuka": 0x27, + "nedis": 0x28, + "newfound": 0x29, + "njiva": 0x4a, + "nulik": 0x2a, + "osojs": 0x4b, + "oxendict": 0x2b, + "pahawh2": 0x2c, + "pahawh3": 0x2d, + "pahawh4": 0x2e, + "pamaka": 0x2f, + "petr1708": 0x30, + "pinyin": 0x31, + "polyton": 0x32, + "puter": 0x33, + "rigik": 0x34, + "rozaj": 0x35, + "rumgr": 0x36, + "scotland": 0x37, + "scouse": 0x38, + "simple": 0x54, + "solba": 0x4c, + "sotav": 0x39, + "spanglis": 0x3a, + "surmiran": 0x3b, + "sursilv": 0x3c, + "sutsilv": 0x3d, + "tarask": 0x3e, + "uccor": 0x3f, + "ucrcor": 0x40, + "ulster": 0x41, + "unifon": 0x42, + "vaidika": 0x43, + "valencia": 0x44, + "vallader": 0x45, + "wadegile": 0x46, + "xsistemo": 0x47, } // variantNumSpecialized is the number of specialized variants in variants. -const variantNumSpecialized = 71 +const variantNumSpecialized = 79 // nRegionGroups is the number of region groups. -const nRegionGroups = 32 +const nRegionGroups = 33 type likelyLangRegion struct { lang uint16 @@ -1345,147 +1356,147 @@ type likelyLangRegion struct { // likelyScript is a lookup table, indexed by scriptID, for the most likely // languages and regions given a script. -// Size: 928 bytes, 232 elements -var likelyScript = [232]likelyLangRegion{ - 1: {lang: 0x14d, region: 0x83}, - 3: {lang: 0x2a0, region: 0x105}, - 4: {lang: 0x1f, region: 0x98}, - 5: {lang: 0x3a, region: 0x6a}, - 7: {lang: 0x3b, region: 0x9b}, - 8: {lang: 0x1d5, region: 0x27}, - 9: {lang: 0x13, region: 0x9b}, - 10: {lang: 0x5b, region: 0x94}, - 11: {lang: 0x60, region: 0x51}, - 12: {lang: 0xb9, region: 0xb3}, - 13: {lang: 0x63, region: 0x94}, - 14: {lang: 0xa5, region: 0x34}, - 15: {lang: 0x3e7, region: 0x98}, - 17: {lang: 0x527, region: 0x12d}, - 18: {lang: 0x3af, region: 0x98}, - 19: {lang: 0x15d, region: 0x77}, - 20: {lang: 0xc2, region: 0x94}, - 21: {lang: 0x9d, region: 0xe6}, - 22: {lang: 0xdb, region: 0x34}, - 23: {lang: 0xf2, region: 0x48}, - 24: {lang: 0x4ee, region: 0x12a}, - 25: {lang: 0xe7, region: 0x13d}, - 26: {lang: 0xe5, region: 0x134}, - 28: {lang: 0xf0, region: 0x6a}, - 29: {lang: 0x19e, region: 0x5c}, - 30: {lang: 0x3e0, region: 0x105}, - 32: {lang: 0x1bc, region: 0x98}, - 34: {lang: 0x15d, region: 0x77}, - 37: {lang: 0x132, region: 0x6a}, - 38: {lang: 0x42f, region: 0x26}, - 39: {lang: 0x27, region: 0x6e}, - 41: {lang: 0x20e, region: 0x7c}, - 42: {lang: 0xfd, region: 0x37}, - 43: {lang: 0x19c, region: 0x12f}, - 44: {lang: 0x3e7, region: 0x98}, - 45: {lang: 0x135, region: 0x86}, - 46: {lang: 0x1a2, region: 0x98}, - 47: {lang: 0x39b, region: 0x98}, - 48: {lang: 0x527, region: 0x12d}, - 49: {lang: 0x252, region: 0xaa}, - 50: {lang: 0x527, region: 0x52}, - 51: {lang: 0x1c9, region: 0xe6}, - 52: {lang: 0x527, region: 0x52}, - 53: {lang: 0x527, region: 0x12d}, - 54: {lang: 0x2fb, region: 0x9a}, - 55: {lang: 0x1ba, region: 0x96}, - 56: {lang: 0x1fe, region: 0xa1}, - 57: {lang: 0x1c3, region: 0x12a}, - 58: {lang: 0x1c8, region: 0xae}, - 60: {lang: 0x1d3, region: 0x91}, - 62: {lang: 0x141, region: 0x9d}, - 63: {lang: 0x252, region: 0xaa}, - 64: {lang: 0x20c, region: 0x94}, - 65: {lang: 0x1fe, region: 0xa1}, - 67: {lang: 0x134, region: 0xc3}, - 68: {lang: 0x1fe, region: 0xa1}, - 69: {lang: 0x3b9, region: 0xe7}, - 70: {lang: 0x248, region: 0xa5}, - 71: {lang: 0x3f8, region: 0x98}, - 74: {lang: 0x24f, region: 0x98}, - 75: {lang: 0x252, region: 0xaa}, - 77: {lang: 0x88, region: 0x98}, - 78: {lang: 0x36e, region: 0x122}, - 79: {lang: 0x2b6, region: 0xae}, - 84: {lang: 0x29d, region: 0x98}, - 85: {lang: 0x2a6, region: 0x98}, - 86: {lang: 0x28d, region: 0x86}, - 87: {lang: 0x19e, region: 0x86}, - 88: {lang: 0x2aa, region: 0x52}, - 90: {lang: 0x4f2, region: 0x12a}, - 91: {lang: 0x4f3, region: 0x12a}, - 92: {lang: 0x1bc, region: 0x98}, - 93: {lang: 0x335, region: 0x9b}, - 94: {lang: 0x4f5, region: 0x52}, - 95: {lang: 0xa9, region: 0x52}, - 97: {lang: 0x2e6, region: 0x111}, - 98: {lang: 0x4f6, region: 0x10a}, - 99: {lang: 0x4f6, region: 0x10a}, - 100: {lang: 0x302, region: 0x98}, - 101: {lang: 0x319, region: 0x98}, - 102: {lang: 0x309, region: 0x52}, - 104: {lang: 0x31c, region: 0x34}, - 105: {lang: 0x30c, region: 0x98}, - 106: {lang: 0x412, region: 0xe7}, - 107: {lang: 0x32f, region: 0xc3}, - 108: {lang: 0x4f7, region: 0x107}, - 109: {lang: 0x3b, region: 0xa0}, - 110: {lang: 0x351, region: 0xda}, - 112: {lang: 0x2ce, region: 0x83}, - 114: {lang: 0x401, region: 0x95}, - 115: {lang: 0x3ec, region: 0x98}, - 116: {lang: 0x399, region: 0xc4}, - 117: {lang: 0x393, region: 0x98}, - 118: {lang: 0x397, region: 0x134}, - 119: {lang: 0x427, region: 0x114}, - 120: {lang: 0x3b, region: 0x11b}, - 121: {lang: 0xfc, region: 0xc3}, - 122: {lang: 0x27b, region: 0x105}, - 123: {lang: 0x2c7, region: 0x52}, - 124: {lang: 0x39d, region: 0x9b}, - 125: {lang: 0x39d, region: 0x52}, - 127: {lang: 0x3ab, region: 0xaf}, - 129: {lang: 0x1c4, region: 0x52}, - 130: {lang: 0x4fb, region: 0x9b}, - 181: {lang: 0x3c9, region: 0x94}, - 183: {lang: 0x370, region: 0x10b}, - 184: {lang: 0x41e, region: 0x96}, - 186: {lang: 0x4fd, region: 0x15d}, - 187: {lang: 0x3ee, region: 0x98}, - 188: {lang: 0x45, region: 0x134}, - 189: {lang: 0x138, region: 0x7a}, - 190: {lang: 0x3e7, region: 0x98}, - 191: {lang: 0x3e7, region: 0x98}, - 192: {lang: 0x3f8, region: 0x98}, - 193: {lang: 0x40a, region: 0xb2}, - 194: {lang: 0x431, region: 0x98}, - 195: {lang: 0x43c, region: 0x94}, - 196: {lang: 0x44b, region: 0x34}, - 197: {lang: 0x44c, region: 0x9a}, - 201: {lang: 0x458, region: 0xe6}, - 202: {lang: 0x119, region: 0x98}, - 203: {lang: 0x45c, region: 0x52}, - 204: {lang: 0x230, region: 0x52}, - 205: {lang: 0x44e, region: 0x98}, - 206: {lang: 0x4a3, region: 0x52}, - 207: {lang: 0x9f, region: 0x13d}, - 208: {lang: 0x45f, region: 0x98}, - 210: {lang: 0x526, region: 0xb9}, - 211: {lang: 0x152, region: 0xe6}, - 212: {lang: 0x127, region: 0xcc}, - 213: {lang: 0x469, region: 0x122}, - 214: {lang: 0xa9, region: 0x52}, - 215: {lang: 0x2cc, region: 0x98}, - 216: {lang: 0x4ab, region: 0x11b}, - 217: {lang: 0x4bc, region: 0xb3}, - 219: {lang: 0x1cc, region: 0x98}, - 221: {lang: 0x3a7, region: 0x9b}, - 222: {lang: 0x22, region: 0x9a}, - 223: {lang: 0x1e8, region: 0x52}, +// Size: 956 bytes, 239 elements +var likelyScript = [239]likelyLangRegion{ + 1: {lang: 0x14d, region: 0x84}, + 3: {lang: 0x2a0, region: 0x106}, + 4: {lang: 0x1f, region: 0x99}, + 5: {lang: 0x3a, region: 0x6b}, + 7: {lang: 0x3b, region: 0x9c}, + 8: {lang: 0x1d5, region: 0x28}, + 9: {lang: 0x13, region: 0x9c}, + 10: {lang: 0x5b, region: 0x95}, + 11: {lang: 0x60, region: 0x52}, + 12: {lang: 0xb9, region: 0xb4}, + 13: {lang: 0x63, region: 0x95}, + 14: {lang: 0xa5, region: 0x35}, + 15: {lang: 0x3e7, region: 0x99}, + 17: {lang: 0x527, region: 0x12e}, + 18: {lang: 0x3af, region: 0x99}, + 19: {lang: 0x15d, region: 0x78}, + 20: {lang: 0xc2, region: 0x95}, + 21: {lang: 0x9d, region: 0xe7}, + 22: {lang: 0xdb, region: 0x35}, + 23: {lang: 0xf2, region: 0x49}, + 24: {lang: 0x4ee, region: 0x12b}, + 25: {lang: 0xe7, region: 0x13e}, + 26: {lang: 0xe5, region: 0x135}, + 28: {lang: 0xf0, region: 0x6b}, + 29: {lang: 0x19e, region: 0x5d}, + 30: {lang: 0x3e0, region: 0x106}, + 32: {lang: 0x1bc, region: 0x99}, + 35: {lang: 0x15d, region: 0x78}, + 38: {lang: 0x132, region: 0x6b}, + 39: {lang: 0x42f, region: 0x27}, + 40: {lang: 0x27, region: 0x6f}, + 42: {lang: 0x20e, region: 0x7d}, + 43: {lang: 0xfd, region: 0x38}, + 46: {lang: 0x19c, region: 0x130}, + 47: {lang: 0x3e7, region: 0x99}, + 48: {lang: 0x135, region: 0x87}, + 49: {lang: 0x1a2, region: 0x99}, + 50: {lang: 0x39b, region: 0x99}, + 51: {lang: 0x527, region: 0x12e}, + 52: {lang: 0x252, region: 0xab}, + 53: {lang: 0x527, region: 0x53}, + 54: {lang: 0x1c9, region: 0xe7}, + 55: {lang: 0x527, region: 0x53}, + 56: {lang: 0x527, region: 0x12e}, + 57: {lang: 0x2fb, region: 0x9b}, + 58: {lang: 0x1ba, region: 0x97}, + 59: {lang: 0x1fe, region: 0xa2}, + 60: {lang: 0x1c3, region: 0x12b}, + 61: {lang: 0x1c8, region: 0xaf}, + 63: {lang: 0x1d3, region: 0x92}, + 65: {lang: 0x141, region: 0x9e}, + 66: {lang: 0x252, region: 0xab}, + 67: {lang: 0x20c, region: 0x95}, + 68: {lang: 0x1fe, region: 0xa2}, + 70: {lang: 0x134, region: 0xc4}, + 71: {lang: 0x1fe, region: 0xa2}, + 72: {lang: 0x3b9, region: 0xe8}, + 73: {lang: 0x248, region: 0xa6}, + 74: {lang: 0x3f8, region: 0x99}, + 77: {lang: 0x24f, region: 0x99}, + 78: {lang: 0x252, region: 0xab}, + 80: {lang: 0x88, region: 0x99}, + 81: {lang: 0x36e, region: 0x123}, + 82: {lang: 0x2b6, region: 0xaf}, + 87: {lang: 0x29d, region: 0x99}, + 88: {lang: 0x2a6, region: 0x99}, + 89: {lang: 0x28d, region: 0x87}, + 90: {lang: 0x19e, region: 0x87}, + 91: {lang: 0x2aa, region: 0x53}, + 93: {lang: 0x4f2, region: 0x12b}, + 94: {lang: 0x4f3, region: 0x12b}, + 95: {lang: 0x1bc, region: 0x99}, + 97: {lang: 0x335, region: 0x9c}, + 98: {lang: 0x4f5, region: 0x53}, + 99: {lang: 0xa9, region: 0x53}, + 102: {lang: 0x2e6, region: 0x112}, + 103: {lang: 0x4f6, region: 0x10b}, + 104: {lang: 0x4f6, region: 0x10b}, + 105: {lang: 0x302, region: 0x99}, + 106: {lang: 0x319, region: 0x99}, + 107: {lang: 0x309, region: 0x53}, + 109: {lang: 0x31c, region: 0x35}, + 110: {lang: 0x30c, region: 0x99}, + 111: {lang: 0x412, region: 0xe8}, + 112: {lang: 0x32f, region: 0xc4}, + 113: {lang: 0x4f7, region: 0x108}, + 114: {lang: 0x3b, region: 0xa1}, + 115: {lang: 0x351, region: 0xdb}, + 117: {lang: 0x2ce, region: 0x84}, + 119: {lang: 0x401, region: 0x96}, + 120: {lang: 0x3ec, region: 0x99}, + 121: {lang: 0x399, region: 0xc5}, + 122: {lang: 0x393, region: 0x99}, + 123: {lang: 0x397, region: 0x135}, + 124: {lang: 0x427, region: 0x115}, + 125: {lang: 0x3b, region: 0x11c}, + 126: {lang: 0xfc, region: 0xc4}, + 127: {lang: 0x27b, region: 0x106}, + 128: {lang: 0x2c7, region: 0x53}, + 129: {lang: 0x39d, region: 0x9c}, + 130: {lang: 0x39d, region: 0x53}, + 132: {lang: 0x3ab, region: 0xb0}, + 134: {lang: 0x1c4, region: 0x53}, + 135: {lang: 0x4fb, region: 0x9c}, + 186: {lang: 0x3c9, region: 0x95}, + 188: {lang: 0x370, region: 0x10c}, + 189: {lang: 0x41e, region: 0x97}, + 191: {lang: 0x4fd, region: 0x15e}, + 192: {lang: 0x3ee, region: 0x99}, + 193: {lang: 0x45, region: 0x135}, + 194: {lang: 0x138, region: 0x7b}, + 195: {lang: 0x3e7, region: 0x99}, + 196: {lang: 0x3e7, region: 0x99}, + 197: {lang: 0x3f8, region: 0x99}, + 198: {lang: 0x40a, region: 0xb3}, + 199: {lang: 0x431, region: 0x99}, + 201: {lang: 0x43c, region: 0x95}, + 202: {lang: 0x44b, region: 0x35}, + 203: {lang: 0x44c, region: 0x9b}, + 207: {lang: 0x458, region: 0xe7}, + 208: {lang: 0x119, region: 0x99}, + 209: {lang: 0x45c, region: 0x53}, + 210: {lang: 0x230, region: 0x53}, + 211: {lang: 0x44e, region: 0x99}, + 212: {lang: 0x4a3, region: 0x53}, + 213: {lang: 0x9f, region: 0x13e}, + 214: {lang: 0x45f, region: 0x99}, + 216: {lang: 0x526, region: 0xba}, + 217: {lang: 0x152, region: 0xe7}, + 218: {lang: 0x127, region: 0xcd}, + 219: {lang: 0x469, region: 0x123}, + 220: {lang: 0xa9, region: 0x53}, + 221: {lang: 0x2cc, region: 0x99}, + 222: {lang: 0x4ab, region: 0x11c}, + 223: {lang: 0x4bc, region: 0xb4}, + 225: {lang: 0x1cc, region: 0x99}, + 227: {lang: 0x3a7, region: 0x9c}, + 228: {lang: 0x22, region: 0x9b}, + 229: {lang: 0x1e8, region: 0x53}, } type likelyScriptRegion struct { @@ -1500,1417 +1511,1417 @@ type likelyScriptRegion struct { // of the list in likelyLangList. // Size: 5308 bytes, 1327 elements var likelyLang = [1327]likelyScriptRegion{ - 0: {region: 0x134, script: 0x52, flags: 0x0}, - 1: {region: 0x6e, script: 0x52, flags: 0x0}, - 2: {region: 0x164, script: 0x52, flags: 0x0}, - 3: {region: 0x164, script: 0x52, flags: 0x0}, - 4: {region: 0x164, script: 0x52, flags: 0x0}, - 5: {region: 0x7c, script: 0x1e, flags: 0x0}, - 6: {region: 0x164, script: 0x52, flags: 0x0}, - 7: {region: 0x164, script: 0x1e, flags: 0x0}, - 8: {region: 0x7f, script: 0x52, flags: 0x0}, - 9: {region: 0x164, script: 0x52, flags: 0x0}, - 10: {region: 0x164, script: 0x52, flags: 0x0}, - 11: {region: 0x164, script: 0x52, flags: 0x0}, - 12: {region: 0x94, script: 0x52, flags: 0x0}, - 13: {region: 0x130, script: 0x52, flags: 0x0}, - 14: {region: 0x7f, script: 0x52, flags: 0x0}, - 15: {region: 0x164, script: 0x52, flags: 0x0}, - 16: {region: 0x164, script: 0x52, flags: 0x0}, - 17: {region: 0x105, script: 0x1e, flags: 0x0}, - 18: {region: 0x164, script: 0x52, flags: 0x0}, - 19: {region: 0x9b, script: 0x9, flags: 0x0}, - 20: {region: 0x127, script: 0x5, flags: 0x0}, - 21: {region: 0x164, script: 0x52, flags: 0x0}, - 22: {region: 0x160, script: 0x52, flags: 0x0}, - 23: {region: 0x164, script: 0x52, flags: 0x0}, - 24: {region: 0x164, script: 0x52, flags: 0x0}, - 25: {region: 0x164, script: 0x52, flags: 0x0}, - 26: {region: 0x164, script: 0x52, flags: 0x0}, - 27: {region: 0x164, script: 0x52, flags: 0x0}, - 28: {region: 0x51, script: 0x52, flags: 0x0}, - 29: {region: 0x164, script: 0x52, flags: 0x0}, - 30: {region: 0x164, script: 0x52, flags: 0x0}, - 31: {region: 0x98, script: 0x4, flags: 0x0}, - 32: {region: 0x164, script: 0x52, flags: 0x0}, - 33: {region: 0x7f, script: 0x52, flags: 0x0}, - 34: {region: 0x9a, script: 0xde, flags: 0x0}, - 35: {region: 0x164, script: 0x52, flags: 0x0}, - 36: {region: 0x164, script: 0x52, flags: 0x0}, - 37: {region: 0x14c, script: 0x52, flags: 0x0}, - 38: {region: 0x105, script: 0x1e, flags: 0x0}, - 39: {region: 0x6e, script: 0x27, flags: 0x0}, - 40: {region: 0x164, script: 0x52, flags: 0x0}, - 41: {region: 0x164, script: 0x52, flags: 0x0}, - 42: {region: 0xd5, script: 0x52, flags: 0x0}, - 43: {region: 0x164, script: 0x52, flags: 0x0}, - 45: {region: 0x164, script: 0x52, flags: 0x0}, - 46: {region: 0x164, script: 0x52, flags: 0x0}, - 47: {region: 0x164, script: 0x52, flags: 0x0}, - 48: {region: 0x164, script: 0x52, flags: 0x0}, - 49: {region: 0x164, script: 0x52, flags: 0x0}, - 50: {region: 0x164, script: 0x52, flags: 0x0}, - 51: {region: 0x94, script: 0x52, flags: 0x0}, - 52: {region: 0x164, script: 0x5, flags: 0x0}, - 53: {region: 0x121, script: 0x5, flags: 0x0}, - 54: {region: 0x164, script: 0x52, flags: 0x0}, - 55: {region: 0x164, script: 0x52, flags: 0x0}, - 56: {region: 0x164, script: 0x52, flags: 0x0}, - 57: {region: 0x164, script: 0x52, flags: 0x0}, - 58: {region: 0x6a, script: 0x5, flags: 0x0}, + 0: {region: 0x135, script: 0x55, flags: 0x0}, + 1: {region: 0x6f, script: 0x55, flags: 0x0}, + 2: {region: 0x165, script: 0x55, flags: 0x0}, + 3: {region: 0x165, script: 0x55, flags: 0x0}, + 4: {region: 0x165, script: 0x55, flags: 0x0}, + 5: {region: 0x7d, script: 0x1e, flags: 0x0}, + 6: {region: 0x165, script: 0x55, flags: 0x0}, + 7: {region: 0x165, script: 0x1e, flags: 0x0}, + 8: {region: 0x80, script: 0x55, flags: 0x0}, + 9: {region: 0x165, script: 0x55, flags: 0x0}, + 10: {region: 0x165, script: 0x55, flags: 0x0}, + 11: {region: 0x165, script: 0x55, flags: 0x0}, + 12: {region: 0x95, script: 0x55, flags: 0x0}, + 13: {region: 0x131, script: 0x55, flags: 0x0}, + 14: {region: 0x80, script: 0x55, flags: 0x0}, + 15: {region: 0x165, script: 0x55, flags: 0x0}, + 16: {region: 0x165, script: 0x55, flags: 0x0}, + 17: {region: 0x106, script: 0x1e, flags: 0x0}, + 18: {region: 0x165, script: 0x55, flags: 0x0}, + 19: {region: 0x9c, script: 0x9, flags: 0x0}, + 20: {region: 0x128, script: 0x5, flags: 0x0}, + 21: {region: 0x165, script: 0x55, flags: 0x0}, + 22: {region: 0x161, script: 0x55, flags: 0x0}, + 23: {region: 0x165, script: 0x55, flags: 0x0}, + 24: {region: 0x165, script: 0x55, flags: 0x0}, + 25: {region: 0x165, script: 0x55, flags: 0x0}, + 26: {region: 0x165, script: 0x55, flags: 0x0}, + 27: {region: 0x165, script: 0x55, flags: 0x0}, + 28: {region: 0x52, script: 0x55, flags: 0x0}, + 29: {region: 0x165, script: 0x55, flags: 0x0}, + 30: {region: 0x165, script: 0x55, flags: 0x0}, + 31: {region: 0x99, script: 0x4, flags: 0x0}, + 32: {region: 0x165, script: 0x55, flags: 0x0}, + 33: {region: 0x80, script: 0x55, flags: 0x0}, + 34: {region: 0x9b, script: 0xe4, flags: 0x0}, + 35: {region: 0x165, script: 0x55, flags: 0x0}, + 36: {region: 0x165, script: 0x55, flags: 0x0}, + 37: {region: 0x14d, script: 0x55, flags: 0x0}, + 38: {region: 0x106, script: 0x1e, flags: 0x0}, + 39: {region: 0x6f, script: 0x28, flags: 0x0}, + 40: {region: 0x165, script: 0x55, flags: 0x0}, + 41: {region: 0x165, script: 0x55, flags: 0x0}, + 42: {region: 0xd6, script: 0x55, flags: 0x0}, + 43: {region: 0x165, script: 0x55, flags: 0x0}, + 45: {region: 0x165, script: 0x55, flags: 0x0}, + 46: {region: 0x165, script: 0x55, flags: 0x0}, + 47: {region: 0x165, script: 0x55, flags: 0x0}, + 48: {region: 0x165, script: 0x55, flags: 0x0}, + 49: {region: 0x165, script: 0x55, flags: 0x0}, + 50: {region: 0x165, script: 0x55, flags: 0x0}, + 51: {region: 0x95, script: 0x55, flags: 0x0}, + 52: {region: 0x165, script: 0x5, flags: 0x0}, + 53: {region: 0x122, script: 0x5, flags: 0x0}, + 54: {region: 0x165, script: 0x55, flags: 0x0}, + 55: {region: 0x165, script: 0x55, flags: 0x0}, + 56: {region: 0x165, script: 0x55, flags: 0x0}, + 57: {region: 0x165, script: 0x55, flags: 0x0}, + 58: {region: 0x6b, script: 0x5, flags: 0x0}, 59: {region: 0x0, script: 0x3, flags: 0x1}, - 60: {region: 0x164, script: 0x52, flags: 0x0}, - 61: {region: 0x50, script: 0x52, flags: 0x0}, - 62: {region: 0x3e, script: 0x52, flags: 0x0}, - 63: {region: 0x66, script: 0x5, flags: 0x0}, - 65: {region: 0xb9, script: 0x5, flags: 0x0}, - 66: {region: 0x6a, script: 0x5, flags: 0x0}, - 67: {region: 0x98, script: 0xe, flags: 0x0}, - 68: {region: 0x12e, script: 0x52, flags: 0x0}, - 69: {region: 0x134, script: 0xbc, flags: 0x0}, - 70: {region: 0x164, script: 0x52, flags: 0x0}, - 71: {region: 0x164, script: 0x52, flags: 0x0}, - 72: {region: 0x6d, script: 0x52, flags: 0x0}, - 73: {region: 0x164, script: 0x52, flags: 0x0}, - 74: {region: 0x164, script: 0x52, flags: 0x0}, - 75: {region: 0x48, script: 0x52, flags: 0x0}, - 76: {region: 0x164, script: 0x52, flags: 0x0}, - 77: {region: 0x105, script: 0x1e, flags: 0x0}, - 78: {region: 0x164, script: 0x5, flags: 0x0}, - 79: {region: 0x164, script: 0x52, flags: 0x0}, - 80: {region: 0x164, script: 0x52, flags: 0x0}, - 81: {region: 0x164, script: 0x52, flags: 0x0}, - 82: {region: 0x98, script: 0x20, flags: 0x0}, - 83: {region: 0x164, script: 0x52, flags: 0x0}, - 84: {region: 0x164, script: 0x52, flags: 0x0}, - 85: {region: 0x164, script: 0x52, flags: 0x0}, - 86: {region: 0x3e, script: 0x52, flags: 0x0}, - 87: {region: 0x164, script: 0x52, flags: 0x0}, + 60: {region: 0x165, script: 0x55, flags: 0x0}, + 61: {region: 0x51, script: 0x55, flags: 0x0}, + 62: {region: 0x3f, script: 0x55, flags: 0x0}, + 63: {region: 0x67, script: 0x5, flags: 0x0}, + 65: {region: 0xba, script: 0x5, flags: 0x0}, + 66: {region: 0x6b, script: 0x5, flags: 0x0}, + 67: {region: 0x99, script: 0xe, flags: 0x0}, + 68: {region: 0x12f, script: 0x55, flags: 0x0}, + 69: {region: 0x135, script: 0xc1, flags: 0x0}, + 70: {region: 0x165, script: 0x55, flags: 0x0}, + 71: {region: 0x165, script: 0x55, flags: 0x0}, + 72: {region: 0x6e, script: 0x55, flags: 0x0}, + 73: {region: 0x165, script: 0x55, flags: 0x0}, + 74: {region: 0x165, script: 0x55, flags: 0x0}, + 75: {region: 0x49, script: 0x55, flags: 0x0}, + 76: {region: 0x165, script: 0x55, flags: 0x0}, + 77: {region: 0x106, script: 0x1e, flags: 0x0}, + 78: {region: 0x165, script: 0x5, flags: 0x0}, + 79: {region: 0x165, script: 0x55, flags: 0x0}, + 80: {region: 0x165, script: 0x55, flags: 0x0}, + 81: {region: 0x165, script: 0x55, flags: 0x0}, + 82: {region: 0x99, script: 0x20, flags: 0x0}, + 83: {region: 0x165, script: 0x55, flags: 0x0}, + 84: {region: 0x165, script: 0x55, flags: 0x0}, + 85: {region: 0x165, script: 0x55, flags: 0x0}, + 86: {region: 0x3f, script: 0x55, flags: 0x0}, + 87: {region: 0x165, script: 0x55, flags: 0x0}, 88: {region: 0x3, script: 0x5, flags: 0x1}, - 89: {region: 0x105, script: 0x1e, flags: 0x0}, - 90: {region: 0xe7, script: 0x5, flags: 0x0}, - 91: {region: 0x94, script: 0x52, flags: 0x0}, - 92: {region: 0xda, script: 0x20, flags: 0x0}, - 93: {region: 0x2d, script: 0x52, flags: 0x0}, - 94: {region: 0x51, script: 0x52, flags: 0x0}, - 95: {region: 0x164, script: 0x52, flags: 0x0}, - 96: {region: 0x51, script: 0xb, flags: 0x0}, - 97: {region: 0x164, script: 0x52, flags: 0x0}, - 98: {region: 0x164, script: 0x52, flags: 0x0}, - 99: {region: 0x94, script: 0x52, flags: 0x0}, - 100: {region: 0x164, script: 0x52, flags: 0x0}, - 101: {region: 0x51, script: 0x52, flags: 0x0}, - 102: {region: 0x164, script: 0x52, flags: 0x0}, - 103: {region: 0x164, script: 0x52, flags: 0x0}, - 104: {region: 0x164, script: 0x52, flags: 0x0}, - 105: {region: 0x164, script: 0x52, flags: 0x0}, - 106: {region: 0x4e, script: 0x52, flags: 0x0}, - 107: {region: 0x164, script: 0x52, flags: 0x0}, - 108: {region: 0x164, script: 0x52, flags: 0x0}, - 109: {region: 0x164, script: 0x52, flags: 0x0}, - 110: {region: 0x164, script: 0x27, flags: 0x0}, - 111: {region: 0x164, script: 0x52, flags: 0x0}, - 112: {region: 0x164, script: 0x52, flags: 0x0}, - 113: {region: 0x46, script: 0x1e, flags: 0x0}, - 114: {region: 0x164, script: 0x52, flags: 0x0}, - 115: {region: 0x164, script: 0x52, flags: 0x0}, - 116: {region: 0x10a, script: 0x5, flags: 0x0}, - 117: {region: 0x161, script: 0x52, flags: 0x0}, - 118: {region: 0x164, script: 0x52, flags: 0x0}, - 119: {region: 0x94, script: 0x52, flags: 0x0}, - 120: {region: 0x164, script: 0x52, flags: 0x0}, - 121: {region: 0x12e, script: 0x52, flags: 0x0}, - 122: {region: 0x51, script: 0x52, flags: 0x0}, - 123: {region: 0x98, script: 0xcd, flags: 0x0}, - 124: {region: 0xe7, script: 0x5, flags: 0x0}, - 125: {region: 0x98, script: 0x20, flags: 0x0}, - 126: {region: 0x37, script: 0x1e, flags: 0x0}, - 127: {region: 0x98, script: 0x20, flags: 0x0}, - 128: {region: 0xe7, script: 0x5, flags: 0x0}, - 129: {region: 0x12a, script: 0x2d, flags: 0x0}, - 131: {region: 0x98, script: 0x20, flags: 0x0}, - 132: {region: 0x164, script: 0x52, flags: 0x0}, - 133: {region: 0x98, script: 0x20, flags: 0x0}, - 134: {region: 0xe6, script: 0x52, flags: 0x0}, - 135: {region: 0x164, script: 0x52, flags: 0x0}, - 136: {region: 0x98, script: 0x20, flags: 0x0}, - 137: {region: 0x164, script: 0x52, flags: 0x0}, - 138: {region: 0x13e, script: 0x52, flags: 0x0}, - 139: {region: 0x164, script: 0x52, flags: 0x0}, - 140: {region: 0x164, script: 0x52, flags: 0x0}, - 141: {region: 0xe6, script: 0x52, flags: 0x0}, - 142: {region: 0x164, script: 0x52, flags: 0x0}, - 143: {region: 0xd5, script: 0x52, flags: 0x0}, - 144: {region: 0x164, script: 0x52, flags: 0x0}, - 145: {region: 0x164, script: 0x52, flags: 0x0}, - 146: {region: 0x164, script: 0x52, flags: 0x0}, - 147: {region: 0x164, script: 0x27, flags: 0x0}, - 148: {region: 0x98, script: 0x20, flags: 0x0}, - 149: {region: 0x94, script: 0x52, flags: 0x0}, - 150: {region: 0x164, script: 0x52, flags: 0x0}, - 151: {region: 0x164, script: 0x52, flags: 0x0}, - 152: {region: 0x113, script: 0x52, flags: 0x0}, - 153: {region: 0x164, script: 0x52, flags: 0x0}, - 154: {region: 0x164, script: 0x52, flags: 0x0}, - 155: {region: 0x51, script: 0x52, flags: 0x0}, - 156: {region: 0x164, script: 0x52, flags: 0x0}, - 157: {region: 0xe6, script: 0x52, flags: 0x0}, - 158: {region: 0x164, script: 0x52, flags: 0x0}, - 159: {region: 0x13d, script: 0xcf, flags: 0x0}, - 160: {region: 0xc2, script: 0x52, flags: 0x0}, - 161: {region: 0x164, script: 0x52, flags: 0x0}, - 162: {region: 0x164, script: 0x52, flags: 0x0}, - 163: {region: 0xc2, script: 0x52, flags: 0x0}, - 164: {region: 0x164, script: 0x52, flags: 0x0}, - 165: {region: 0x34, script: 0xe, flags: 0x0}, - 166: {region: 0x164, script: 0x52, flags: 0x0}, - 167: {region: 0x164, script: 0x52, flags: 0x0}, - 168: {region: 0x164, script: 0x52, flags: 0x0}, - 169: {region: 0x52, script: 0xd6, flags: 0x0}, - 170: {region: 0x164, script: 0x52, flags: 0x0}, - 171: {region: 0x164, script: 0x52, flags: 0x0}, - 172: {region: 0x164, script: 0x52, flags: 0x0}, - 173: {region: 0x98, script: 0xe, flags: 0x0}, - 174: {region: 0x164, script: 0x52, flags: 0x0}, - 175: {region: 0x9b, script: 0x5, flags: 0x0}, - 176: {region: 0x164, script: 0x52, flags: 0x0}, - 177: {region: 0x4e, script: 0x52, flags: 0x0}, - 178: {region: 0x77, script: 0x52, flags: 0x0}, - 179: {region: 0x98, script: 0x20, flags: 0x0}, - 180: {region: 0xe7, script: 0x5, flags: 0x0}, - 181: {region: 0x98, script: 0x20, flags: 0x0}, - 182: {region: 0x164, script: 0x52, flags: 0x0}, - 183: {region: 0x32, script: 0x52, flags: 0x0}, - 184: {region: 0x164, script: 0x52, flags: 0x0}, - 185: {region: 0xb3, script: 0xc, flags: 0x0}, - 186: {region: 0x51, script: 0x52, flags: 0x0}, - 187: {region: 0x164, script: 0x27, flags: 0x0}, - 188: {region: 0xe6, script: 0x52, flags: 0x0}, - 189: {region: 0x164, script: 0x52, flags: 0x0}, - 190: {region: 0xe7, script: 0x20, flags: 0x0}, - 191: {region: 0x105, script: 0x1e, flags: 0x0}, - 192: {region: 0x15e, script: 0x52, flags: 0x0}, - 193: {region: 0x164, script: 0x52, flags: 0x0}, - 194: {region: 0x94, script: 0x52, flags: 0x0}, - 195: {region: 0x164, script: 0x52, flags: 0x0}, - 196: {region: 0x51, script: 0x52, flags: 0x0}, - 197: {region: 0x164, script: 0x52, flags: 0x0}, - 198: {region: 0x164, script: 0x52, flags: 0x0}, - 199: {region: 0x164, script: 0x52, flags: 0x0}, - 200: {region: 0x85, script: 0x52, flags: 0x0}, - 201: {region: 0x164, script: 0x52, flags: 0x0}, - 202: {region: 0x164, script: 0x52, flags: 0x0}, - 203: {region: 0x164, script: 0x52, flags: 0x0}, - 204: {region: 0x164, script: 0x52, flags: 0x0}, - 205: {region: 0x6c, script: 0x27, flags: 0x0}, - 206: {region: 0x164, script: 0x52, flags: 0x0}, - 207: {region: 0x164, script: 0x52, flags: 0x0}, - 208: {region: 0x51, script: 0x52, flags: 0x0}, - 209: {region: 0x164, script: 0x52, flags: 0x0}, - 210: {region: 0x164, script: 0x52, flags: 0x0}, - 211: {region: 0xc2, script: 0x52, flags: 0x0}, - 212: {region: 0x164, script: 0x52, flags: 0x0}, - 213: {region: 0x164, script: 0x52, flags: 0x0}, - 214: {region: 0x164, script: 0x52, flags: 0x0}, - 215: {region: 0x6d, script: 0x52, flags: 0x0}, - 216: {region: 0x164, script: 0x52, flags: 0x0}, - 217: {region: 0x164, script: 0x52, flags: 0x0}, - 218: {region: 0xd5, script: 0x52, flags: 0x0}, - 219: {region: 0x34, script: 0x16, flags: 0x0}, - 220: {region: 0x105, script: 0x1e, flags: 0x0}, - 221: {region: 0xe6, script: 0x52, flags: 0x0}, - 222: {region: 0x164, script: 0x52, flags: 0x0}, - 223: {region: 0x130, script: 0x52, flags: 0x0}, - 224: {region: 0x89, script: 0x52, flags: 0x0}, - 225: {region: 0x74, script: 0x52, flags: 0x0}, - 226: {region: 0x105, script: 0x1e, flags: 0x0}, - 227: {region: 0x134, script: 0x52, flags: 0x0}, - 228: {region: 0x48, script: 0x52, flags: 0x0}, - 229: {region: 0x134, script: 0x1a, flags: 0x0}, - 230: {region: 0xa5, script: 0x5, flags: 0x0}, - 231: {region: 0x13d, script: 0x19, flags: 0x0}, - 232: {region: 0x164, script: 0x52, flags: 0x0}, - 233: {region: 0x9a, script: 0x5, flags: 0x0}, - 234: {region: 0x164, script: 0x52, flags: 0x0}, - 235: {region: 0x164, script: 0x52, flags: 0x0}, - 236: {region: 0x164, script: 0x52, flags: 0x0}, - 237: {region: 0x164, script: 0x52, flags: 0x0}, - 238: {region: 0x164, script: 0x52, flags: 0x0}, - 239: {region: 0x77, script: 0x52, flags: 0x0}, - 240: {region: 0x6a, script: 0x1c, flags: 0x0}, - 241: {region: 0xe6, script: 0x52, flags: 0x0}, - 242: {region: 0x48, script: 0x17, flags: 0x0}, - 243: {region: 0x12f, script: 0x1e, flags: 0x0}, - 244: {region: 0x48, script: 0x17, flags: 0x0}, - 245: {region: 0x48, script: 0x17, flags: 0x0}, - 246: {region: 0x48, script: 0x17, flags: 0x0}, - 247: {region: 0x48, script: 0x17, flags: 0x0}, - 248: {region: 0x109, script: 0x52, flags: 0x0}, - 249: {region: 0x5d, script: 0x52, flags: 0x0}, - 250: {region: 0xe8, script: 0x52, flags: 0x0}, - 251: {region: 0x48, script: 0x17, flags: 0x0}, - 252: {region: 0xc3, script: 0x79, flags: 0x0}, + 89: {region: 0x106, script: 0x1e, flags: 0x0}, + 90: {region: 0xe8, script: 0x5, flags: 0x0}, + 91: {region: 0x95, script: 0x55, flags: 0x0}, + 92: {region: 0xdb, script: 0x20, flags: 0x0}, + 93: {region: 0x2e, script: 0x55, flags: 0x0}, + 94: {region: 0x52, script: 0x55, flags: 0x0}, + 95: {region: 0x165, script: 0x55, flags: 0x0}, + 96: {region: 0x52, script: 0xb, flags: 0x0}, + 97: {region: 0x165, script: 0x55, flags: 0x0}, + 98: {region: 0x165, script: 0x55, flags: 0x0}, + 99: {region: 0x95, script: 0x55, flags: 0x0}, + 100: {region: 0x165, script: 0x55, flags: 0x0}, + 101: {region: 0x52, script: 0x55, flags: 0x0}, + 102: {region: 0x165, script: 0x55, flags: 0x0}, + 103: {region: 0x165, script: 0x55, flags: 0x0}, + 104: {region: 0x165, script: 0x55, flags: 0x0}, + 105: {region: 0x165, script: 0x55, flags: 0x0}, + 106: {region: 0x4f, script: 0x55, flags: 0x0}, + 107: {region: 0x165, script: 0x55, flags: 0x0}, + 108: {region: 0x165, script: 0x55, flags: 0x0}, + 109: {region: 0x165, script: 0x55, flags: 0x0}, + 110: {region: 0x165, script: 0x28, flags: 0x0}, + 111: {region: 0x165, script: 0x55, flags: 0x0}, + 112: {region: 0x165, script: 0x55, flags: 0x0}, + 113: {region: 0x47, script: 0x1e, flags: 0x0}, + 114: {region: 0x165, script: 0x55, flags: 0x0}, + 115: {region: 0x165, script: 0x55, flags: 0x0}, + 116: {region: 0x10b, script: 0x5, flags: 0x0}, + 117: {region: 0x162, script: 0x55, flags: 0x0}, + 118: {region: 0x165, script: 0x55, flags: 0x0}, + 119: {region: 0x95, script: 0x55, flags: 0x0}, + 120: {region: 0x165, script: 0x55, flags: 0x0}, + 121: {region: 0x12f, script: 0x55, flags: 0x0}, + 122: {region: 0x52, script: 0x55, flags: 0x0}, + 123: {region: 0x99, script: 0xd3, flags: 0x0}, + 124: {region: 0xe8, script: 0x5, flags: 0x0}, + 125: {region: 0x99, script: 0x20, flags: 0x0}, + 126: {region: 0x38, script: 0x1e, flags: 0x0}, + 127: {region: 0x99, script: 0x20, flags: 0x0}, + 128: {region: 0xe8, script: 0x5, flags: 0x0}, + 129: {region: 0x12b, script: 0x30, flags: 0x0}, + 131: {region: 0x99, script: 0x20, flags: 0x0}, + 132: {region: 0x165, script: 0x55, flags: 0x0}, + 133: {region: 0x99, script: 0x20, flags: 0x0}, + 134: {region: 0xe7, script: 0x55, flags: 0x0}, + 135: {region: 0x165, script: 0x55, flags: 0x0}, + 136: {region: 0x99, script: 0x20, flags: 0x0}, + 137: {region: 0x165, script: 0x55, flags: 0x0}, + 138: {region: 0x13f, script: 0x55, flags: 0x0}, + 139: {region: 0x165, script: 0x55, flags: 0x0}, + 140: {region: 0x165, script: 0x55, flags: 0x0}, + 141: {region: 0xe7, script: 0x55, flags: 0x0}, + 142: {region: 0x165, script: 0x55, flags: 0x0}, + 143: {region: 0xd6, script: 0x55, flags: 0x0}, + 144: {region: 0x165, script: 0x55, flags: 0x0}, + 145: {region: 0x165, script: 0x55, flags: 0x0}, + 146: {region: 0x165, script: 0x55, flags: 0x0}, + 147: {region: 0x165, script: 0x28, flags: 0x0}, + 148: {region: 0x99, script: 0x20, flags: 0x0}, + 149: {region: 0x95, script: 0x55, flags: 0x0}, + 150: {region: 0x165, script: 0x55, flags: 0x0}, + 151: {region: 0x165, script: 0x55, flags: 0x0}, + 152: {region: 0x114, script: 0x55, flags: 0x0}, + 153: {region: 0x165, script: 0x55, flags: 0x0}, + 154: {region: 0x165, script: 0x55, flags: 0x0}, + 155: {region: 0x52, script: 0x55, flags: 0x0}, + 156: {region: 0x165, script: 0x55, flags: 0x0}, + 157: {region: 0xe7, script: 0x55, flags: 0x0}, + 158: {region: 0x165, script: 0x55, flags: 0x0}, + 159: {region: 0x13e, script: 0xd5, flags: 0x0}, + 160: {region: 0xc3, script: 0x55, flags: 0x0}, + 161: {region: 0x165, script: 0x55, flags: 0x0}, + 162: {region: 0x165, script: 0x55, flags: 0x0}, + 163: {region: 0xc3, script: 0x55, flags: 0x0}, + 164: {region: 0x165, script: 0x55, flags: 0x0}, + 165: {region: 0x35, script: 0xe, flags: 0x0}, + 166: {region: 0x165, script: 0x55, flags: 0x0}, + 167: {region: 0x165, script: 0x55, flags: 0x0}, + 168: {region: 0x165, script: 0x55, flags: 0x0}, + 169: {region: 0x53, script: 0xdc, flags: 0x0}, + 170: {region: 0x165, script: 0x55, flags: 0x0}, + 171: {region: 0x165, script: 0x55, flags: 0x0}, + 172: {region: 0x165, script: 0x55, flags: 0x0}, + 173: {region: 0x99, script: 0xe, flags: 0x0}, + 174: {region: 0x165, script: 0x55, flags: 0x0}, + 175: {region: 0x9c, script: 0x5, flags: 0x0}, + 176: {region: 0x165, script: 0x55, flags: 0x0}, + 177: {region: 0x4f, script: 0x55, flags: 0x0}, + 178: {region: 0x78, script: 0x55, flags: 0x0}, + 179: {region: 0x99, script: 0x20, flags: 0x0}, + 180: {region: 0xe8, script: 0x5, flags: 0x0}, + 181: {region: 0x99, script: 0x20, flags: 0x0}, + 182: {region: 0x165, script: 0x55, flags: 0x0}, + 183: {region: 0x33, script: 0x55, flags: 0x0}, + 184: {region: 0x165, script: 0x55, flags: 0x0}, + 185: {region: 0xb4, script: 0xc, flags: 0x0}, + 186: {region: 0x52, script: 0x55, flags: 0x0}, + 187: {region: 0x165, script: 0x28, flags: 0x0}, + 188: {region: 0xe7, script: 0x55, flags: 0x0}, + 189: {region: 0x165, script: 0x55, flags: 0x0}, + 190: {region: 0xe8, script: 0x20, flags: 0x0}, + 191: {region: 0x106, script: 0x1e, flags: 0x0}, + 192: {region: 0x15f, script: 0x55, flags: 0x0}, + 193: {region: 0x165, script: 0x55, flags: 0x0}, + 194: {region: 0x95, script: 0x55, flags: 0x0}, + 195: {region: 0x165, script: 0x55, flags: 0x0}, + 196: {region: 0x52, script: 0x55, flags: 0x0}, + 197: {region: 0x165, script: 0x55, flags: 0x0}, + 198: {region: 0x165, script: 0x55, flags: 0x0}, + 199: {region: 0x165, script: 0x55, flags: 0x0}, + 200: {region: 0x86, script: 0x55, flags: 0x0}, + 201: {region: 0x165, script: 0x55, flags: 0x0}, + 202: {region: 0x165, script: 0x55, flags: 0x0}, + 203: {region: 0x165, script: 0x55, flags: 0x0}, + 204: {region: 0x165, script: 0x55, flags: 0x0}, + 205: {region: 0x6d, script: 0x28, flags: 0x0}, + 206: {region: 0x165, script: 0x55, flags: 0x0}, + 207: {region: 0x165, script: 0x55, flags: 0x0}, + 208: {region: 0x52, script: 0x55, flags: 0x0}, + 209: {region: 0x165, script: 0x55, flags: 0x0}, + 210: {region: 0x165, script: 0x55, flags: 0x0}, + 211: {region: 0xc3, script: 0x55, flags: 0x0}, + 212: {region: 0x165, script: 0x55, flags: 0x0}, + 213: {region: 0x165, script: 0x55, flags: 0x0}, + 214: {region: 0x165, script: 0x55, flags: 0x0}, + 215: {region: 0x6e, script: 0x55, flags: 0x0}, + 216: {region: 0x165, script: 0x55, flags: 0x0}, + 217: {region: 0x165, script: 0x55, flags: 0x0}, + 218: {region: 0xd6, script: 0x55, flags: 0x0}, + 219: {region: 0x35, script: 0x16, flags: 0x0}, + 220: {region: 0x106, script: 0x1e, flags: 0x0}, + 221: {region: 0xe7, script: 0x55, flags: 0x0}, + 222: {region: 0x165, script: 0x55, flags: 0x0}, + 223: {region: 0x131, script: 0x55, flags: 0x0}, + 224: {region: 0x8a, script: 0x55, flags: 0x0}, + 225: {region: 0x75, script: 0x55, flags: 0x0}, + 226: {region: 0x106, script: 0x1e, flags: 0x0}, + 227: {region: 0x135, script: 0x55, flags: 0x0}, + 228: {region: 0x49, script: 0x55, flags: 0x0}, + 229: {region: 0x135, script: 0x1a, flags: 0x0}, + 230: {region: 0xa6, script: 0x5, flags: 0x0}, + 231: {region: 0x13e, script: 0x19, flags: 0x0}, + 232: {region: 0x165, script: 0x55, flags: 0x0}, + 233: {region: 0x9b, script: 0x5, flags: 0x0}, + 234: {region: 0x165, script: 0x55, flags: 0x0}, + 235: {region: 0x165, script: 0x55, flags: 0x0}, + 236: {region: 0x165, script: 0x55, flags: 0x0}, + 237: {region: 0x165, script: 0x55, flags: 0x0}, + 238: {region: 0x165, script: 0x55, flags: 0x0}, + 239: {region: 0x78, script: 0x55, flags: 0x0}, + 240: {region: 0x6b, script: 0x1c, flags: 0x0}, + 241: {region: 0xe7, script: 0x55, flags: 0x0}, + 242: {region: 0x49, script: 0x17, flags: 0x0}, + 243: {region: 0x130, script: 0x1e, flags: 0x0}, + 244: {region: 0x49, script: 0x17, flags: 0x0}, + 245: {region: 0x49, script: 0x17, flags: 0x0}, + 246: {region: 0x49, script: 0x17, flags: 0x0}, + 247: {region: 0x49, script: 0x17, flags: 0x0}, + 248: {region: 0x10a, script: 0x55, flags: 0x0}, + 249: {region: 0x5e, script: 0x55, flags: 0x0}, + 250: {region: 0xe9, script: 0x55, flags: 0x0}, + 251: {region: 0x49, script: 0x17, flags: 0x0}, + 252: {region: 0xc4, script: 0x7e, flags: 0x0}, 253: {region: 0x8, script: 0x2, flags: 0x1}, - 254: {region: 0x105, script: 0x1e, flags: 0x0}, - 255: {region: 0x7a, script: 0x52, flags: 0x0}, - 256: {region: 0x62, script: 0x52, flags: 0x0}, - 257: {region: 0x164, script: 0x52, flags: 0x0}, - 258: {region: 0x164, script: 0x52, flags: 0x0}, - 259: {region: 0x164, script: 0x52, flags: 0x0}, - 260: {region: 0x164, script: 0x52, flags: 0x0}, - 261: {region: 0x134, script: 0x52, flags: 0x0}, - 262: {region: 0x105, script: 0x1e, flags: 0x0}, - 263: {region: 0xa3, script: 0x52, flags: 0x0}, - 264: {region: 0x164, script: 0x52, flags: 0x0}, - 265: {region: 0x164, script: 0x52, flags: 0x0}, - 266: {region: 0x98, script: 0x5, flags: 0x0}, - 267: {region: 0x164, script: 0x52, flags: 0x0}, - 268: {region: 0x5f, script: 0x52, flags: 0x0}, - 269: {region: 0x164, script: 0x52, flags: 0x0}, - 270: {region: 0x48, script: 0x52, flags: 0x0}, - 271: {region: 0x164, script: 0x52, flags: 0x0}, - 272: {region: 0x164, script: 0x52, flags: 0x0}, - 273: {region: 0x164, script: 0x52, flags: 0x0}, - 274: {region: 0x164, script: 0x5, flags: 0x0}, - 275: {region: 0x48, script: 0x52, flags: 0x0}, - 276: {region: 0x164, script: 0x52, flags: 0x0}, - 277: {region: 0x164, script: 0x52, flags: 0x0}, - 278: {region: 0xd3, script: 0x52, flags: 0x0}, - 279: {region: 0x4e, script: 0x52, flags: 0x0}, - 280: {region: 0x164, script: 0x52, flags: 0x0}, - 281: {region: 0x98, script: 0x5, flags: 0x0}, - 282: {region: 0x164, script: 0x52, flags: 0x0}, - 283: {region: 0x164, script: 0x52, flags: 0x0}, - 284: {region: 0x164, script: 0x52, flags: 0x0}, - 285: {region: 0x164, script: 0x27, flags: 0x0}, - 286: {region: 0x5f, script: 0x52, flags: 0x0}, - 287: {region: 0xc2, script: 0x52, flags: 0x0}, - 288: {region: 0xcf, script: 0x52, flags: 0x0}, - 289: {region: 0x164, script: 0x52, flags: 0x0}, - 290: {region: 0xda, script: 0x20, flags: 0x0}, - 291: {region: 0x51, script: 0x52, flags: 0x0}, - 292: {region: 0x164, script: 0x52, flags: 0x0}, - 293: {region: 0x164, script: 0x52, flags: 0x0}, - 294: {region: 0x164, script: 0x52, flags: 0x0}, - 295: {region: 0xcc, script: 0xd4, flags: 0x0}, - 296: {region: 0x164, script: 0x52, flags: 0x0}, - 297: {region: 0x164, script: 0x52, flags: 0x0}, - 298: {region: 0x113, script: 0x52, flags: 0x0}, - 299: {region: 0x36, script: 0x52, flags: 0x0}, - 300: {region: 0x42, script: 0xd6, flags: 0x0}, - 301: {region: 0x164, script: 0x52, flags: 0x0}, - 302: {region: 0xa3, script: 0x52, flags: 0x0}, - 303: {region: 0x7f, script: 0x52, flags: 0x0}, - 304: {region: 0xd5, script: 0x52, flags: 0x0}, - 305: {region: 0x9d, script: 0x52, flags: 0x0}, - 306: {region: 0x6a, script: 0x25, flags: 0x0}, - 307: {region: 0x164, script: 0x52, flags: 0x0}, - 308: {region: 0xc3, script: 0x43, flags: 0x0}, - 309: {region: 0x86, script: 0x2d, flags: 0x0}, - 310: {region: 0x164, script: 0x52, flags: 0x0}, - 311: {region: 0x164, script: 0x52, flags: 0x0}, + 254: {region: 0x106, script: 0x1e, flags: 0x0}, + 255: {region: 0x7b, script: 0x55, flags: 0x0}, + 256: {region: 0x63, script: 0x55, flags: 0x0}, + 257: {region: 0x165, script: 0x55, flags: 0x0}, + 258: {region: 0x165, script: 0x55, flags: 0x0}, + 259: {region: 0x165, script: 0x55, flags: 0x0}, + 260: {region: 0x165, script: 0x55, flags: 0x0}, + 261: {region: 0x135, script: 0x55, flags: 0x0}, + 262: {region: 0x106, script: 0x1e, flags: 0x0}, + 263: {region: 0xa4, script: 0x55, flags: 0x0}, + 264: {region: 0x165, script: 0x55, flags: 0x0}, + 265: {region: 0x165, script: 0x55, flags: 0x0}, + 266: {region: 0x99, script: 0x5, flags: 0x0}, + 267: {region: 0x165, script: 0x55, flags: 0x0}, + 268: {region: 0x60, script: 0x55, flags: 0x0}, + 269: {region: 0x165, script: 0x55, flags: 0x0}, + 270: {region: 0x49, script: 0x55, flags: 0x0}, + 271: {region: 0x165, script: 0x55, flags: 0x0}, + 272: {region: 0x165, script: 0x55, flags: 0x0}, + 273: {region: 0x165, script: 0x55, flags: 0x0}, + 274: {region: 0x165, script: 0x5, flags: 0x0}, + 275: {region: 0x49, script: 0x55, flags: 0x0}, + 276: {region: 0x165, script: 0x55, flags: 0x0}, + 277: {region: 0x165, script: 0x55, flags: 0x0}, + 278: {region: 0xd4, script: 0x55, flags: 0x0}, + 279: {region: 0x4f, script: 0x55, flags: 0x0}, + 280: {region: 0x165, script: 0x55, flags: 0x0}, + 281: {region: 0x99, script: 0x5, flags: 0x0}, + 282: {region: 0x165, script: 0x55, flags: 0x0}, + 283: {region: 0x165, script: 0x55, flags: 0x0}, + 284: {region: 0x165, script: 0x55, flags: 0x0}, + 285: {region: 0x165, script: 0x28, flags: 0x0}, + 286: {region: 0x60, script: 0x55, flags: 0x0}, + 287: {region: 0xc3, script: 0x55, flags: 0x0}, + 288: {region: 0xd0, script: 0x55, flags: 0x0}, + 289: {region: 0x165, script: 0x55, flags: 0x0}, + 290: {region: 0xdb, script: 0x20, flags: 0x0}, + 291: {region: 0x52, script: 0x55, flags: 0x0}, + 292: {region: 0x165, script: 0x55, flags: 0x0}, + 293: {region: 0x165, script: 0x55, flags: 0x0}, + 294: {region: 0x165, script: 0x55, flags: 0x0}, + 295: {region: 0xcd, script: 0xda, flags: 0x0}, + 296: {region: 0x165, script: 0x55, flags: 0x0}, + 297: {region: 0x165, script: 0x55, flags: 0x0}, + 298: {region: 0x114, script: 0x55, flags: 0x0}, + 299: {region: 0x37, script: 0x55, flags: 0x0}, + 300: {region: 0x43, script: 0xdc, flags: 0x0}, + 301: {region: 0x165, script: 0x55, flags: 0x0}, + 302: {region: 0xa4, script: 0x55, flags: 0x0}, + 303: {region: 0x80, script: 0x55, flags: 0x0}, + 304: {region: 0xd6, script: 0x55, flags: 0x0}, + 305: {region: 0x9e, script: 0x55, flags: 0x0}, + 306: {region: 0x6b, script: 0x26, flags: 0x0}, + 307: {region: 0x165, script: 0x55, flags: 0x0}, + 308: {region: 0xc4, script: 0x46, flags: 0x0}, + 309: {region: 0x87, script: 0x30, flags: 0x0}, + 310: {region: 0x165, script: 0x55, flags: 0x0}, + 311: {region: 0x165, script: 0x55, flags: 0x0}, 312: {region: 0xa, script: 0x2, flags: 0x1}, - 313: {region: 0x164, script: 0x52, flags: 0x0}, - 314: {region: 0x164, script: 0x52, flags: 0x0}, - 315: {region: 0x1, script: 0x52, flags: 0x0}, - 316: {region: 0x164, script: 0x52, flags: 0x0}, - 317: {region: 0x6d, script: 0x52, flags: 0x0}, - 318: {region: 0x134, script: 0x52, flags: 0x0}, - 319: {region: 0x69, script: 0x52, flags: 0x0}, - 320: {region: 0x164, script: 0x52, flags: 0x0}, - 321: {region: 0x9d, script: 0x3e, flags: 0x0}, - 322: {region: 0x164, script: 0x52, flags: 0x0}, - 323: {region: 0x164, script: 0x52, flags: 0x0}, - 324: {region: 0x6d, script: 0x52, flags: 0x0}, - 325: {region: 0x51, script: 0x52, flags: 0x0}, - 326: {region: 0x6d, script: 0x52, flags: 0x0}, - 327: {region: 0x9b, script: 0x5, flags: 0x0}, - 328: {region: 0x164, script: 0x52, flags: 0x0}, - 329: {region: 0x164, script: 0x52, flags: 0x0}, - 330: {region: 0x164, script: 0x52, flags: 0x0}, - 331: {region: 0x164, script: 0x52, flags: 0x0}, - 332: {region: 0x85, script: 0x52, flags: 0x0}, + 313: {region: 0x165, script: 0x55, flags: 0x0}, + 314: {region: 0x165, script: 0x55, flags: 0x0}, + 315: {region: 0x1, script: 0x55, flags: 0x0}, + 316: {region: 0x165, script: 0x55, flags: 0x0}, + 317: {region: 0x6e, script: 0x55, flags: 0x0}, + 318: {region: 0x135, script: 0x55, flags: 0x0}, + 319: {region: 0x6a, script: 0x55, flags: 0x0}, + 320: {region: 0x165, script: 0x55, flags: 0x0}, + 321: {region: 0x9e, script: 0x41, flags: 0x0}, + 322: {region: 0x165, script: 0x55, flags: 0x0}, + 323: {region: 0x165, script: 0x55, flags: 0x0}, + 324: {region: 0x6e, script: 0x55, flags: 0x0}, + 325: {region: 0x52, script: 0x55, flags: 0x0}, + 326: {region: 0x6e, script: 0x55, flags: 0x0}, + 327: {region: 0x9c, script: 0x5, flags: 0x0}, + 328: {region: 0x165, script: 0x55, flags: 0x0}, + 329: {region: 0x165, script: 0x55, flags: 0x0}, + 330: {region: 0x165, script: 0x55, flags: 0x0}, + 331: {region: 0x165, script: 0x55, flags: 0x0}, + 332: {region: 0x86, script: 0x55, flags: 0x0}, 333: {region: 0xc, script: 0x2, flags: 0x1}, - 334: {region: 0x164, script: 0x52, flags: 0x0}, - 335: {region: 0xc2, script: 0x52, flags: 0x0}, - 336: {region: 0x71, script: 0x52, flags: 0x0}, - 337: {region: 0x10a, script: 0x5, flags: 0x0}, - 338: {region: 0xe6, script: 0x52, flags: 0x0}, - 339: {region: 0x10b, script: 0x52, flags: 0x0}, - 340: {region: 0x72, script: 0x52, flags: 0x0}, - 341: {region: 0x164, script: 0x52, flags: 0x0}, - 342: {region: 0x164, script: 0x52, flags: 0x0}, - 343: {region: 0x75, script: 0x52, flags: 0x0}, - 344: {region: 0x164, script: 0x52, flags: 0x0}, - 345: {region: 0x3a, script: 0x52, flags: 0x0}, - 346: {region: 0x164, script: 0x52, flags: 0x0}, - 347: {region: 0x164, script: 0x52, flags: 0x0}, - 348: {region: 0x164, script: 0x52, flags: 0x0}, - 349: {region: 0x77, script: 0x52, flags: 0x0}, - 350: {region: 0x134, script: 0x52, flags: 0x0}, - 351: {region: 0x77, script: 0x52, flags: 0x0}, - 352: {region: 0x5f, script: 0x52, flags: 0x0}, - 353: {region: 0x5f, script: 0x52, flags: 0x0}, - 354: {region: 0x51, script: 0x5, flags: 0x0}, - 355: {region: 0x13f, script: 0x52, flags: 0x0}, - 356: {region: 0x164, script: 0x52, flags: 0x0}, - 357: {region: 0x83, script: 0x52, flags: 0x0}, - 358: {region: 0x164, script: 0x52, flags: 0x0}, - 359: {region: 0xd3, script: 0x52, flags: 0x0}, - 360: {region: 0x9d, script: 0x52, flags: 0x0}, - 361: {region: 0xd5, script: 0x52, flags: 0x0}, - 362: {region: 0x164, script: 0x52, flags: 0x0}, - 363: {region: 0x10a, script: 0x52, flags: 0x0}, - 364: {region: 0xd8, script: 0x52, flags: 0x0}, - 365: {region: 0x95, script: 0x52, flags: 0x0}, - 366: {region: 0x7f, script: 0x52, flags: 0x0}, - 367: {region: 0x164, script: 0x52, flags: 0x0}, - 368: {region: 0xbb, script: 0x52, flags: 0x0}, - 369: {region: 0x164, script: 0x52, flags: 0x0}, - 370: {region: 0x164, script: 0x52, flags: 0x0}, - 371: {region: 0x164, script: 0x52, flags: 0x0}, - 372: {region: 0x52, script: 0x34, flags: 0x0}, - 373: {region: 0x164, script: 0x52, flags: 0x0}, - 374: {region: 0x94, script: 0x52, flags: 0x0}, - 375: {region: 0x164, script: 0x52, flags: 0x0}, - 376: {region: 0x98, script: 0x20, flags: 0x0}, - 377: {region: 0x164, script: 0x52, flags: 0x0}, - 378: {region: 0x9b, script: 0x5, flags: 0x0}, - 379: {region: 0x7d, script: 0x52, flags: 0x0}, - 380: {region: 0x7a, script: 0x52, flags: 0x0}, - 381: {region: 0x164, script: 0x52, flags: 0x0}, - 382: {region: 0x164, script: 0x52, flags: 0x0}, - 383: {region: 0x164, script: 0x52, flags: 0x0}, - 384: {region: 0x164, script: 0x52, flags: 0x0}, - 385: {region: 0x164, script: 0x52, flags: 0x0}, - 386: {region: 0x164, script: 0x52, flags: 0x0}, - 387: {region: 0x6e, script: 0x27, flags: 0x0}, - 388: {region: 0x164, script: 0x52, flags: 0x0}, - 389: {region: 0xda, script: 0x20, flags: 0x0}, - 390: {region: 0x164, script: 0x52, flags: 0x0}, - 391: {region: 0xa6, script: 0x52, flags: 0x0}, - 392: {region: 0x164, script: 0x52, flags: 0x0}, - 393: {region: 0xe7, script: 0x5, flags: 0x0}, - 394: {region: 0x164, script: 0x52, flags: 0x0}, - 395: {region: 0xe7, script: 0x5, flags: 0x0}, - 396: {region: 0x164, script: 0x52, flags: 0x0}, - 397: {region: 0x164, script: 0x52, flags: 0x0}, - 398: {region: 0x6d, script: 0x52, flags: 0x0}, - 399: {region: 0x9b, script: 0x5, flags: 0x0}, - 400: {region: 0x164, script: 0x52, flags: 0x0}, - 401: {region: 0x164, script: 0x27, flags: 0x0}, - 402: {region: 0xf0, script: 0x52, flags: 0x0}, - 403: {region: 0x164, script: 0x52, flags: 0x0}, - 404: {region: 0x164, script: 0x52, flags: 0x0}, - 405: {region: 0x164, script: 0x52, flags: 0x0}, - 406: {region: 0x164, script: 0x27, flags: 0x0}, - 407: {region: 0x164, script: 0x52, flags: 0x0}, - 408: {region: 0x98, script: 0x20, flags: 0x0}, - 409: {region: 0x98, script: 0xd0, flags: 0x0}, - 410: {region: 0x94, script: 0x52, flags: 0x0}, - 411: {region: 0xd8, script: 0x52, flags: 0x0}, - 412: {region: 0x12f, script: 0x2b, flags: 0x0}, - 413: {region: 0x164, script: 0x52, flags: 0x0}, + 334: {region: 0x165, script: 0x55, flags: 0x0}, + 335: {region: 0xc3, script: 0x55, flags: 0x0}, + 336: {region: 0x72, script: 0x55, flags: 0x0}, + 337: {region: 0x10b, script: 0x5, flags: 0x0}, + 338: {region: 0xe7, script: 0x55, flags: 0x0}, + 339: {region: 0x10c, script: 0x55, flags: 0x0}, + 340: {region: 0x73, script: 0x55, flags: 0x0}, + 341: {region: 0x165, script: 0x55, flags: 0x0}, + 342: {region: 0x165, script: 0x55, flags: 0x0}, + 343: {region: 0x76, script: 0x55, flags: 0x0}, + 344: {region: 0x165, script: 0x55, flags: 0x0}, + 345: {region: 0x3b, script: 0x55, flags: 0x0}, + 346: {region: 0x165, script: 0x55, flags: 0x0}, + 347: {region: 0x165, script: 0x55, flags: 0x0}, + 348: {region: 0x165, script: 0x55, flags: 0x0}, + 349: {region: 0x78, script: 0x55, flags: 0x0}, + 350: {region: 0x135, script: 0x55, flags: 0x0}, + 351: {region: 0x78, script: 0x55, flags: 0x0}, + 352: {region: 0x60, script: 0x55, flags: 0x0}, + 353: {region: 0x60, script: 0x55, flags: 0x0}, + 354: {region: 0x52, script: 0x5, flags: 0x0}, + 355: {region: 0x140, script: 0x55, flags: 0x0}, + 356: {region: 0x165, script: 0x55, flags: 0x0}, + 357: {region: 0x84, script: 0x55, flags: 0x0}, + 358: {region: 0x165, script: 0x55, flags: 0x0}, + 359: {region: 0xd4, script: 0x55, flags: 0x0}, + 360: {region: 0x9e, script: 0x55, flags: 0x0}, + 361: {region: 0xd6, script: 0x55, flags: 0x0}, + 362: {region: 0x165, script: 0x55, flags: 0x0}, + 363: {region: 0x10b, script: 0x55, flags: 0x0}, + 364: {region: 0xd9, script: 0x55, flags: 0x0}, + 365: {region: 0x96, script: 0x55, flags: 0x0}, + 366: {region: 0x80, script: 0x55, flags: 0x0}, + 367: {region: 0x165, script: 0x55, flags: 0x0}, + 368: {region: 0xbc, script: 0x55, flags: 0x0}, + 369: {region: 0x165, script: 0x55, flags: 0x0}, + 370: {region: 0x165, script: 0x55, flags: 0x0}, + 371: {region: 0x165, script: 0x55, flags: 0x0}, + 372: {region: 0x53, script: 0x37, flags: 0x0}, + 373: {region: 0x165, script: 0x55, flags: 0x0}, + 374: {region: 0x95, script: 0x55, flags: 0x0}, + 375: {region: 0x165, script: 0x55, flags: 0x0}, + 376: {region: 0x99, script: 0x20, flags: 0x0}, + 377: {region: 0x165, script: 0x55, flags: 0x0}, + 378: {region: 0x9c, script: 0x5, flags: 0x0}, + 379: {region: 0x7e, script: 0x55, flags: 0x0}, + 380: {region: 0x7b, script: 0x55, flags: 0x0}, + 381: {region: 0x165, script: 0x55, flags: 0x0}, + 382: {region: 0x165, script: 0x55, flags: 0x0}, + 383: {region: 0x165, script: 0x55, flags: 0x0}, + 384: {region: 0x165, script: 0x55, flags: 0x0}, + 385: {region: 0x165, script: 0x55, flags: 0x0}, + 386: {region: 0x165, script: 0x55, flags: 0x0}, + 387: {region: 0x6f, script: 0x28, flags: 0x0}, + 388: {region: 0x165, script: 0x55, flags: 0x0}, + 389: {region: 0xdb, script: 0x20, flags: 0x0}, + 390: {region: 0x165, script: 0x55, flags: 0x0}, + 391: {region: 0xa7, script: 0x55, flags: 0x0}, + 392: {region: 0x165, script: 0x55, flags: 0x0}, + 393: {region: 0xe8, script: 0x5, flags: 0x0}, + 394: {region: 0x165, script: 0x55, flags: 0x0}, + 395: {region: 0xe8, script: 0x5, flags: 0x0}, + 396: {region: 0x165, script: 0x55, flags: 0x0}, + 397: {region: 0x165, script: 0x55, flags: 0x0}, + 398: {region: 0x6e, script: 0x55, flags: 0x0}, + 399: {region: 0x9c, script: 0x5, flags: 0x0}, + 400: {region: 0x165, script: 0x55, flags: 0x0}, + 401: {region: 0x165, script: 0x28, flags: 0x0}, + 402: {region: 0xf1, script: 0x55, flags: 0x0}, + 403: {region: 0x165, script: 0x55, flags: 0x0}, + 404: {region: 0x165, script: 0x55, flags: 0x0}, + 405: {region: 0x165, script: 0x55, flags: 0x0}, + 406: {region: 0x165, script: 0x28, flags: 0x0}, + 407: {region: 0x165, script: 0x55, flags: 0x0}, + 408: {region: 0x99, script: 0x20, flags: 0x0}, + 409: {region: 0x99, script: 0xd6, flags: 0x0}, + 410: {region: 0x95, script: 0x55, flags: 0x0}, + 411: {region: 0xd9, script: 0x55, flags: 0x0}, + 412: {region: 0x130, script: 0x2e, flags: 0x0}, + 413: {region: 0x165, script: 0x55, flags: 0x0}, 414: {region: 0xe, script: 0x2, flags: 0x1}, - 415: {region: 0x98, script: 0xe, flags: 0x0}, - 416: {region: 0x164, script: 0x52, flags: 0x0}, - 417: {region: 0x4d, script: 0x52, flags: 0x0}, - 418: {region: 0x98, script: 0x2e, flags: 0x0}, - 419: {region: 0x40, script: 0x52, flags: 0x0}, - 420: {region: 0x53, script: 0x52, flags: 0x0}, - 421: {region: 0x164, script: 0x52, flags: 0x0}, - 422: {region: 0x7f, script: 0x52, flags: 0x0}, - 423: {region: 0x164, script: 0x52, flags: 0x0}, - 424: {region: 0x164, script: 0x52, flags: 0x0}, - 425: {region: 0xa3, script: 0x52, flags: 0x0}, - 426: {region: 0x97, script: 0x52, flags: 0x0}, - 427: {region: 0x164, script: 0x52, flags: 0x0}, - 428: {region: 0xda, script: 0x20, flags: 0x0}, - 429: {region: 0x164, script: 0x52, flags: 0x0}, - 430: {region: 0x164, script: 0x5, flags: 0x0}, - 431: {region: 0x48, script: 0x52, flags: 0x0}, - 432: {region: 0x164, script: 0x5, flags: 0x0}, - 433: {region: 0x164, script: 0x52, flags: 0x0}, + 415: {region: 0x99, script: 0xe, flags: 0x0}, + 416: {region: 0x165, script: 0x55, flags: 0x0}, + 417: {region: 0x4e, script: 0x55, flags: 0x0}, + 418: {region: 0x99, script: 0x31, flags: 0x0}, + 419: {region: 0x41, script: 0x55, flags: 0x0}, + 420: {region: 0x54, script: 0x55, flags: 0x0}, + 421: {region: 0x165, script: 0x55, flags: 0x0}, + 422: {region: 0x80, script: 0x55, flags: 0x0}, + 423: {region: 0x165, script: 0x55, flags: 0x0}, + 424: {region: 0x165, script: 0x55, flags: 0x0}, + 425: {region: 0xa4, script: 0x55, flags: 0x0}, + 426: {region: 0x98, script: 0x55, flags: 0x0}, + 427: {region: 0x165, script: 0x55, flags: 0x0}, + 428: {region: 0xdb, script: 0x20, flags: 0x0}, + 429: {region: 0x165, script: 0x55, flags: 0x0}, + 430: {region: 0x165, script: 0x5, flags: 0x0}, + 431: {region: 0x49, script: 0x55, flags: 0x0}, + 432: {region: 0x165, script: 0x5, flags: 0x0}, + 433: {region: 0x165, script: 0x55, flags: 0x0}, 434: {region: 0x10, script: 0x3, flags: 0x1}, - 435: {region: 0x164, script: 0x52, flags: 0x0}, - 436: {region: 0x52, script: 0x34, flags: 0x0}, - 437: {region: 0x164, script: 0x52, flags: 0x0}, - 438: {region: 0x134, script: 0x52, flags: 0x0}, - 439: {region: 0x23, script: 0x5, flags: 0x0}, - 440: {region: 0x164, script: 0x52, flags: 0x0}, - 441: {region: 0x164, script: 0x27, flags: 0x0}, - 442: {region: 0x96, script: 0x37, flags: 0x0}, - 443: {region: 0x164, script: 0x52, flags: 0x0}, - 444: {region: 0x98, script: 0x20, flags: 0x0}, - 445: {region: 0x164, script: 0x52, flags: 0x0}, - 446: {region: 0x72, script: 0x52, flags: 0x0}, - 447: {region: 0x164, script: 0x52, flags: 0x0}, - 448: {region: 0x164, script: 0x52, flags: 0x0}, - 449: {region: 0xe6, script: 0x52, flags: 0x0}, - 450: {region: 0x164, script: 0x52, flags: 0x0}, - 451: {region: 0x12a, script: 0x39, flags: 0x0}, - 452: {region: 0x52, script: 0x81, flags: 0x0}, - 453: {region: 0x164, script: 0x52, flags: 0x0}, - 454: {region: 0xe7, script: 0x5, flags: 0x0}, - 455: {region: 0x98, script: 0x20, flags: 0x0}, - 456: {region: 0xae, script: 0x3a, flags: 0x0}, - 457: {region: 0xe6, script: 0x52, flags: 0x0}, - 458: {region: 0xe7, script: 0x5, flags: 0x0}, - 459: {region: 0xe5, script: 0x52, flags: 0x0}, - 460: {region: 0x98, script: 0x20, flags: 0x0}, - 461: {region: 0x98, script: 0x20, flags: 0x0}, - 462: {region: 0x164, script: 0x52, flags: 0x0}, - 463: {region: 0x8f, script: 0x52, flags: 0x0}, - 464: {region: 0x5f, script: 0x52, flags: 0x0}, - 465: {region: 0x52, script: 0x34, flags: 0x0}, - 466: {region: 0x90, script: 0x52, flags: 0x0}, - 467: {region: 0x91, script: 0x52, flags: 0x0}, - 468: {region: 0x164, script: 0x52, flags: 0x0}, - 469: {region: 0x27, script: 0x8, flags: 0x0}, - 470: {region: 0xd1, script: 0x52, flags: 0x0}, - 471: {region: 0x77, script: 0x52, flags: 0x0}, - 472: {region: 0x164, script: 0x52, flags: 0x0}, - 473: {region: 0x164, script: 0x52, flags: 0x0}, - 474: {region: 0xcf, script: 0x52, flags: 0x0}, - 475: {region: 0xd5, script: 0x52, flags: 0x0}, - 476: {region: 0x164, script: 0x52, flags: 0x0}, - 477: {region: 0x164, script: 0x52, flags: 0x0}, - 478: {region: 0x164, script: 0x52, flags: 0x0}, - 479: {region: 0x94, script: 0x52, flags: 0x0}, - 480: {region: 0x164, script: 0x52, flags: 0x0}, - 481: {region: 0x164, script: 0x52, flags: 0x0}, - 482: {region: 0x164, script: 0x52, flags: 0x0}, - 484: {region: 0x121, script: 0x52, flags: 0x0}, - 485: {region: 0xd5, script: 0x52, flags: 0x0}, - 486: {region: 0x164, script: 0x52, flags: 0x0}, - 487: {region: 0x164, script: 0x52, flags: 0x0}, - 488: {region: 0x52, script: 0xdf, flags: 0x0}, - 489: {region: 0x164, script: 0x52, flags: 0x0}, - 490: {region: 0x134, script: 0x52, flags: 0x0}, - 491: {region: 0x164, script: 0x52, flags: 0x0}, - 492: {region: 0x48, script: 0x52, flags: 0x0}, - 493: {region: 0x164, script: 0x52, flags: 0x0}, - 494: {region: 0x164, script: 0x52, flags: 0x0}, - 495: {region: 0xe6, script: 0x52, flags: 0x0}, - 496: {region: 0x164, script: 0x52, flags: 0x0}, - 497: {region: 0x94, script: 0x52, flags: 0x0}, - 498: {region: 0x105, script: 0x1e, flags: 0x0}, - 500: {region: 0x164, script: 0x52, flags: 0x0}, - 501: {region: 0x164, script: 0x52, flags: 0x0}, - 502: {region: 0x9c, script: 0x52, flags: 0x0}, - 503: {region: 0x9d, script: 0x52, flags: 0x0}, - 504: {region: 0x48, script: 0x17, flags: 0x0}, - 505: {region: 0x96, script: 0x37, flags: 0x0}, - 506: {region: 0x164, script: 0x52, flags: 0x0}, - 507: {region: 0x164, script: 0x52, flags: 0x0}, - 508: {region: 0x105, script: 0x52, flags: 0x0}, - 509: {region: 0x164, script: 0x52, flags: 0x0}, - 510: {region: 0xa1, script: 0x41, flags: 0x0}, - 511: {region: 0x164, script: 0x52, flags: 0x0}, - 512: {region: 0x9f, script: 0x52, flags: 0x0}, - 514: {region: 0x164, script: 0x52, flags: 0x0}, - 515: {region: 0x164, script: 0x52, flags: 0x0}, - 516: {region: 0x164, script: 0x52, flags: 0x0}, - 517: {region: 0x51, script: 0x52, flags: 0x0}, - 518: {region: 0x12f, script: 0x37, flags: 0x0}, - 519: {region: 0x164, script: 0x52, flags: 0x0}, - 520: {region: 0x12e, script: 0x52, flags: 0x0}, - 521: {region: 0xda, script: 0x20, flags: 0x0}, - 522: {region: 0x164, script: 0x52, flags: 0x0}, - 523: {region: 0x62, script: 0x52, flags: 0x0}, - 524: {region: 0x94, script: 0x52, flags: 0x0}, - 525: {region: 0x94, script: 0x52, flags: 0x0}, - 526: {region: 0x7c, script: 0x29, flags: 0x0}, - 527: {region: 0x136, script: 0x1e, flags: 0x0}, - 528: {region: 0x66, script: 0x52, flags: 0x0}, - 529: {region: 0xc3, script: 0x52, flags: 0x0}, - 530: {region: 0x164, script: 0x52, flags: 0x0}, - 531: {region: 0x164, script: 0x52, flags: 0x0}, - 532: {region: 0xd5, script: 0x52, flags: 0x0}, - 533: {region: 0xa3, script: 0x52, flags: 0x0}, - 534: {region: 0xc2, script: 0x52, flags: 0x0}, - 535: {region: 0x105, script: 0x1e, flags: 0x0}, - 536: {region: 0x164, script: 0x52, flags: 0x0}, - 537: {region: 0x164, script: 0x52, flags: 0x0}, - 538: {region: 0x164, script: 0x52, flags: 0x0}, - 539: {region: 0x164, script: 0x52, flags: 0x0}, - 540: {region: 0xd3, script: 0x5, flags: 0x0}, - 541: {region: 0xd5, script: 0x52, flags: 0x0}, - 542: {region: 0x163, script: 0x52, flags: 0x0}, - 543: {region: 0x164, script: 0x52, flags: 0x0}, - 544: {region: 0x164, script: 0x52, flags: 0x0}, - 545: {region: 0x12e, script: 0x52, flags: 0x0}, - 546: {region: 0x121, script: 0x5, flags: 0x0}, - 547: {region: 0x164, script: 0x52, flags: 0x0}, - 548: {region: 0x122, script: 0xd5, flags: 0x0}, - 549: {region: 0x59, script: 0x52, flags: 0x0}, - 550: {region: 0x51, script: 0x52, flags: 0x0}, - 551: {region: 0x164, script: 0x52, flags: 0x0}, - 552: {region: 0x4e, script: 0x52, flags: 0x0}, - 553: {region: 0x98, script: 0x20, flags: 0x0}, - 554: {region: 0x98, script: 0x20, flags: 0x0}, - 555: {region: 0x4a, script: 0x52, flags: 0x0}, - 556: {region: 0x94, script: 0x52, flags: 0x0}, - 557: {region: 0x164, script: 0x52, flags: 0x0}, - 558: {region: 0x40, script: 0x52, flags: 0x0}, - 559: {region: 0x98, script: 0x52, flags: 0x0}, - 560: {region: 0x52, script: 0xcc, flags: 0x0}, - 561: {region: 0x98, script: 0x20, flags: 0x0}, - 562: {region: 0xc2, script: 0x52, flags: 0x0}, - 563: {region: 0x164, script: 0x52, flags: 0x0}, - 564: {region: 0x98, script: 0x6b, flags: 0x0}, - 565: {region: 0xe7, script: 0x5, flags: 0x0}, - 566: {region: 0x164, script: 0x52, flags: 0x0}, - 567: {region: 0xa3, script: 0x52, flags: 0x0}, - 568: {region: 0x164, script: 0x52, flags: 0x0}, - 569: {region: 0x12a, script: 0x52, flags: 0x0}, - 570: {region: 0x164, script: 0x52, flags: 0x0}, - 571: {region: 0xd1, script: 0x52, flags: 0x0}, - 572: {region: 0x164, script: 0x52, flags: 0x0}, - 573: {region: 0xae, script: 0x4f, flags: 0x0}, - 574: {region: 0x164, script: 0x52, flags: 0x0}, - 575: {region: 0x164, script: 0x52, flags: 0x0}, + 435: {region: 0x165, script: 0x55, flags: 0x0}, + 436: {region: 0x53, script: 0x37, flags: 0x0}, + 437: {region: 0x165, script: 0x55, flags: 0x0}, + 438: {region: 0x135, script: 0x55, flags: 0x0}, + 439: {region: 0x24, script: 0x5, flags: 0x0}, + 440: {region: 0x165, script: 0x55, flags: 0x0}, + 441: {region: 0x165, script: 0x28, flags: 0x0}, + 442: {region: 0x97, script: 0x3a, flags: 0x0}, + 443: {region: 0x165, script: 0x55, flags: 0x0}, + 444: {region: 0x99, script: 0x20, flags: 0x0}, + 445: {region: 0x165, script: 0x55, flags: 0x0}, + 446: {region: 0x73, script: 0x55, flags: 0x0}, + 447: {region: 0x165, script: 0x55, flags: 0x0}, + 448: {region: 0x165, script: 0x55, flags: 0x0}, + 449: {region: 0xe7, script: 0x55, flags: 0x0}, + 450: {region: 0x165, script: 0x55, flags: 0x0}, + 451: {region: 0x12b, script: 0x3c, flags: 0x0}, + 452: {region: 0x53, script: 0x86, flags: 0x0}, + 453: {region: 0x165, script: 0x55, flags: 0x0}, + 454: {region: 0xe8, script: 0x5, flags: 0x0}, + 455: {region: 0x99, script: 0x20, flags: 0x0}, + 456: {region: 0xaf, script: 0x3d, flags: 0x0}, + 457: {region: 0xe7, script: 0x55, flags: 0x0}, + 458: {region: 0xe8, script: 0x5, flags: 0x0}, + 459: {region: 0xe6, script: 0x55, flags: 0x0}, + 460: {region: 0x99, script: 0x20, flags: 0x0}, + 461: {region: 0x99, script: 0x20, flags: 0x0}, + 462: {region: 0x165, script: 0x55, flags: 0x0}, + 463: {region: 0x90, script: 0x55, flags: 0x0}, + 464: {region: 0x60, script: 0x55, flags: 0x0}, + 465: {region: 0x53, script: 0x37, flags: 0x0}, + 466: {region: 0x91, script: 0x55, flags: 0x0}, + 467: {region: 0x92, script: 0x55, flags: 0x0}, + 468: {region: 0x165, script: 0x55, flags: 0x0}, + 469: {region: 0x28, script: 0x8, flags: 0x0}, + 470: {region: 0xd2, script: 0x55, flags: 0x0}, + 471: {region: 0x78, script: 0x55, flags: 0x0}, + 472: {region: 0x165, script: 0x55, flags: 0x0}, + 473: {region: 0x165, script: 0x55, flags: 0x0}, + 474: {region: 0xd0, script: 0x55, flags: 0x0}, + 475: {region: 0xd6, script: 0x55, flags: 0x0}, + 476: {region: 0x165, script: 0x55, flags: 0x0}, + 477: {region: 0x165, script: 0x55, flags: 0x0}, + 478: {region: 0x165, script: 0x55, flags: 0x0}, + 479: {region: 0x95, script: 0x55, flags: 0x0}, + 480: {region: 0x165, script: 0x55, flags: 0x0}, + 481: {region: 0x165, script: 0x55, flags: 0x0}, + 482: {region: 0x165, script: 0x55, flags: 0x0}, + 484: {region: 0x122, script: 0x55, flags: 0x0}, + 485: {region: 0xd6, script: 0x55, flags: 0x0}, + 486: {region: 0x165, script: 0x55, flags: 0x0}, + 487: {region: 0x165, script: 0x55, flags: 0x0}, + 488: {region: 0x53, script: 0xe5, flags: 0x0}, + 489: {region: 0x165, script: 0x55, flags: 0x0}, + 490: {region: 0x135, script: 0x55, flags: 0x0}, + 491: {region: 0x165, script: 0x55, flags: 0x0}, + 492: {region: 0x49, script: 0x55, flags: 0x0}, + 493: {region: 0x165, script: 0x55, flags: 0x0}, + 494: {region: 0x165, script: 0x55, flags: 0x0}, + 495: {region: 0xe7, script: 0x55, flags: 0x0}, + 496: {region: 0x165, script: 0x55, flags: 0x0}, + 497: {region: 0x95, script: 0x55, flags: 0x0}, + 498: {region: 0x106, script: 0x1e, flags: 0x0}, + 500: {region: 0x165, script: 0x55, flags: 0x0}, + 501: {region: 0x165, script: 0x55, flags: 0x0}, + 502: {region: 0x9d, script: 0x55, flags: 0x0}, + 503: {region: 0x9e, script: 0x55, flags: 0x0}, + 504: {region: 0x49, script: 0x17, flags: 0x0}, + 505: {region: 0x97, script: 0x3a, flags: 0x0}, + 506: {region: 0x165, script: 0x55, flags: 0x0}, + 507: {region: 0x165, script: 0x55, flags: 0x0}, + 508: {region: 0x106, script: 0x55, flags: 0x0}, + 509: {region: 0x165, script: 0x55, flags: 0x0}, + 510: {region: 0xa2, script: 0x44, flags: 0x0}, + 511: {region: 0x165, script: 0x55, flags: 0x0}, + 512: {region: 0xa0, script: 0x55, flags: 0x0}, + 514: {region: 0x165, script: 0x55, flags: 0x0}, + 515: {region: 0x165, script: 0x55, flags: 0x0}, + 516: {region: 0x165, script: 0x55, flags: 0x0}, + 517: {region: 0x52, script: 0x55, flags: 0x0}, + 518: {region: 0x130, script: 0x3a, flags: 0x0}, + 519: {region: 0x165, script: 0x55, flags: 0x0}, + 520: {region: 0x12f, script: 0x55, flags: 0x0}, + 521: {region: 0xdb, script: 0x20, flags: 0x0}, + 522: {region: 0x165, script: 0x55, flags: 0x0}, + 523: {region: 0x63, script: 0x55, flags: 0x0}, + 524: {region: 0x95, script: 0x55, flags: 0x0}, + 525: {region: 0x95, script: 0x55, flags: 0x0}, + 526: {region: 0x7d, script: 0x2a, flags: 0x0}, + 527: {region: 0x137, script: 0x1e, flags: 0x0}, + 528: {region: 0x67, script: 0x55, flags: 0x0}, + 529: {region: 0xc4, script: 0x55, flags: 0x0}, + 530: {region: 0x165, script: 0x55, flags: 0x0}, + 531: {region: 0x165, script: 0x55, flags: 0x0}, + 532: {region: 0xd6, script: 0x55, flags: 0x0}, + 533: {region: 0xa4, script: 0x55, flags: 0x0}, + 534: {region: 0xc3, script: 0x55, flags: 0x0}, + 535: {region: 0x106, script: 0x1e, flags: 0x0}, + 536: {region: 0x165, script: 0x55, flags: 0x0}, + 537: {region: 0x165, script: 0x55, flags: 0x0}, + 538: {region: 0x165, script: 0x55, flags: 0x0}, + 539: {region: 0x165, script: 0x55, flags: 0x0}, + 540: {region: 0xd4, script: 0x5, flags: 0x0}, + 541: {region: 0xd6, script: 0x55, flags: 0x0}, + 542: {region: 0x164, script: 0x55, flags: 0x0}, + 543: {region: 0x165, script: 0x55, flags: 0x0}, + 544: {region: 0x165, script: 0x55, flags: 0x0}, + 545: {region: 0x12f, script: 0x55, flags: 0x0}, + 546: {region: 0x122, script: 0x5, flags: 0x0}, + 547: {region: 0x165, script: 0x55, flags: 0x0}, + 548: {region: 0x123, script: 0xdb, flags: 0x0}, + 549: {region: 0x5a, script: 0x55, flags: 0x0}, + 550: {region: 0x52, script: 0x55, flags: 0x0}, + 551: {region: 0x165, script: 0x55, flags: 0x0}, + 552: {region: 0x4f, script: 0x55, flags: 0x0}, + 553: {region: 0x99, script: 0x20, flags: 0x0}, + 554: {region: 0x99, script: 0x20, flags: 0x0}, + 555: {region: 0x4b, script: 0x55, flags: 0x0}, + 556: {region: 0x95, script: 0x55, flags: 0x0}, + 557: {region: 0x165, script: 0x55, flags: 0x0}, + 558: {region: 0x41, script: 0x55, flags: 0x0}, + 559: {region: 0x99, script: 0x55, flags: 0x0}, + 560: {region: 0x53, script: 0xd2, flags: 0x0}, + 561: {region: 0x99, script: 0x20, flags: 0x0}, + 562: {region: 0xc3, script: 0x55, flags: 0x0}, + 563: {region: 0x165, script: 0x55, flags: 0x0}, + 564: {region: 0x99, script: 0x70, flags: 0x0}, + 565: {region: 0xe8, script: 0x5, flags: 0x0}, + 566: {region: 0x165, script: 0x55, flags: 0x0}, + 567: {region: 0xa4, script: 0x55, flags: 0x0}, + 568: {region: 0x165, script: 0x55, flags: 0x0}, + 569: {region: 0x12b, script: 0x55, flags: 0x0}, + 570: {region: 0x165, script: 0x55, flags: 0x0}, + 571: {region: 0xd2, script: 0x55, flags: 0x0}, + 572: {region: 0x165, script: 0x55, flags: 0x0}, + 573: {region: 0xaf, script: 0x52, flags: 0x0}, + 574: {region: 0x165, script: 0x55, flags: 0x0}, + 575: {region: 0x165, script: 0x55, flags: 0x0}, 576: {region: 0x13, script: 0x6, flags: 0x1}, - 577: {region: 0x164, script: 0x52, flags: 0x0}, - 578: {region: 0x51, script: 0x52, flags: 0x0}, - 579: {region: 0x81, script: 0x52, flags: 0x0}, - 580: {region: 0xa3, script: 0x52, flags: 0x0}, - 581: {region: 0x164, script: 0x52, flags: 0x0}, - 582: {region: 0x164, script: 0x52, flags: 0x0}, - 583: {region: 0x164, script: 0x52, flags: 0x0}, - 584: {region: 0xa5, script: 0x46, flags: 0x0}, - 585: {region: 0x29, script: 0x52, flags: 0x0}, - 586: {region: 0x164, script: 0x52, flags: 0x0}, - 587: {region: 0x164, script: 0x52, flags: 0x0}, - 588: {region: 0x164, script: 0x52, flags: 0x0}, - 589: {region: 0x164, script: 0x52, flags: 0x0}, - 590: {region: 0x164, script: 0x52, flags: 0x0}, - 591: {region: 0x98, script: 0x4a, flags: 0x0}, - 592: {region: 0x113, script: 0x52, flags: 0x0}, - 593: {region: 0x164, script: 0x52, flags: 0x0}, - 594: {region: 0xaa, script: 0x4b, flags: 0x0}, - 595: {region: 0x105, script: 0x1e, flags: 0x0}, - 596: {region: 0x98, script: 0x20, flags: 0x0}, - 597: {region: 0x164, script: 0x52, flags: 0x0}, - 598: {region: 0x74, script: 0x52, flags: 0x0}, - 599: {region: 0x164, script: 0x52, flags: 0x0}, - 600: {region: 0xb3, script: 0x52, flags: 0x0}, - 601: {region: 0x164, script: 0x52, flags: 0x0}, - 602: {region: 0x164, script: 0x52, flags: 0x0}, - 603: {region: 0x164, script: 0x52, flags: 0x0}, - 604: {region: 0x164, script: 0x52, flags: 0x0}, - 605: {region: 0x164, script: 0x52, flags: 0x0}, - 606: {region: 0x164, script: 0x52, flags: 0x0}, - 607: {region: 0x164, script: 0x52, flags: 0x0}, - 608: {region: 0x164, script: 0x27, flags: 0x0}, - 610: {region: 0x105, script: 0x1e, flags: 0x0}, - 611: {region: 0x111, script: 0x52, flags: 0x0}, - 612: {region: 0xe6, script: 0x52, flags: 0x0}, - 613: {region: 0x105, script: 0x52, flags: 0x0}, - 614: {region: 0x164, script: 0x52, flags: 0x0}, - 615: {region: 0x98, script: 0x20, flags: 0x0}, - 616: {region: 0x98, script: 0x5, flags: 0x0}, - 617: {region: 0x12e, script: 0x52, flags: 0x0}, - 618: {region: 0x164, script: 0x52, flags: 0x0}, - 619: {region: 0x51, script: 0x52, flags: 0x0}, - 620: {region: 0x5f, script: 0x52, flags: 0x0}, - 621: {region: 0x164, script: 0x52, flags: 0x0}, - 622: {region: 0x164, script: 0x52, flags: 0x0}, - 623: {region: 0x164, script: 0x27, flags: 0x0}, - 624: {region: 0x164, script: 0x52, flags: 0x0}, - 625: {region: 0x164, script: 0x52, flags: 0x0}, + 577: {region: 0x165, script: 0x55, flags: 0x0}, + 578: {region: 0x52, script: 0x55, flags: 0x0}, + 579: {region: 0x82, script: 0x55, flags: 0x0}, + 580: {region: 0xa4, script: 0x55, flags: 0x0}, + 581: {region: 0x165, script: 0x55, flags: 0x0}, + 582: {region: 0x165, script: 0x55, flags: 0x0}, + 583: {region: 0x165, script: 0x55, flags: 0x0}, + 584: {region: 0xa6, script: 0x49, flags: 0x0}, + 585: {region: 0x2a, script: 0x55, flags: 0x0}, + 586: {region: 0x165, script: 0x55, flags: 0x0}, + 587: {region: 0x165, script: 0x55, flags: 0x0}, + 588: {region: 0x165, script: 0x55, flags: 0x0}, + 589: {region: 0x165, script: 0x55, flags: 0x0}, + 590: {region: 0x165, script: 0x55, flags: 0x0}, + 591: {region: 0x99, script: 0x4d, flags: 0x0}, + 592: {region: 0x114, script: 0x55, flags: 0x0}, + 593: {region: 0x165, script: 0x55, flags: 0x0}, + 594: {region: 0xab, script: 0x4e, flags: 0x0}, + 595: {region: 0x106, script: 0x1e, flags: 0x0}, + 596: {region: 0x99, script: 0x20, flags: 0x0}, + 597: {region: 0x165, script: 0x55, flags: 0x0}, + 598: {region: 0x75, script: 0x55, flags: 0x0}, + 599: {region: 0x165, script: 0x55, flags: 0x0}, + 600: {region: 0xb4, script: 0x55, flags: 0x0}, + 601: {region: 0x165, script: 0x55, flags: 0x0}, + 602: {region: 0x165, script: 0x55, flags: 0x0}, + 603: {region: 0x165, script: 0x55, flags: 0x0}, + 604: {region: 0x165, script: 0x55, flags: 0x0}, + 605: {region: 0x165, script: 0x55, flags: 0x0}, + 606: {region: 0x165, script: 0x55, flags: 0x0}, + 607: {region: 0x165, script: 0x55, flags: 0x0}, + 608: {region: 0x165, script: 0x28, flags: 0x0}, + 610: {region: 0x106, script: 0x1e, flags: 0x0}, + 611: {region: 0x112, script: 0x55, flags: 0x0}, + 612: {region: 0xe7, script: 0x55, flags: 0x0}, + 613: {region: 0x106, script: 0x55, flags: 0x0}, + 614: {region: 0x165, script: 0x55, flags: 0x0}, + 615: {region: 0x99, script: 0x20, flags: 0x0}, + 616: {region: 0x99, script: 0x5, flags: 0x0}, + 617: {region: 0x12f, script: 0x55, flags: 0x0}, + 618: {region: 0x165, script: 0x55, flags: 0x0}, + 619: {region: 0x52, script: 0x55, flags: 0x0}, + 620: {region: 0x60, script: 0x55, flags: 0x0}, + 621: {region: 0x165, script: 0x55, flags: 0x0}, + 622: {region: 0x165, script: 0x55, flags: 0x0}, + 623: {region: 0x165, script: 0x28, flags: 0x0}, + 624: {region: 0x165, script: 0x55, flags: 0x0}, + 625: {region: 0x165, script: 0x55, flags: 0x0}, 626: {region: 0x19, script: 0x3, flags: 0x1}, - 627: {region: 0x164, script: 0x52, flags: 0x0}, - 628: {region: 0x164, script: 0x52, flags: 0x0}, - 629: {region: 0x164, script: 0x52, flags: 0x0}, - 630: {region: 0x164, script: 0x52, flags: 0x0}, - 631: {region: 0x105, script: 0x1e, flags: 0x0}, - 632: {region: 0x164, script: 0x52, flags: 0x0}, - 633: {region: 0x164, script: 0x52, flags: 0x0}, - 634: {region: 0x164, script: 0x52, flags: 0x0}, - 635: {region: 0x105, script: 0x1e, flags: 0x0}, - 636: {region: 0x164, script: 0x52, flags: 0x0}, - 637: {region: 0x94, script: 0x52, flags: 0x0}, - 638: {region: 0xe7, script: 0x5, flags: 0x0}, - 639: {region: 0x7a, script: 0x52, flags: 0x0}, - 640: {region: 0x164, script: 0x52, flags: 0x0}, - 641: {region: 0x164, script: 0x52, flags: 0x0}, - 642: {region: 0x164, script: 0x52, flags: 0x0}, - 643: {region: 0x164, script: 0x27, flags: 0x0}, - 644: {region: 0x122, script: 0xd5, flags: 0x0}, - 645: {region: 0xe7, script: 0x5, flags: 0x0}, - 646: {region: 0x164, script: 0x52, flags: 0x0}, - 647: {region: 0x164, script: 0x52, flags: 0x0}, + 627: {region: 0x165, script: 0x55, flags: 0x0}, + 628: {region: 0x165, script: 0x55, flags: 0x0}, + 629: {region: 0x165, script: 0x55, flags: 0x0}, + 630: {region: 0x165, script: 0x55, flags: 0x0}, + 631: {region: 0x106, script: 0x1e, flags: 0x0}, + 632: {region: 0x165, script: 0x55, flags: 0x0}, + 633: {region: 0x165, script: 0x55, flags: 0x0}, + 634: {region: 0x165, script: 0x55, flags: 0x0}, + 635: {region: 0x106, script: 0x1e, flags: 0x0}, + 636: {region: 0x165, script: 0x55, flags: 0x0}, + 637: {region: 0x95, script: 0x55, flags: 0x0}, + 638: {region: 0xe8, script: 0x5, flags: 0x0}, + 639: {region: 0x7b, script: 0x55, flags: 0x0}, + 640: {region: 0x165, script: 0x55, flags: 0x0}, + 641: {region: 0x165, script: 0x55, flags: 0x0}, + 642: {region: 0x165, script: 0x55, flags: 0x0}, + 643: {region: 0x165, script: 0x28, flags: 0x0}, + 644: {region: 0x123, script: 0xdb, flags: 0x0}, + 645: {region: 0xe8, script: 0x5, flags: 0x0}, + 646: {region: 0x165, script: 0x55, flags: 0x0}, + 647: {region: 0x165, script: 0x55, flags: 0x0}, 648: {region: 0x1c, script: 0x5, flags: 0x1}, - 649: {region: 0x164, script: 0x52, flags: 0x0}, - 650: {region: 0x164, script: 0x52, flags: 0x0}, - 651: {region: 0x164, script: 0x52, flags: 0x0}, - 652: {region: 0x137, script: 0x52, flags: 0x0}, - 653: {region: 0x86, script: 0x56, flags: 0x0}, - 654: {region: 0x96, script: 0x37, flags: 0x0}, - 655: {region: 0x12e, script: 0x52, flags: 0x0}, - 656: {region: 0xe7, script: 0x5, flags: 0x0}, - 657: {region: 0x130, script: 0x52, flags: 0x0}, - 658: {region: 0x164, script: 0x52, flags: 0x0}, - 659: {region: 0xb6, script: 0x52, flags: 0x0}, - 660: {region: 0x105, script: 0x1e, flags: 0x0}, - 661: {region: 0x164, script: 0x52, flags: 0x0}, - 662: {region: 0x94, script: 0x52, flags: 0x0}, - 663: {region: 0x164, script: 0x52, flags: 0x0}, - 664: {region: 0x52, script: 0xd5, flags: 0x0}, - 665: {region: 0x164, script: 0x52, flags: 0x0}, - 666: {region: 0x164, script: 0x52, flags: 0x0}, - 667: {region: 0x164, script: 0x52, flags: 0x0}, - 668: {region: 0x164, script: 0x52, flags: 0x0}, - 669: {region: 0x98, script: 0x54, flags: 0x0}, - 670: {region: 0x164, script: 0x52, flags: 0x0}, - 671: {region: 0x164, script: 0x52, flags: 0x0}, - 672: {region: 0x105, script: 0x1e, flags: 0x0}, - 673: {region: 0x130, script: 0x52, flags: 0x0}, - 674: {region: 0x164, script: 0x52, flags: 0x0}, - 675: {region: 0xd8, script: 0x52, flags: 0x0}, - 676: {region: 0x164, script: 0x52, flags: 0x0}, - 677: {region: 0x164, script: 0x52, flags: 0x0}, + 649: {region: 0x165, script: 0x55, flags: 0x0}, + 650: {region: 0x165, script: 0x55, flags: 0x0}, + 651: {region: 0x165, script: 0x55, flags: 0x0}, + 652: {region: 0x138, script: 0x55, flags: 0x0}, + 653: {region: 0x87, script: 0x59, flags: 0x0}, + 654: {region: 0x97, script: 0x3a, flags: 0x0}, + 655: {region: 0x12f, script: 0x55, flags: 0x0}, + 656: {region: 0xe8, script: 0x5, flags: 0x0}, + 657: {region: 0x131, script: 0x55, flags: 0x0}, + 658: {region: 0x165, script: 0x55, flags: 0x0}, + 659: {region: 0xb7, script: 0x55, flags: 0x0}, + 660: {region: 0x106, script: 0x1e, flags: 0x0}, + 661: {region: 0x165, script: 0x55, flags: 0x0}, + 662: {region: 0x95, script: 0x55, flags: 0x0}, + 663: {region: 0x165, script: 0x55, flags: 0x0}, + 664: {region: 0x53, script: 0xdb, flags: 0x0}, + 665: {region: 0x165, script: 0x55, flags: 0x0}, + 666: {region: 0x165, script: 0x55, flags: 0x0}, + 667: {region: 0x165, script: 0x55, flags: 0x0}, + 668: {region: 0x165, script: 0x55, flags: 0x0}, + 669: {region: 0x99, script: 0x57, flags: 0x0}, + 670: {region: 0x165, script: 0x55, flags: 0x0}, + 671: {region: 0x165, script: 0x55, flags: 0x0}, + 672: {region: 0x106, script: 0x1e, flags: 0x0}, + 673: {region: 0x131, script: 0x55, flags: 0x0}, + 674: {region: 0x165, script: 0x55, flags: 0x0}, + 675: {region: 0xd9, script: 0x55, flags: 0x0}, + 676: {region: 0x165, script: 0x55, flags: 0x0}, + 677: {region: 0x165, script: 0x55, flags: 0x0}, 678: {region: 0x21, script: 0x2, flags: 0x1}, - 679: {region: 0x164, script: 0x52, flags: 0x0}, - 680: {region: 0x164, script: 0x52, flags: 0x0}, - 681: {region: 0x9d, script: 0x52, flags: 0x0}, - 682: {region: 0x52, script: 0x58, flags: 0x0}, - 683: {region: 0x94, script: 0x52, flags: 0x0}, - 684: {region: 0x9b, script: 0x5, flags: 0x0}, - 685: {region: 0x134, script: 0x52, flags: 0x0}, - 686: {region: 0x164, script: 0x52, flags: 0x0}, - 687: {region: 0x164, script: 0x52, flags: 0x0}, - 688: {region: 0x98, script: 0xd0, flags: 0x0}, - 689: {region: 0x9d, script: 0x52, flags: 0x0}, - 690: {region: 0x164, script: 0x52, flags: 0x0}, - 691: {region: 0x4a, script: 0x52, flags: 0x0}, - 692: {region: 0x164, script: 0x52, flags: 0x0}, - 693: {region: 0x164, script: 0x52, flags: 0x0}, - 694: {region: 0xae, script: 0x4f, flags: 0x0}, - 695: {region: 0x164, script: 0x52, flags: 0x0}, - 696: {region: 0x164, script: 0x52, flags: 0x0}, - 697: {region: 0x4a, script: 0x52, flags: 0x0}, - 698: {region: 0x164, script: 0x52, flags: 0x0}, - 699: {region: 0x164, script: 0x52, flags: 0x0}, - 700: {region: 0x161, script: 0x52, flags: 0x0}, - 701: {region: 0x9b, script: 0x5, flags: 0x0}, - 702: {region: 0xb5, script: 0x52, flags: 0x0}, - 703: {region: 0xb7, script: 0x52, flags: 0x0}, - 704: {region: 0x4a, script: 0x52, flags: 0x0}, - 705: {region: 0x4a, script: 0x52, flags: 0x0}, - 706: {region: 0xa3, script: 0x52, flags: 0x0}, - 707: {region: 0xa3, script: 0x52, flags: 0x0}, - 708: {region: 0x9b, script: 0x5, flags: 0x0}, - 709: {region: 0xb7, script: 0x52, flags: 0x0}, - 710: {region: 0x122, script: 0xd5, flags: 0x0}, - 711: {region: 0x52, script: 0x34, flags: 0x0}, - 712: {region: 0x12a, script: 0x52, flags: 0x0}, - 713: {region: 0x94, script: 0x52, flags: 0x0}, - 714: {region: 0x51, script: 0x52, flags: 0x0}, - 715: {region: 0x98, script: 0x20, flags: 0x0}, - 716: {region: 0x98, script: 0x20, flags: 0x0}, - 717: {region: 0x94, script: 0x52, flags: 0x0}, + 679: {region: 0x165, script: 0x55, flags: 0x0}, + 680: {region: 0x165, script: 0x55, flags: 0x0}, + 681: {region: 0x9e, script: 0x55, flags: 0x0}, + 682: {region: 0x53, script: 0x5b, flags: 0x0}, + 683: {region: 0x95, script: 0x55, flags: 0x0}, + 684: {region: 0x9c, script: 0x5, flags: 0x0}, + 685: {region: 0x135, script: 0x55, flags: 0x0}, + 686: {region: 0x165, script: 0x55, flags: 0x0}, + 687: {region: 0x165, script: 0x55, flags: 0x0}, + 688: {region: 0x99, script: 0xd6, flags: 0x0}, + 689: {region: 0x9e, script: 0x55, flags: 0x0}, + 690: {region: 0x165, script: 0x55, flags: 0x0}, + 691: {region: 0x4b, script: 0x55, flags: 0x0}, + 692: {region: 0x165, script: 0x55, flags: 0x0}, + 693: {region: 0x165, script: 0x55, flags: 0x0}, + 694: {region: 0xaf, script: 0x52, flags: 0x0}, + 695: {region: 0x165, script: 0x55, flags: 0x0}, + 696: {region: 0x165, script: 0x55, flags: 0x0}, + 697: {region: 0x4b, script: 0x55, flags: 0x0}, + 698: {region: 0x165, script: 0x55, flags: 0x0}, + 699: {region: 0x165, script: 0x55, flags: 0x0}, + 700: {region: 0x162, script: 0x55, flags: 0x0}, + 701: {region: 0x9c, script: 0x5, flags: 0x0}, + 702: {region: 0xb6, script: 0x55, flags: 0x0}, + 703: {region: 0xb8, script: 0x55, flags: 0x0}, + 704: {region: 0x4b, script: 0x55, flags: 0x0}, + 705: {region: 0x4b, script: 0x55, flags: 0x0}, + 706: {region: 0xa4, script: 0x55, flags: 0x0}, + 707: {region: 0xa4, script: 0x55, flags: 0x0}, + 708: {region: 0x9c, script: 0x5, flags: 0x0}, + 709: {region: 0xb8, script: 0x55, flags: 0x0}, + 710: {region: 0x123, script: 0xdb, flags: 0x0}, + 711: {region: 0x53, script: 0x37, flags: 0x0}, + 712: {region: 0x12b, script: 0x55, flags: 0x0}, + 713: {region: 0x95, script: 0x55, flags: 0x0}, + 714: {region: 0x52, script: 0x55, flags: 0x0}, + 715: {region: 0x99, script: 0x20, flags: 0x0}, + 716: {region: 0x99, script: 0x20, flags: 0x0}, + 717: {region: 0x95, script: 0x55, flags: 0x0}, 718: {region: 0x23, script: 0x3, flags: 0x1}, - 719: {region: 0xa3, script: 0x52, flags: 0x0}, - 720: {region: 0x164, script: 0x52, flags: 0x0}, - 721: {region: 0xce, script: 0x52, flags: 0x0}, - 722: {region: 0x164, script: 0x52, flags: 0x0}, - 723: {region: 0x164, script: 0x52, flags: 0x0}, - 724: {region: 0x164, script: 0x52, flags: 0x0}, - 725: {region: 0x164, script: 0x52, flags: 0x0}, - 726: {region: 0x164, script: 0x52, flags: 0x0}, - 727: {region: 0x164, script: 0x52, flags: 0x0}, - 728: {region: 0x164, script: 0x52, flags: 0x0}, - 729: {region: 0x164, script: 0x52, flags: 0x0}, - 730: {region: 0x164, script: 0x52, flags: 0x0}, - 731: {region: 0x164, script: 0x52, flags: 0x0}, - 732: {region: 0x164, script: 0x52, flags: 0x0}, - 733: {region: 0x164, script: 0x5, flags: 0x0}, - 734: {region: 0x105, script: 0x1e, flags: 0x0}, - 735: {region: 0xe6, script: 0x52, flags: 0x0}, - 736: {region: 0x164, script: 0x52, flags: 0x0}, - 737: {region: 0x94, script: 0x52, flags: 0x0}, - 738: {region: 0x164, script: 0x27, flags: 0x0}, - 739: {region: 0x164, script: 0x52, flags: 0x0}, - 740: {region: 0x164, script: 0x52, flags: 0x0}, - 741: {region: 0x164, script: 0x52, flags: 0x0}, - 742: {region: 0x111, script: 0x52, flags: 0x0}, - 743: {region: 0xa3, script: 0x52, flags: 0x0}, - 744: {region: 0x164, script: 0x52, flags: 0x0}, - 745: {region: 0x164, script: 0x52, flags: 0x0}, - 746: {region: 0x122, script: 0x5, flags: 0x0}, - 747: {region: 0xcb, script: 0x52, flags: 0x0}, - 748: {region: 0x164, script: 0x52, flags: 0x0}, - 749: {region: 0x164, script: 0x52, flags: 0x0}, - 750: {region: 0x164, script: 0x52, flags: 0x0}, - 751: {region: 0xbe, script: 0x52, flags: 0x0}, - 752: {region: 0xd0, script: 0x52, flags: 0x0}, - 753: {region: 0x164, script: 0x52, flags: 0x0}, - 754: {region: 0x51, script: 0x52, flags: 0x0}, - 755: {region: 0xda, script: 0x20, flags: 0x0}, - 756: {region: 0x12e, script: 0x52, flags: 0x0}, - 757: {region: 0xbf, script: 0x52, flags: 0x0}, - 758: {region: 0x164, script: 0x52, flags: 0x0}, - 759: {region: 0x164, script: 0x52, flags: 0x0}, - 760: {region: 0xdf, script: 0x52, flags: 0x0}, - 761: {region: 0x164, script: 0x52, flags: 0x0}, - 762: {region: 0x94, script: 0x52, flags: 0x0}, - 763: {region: 0x9a, script: 0x36, flags: 0x0}, - 764: {region: 0x164, script: 0x52, flags: 0x0}, - 765: {region: 0xc1, script: 0x1e, flags: 0x0}, - 766: {region: 0x164, script: 0x5, flags: 0x0}, - 767: {region: 0x164, script: 0x52, flags: 0x0}, - 768: {region: 0x164, script: 0x52, flags: 0x0}, - 769: {region: 0x164, script: 0x52, flags: 0x0}, - 770: {region: 0x98, script: 0x64, flags: 0x0}, - 771: {region: 0x164, script: 0x52, flags: 0x0}, - 772: {region: 0x164, script: 0x52, flags: 0x0}, - 773: {region: 0x10a, script: 0x52, flags: 0x0}, - 774: {region: 0x164, script: 0x52, flags: 0x0}, - 775: {region: 0x164, script: 0x52, flags: 0x0}, - 776: {region: 0x164, script: 0x52, flags: 0x0}, + 719: {region: 0xa4, script: 0x55, flags: 0x0}, + 720: {region: 0x165, script: 0x55, flags: 0x0}, + 721: {region: 0xcf, script: 0x55, flags: 0x0}, + 722: {region: 0x165, script: 0x55, flags: 0x0}, + 723: {region: 0x165, script: 0x55, flags: 0x0}, + 724: {region: 0x165, script: 0x55, flags: 0x0}, + 725: {region: 0x165, script: 0x55, flags: 0x0}, + 726: {region: 0x165, script: 0x55, flags: 0x0}, + 727: {region: 0x165, script: 0x55, flags: 0x0}, + 728: {region: 0x165, script: 0x55, flags: 0x0}, + 729: {region: 0x165, script: 0x55, flags: 0x0}, + 730: {region: 0x165, script: 0x55, flags: 0x0}, + 731: {region: 0x165, script: 0x55, flags: 0x0}, + 732: {region: 0x165, script: 0x55, flags: 0x0}, + 733: {region: 0x165, script: 0x5, flags: 0x0}, + 734: {region: 0x106, script: 0x1e, flags: 0x0}, + 735: {region: 0xe7, script: 0x55, flags: 0x0}, + 736: {region: 0x165, script: 0x55, flags: 0x0}, + 737: {region: 0x95, script: 0x55, flags: 0x0}, + 738: {region: 0x165, script: 0x28, flags: 0x0}, + 739: {region: 0x165, script: 0x55, flags: 0x0}, + 740: {region: 0x165, script: 0x55, flags: 0x0}, + 741: {region: 0x165, script: 0x55, flags: 0x0}, + 742: {region: 0x112, script: 0x55, flags: 0x0}, + 743: {region: 0xa4, script: 0x55, flags: 0x0}, + 744: {region: 0x165, script: 0x55, flags: 0x0}, + 745: {region: 0x165, script: 0x55, flags: 0x0}, + 746: {region: 0x123, script: 0x5, flags: 0x0}, + 747: {region: 0xcc, script: 0x55, flags: 0x0}, + 748: {region: 0x165, script: 0x55, flags: 0x0}, + 749: {region: 0x165, script: 0x55, flags: 0x0}, + 750: {region: 0x165, script: 0x55, flags: 0x0}, + 751: {region: 0xbf, script: 0x55, flags: 0x0}, + 752: {region: 0xd1, script: 0x55, flags: 0x0}, + 753: {region: 0x165, script: 0x55, flags: 0x0}, + 754: {region: 0x52, script: 0x55, flags: 0x0}, + 755: {region: 0xdb, script: 0x20, flags: 0x0}, + 756: {region: 0x12f, script: 0x55, flags: 0x0}, + 757: {region: 0xc0, script: 0x55, flags: 0x0}, + 758: {region: 0x165, script: 0x55, flags: 0x0}, + 759: {region: 0x165, script: 0x55, flags: 0x0}, + 760: {region: 0xe0, script: 0x55, flags: 0x0}, + 761: {region: 0x165, script: 0x55, flags: 0x0}, + 762: {region: 0x95, script: 0x55, flags: 0x0}, + 763: {region: 0x9b, script: 0x39, flags: 0x0}, + 764: {region: 0x165, script: 0x55, flags: 0x0}, + 765: {region: 0xc2, script: 0x1e, flags: 0x0}, + 766: {region: 0x165, script: 0x5, flags: 0x0}, + 767: {region: 0x165, script: 0x55, flags: 0x0}, + 768: {region: 0x165, script: 0x55, flags: 0x0}, + 769: {region: 0x165, script: 0x55, flags: 0x0}, + 770: {region: 0x99, script: 0x69, flags: 0x0}, + 771: {region: 0x165, script: 0x55, flags: 0x0}, + 772: {region: 0x165, script: 0x55, flags: 0x0}, + 773: {region: 0x10b, script: 0x55, flags: 0x0}, + 774: {region: 0x165, script: 0x55, flags: 0x0}, + 775: {region: 0x165, script: 0x55, flags: 0x0}, + 776: {region: 0x165, script: 0x55, flags: 0x0}, 777: {region: 0x26, script: 0x3, flags: 0x1}, - 778: {region: 0x164, script: 0x52, flags: 0x0}, - 779: {region: 0x164, script: 0x52, flags: 0x0}, - 780: {region: 0x98, script: 0xe, flags: 0x0}, - 781: {region: 0xc3, script: 0x6b, flags: 0x0}, - 783: {region: 0x164, script: 0x52, flags: 0x0}, - 784: {region: 0x48, script: 0x52, flags: 0x0}, - 785: {region: 0x48, script: 0x52, flags: 0x0}, - 786: {region: 0x36, script: 0x52, flags: 0x0}, - 787: {region: 0x164, script: 0x52, flags: 0x0}, - 788: {region: 0x164, script: 0x52, flags: 0x0}, - 789: {region: 0x164, script: 0x52, flags: 0x0}, - 790: {region: 0x164, script: 0x52, flags: 0x0}, - 791: {region: 0x164, script: 0x52, flags: 0x0}, - 792: {region: 0x164, script: 0x52, flags: 0x0}, - 793: {region: 0x98, script: 0x20, flags: 0x0}, - 794: {region: 0xda, script: 0x20, flags: 0x0}, - 795: {region: 0x105, script: 0x1e, flags: 0x0}, - 796: {region: 0x34, script: 0x68, flags: 0x0}, + 778: {region: 0x165, script: 0x55, flags: 0x0}, + 779: {region: 0x165, script: 0x55, flags: 0x0}, + 780: {region: 0x99, script: 0xe, flags: 0x0}, + 781: {region: 0xc4, script: 0x70, flags: 0x0}, + 783: {region: 0x165, script: 0x55, flags: 0x0}, + 784: {region: 0x49, script: 0x55, flags: 0x0}, + 785: {region: 0x49, script: 0x55, flags: 0x0}, + 786: {region: 0x37, script: 0x55, flags: 0x0}, + 787: {region: 0x165, script: 0x55, flags: 0x0}, + 788: {region: 0x165, script: 0x55, flags: 0x0}, + 789: {region: 0x165, script: 0x55, flags: 0x0}, + 790: {region: 0x165, script: 0x55, flags: 0x0}, + 791: {region: 0x165, script: 0x55, flags: 0x0}, + 792: {region: 0x165, script: 0x55, flags: 0x0}, + 793: {region: 0x99, script: 0x20, flags: 0x0}, + 794: {region: 0xdb, script: 0x20, flags: 0x0}, + 795: {region: 0x106, script: 0x1e, flags: 0x0}, + 796: {region: 0x35, script: 0x6d, flags: 0x0}, 797: {region: 0x29, script: 0x3, flags: 0x1}, - 798: {region: 0xca, script: 0x52, flags: 0x0}, - 799: {region: 0x164, script: 0x52, flags: 0x0}, - 800: {region: 0x164, script: 0x52, flags: 0x0}, - 801: {region: 0x164, script: 0x52, flags: 0x0}, - 802: {region: 0x98, script: 0x20, flags: 0x0}, - 803: {region: 0x51, script: 0x52, flags: 0x0}, - 805: {region: 0x164, script: 0x52, flags: 0x0}, - 806: {region: 0x134, script: 0x52, flags: 0x0}, - 807: {region: 0x164, script: 0x52, flags: 0x0}, - 808: {region: 0x164, script: 0x52, flags: 0x0}, - 809: {region: 0xe7, script: 0x5, flags: 0x0}, - 810: {region: 0xc2, script: 0x52, flags: 0x0}, - 811: {region: 0x98, script: 0x20, flags: 0x0}, - 812: {region: 0x94, script: 0x52, flags: 0x0}, - 813: {region: 0x163, script: 0x52, flags: 0x0}, - 814: {region: 0x164, script: 0x52, flags: 0x0}, - 815: {region: 0xc3, script: 0x6b, flags: 0x0}, - 816: {region: 0x164, script: 0x52, flags: 0x0}, - 817: {region: 0x164, script: 0x27, flags: 0x0}, - 818: {region: 0x105, script: 0x1e, flags: 0x0}, - 819: {region: 0x164, script: 0x52, flags: 0x0}, - 820: {region: 0x130, script: 0x52, flags: 0x0}, - 821: {region: 0x9b, script: 0x5d, flags: 0x0}, - 822: {region: 0x164, script: 0x52, flags: 0x0}, - 823: {region: 0x164, script: 0x52, flags: 0x0}, - 824: {region: 0x9b, script: 0x5, flags: 0x0}, - 825: {region: 0x164, script: 0x52, flags: 0x0}, - 826: {region: 0x164, script: 0x52, flags: 0x0}, - 827: {region: 0x164, script: 0x52, flags: 0x0}, - 828: {region: 0xdc, script: 0x52, flags: 0x0}, - 829: {region: 0x164, script: 0x52, flags: 0x0}, - 830: {region: 0x164, script: 0x52, flags: 0x0}, - 832: {region: 0x164, script: 0x52, flags: 0x0}, - 833: {region: 0x52, script: 0x34, flags: 0x0}, - 834: {region: 0x9d, script: 0x52, flags: 0x0}, - 835: {region: 0xd1, script: 0x52, flags: 0x0}, - 836: {region: 0x164, script: 0x52, flags: 0x0}, - 837: {region: 0xd9, script: 0x52, flags: 0x0}, - 838: {region: 0x164, script: 0x52, flags: 0x0}, - 839: {region: 0x164, script: 0x52, flags: 0x0}, - 840: {region: 0x164, script: 0x52, flags: 0x0}, - 841: {region: 0xce, script: 0x52, flags: 0x0}, - 842: {region: 0x164, script: 0x52, flags: 0x0}, - 843: {region: 0x164, script: 0x52, flags: 0x0}, - 844: {region: 0x163, script: 0x52, flags: 0x0}, - 845: {region: 0xd0, script: 0x52, flags: 0x0}, - 846: {region: 0x5f, script: 0x52, flags: 0x0}, - 847: {region: 0xda, script: 0x20, flags: 0x0}, - 848: {region: 0x164, script: 0x52, flags: 0x0}, - 849: {region: 0xda, script: 0x20, flags: 0x0}, - 850: {region: 0x164, script: 0x52, flags: 0x0}, - 851: {region: 0x164, script: 0x52, flags: 0x0}, - 852: {region: 0xd1, script: 0x52, flags: 0x0}, - 853: {region: 0x164, script: 0x52, flags: 0x0}, - 854: {region: 0x164, script: 0x52, flags: 0x0}, - 855: {region: 0xd0, script: 0x52, flags: 0x0}, - 856: {region: 0x164, script: 0x52, flags: 0x0}, - 857: {region: 0xce, script: 0x52, flags: 0x0}, - 858: {region: 0xce, script: 0x52, flags: 0x0}, - 859: {region: 0x164, script: 0x52, flags: 0x0}, - 860: {region: 0x164, script: 0x52, flags: 0x0}, - 861: {region: 0x94, script: 0x52, flags: 0x0}, - 862: {region: 0x164, script: 0x52, flags: 0x0}, - 863: {region: 0xde, script: 0x52, flags: 0x0}, - 864: {region: 0x164, script: 0x52, flags: 0x0}, - 865: {region: 0x164, script: 0x52, flags: 0x0}, - 866: {region: 0x98, script: 0x52, flags: 0x0}, - 867: {region: 0x164, script: 0x52, flags: 0x0}, - 868: {region: 0x164, script: 0x52, flags: 0x0}, - 869: {region: 0xd8, script: 0x52, flags: 0x0}, - 870: {region: 0x51, script: 0x52, flags: 0x0}, - 871: {region: 0x164, script: 0x52, flags: 0x0}, - 872: {region: 0xd9, script: 0x52, flags: 0x0}, - 873: {region: 0x164, script: 0x52, flags: 0x0}, - 874: {region: 0x51, script: 0x52, flags: 0x0}, - 875: {region: 0x164, script: 0x52, flags: 0x0}, - 876: {region: 0x164, script: 0x52, flags: 0x0}, - 877: {region: 0xd9, script: 0x52, flags: 0x0}, - 878: {region: 0x122, script: 0x4e, flags: 0x0}, - 879: {region: 0x98, script: 0x20, flags: 0x0}, - 880: {region: 0x10b, script: 0xb7, flags: 0x0}, - 881: {region: 0x164, script: 0x52, flags: 0x0}, - 882: {region: 0x164, script: 0x52, flags: 0x0}, - 883: {region: 0x83, script: 0x70, flags: 0x0}, - 884: {region: 0x160, script: 0x52, flags: 0x0}, - 885: {region: 0x164, script: 0x52, flags: 0x0}, - 886: {region: 0x48, script: 0x17, flags: 0x0}, - 887: {region: 0x164, script: 0x52, flags: 0x0}, - 888: {region: 0x160, script: 0x52, flags: 0x0}, - 889: {region: 0x164, script: 0x52, flags: 0x0}, - 890: {region: 0x164, script: 0x52, flags: 0x0}, - 891: {region: 0x164, script: 0x52, flags: 0x0}, - 892: {region: 0x164, script: 0x52, flags: 0x0}, - 893: {region: 0x164, script: 0x52, flags: 0x0}, - 894: {region: 0x116, script: 0x52, flags: 0x0}, - 895: {region: 0x164, script: 0x52, flags: 0x0}, - 896: {region: 0x164, script: 0x52, flags: 0x0}, - 897: {region: 0x134, script: 0x52, flags: 0x0}, - 898: {region: 0x164, script: 0x52, flags: 0x0}, - 899: {region: 0x52, script: 0x52, flags: 0x0}, - 900: {region: 0x164, script: 0x52, flags: 0x0}, - 901: {region: 0xcd, script: 0x52, flags: 0x0}, - 902: {region: 0x12e, script: 0x52, flags: 0x0}, - 903: {region: 0x130, script: 0x52, flags: 0x0}, - 904: {region: 0x7f, script: 0x52, flags: 0x0}, - 905: {region: 0x77, script: 0x52, flags: 0x0}, - 906: {region: 0x164, script: 0x52, flags: 0x0}, - 908: {region: 0x164, script: 0x52, flags: 0x0}, - 909: {region: 0x164, script: 0x52, flags: 0x0}, - 910: {region: 0x6e, script: 0x52, flags: 0x0}, - 911: {region: 0x164, script: 0x52, flags: 0x0}, - 912: {region: 0x164, script: 0x52, flags: 0x0}, - 913: {region: 0x164, script: 0x52, flags: 0x0}, - 914: {region: 0x164, script: 0x52, flags: 0x0}, - 915: {region: 0x98, script: 0x75, flags: 0x0}, - 916: {region: 0x164, script: 0x52, flags: 0x0}, - 917: {region: 0x164, script: 0x5, flags: 0x0}, - 918: {region: 0x7c, script: 0x1e, flags: 0x0}, - 919: {region: 0x134, script: 0x76, flags: 0x0}, - 920: {region: 0x164, script: 0x5, flags: 0x0}, - 921: {region: 0xc4, script: 0x74, flags: 0x0}, - 922: {region: 0x164, script: 0x52, flags: 0x0}, + 798: {region: 0xcb, script: 0x55, flags: 0x0}, + 799: {region: 0x165, script: 0x55, flags: 0x0}, + 800: {region: 0x165, script: 0x55, flags: 0x0}, + 801: {region: 0x165, script: 0x55, flags: 0x0}, + 802: {region: 0x99, script: 0x20, flags: 0x0}, + 803: {region: 0x52, script: 0x55, flags: 0x0}, + 805: {region: 0x165, script: 0x55, flags: 0x0}, + 806: {region: 0x135, script: 0x55, flags: 0x0}, + 807: {region: 0x165, script: 0x55, flags: 0x0}, + 808: {region: 0x165, script: 0x55, flags: 0x0}, + 809: {region: 0xe8, script: 0x5, flags: 0x0}, + 810: {region: 0xc3, script: 0x55, flags: 0x0}, + 811: {region: 0x99, script: 0x20, flags: 0x0}, + 812: {region: 0x95, script: 0x55, flags: 0x0}, + 813: {region: 0x164, script: 0x55, flags: 0x0}, + 814: {region: 0x165, script: 0x55, flags: 0x0}, + 815: {region: 0xc4, script: 0x70, flags: 0x0}, + 816: {region: 0x165, script: 0x55, flags: 0x0}, + 817: {region: 0x165, script: 0x28, flags: 0x0}, + 818: {region: 0x106, script: 0x1e, flags: 0x0}, + 819: {region: 0x165, script: 0x55, flags: 0x0}, + 820: {region: 0x131, script: 0x55, flags: 0x0}, + 821: {region: 0x9c, script: 0x61, flags: 0x0}, + 822: {region: 0x165, script: 0x55, flags: 0x0}, + 823: {region: 0x165, script: 0x55, flags: 0x0}, + 824: {region: 0x9c, script: 0x5, flags: 0x0}, + 825: {region: 0x165, script: 0x55, flags: 0x0}, + 826: {region: 0x165, script: 0x55, flags: 0x0}, + 827: {region: 0x165, script: 0x55, flags: 0x0}, + 828: {region: 0xdd, script: 0x55, flags: 0x0}, + 829: {region: 0x165, script: 0x55, flags: 0x0}, + 830: {region: 0x165, script: 0x55, flags: 0x0}, + 832: {region: 0x165, script: 0x55, flags: 0x0}, + 833: {region: 0x53, script: 0x37, flags: 0x0}, + 834: {region: 0x9e, script: 0x55, flags: 0x0}, + 835: {region: 0xd2, script: 0x55, flags: 0x0}, + 836: {region: 0x165, script: 0x55, flags: 0x0}, + 837: {region: 0xda, script: 0x55, flags: 0x0}, + 838: {region: 0x165, script: 0x55, flags: 0x0}, + 839: {region: 0x165, script: 0x55, flags: 0x0}, + 840: {region: 0x165, script: 0x55, flags: 0x0}, + 841: {region: 0xcf, script: 0x55, flags: 0x0}, + 842: {region: 0x165, script: 0x55, flags: 0x0}, + 843: {region: 0x165, script: 0x55, flags: 0x0}, + 844: {region: 0x164, script: 0x55, flags: 0x0}, + 845: {region: 0xd1, script: 0x55, flags: 0x0}, + 846: {region: 0x60, script: 0x55, flags: 0x0}, + 847: {region: 0xdb, script: 0x20, flags: 0x0}, + 848: {region: 0x165, script: 0x55, flags: 0x0}, + 849: {region: 0xdb, script: 0x20, flags: 0x0}, + 850: {region: 0x165, script: 0x55, flags: 0x0}, + 851: {region: 0x165, script: 0x55, flags: 0x0}, + 852: {region: 0xd2, script: 0x55, flags: 0x0}, + 853: {region: 0x165, script: 0x55, flags: 0x0}, + 854: {region: 0x165, script: 0x55, flags: 0x0}, + 855: {region: 0xd1, script: 0x55, flags: 0x0}, + 856: {region: 0x165, script: 0x55, flags: 0x0}, + 857: {region: 0xcf, script: 0x55, flags: 0x0}, + 858: {region: 0xcf, script: 0x55, flags: 0x0}, + 859: {region: 0x165, script: 0x55, flags: 0x0}, + 860: {region: 0x165, script: 0x55, flags: 0x0}, + 861: {region: 0x95, script: 0x55, flags: 0x0}, + 862: {region: 0x165, script: 0x55, flags: 0x0}, + 863: {region: 0xdf, script: 0x55, flags: 0x0}, + 864: {region: 0x165, script: 0x55, flags: 0x0}, + 865: {region: 0x165, script: 0x55, flags: 0x0}, + 866: {region: 0x99, script: 0x55, flags: 0x0}, + 867: {region: 0x165, script: 0x55, flags: 0x0}, + 868: {region: 0x165, script: 0x55, flags: 0x0}, + 869: {region: 0xd9, script: 0x55, flags: 0x0}, + 870: {region: 0x52, script: 0x55, flags: 0x0}, + 871: {region: 0x165, script: 0x55, flags: 0x0}, + 872: {region: 0xda, script: 0x55, flags: 0x0}, + 873: {region: 0x165, script: 0x55, flags: 0x0}, + 874: {region: 0x52, script: 0x55, flags: 0x0}, + 875: {region: 0x165, script: 0x55, flags: 0x0}, + 876: {region: 0x165, script: 0x55, flags: 0x0}, + 877: {region: 0xda, script: 0x55, flags: 0x0}, + 878: {region: 0x123, script: 0x51, flags: 0x0}, + 879: {region: 0x99, script: 0x20, flags: 0x0}, + 880: {region: 0x10c, script: 0xbc, flags: 0x0}, + 881: {region: 0x165, script: 0x55, flags: 0x0}, + 882: {region: 0x165, script: 0x55, flags: 0x0}, + 883: {region: 0x84, script: 0x75, flags: 0x0}, + 884: {region: 0x161, script: 0x55, flags: 0x0}, + 885: {region: 0x165, script: 0x55, flags: 0x0}, + 886: {region: 0x49, script: 0x17, flags: 0x0}, + 887: {region: 0x165, script: 0x55, flags: 0x0}, + 888: {region: 0x161, script: 0x55, flags: 0x0}, + 889: {region: 0x165, script: 0x55, flags: 0x0}, + 890: {region: 0x165, script: 0x55, flags: 0x0}, + 891: {region: 0x165, script: 0x55, flags: 0x0}, + 892: {region: 0x165, script: 0x55, flags: 0x0}, + 893: {region: 0x165, script: 0x55, flags: 0x0}, + 894: {region: 0x117, script: 0x55, flags: 0x0}, + 895: {region: 0x165, script: 0x55, flags: 0x0}, + 896: {region: 0x165, script: 0x55, flags: 0x0}, + 897: {region: 0x135, script: 0x55, flags: 0x0}, + 898: {region: 0x165, script: 0x55, flags: 0x0}, + 899: {region: 0x53, script: 0x55, flags: 0x0}, + 900: {region: 0x165, script: 0x55, flags: 0x0}, + 901: {region: 0xce, script: 0x55, flags: 0x0}, + 902: {region: 0x12f, script: 0x55, flags: 0x0}, + 903: {region: 0x131, script: 0x55, flags: 0x0}, + 904: {region: 0x80, script: 0x55, flags: 0x0}, + 905: {region: 0x78, script: 0x55, flags: 0x0}, + 906: {region: 0x165, script: 0x55, flags: 0x0}, + 908: {region: 0x165, script: 0x55, flags: 0x0}, + 909: {region: 0x165, script: 0x55, flags: 0x0}, + 910: {region: 0x6f, script: 0x55, flags: 0x0}, + 911: {region: 0x165, script: 0x55, flags: 0x0}, + 912: {region: 0x165, script: 0x55, flags: 0x0}, + 913: {region: 0x165, script: 0x55, flags: 0x0}, + 914: {region: 0x165, script: 0x55, flags: 0x0}, + 915: {region: 0x99, script: 0x7a, flags: 0x0}, + 916: {region: 0x165, script: 0x55, flags: 0x0}, + 917: {region: 0x165, script: 0x5, flags: 0x0}, + 918: {region: 0x7d, script: 0x1e, flags: 0x0}, + 919: {region: 0x135, script: 0x7b, flags: 0x0}, + 920: {region: 0x165, script: 0x5, flags: 0x0}, + 921: {region: 0xc5, script: 0x79, flags: 0x0}, + 922: {region: 0x165, script: 0x55, flags: 0x0}, 923: {region: 0x2c, script: 0x3, flags: 0x1}, - 924: {region: 0xe6, script: 0x52, flags: 0x0}, + 924: {region: 0xe7, script: 0x55, flags: 0x0}, 925: {region: 0x2f, script: 0x2, flags: 0x1}, - 926: {region: 0xe6, script: 0x52, flags: 0x0}, - 927: {region: 0x2f, script: 0x52, flags: 0x0}, - 928: {region: 0xef, script: 0x52, flags: 0x0}, - 929: {region: 0x164, script: 0x52, flags: 0x0}, - 930: {region: 0x77, script: 0x52, flags: 0x0}, - 931: {region: 0xd5, script: 0x52, flags: 0x0}, - 932: {region: 0x134, script: 0x52, flags: 0x0}, - 933: {region: 0x48, script: 0x52, flags: 0x0}, - 934: {region: 0x164, script: 0x52, flags: 0x0}, - 935: {region: 0x9b, script: 0xdd, flags: 0x0}, - 936: {region: 0x164, script: 0x52, flags: 0x0}, - 937: {region: 0x5f, script: 0x52, flags: 0x0}, - 938: {region: 0x164, script: 0x5, flags: 0x0}, - 939: {region: 0xaf, script: 0x7f, flags: 0x0}, - 941: {region: 0x164, script: 0x52, flags: 0x0}, - 942: {region: 0x164, script: 0x52, flags: 0x0}, - 943: {region: 0x98, script: 0x12, flags: 0x0}, - 944: {region: 0xa3, script: 0x52, flags: 0x0}, - 945: {region: 0xe8, script: 0x52, flags: 0x0}, - 946: {region: 0x164, script: 0x52, flags: 0x0}, - 947: {region: 0x9d, script: 0x52, flags: 0x0}, - 948: {region: 0x164, script: 0x52, flags: 0x0}, - 949: {region: 0x164, script: 0x52, flags: 0x0}, - 950: {region: 0x86, script: 0x2d, flags: 0x0}, - 951: {region: 0x74, script: 0x52, flags: 0x0}, - 952: {region: 0x164, script: 0x52, flags: 0x0}, - 953: {region: 0xe7, script: 0x45, flags: 0x0}, - 954: {region: 0x9b, script: 0x5, flags: 0x0}, - 955: {region: 0x1, script: 0x52, flags: 0x0}, - 956: {region: 0x23, script: 0x5, flags: 0x0}, - 957: {region: 0x164, script: 0x52, flags: 0x0}, - 958: {region: 0x40, script: 0x52, flags: 0x0}, - 959: {region: 0x164, script: 0x52, flags: 0x0}, - 960: {region: 0x79, script: 0x52, flags: 0x0}, - 961: {region: 0x164, script: 0x52, flags: 0x0}, - 962: {region: 0xe3, script: 0x52, flags: 0x0}, - 963: {region: 0x88, script: 0x52, flags: 0x0}, - 964: {region: 0x68, script: 0x52, flags: 0x0}, - 965: {region: 0x164, script: 0x52, flags: 0x0}, - 966: {region: 0x98, script: 0x20, flags: 0x0}, - 967: {region: 0x164, script: 0x52, flags: 0x0}, - 968: {region: 0x101, script: 0x52, flags: 0x0}, - 969: {region: 0x94, script: 0x52, flags: 0x0}, - 970: {region: 0x164, script: 0x52, flags: 0x0}, - 971: {region: 0x164, script: 0x52, flags: 0x0}, - 972: {region: 0x9d, script: 0x52, flags: 0x0}, - 973: {region: 0x164, script: 0x5, flags: 0x0}, - 974: {region: 0x98, script: 0x52, flags: 0x0}, + 926: {region: 0xe7, script: 0x55, flags: 0x0}, + 927: {region: 0x30, script: 0x55, flags: 0x0}, + 928: {region: 0xf0, script: 0x55, flags: 0x0}, + 929: {region: 0x165, script: 0x55, flags: 0x0}, + 930: {region: 0x78, script: 0x55, flags: 0x0}, + 931: {region: 0xd6, script: 0x55, flags: 0x0}, + 932: {region: 0x135, script: 0x55, flags: 0x0}, + 933: {region: 0x49, script: 0x55, flags: 0x0}, + 934: {region: 0x165, script: 0x55, flags: 0x0}, + 935: {region: 0x9c, script: 0xe3, flags: 0x0}, + 936: {region: 0x165, script: 0x55, flags: 0x0}, + 937: {region: 0x60, script: 0x55, flags: 0x0}, + 938: {region: 0x165, script: 0x5, flags: 0x0}, + 939: {region: 0xb0, script: 0x84, flags: 0x0}, + 941: {region: 0x165, script: 0x55, flags: 0x0}, + 942: {region: 0x165, script: 0x55, flags: 0x0}, + 943: {region: 0x99, script: 0x12, flags: 0x0}, + 944: {region: 0xa4, script: 0x55, flags: 0x0}, + 945: {region: 0xe9, script: 0x55, flags: 0x0}, + 946: {region: 0x165, script: 0x55, flags: 0x0}, + 947: {region: 0x9e, script: 0x55, flags: 0x0}, + 948: {region: 0x165, script: 0x55, flags: 0x0}, + 949: {region: 0x165, script: 0x55, flags: 0x0}, + 950: {region: 0x87, script: 0x30, flags: 0x0}, + 951: {region: 0x75, script: 0x55, flags: 0x0}, + 952: {region: 0x165, script: 0x55, flags: 0x0}, + 953: {region: 0xe8, script: 0x48, flags: 0x0}, + 954: {region: 0x9c, script: 0x5, flags: 0x0}, + 955: {region: 0x1, script: 0x55, flags: 0x0}, + 956: {region: 0x24, script: 0x5, flags: 0x0}, + 957: {region: 0x165, script: 0x55, flags: 0x0}, + 958: {region: 0x41, script: 0x55, flags: 0x0}, + 959: {region: 0x165, script: 0x55, flags: 0x0}, + 960: {region: 0x7a, script: 0x55, flags: 0x0}, + 961: {region: 0x165, script: 0x55, flags: 0x0}, + 962: {region: 0xe4, script: 0x55, flags: 0x0}, + 963: {region: 0x89, script: 0x55, flags: 0x0}, + 964: {region: 0x69, script: 0x55, flags: 0x0}, + 965: {region: 0x165, script: 0x55, flags: 0x0}, + 966: {region: 0x99, script: 0x20, flags: 0x0}, + 967: {region: 0x165, script: 0x55, flags: 0x0}, + 968: {region: 0x102, script: 0x55, flags: 0x0}, + 969: {region: 0x95, script: 0x55, flags: 0x0}, + 970: {region: 0x165, script: 0x55, flags: 0x0}, + 971: {region: 0x165, script: 0x55, flags: 0x0}, + 972: {region: 0x9e, script: 0x55, flags: 0x0}, + 973: {region: 0x165, script: 0x5, flags: 0x0}, + 974: {region: 0x99, script: 0x55, flags: 0x0}, 975: {region: 0x31, script: 0x2, flags: 0x1}, - 976: {region: 0xda, script: 0x20, flags: 0x0}, - 977: {region: 0x34, script: 0xe, flags: 0x0}, - 978: {region: 0x4d, script: 0x52, flags: 0x0}, - 979: {region: 0x71, script: 0x52, flags: 0x0}, - 980: {region: 0x4d, script: 0x52, flags: 0x0}, - 981: {region: 0x9b, script: 0x5, flags: 0x0}, - 982: {region: 0x10b, script: 0x52, flags: 0x0}, - 983: {region: 0x39, script: 0x52, flags: 0x0}, - 984: {region: 0x164, script: 0x52, flags: 0x0}, - 985: {region: 0xd0, script: 0x52, flags: 0x0}, - 986: {region: 0x103, script: 0x52, flags: 0x0}, - 987: {region: 0x94, script: 0x52, flags: 0x0}, - 988: {region: 0x12e, script: 0x52, flags: 0x0}, - 989: {region: 0x164, script: 0x52, flags: 0x0}, - 990: {region: 0x164, script: 0x52, flags: 0x0}, - 991: {region: 0x72, script: 0x52, flags: 0x0}, - 992: {region: 0x105, script: 0x1e, flags: 0x0}, - 993: {region: 0x12f, script: 0x1e, flags: 0x0}, - 994: {region: 0x108, script: 0x52, flags: 0x0}, - 995: {region: 0x106, script: 0x52, flags: 0x0}, - 996: {region: 0x12e, script: 0x52, flags: 0x0}, - 997: {region: 0x164, script: 0x52, flags: 0x0}, - 998: {region: 0xa1, script: 0x44, flags: 0x0}, - 999: {region: 0x98, script: 0x20, flags: 0x0}, - 1000: {region: 0x7f, script: 0x52, flags: 0x0}, - 1001: {region: 0x105, script: 0x1e, flags: 0x0}, - 1002: {region: 0xa3, script: 0x52, flags: 0x0}, - 1003: {region: 0x94, script: 0x52, flags: 0x0}, - 1004: {region: 0x98, script: 0x52, flags: 0x0}, - 1005: {region: 0x113, script: 0x52, flags: 0x0}, - 1006: {region: 0x98, script: 0xbb, flags: 0x0}, - 1007: {region: 0x164, script: 0x52, flags: 0x0}, - 1008: {region: 0x164, script: 0x52, flags: 0x0}, - 1009: {region: 0x12e, script: 0x52, flags: 0x0}, - 1010: {region: 0x9d, script: 0x52, flags: 0x0}, - 1011: {region: 0x98, script: 0x20, flags: 0x0}, - 1012: {region: 0x164, script: 0x5, flags: 0x0}, - 1013: {region: 0x9d, script: 0x52, flags: 0x0}, - 1014: {region: 0x7a, script: 0x52, flags: 0x0}, - 1015: {region: 0x48, script: 0x52, flags: 0x0}, + 976: {region: 0xdb, script: 0x20, flags: 0x0}, + 977: {region: 0x35, script: 0xe, flags: 0x0}, + 978: {region: 0x4e, script: 0x55, flags: 0x0}, + 979: {region: 0x72, script: 0x55, flags: 0x0}, + 980: {region: 0x4e, script: 0x55, flags: 0x0}, + 981: {region: 0x9c, script: 0x5, flags: 0x0}, + 982: {region: 0x10c, script: 0x55, flags: 0x0}, + 983: {region: 0x3a, script: 0x55, flags: 0x0}, + 984: {region: 0x165, script: 0x55, flags: 0x0}, + 985: {region: 0xd1, script: 0x55, flags: 0x0}, + 986: {region: 0x104, script: 0x55, flags: 0x0}, + 987: {region: 0x95, script: 0x55, flags: 0x0}, + 988: {region: 0x12f, script: 0x55, flags: 0x0}, + 989: {region: 0x165, script: 0x55, flags: 0x0}, + 990: {region: 0x165, script: 0x55, flags: 0x0}, + 991: {region: 0x73, script: 0x55, flags: 0x0}, + 992: {region: 0x106, script: 0x1e, flags: 0x0}, + 993: {region: 0x130, script: 0x1e, flags: 0x0}, + 994: {region: 0x109, script: 0x55, flags: 0x0}, + 995: {region: 0x107, script: 0x55, flags: 0x0}, + 996: {region: 0x12f, script: 0x55, flags: 0x0}, + 997: {region: 0x165, script: 0x55, flags: 0x0}, + 998: {region: 0xa2, script: 0x47, flags: 0x0}, + 999: {region: 0x99, script: 0x20, flags: 0x0}, + 1000: {region: 0x80, script: 0x55, flags: 0x0}, + 1001: {region: 0x106, script: 0x1e, flags: 0x0}, + 1002: {region: 0xa4, script: 0x55, flags: 0x0}, + 1003: {region: 0x95, script: 0x55, flags: 0x0}, + 1004: {region: 0x99, script: 0x55, flags: 0x0}, + 1005: {region: 0x114, script: 0x55, flags: 0x0}, + 1006: {region: 0x99, script: 0xc0, flags: 0x0}, + 1007: {region: 0x165, script: 0x55, flags: 0x0}, + 1008: {region: 0x165, script: 0x55, flags: 0x0}, + 1009: {region: 0x12f, script: 0x55, flags: 0x0}, + 1010: {region: 0x9e, script: 0x55, flags: 0x0}, + 1011: {region: 0x99, script: 0x20, flags: 0x0}, + 1012: {region: 0x165, script: 0x5, flags: 0x0}, + 1013: {region: 0x9e, script: 0x55, flags: 0x0}, + 1014: {region: 0x7b, script: 0x55, flags: 0x0}, + 1015: {region: 0x49, script: 0x55, flags: 0x0}, 1016: {region: 0x33, script: 0x4, flags: 0x1}, - 1017: {region: 0x9d, script: 0x52, flags: 0x0}, - 1018: {region: 0x9b, script: 0x5, flags: 0x0}, - 1019: {region: 0xd9, script: 0x52, flags: 0x0}, - 1020: {region: 0x4e, script: 0x52, flags: 0x0}, - 1021: {region: 0xd0, script: 0x52, flags: 0x0}, - 1022: {region: 0xce, script: 0x52, flags: 0x0}, - 1023: {region: 0xc2, script: 0x52, flags: 0x0}, - 1024: {region: 0x4b, script: 0x52, flags: 0x0}, - 1025: {region: 0x95, script: 0x72, flags: 0x0}, - 1026: {region: 0xb5, script: 0x52, flags: 0x0}, - 1027: {region: 0x164, script: 0x27, flags: 0x0}, - 1028: {region: 0x164, script: 0x52, flags: 0x0}, - 1030: {region: 0xb9, script: 0xd2, flags: 0x0}, - 1031: {region: 0x164, script: 0x52, flags: 0x0}, - 1032: {region: 0xc3, script: 0x6b, flags: 0x0}, - 1033: {region: 0x164, script: 0x5, flags: 0x0}, - 1034: {region: 0xb2, script: 0xc1, flags: 0x0}, - 1035: {region: 0x6e, script: 0x52, flags: 0x0}, - 1036: {region: 0x164, script: 0x52, flags: 0x0}, - 1037: {region: 0x164, script: 0x52, flags: 0x0}, - 1038: {region: 0x164, script: 0x52, flags: 0x0}, - 1039: {region: 0x164, script: 0x52, flags: 0x0}, - 1040: {region: 0x110, script: 0x52, flags: 0x0}, - 1041: {region: 0x164, script: 0x52, flags: 0x0}, - 1042: {region: 0xe7, script: 0x5, flags: 0x0}, - 1043: {region: 0x164, script: 0x52, flags: 0x0}, - 1044: {region: 0x10e, script: 0x52, flags: 0x0}, - 1045: {region: 0x164, script: 0x52, flags: 0x0}, - 1046: {region: 0xe8, script: 0x52, flags: 0x0}, - 1047: {region: 0x164, script: 0x52, flags: 0x0}, - 1048: {region: 0x94, script: 0x52, flags: 0x0}, - 1049: {region: 0x141, script: 0x52, flags: 0x0}, - 1050: {region: 0x10b, script: 0x52, flags: 0x0}, - 1052: {region: 0x10b, script: 0x52, flags: 0x0}, - 1053: {region: 0x71, script: 0x52, flags: 0x0}, - 1054: {region: 0x96, script: 0xb8, flags: 0x0}, - 1055: {region: 0x164, script: 0x52, flags: 0x0}, - 1056: {region: 0x71, script: 0x52, flags: 0x0}, - 1057: {region: 0x163, script: 0x52, flags: 0x0}, - 1058: {region: 0x164, script: 0x52, flags: 0x0}, - 1059: {region: 0xc2, script: 0x52, flags: 0x0}, - 1060: {region: 0x164, script: 0x52, flags: 0x0}, - 1061: {region: 0x164, script: 0x52, flags: 0x0}, - 1062: {region: 0x164, script: 0x52, flags: 0x0}, - 1063: {region: 0x114, script: 0x52, flags: 0x0}, - 1064: {region: 0x164, script: 0x52, flags: 0x0}, - 1065: {region: 0x164, script: 0x52, flags: 0x0}, - 1066: {region: 0x122, script: 0xd5, flags: 0x0}, - 1067: {region: 0x164, script: 0x52, flags: 0x0}, - 1068: {region: 0x164, script: 0x52, flags: 0x0}, - 1069: {region: 0x164, script: 0x52, flags: 0x0}, - 1070: {region: 0x164, script: 0x52, flags: 0x0}, - 1071: {region: 0x26, script: 0x52, flags: 0x0}, + 1017: {region: 0x9e, script: 0x55, flags: 0x0}, + 1018: {region: 0x9c, script: 0x5, flags: 0x0}, + 1019: {region: 0xda, script: 0x55, flags: 0x0}, + 1020: {region: 0x4f, script: 0x55, flags: 0x0}, + 1021: {region: 0xd1, script: 0x55, flags: 0x0}, + 1022: {region: 0xcf, script: 0x55, flags: 0x0}, + 1023: {region: 0xc3, script: 0x55, flags: 0x0}, + 1024: {region: 0x4c, script: 0x55, flags: 0x0}, + 1025: {region: 0x96, script: 0x77, flags: 0x0}, + 1026: {region: 0xb6, script: 0x55, flags: 0x0}, + 1027: {region: 0x165, script: 0x28, flags: 0x0}, + 1028: {region: 0x165, script: 0x55, flags: 0x0}, + 1030: {region: 0xba, script: 0xd8, flags: 0x0}, + 1031: {region: 0x165, script: 0x55, flags: 0x0}, + 1032: {region: 0xc4, script: 0x70, flags: 0x0}, + 1033: {region: 0x165, script: 0x5, flags: 0x0}, + 1034: {region: 0xb3, script: 0xc6, flags: 0x0}, + 1035: {region: 0x6f, script: 0x55, flags: 0x0}, + 1036: {region: 0x165, script: 0x55, flags: 0x0}, + 1037: {region: 0x165, script: 0x55, flags: 0x0}, + 1038: {region: 0x165, script: 0x55, flags: 0x0}, + 1039: {region: 0x165, script: 0x55, flags: 0x0}, + 1040: {region: 0x111, script: 0x55, flags: 0x0}, + 1041: {region: 0x165, script: 0x55, flags: 0x0}, + 1042: {region: 0xe8, script: 0x5, flags: 0x0}, + 1043: {region: 0x165, script: 0x55, flags: 0x0}, + 1044: {region: 0x10f, script: 0x55, flags: 0x0}, + 1045: {region: 0x165, script: 0x55, flags: 0x0}, + 1046: {region: 0xe9, script: 0x55, flags: 0x0}, + 1047: {region: 0x165, script: 0x55, flags: 0x0}, + 1048: {region: 0x95, script: 0x55, flags: 0x0}, + 1049: {region: 0x142, script: 0x55, flags: 0x0}, + 1050: {region: 0x10c, script: 0x55, flags: 0x0}, + 1052: {region: 0x10c, script: 0x55, flags: 0x0}, + 1053: {region: 0x72, script: 0x55, flags: 0x0}, + 1054: {region: 0x97, script: 0xbd, flags: 0x0}, + 1055: {region: 0x165, script: 0x55, flags: 0x0}, + 1056: {region: 0x72, script: 0x55, flags: 0x0}, + 1057: {region: 0x164, script: 0x55, flags: 0x0}, + 1058: {region: 0x165, script: 0x55, flags: 0x0}, + 1059: {region: 0xc3, script: 0x55, flags: 0x0}, + 1060: {region: 0x165, script: 0x55, flags: 0x0}, + 1061: {region: 0x165, script: 0x55, flags: 0x0}, + 1062: {region: 0x165, script: 0x55, flags: 0x0}, + 1063: {region: 0x115, script: 0x55, flags: 0x0}, + 1064: {region: 0x165, script: 0x55, flags: 0x0}, + 1065: {region: 0x165, script: 0x55, flags: 0x0}, + 1066: {region: 0x123, script: 0xdb, flags: 0x0}, + 1067: {region: 0x165, script: 0x55, flags: 0x0}, + 1068: {region: 0x165, script: 0x55, flags: 0x0}, + 1069: {region: 0x165, script: 0x55, flags: 0x0}, + 1070: {region: 0x165, script: 0x55, flags: 0x0}, + 1071: {region: 0x27, script: 0x55, flags: 0x0}, 1072: {region: 0x37, script: 0x5, flags: 0x1}, - 1073: {region: 0x98, script: 0xc2, flags: 0x0}, - 1074: {region: 0x115, script: 0x52, flags: 0x0}, - 1075: {region: 0x113, script: 0x52, flags: 0x0}, - 1076: {region: 0x98, script: 0x20, flags: 0x0}, - 1077: {region: 0x160, script: 0x52, flags: 0x0}, - 1078: {region: 0x164, script: 0x52, flags: 0x0}, - 1079: {region: 0x164, script: 0x52, flags: 0x0}, - 1080: {region: 0x6c, script: 0x52, flags: 0x0}, - 1081: {region: 0x160, script: 0x52, flags: 0x0}, - 1082: {region: 0x164, script: 0x52, flags: 0x0}, - 1083: {region: 0x5f, script: 0x52, flags: 0x0}, - 1084: {region: 0x94, script: 0x52, flags: 0x0}, - 1085: {region: 0x164, script: 0x52, flags: 0x0}, - 1086: {region: 0x164, script: 0x52, flags: 0x0}, - 1087: {region: 0x12e, script: 0x52, flags: 0x0}, - 1088: {region: 0x164, script: 0x52, flags: 0x0}, - 1089: {region: 0x83, script: 0x52, flags: 0x0}, - 1090: {region: 0x10b, script: 0x52, flags: 0x0}, - 1091: {region: 0x12e, script: 0x52, flags: 0x0}, - 1092: {region: 0x15e, script: 0x5, flags: 0x0}, - 1093: {region: 0x4a, script: 0x52, flags: 0x0}, - 1094: {region: 0x5f, script: 0x52, flags: 0x0}, - 1095: {region: 0x164, script: 0x52, flags: 0x0}, - 1096: {region: 0x98, script: 0x20, flags: 0x0}, - 1097: {region: 0x94, script: 0x52, flags: 0x0}, - 1098: {region: 0x164, script: 0x52, flags: 0x0}, - 1099: {region: 0x34, script: 0xe, flags: 0x0}, - 1100: {region: 0x9a, script: 0xc5, flags: 0x0}, - 1101: {region: 0xe8, script: 0x52, flags: 0x0}, - 1102: {region: 0x98, script: 0xcd, flags: 0x0}, - 1103: {region: 0xda, script: 0x20, flags: 0x0}, - 1104: {region: 0x164, script: 0x52, flags: 0x0}, - 1105: {region: 0x164, script: 0x52, flags: 0x0}, - 1106: {region: 0x164, script: 0x52, flags: 0x0}, - 1107: {region: 0x164, script: 0x52, flags: 0x0}, - 1108: {region: 0x164, script: 0x52, flags: 0x0}, - 1109: {region: 0x164, script: 0x52, flags: 0x0}, - 1110: {region: 0x164, script: 0x52, flags: 0x0}, - 1111: {region: 0x164, script: 0x52, flags: 0x0}, - 1112: {region: 0xe6, script: 0x52, flags: 0x0}, - 1113: {region: 0x164, script: 0x52, flags: 0x0}, - 1114: {region: 0x164, script: 0x52, flags: 0x0}, - 1115: {region: 0x98, script: 0x4a, flags: 0x0}, - 1116: {region: 0x52, script: 0xcb, flags: 0x0}, - 1117: {region: 0xda, script: 0x20, flags: 0x0}, - 1118: {region: 0xda, script: 0x20, flags: 0x0}, - 1119: {region: 0x98, script: 0xd0, flags: 0x0}, - 1120: {region: 0x164, script: 0x52, flags: 0x0}, - 1121: {region: 0x111, script: 0x52, flags: 0x0}, - 1122: {region: 0x130, script: 0x52, flags: 0x0}, - 1123: {region: 0x125, script: 0x52, flags: 0x0}, - 1124: {region: 0x164, script: 0x52, flags: 0x0}, + 1073: {region: 0x99, script: 0xc7, flags: 0x0}, + 1074: {region: 0x116, script: 0x55, flags: 0x0}, + 1075: {region: 0x114, script: 0x55, flags: 0x0}, + 1076: {region: 0x99, script: 0x20, flags: 0x0}, + 1077: {region: 0x161, script: 0x55, flags: 0x0}, + 1078: {region: 0x165, script: 0x55, flags: 0x0}, + 1079: {region: 0x165, script: 0x55, flags: 0x0}, + 1080: {region: 0x6d, script: 0x55, flags: 0x0}, + 1081: {region: 0x161, script: 0x55, flags: 0x0}, + 1082: {region: 0x165, script: 0x55, flags: 0x0}, + 1083: {region: 0x60, script: 0x55, flags: 0x0}, + 1084: {region: 0x95, script: 0x55, flags: 0x0}, + 1085: {region: 0x165, script: 0x55, flags: 0x0}, + 1086: {region: 0x165, script: 0x55, flags: 0x0}, + 1087: {region: 0x12f, script: 0x55, flags: 0x0}, + 1088: {region: 0x165, script: 0x55, flags: 0x0}, + 1089: {region: 0x84, script: 0x55, flags: 0x0}, + 1090: {region: 0x10c, script: 0x55, flags: 0x0}, + 1091: {region: 0x12f, script: 0x55, flags: 0x0}, + 1092: {region: 0x15f, script: 0x5, flags: 0x0}, + 1093: {region: 0x4b, script: 0x55, flags: 0x0}, + 1094: {region: 0x60, script: 0x55, flags: 0x0}, + 1095: {region: 0x165, script: 0x55, flags: 0x0}, + 1096: {region: 0x99, script: 0x20, flags: 0x0}, + 1097: {region: 0x95, script: 0x55, flags: 0x0}, + 1098: {region: 0x165, script: 0x55, flags: 0x0}, + 1099: {region: 0x35, script: 0xe, flags: 0x0}, + 1100: {region: 0x9b, script: 0xcb, flags: 0x0}, + 1101: {region: 0xe9, script: 0x55, flags: 0x0}, + 1102: {region: 0x99, script: 0xd3, flags: 0x0}, + 1103: {region: 0xdb, script: 0x20, flags: 0x0}, + 1104: {region: 0x165, script: 0x55, flags: 0x0}, + 1105: {region: 0x165, script: 0x55, flags: 0x0}, + 1106: {region: 0x165, script: 0x55, flags: 0x0}, + 1107: {region: 0x165, script: 0x55, flags: 0x0}, + 1108: {region: 0x165, script: 0x55, flags: 0x0}, + 1109: {region: 0x165, script: 0x55, flags: 0x0}, + 1110: {region: 0x165, script: 0x55, flags: 0x0}, + 1111: {region: 0x165, script: 0x55, flags: 0x0}, + 1112: {region: 0xe7, script: 0x55, flags: 0x0}, + 1113: {region: 0x165, script: 0x55, flags: 0x0}, + 1114: {region: 0x165, script: 0x55, flags: 0x0}, + 1115: {region: 0x99, script: 0x4d, flags: 0x0}, + 1116: {region: 0x53, script: 0xd1, flags: 0x0}, + 1117: {region: 0xdb, script: 0x20, flags: 0x0}, + 1118: {region: 0xdb, script: 0x20, flags: 0x0}, + 1119: {region: 0x99, script: 0xd6, flags: 0x0}, + 1120: {region: 0x165, script: 0x55, flags: 0x0}, + 1121: {region: 0x112, script: 0x55, flags: 0x0}, + 1122: {region: 0x131, script: 0x55, flags: 0x0}, + 1123: {region: 0x126, script: 0x55, flags: 0x0}, + 1124: {region: 0x165, script: 0x55, flags: 0x0}, 1125: {region: 0x3c, script: 0x3, flags: 0x1}, - 1126: {region: 0x164, script: 0x52, flags: 0x0}, - 1127: {region: 0x164, script: 0x52, flags: 0x0}, - 1128: {region: 0x164, script: 0x52, flags: 0x0}, - 1129: {region: 0x122, script: 0xd5, flags: 0x0}, - 1130: {region: 0xda, script: 0x20, flags: 0x0}, - 1131: {region: 0xda, script: 0x20, flags: 0x0}, - 1132: {region: 0xda, script: 0x20, flags: 0x0}, - 1133: {region: 0x6e, script: 0x27, flags: 0x0}, - 1134: {region: 0x164, script: 0x52, flags: 0x0}, - 1135: {region: 0x6c, script: 0x27, flags: 0x0}, - 1136: {region: 0x164, script: 0x52, flags: 0x0}, - 1137: {region: 0x164, script: 0x52, flags: 0x0}, - 1138: {region: 0x164, script: 0x52, flags: 0x0}, - 1139: {region: 0xd5, script: 0x52, flags: 0x0}, - 1140: {region: 0x126, script: 0x52, flags: 0x0}, - 1141: {region: 0x124, script: 0x52, flags: 0x0}, - 1142: {region: 0x31, script: 0x52, flags: 0x0}, - 1143: {region: 0xda, script: 0x20, flags: 0x0}, - 1144: {region: 0xe6, script: 0x52, flags: 0x0}, - 1145: {region: 0x164, script: 0x52, flags: 0x0}, - 1146: {region: 0x164, script: 0x52, flags: 0x0}, - 1147: {region: 0x31, script: 0x52, flags: 0x0}, - 1148: {region: 0xd3, script: 0x52, flags: 0x0}, - 1149: {region: 0x164, script: 0x52, flags: 0x0}, - 1150: {region: 0x160, script: 0x52, flags: 0x0}, - 1151: {region: 0x164, script: 0x52, flags: 0x0}, - 1152: {region: 0x128, script: 0x52, flags: 0x0}, - 1153: {region: 0x164, script: 0x52, flags: 0x0}, - 1154: {region: 0xcd, script: 0x52, flags: 0x0}, - 1155: {region: 0x164, script: 0x52, flags: 0x0}, - 1156: {region: 0xe5, script: 0x52, flags: 0x0}, - 1157: {region: 0x164, script: 0x52, flags: 0x0}, - 1158: {region: 0x164, script: 0x52, flags: 0x0}, - 1159: {region: 0x164, script: 0x52, flags: 0x0}, - 1160: {region: 0x12a, script: 0x52, flags: 0x0}, - 1161: {region: 0x12a, script: 0x52, flags: 0x0}, - 1162: {region: 0x12d, script: 0x52, flags: 0x0}, - 1163: {region: 0x164, script: 0x5, flags: 0x0}, - 1164: {region: 0x160, script: 0x52, flags: 0x0}, - 1165: {region: 0x86, script: 0x2d, flags: 0x0}, - 1166: {region: 0xda, script: 0x20, flags: 0x0}, - 1167: {region: 0xe6, script: 0x52, flags: 0x0}, - 1168: {region: 0x42, script: 0xd6, flags: 0x0}, - 1169: {region: 0x164, script: 0x52, flags: 0x0}, - 1170: {region: 0x105, script: 0x1e, flags: 0x0}, - 1171: {region: 0x164, script: 0x52, flags: 0x0}, - 1172: {region: 0x164, script: 0x52, flags: 0x0}, - 1173: {region: 0x130, script: 0x52, flags: 0x0}, - 1174: {region: 0x164, script: 0x52, flags: 0x0}, - 1175: {region: 0x122, script: 0xd5, flags: 0x0}, - 1176: {region: 0x31, script: 0x52, flags: 0x0}, - 1177: {region: 0x164, script: 0x52, flags: 0x0}, - 1178: {region: 0x164, script: 0x52, flags: 0x0}, - 1179: {region: 0xcd, script: 0x52, flags: 0x0}, - 1180: {region: 0x164, script: 0x52, flags: 0x0}, - 1181: {region: 0x164, script: 0x52, flags: 0x0}, - 1182: {region: 0x12c, script: 0x52, flags: 0x0}, - 1183: {region: 0x164, script: 0x52, flags: 0x0}, - 1185: {region: 0x164, script: 0x52, flags: 0x0}, - 1186: {region: 0xd3, script: 0x52, flags: 0x0}, - 1187: {region: 0x52, script: 0xce, flags: 0x0}, - 1188: {region: 0xe4, script: 0x52, flags: 0x0}, - 1189: {region: 0x164, script: 0x52, flags: 0x0}, - 1190: {region: 0x105, script: 0x1e, flags: 0x0}, - 1191: {region: 0xb9, script: 0x52, flags: 0x0}, - 1192: {region: 0x164, script: 0x52, flags: 0x0}, - 1193: {region: 0x105, script: 0x1e, flags: 0x0}, + 1126: {region: 0x165, script: 0x55, flags: 0x0}, + 1127: {region: 0x165, script: 0x55, flags: 0x0}, + 1128: {region: 0x165, script: 0x55, flags: 0x0}, + 1129: {region: 0x123, script: 0xdb, flags: 0x0}, + 1130: {region: 0xdb, script: 0x20, flags: 0x0}, + 1131: {region: 0xdb, script: 0x20, flags: 0x0}, + 1132: {region: 0xdb, script: 0x20, flags: 0x0}, + 1133: {region: 0x6f, script: 0x28, flags: 0x0}, + 1134: {region: 0x165, script: 0x55, flags: 0x0}, + 1135: {region: 0x6d, script: 0x28, flags: 0x0}, + 1136: {region: 0x165, script: 0x55, flags: 0x0}, + 1137: {region: 0x165, script: 0x55, flags: 0x0}, + 1138: {region: 0x165, script: 0x55, flags: 0x0}, + 1139: {region: 0xd6, script: 0x55, flags: 0x0}, + 1140: {region: 0x127, script: 0x55, flags: 0x0}, + 1141: {region: 0x125, script: 0x55, flags: 0x0}, + 1142: {region: 0x32, script: 0x55, flags: 0x0}, + 1143: {region: 0xdb, script: 0x20, flags: 0x0}, + 1144: {region: 0xe7, script: 0x55, flags: 0x0}, + 1145: {region: 0x165, script: 0x55, flags: 0x0}, + 1146: {region: 0x165, script: 0x55, flags: 0x0}, + 1147: {region: 0x32, script: 0x55, flags: 0x0}, + 1148: {region: 0xd4, script: 0x55, flags: 0x0}, + 1149: {region: 0x165, script: 0x55, flags: 0x0}, + 1150: {region: 0x161, script: 0x55, flags: 0x0}, + 1151: {region: 0x165, script: 0x55, flags: 0x0}, + 1152: {region: 0x129, script: 0x55, flags: 0x0}, + 1153: {region: 0x165, script: 0x55, flags: 0x0}, + 1154: {region: 0xce, script: 0x55, flags: 0x0}, + 1155: {region: 0x165, script: 0x55, flags: 0x0}, + 1156: {region: 0xe6, script: 0x55, flags: 0x0}, + 1157: {region: 0x165, script: 0x55, flags: 0x0}, + 1158: {region: 0x165, script: 0x55, flags: 0x0}, + 1159: {region: 0x165, script: 0x55, flags: 0x0}, + 1160: {region: 0x12b, script: 0x55, flags: 0x0}, + 1161: {region: 0x12b, script: 0x55, flags: 0x0}, + 1162: {region: 0x12e, script: 0x55, flags: 0x0}, + 1163: {region: 0x165, script: 0x5, flags: 0x0}, + 1164: {region: 0x161, script: 0x55, flags: 0x0}, + 1165: {region: 0x87, script: 0x30, flags: 0x0}, + 1166: {region: 0xdb, script: 0x20, flags: 0x0}, + 1167: {region: 0xe7, script: 0x55, flags: 0x0}, + 1168: {region: 0x43, script: 0xdc, flags: 0x0}, + 1169: {region: 0x165, script: 0x55, flags: 0x0}, + 1170: {region: 0x106, script: 0x1e, flags: 0x0}, + 1171: {region: 0x165, script: 0x55, flags: 0x0}, + 1172: {region: 0x165, script: 0x55, flags: 0x0}, + 1173: {region: 0x131, script: 0x55, flags: 0x0}, + 1174: {region: 0x165, script: 0x55, flags: 0x0}, + 1175: {region: 0x123, script: 0xdb, flags: 0x0}, + 1176: {region: 0x32, script: 0x55, flags: 0x0}, + 1177: {region: 0x165, script: 0x55, flags: 0x0}, + 1178: {region: 0x165, script: 0x55, flags: 0x0}, + 1179: {region: 0xce, script: 0x55, flags: 0x0}, + 1180: {region: 0x165, script: 0x55, flags: 0x0}, + 1181: {region: 0x165, script: 0x55, flags: 0x0}, + 1182: {region: 0x12d, script: 0x55, flags: 0x0}, + 1183: {region: 0x165, script: 0x55, flags: 0x0}, + 1185: {region: 0x165, script: 0x55, flags: 0x0}, + 1186: {region: 0xd4, script: 0x55, flags: 0x0}, + 1187: {region: 0x53, script: 0xd4, flags: 0x0}, + 1188: {region: 0xe5, script: 0x55, flags: 0x0}, + 1189: {region: 0x165, script: 0x55, flags: 0x0}, + 1190: {region: 0x106, script: 0x1e, flags: 0x0}, + 1191: {region: 0xba, script: 0x55, flags: 0x0}, + 1192: {region: 0x165, script: 0x55, flags: 0x0}, + 1193: {region: 0x106, script: 0x1e, flags: 0x0}, 1194: {region: 0x3f, script: 0x4, flags: 0x1}, - 1195: {region: 0x11b, script: 0xd8, flags: 0x0}, - 1196: {region: 0x12f, script: 0x1e, flags: 0x0}, - 1197: {region: 0x74, script: 0x52, flags: 0x0}, - 1198: {region: 0x29, script: 0x52, flags: 0x0}, + 1195: {region: 0x11c, script: 0xde, flags: 0x0}, + 1196: {region: 0x130, script: 0x1e, flags: 0x0}, + 1197: {region: 0x75, script: 0x55, flags: 0x0}, + 1198: {region: 0x2a, script: 0x55, flags: 0x0}, 1200: {region: 0x43, script: 0x3, flags: 0x1}, - 1201: {region: 0x98, script: 0xe, flags: 0x0}, - 1202: {region: 0xe7, script: 0x5, flags: 0x0}, - 1203: {region: 0x164, script: 0x52, flags: 0x0}, - 1204: {region: 0x164, script: 0x52, flags: 0x0}, - 1205: {region: 0x164, script: 0x52, flags: 0x0}, - 1206: {region: 0x164, script: 0x52, flags: 0x0}, - 1207: {region: 0x164, script: 0x52, flags: 0x0}, - 1208: {region: 0x164, script: 0x52, flags: 0x0}, - 1209: {region: 0x164, script: 0x52, flags: 0x0}, + 1201: {region: 0x99, script: 0xe, flags: 0x0}, + 1202: {region: 0xe8, script: 0x5, flags: 0x0}, + 1203: {region: 0x165, script: 0x55, flags: 0x0}, + 1204: {region: 0x165, script: 0x55, flags: 0x0}, + 1205: {region: 0x165, script: 0x55, flags: 0x0}, + 1206: {region: 0x165, script: 0x55, flags: 0x0}, + 1207: {region: 0x165, script: 0x55, flags: 0x0}, + 1208: {region: 0x165, script: 0x55, flags: 0x0}, + 1209: {region: 0x165, script: 0x55, flags: 0x0}, 1210: {region: 0x46, script: 0x4, flags: 0x1}, - 1211: {region: 0x164, script: 0x52, flags: 0x0}, - 1212: {region: 0xb3, script: 0xd9, flags: 0x0}, - 1213: {region: 0x164, script: 0x52, flags: 0x0}, - 1214: {region: 0x160, script: 0x52, flags: 0x0}, - 1215: {region: 0x9d, script: 0x52, flags: 0x0}, - 1216: {region: 0x105, script: 0x52, flags: 0x0}, - 1217: {region: 0x13d, script: 0x52, flags: 0x0}, - 1218: {region: 0x11a, script: 0x52, flags: 0x0}, - 1219: {region: 0x164, script: 0x52, flags: 0x0}, - 1220: {region: 0x35, script: 0x52, flags: 0x0}, - 1221: {region: 0x5f, script: 0x52, flags: 0x0}, - 1222: {region: 0xd0, script: 0x52, flags: 0x0}, - 1223: {region: 0x1, script: 0x52, flags: 0x0}, - 1224: {region: 0x105, script: 0x52, flags: 0x0}, - 1225: {region: 0x69, script: 0x52, flags: 0x0}, - 1226: {region: 0x12e, script: 0x52, flags: 0x0}, - 1227: {region: 0x164, script: 0x52, flags: 0x0}, - 1228: {region: 0x35, script: 0x52, flags: 0x0}, - 1229: {region: 0x4d, script: 0x52, flags: 0x0}, - 1230: {region: 0x164, script: 0x52, flags: 0x0}, - 1231: {region: 0x6e, script: 0x27, flags: 0x0}, - 1232: {region: 0x164, script: 0x52, flags: 0x0}, - 1233: {region: 0xe6, script: 0x52, flags: 0x0}, - 1234: {region: 0x2e, script: 0x52, flags: 0x0}, - 1235: {region: 0x98, script: 0xd0, flags: 0x0}, - 1236: {region: 0x98, script: 0x20, flags: 0x0}, - 1237: {region: 0x164, script: 0x52, flags: 0x0}, - 1238: {region: 0x164, script: 0x52, flags: 0x0}, - 1239: {region: 0x164, script: 0x52, flags: 0x0}, - 1240: {region: 0x164, script: 0x52, flags: 0x0}, - 1241: {region: 0x164, script: 0x52, flags: 0x0}, - 1242: {region: 0x164, script: 0x52, flags: 0x0}, - 1243: {region: 0x164, script: 0x52, flags: 0x0}, - 1244: {region: 0x164, script: 0x52, flags: 0x0}, - 1245: {region: 0x164, script: 0x52, flags: 0x0}, - 1246: {region: 0x13f, script: 0x52, flags: 0x0}, - 1247: {region: 0x164, script: 0x52, flags: 0x0}, - 1248: {region: 0x164, script: 0x52, flags: 0x0}, - 1249: {region: 0xa7, script: 0x5, flags: 0x0}, - 1250: {region: 0x164, script: 0x52, flags: 0x0}, - 1251: {region: 0x113, script: 0x52, flags: 0x0}, - 1252: {region: 0x164, script: 0x52, flags: 0x0}, - 1253: {region: 0x164, script: 0x52, flags: 0x0}, - 1254: {region: 0x164, script: 0x52, flags: 0x0}, - 1255: {region: 0x164, script: 0x52, flags: 0x0}, - 1256: {region: 0x98, script: 0x20, flags: 0x0}, - 1257: {region: 0x52, script: 0x34, flags: 0x0}, - 1258: {region: 0x164, script: 0x52, flags: 0x0}, - 1259: {region: 0x164, script: 0x52, flags: 0x0}, - 1260: {region: 0x40, script: 0x52, flags: 0x0}, - 1261: {region: 0x164, script: 0x52, flags: 0x0}, - 1262: {region: 0x12a, script: 0x18, flags: 0x0}, - 1263: {region: 0x164, script: 0x52, flags: 0x0}, - 1264: {region: 0x160, script: 0x52, flags: 0x0}, - 1265: {region: 0x164, script: 0x52, flags: 0x0}, - 1266: {region: 0x12a, script: 0x5a, flags: 0x0}, - 1267: {region: 0x12a, script: 0x5b, flags: 0x0}, - 1268: {region: 0x7c, script: 0x29, flags: 0x0}, - 1269: {region: 0x52, script: 0x5e, flags: 0x0}, - 1270: {region: 0x10a, script: 0x62, flags: 0x0}, - 1271: {region: 0x107, script: 0x6c, flags: 0x0}, - 1272: {region: 0x98, script: 0x20, flags: 0x0}, - 1273: {region: 0x130, script: 0x52, flags: 0x0}, - 1274: {region: 0x164, script: 0x52, flags: 0x0}, - 1275: {region: 0x9b, script: 0x82, flags: 0x0}, - 1276: {region: 0x164, script: 0x52, flags: 0x0}, - 1277: {region: 0x15d, script: 0xba, flags: 0x0}, - 1278: {region: 0x164, script: 0x52, flags: 0x0}, - 1279: {region: 0x164, script: 0x52, flags: 0x0}, - 1280: {region: 0xda, script: 0x20, flags: 0x0}, - 1281: {region: 0x164, script: 0x52, flags: 0x0}, - 1282: {region: 0x164, script: 0x52, flags: 0x0}, - 1283: {region: 0xd0, script: 0x52, flags: 0x0}, - 1284: {region: 0x74, script: 0x52, flags: 0x0}, - 1285: {region: 0x164, script: 0x52, flags: 0x0}, - 1286: {region: 0x164, script: 0x52, flags: 0x0}, - 1287: {region: 0x51, script: 0x52, flags: 0x0}, - 1288: {region: 0x164, script: 0x52, flags: 0x0}, - 1289: {region: 0x164, script: 0x52, flags: 0x0}, - 1290: {region: 0x164, script: 0x52, flags: 0x0}, - 1291: {region: 0x51, script: 0x52, flags: 0x0}, - 1292: {region: 0x164, script: 0x52, flags: 0x0}, - 1293: {region: 0x164, script: 0x52, flags: 0x0}, - 1294: {region: 0x164, script: 0x52, flags: 0x0}, - 1295: {region: 0x164, script: 0x52, flags: 0x0}, - 1296: {region: 0x1, script: 0x37, flags: 0x0}, - 1297: {region: 0x164, script: 0x52, flags: 0x0}, - 1298: {region: 0x164, script: 0x52, flags: 0x0}, - 1299: {region: 0x164, script: 0x52, flags: 0x0}, - 1300: {region: 0x164, script: 0x52, flags: 0x0}, - 1301: {region: 0x164, script: 0x52, flags: 0x0}, - 1302: {region: 0xd5, script: 0x52, flags: 0x0}, - 1303: {region: 0x164, script: 0x52, flags: 0x0}, - 1304: {region: 0x164, script: 0x52, flags: 0x0}, - 1305: {region: 0x164, script: 0x52, flags: 0x0}, - 1306: {region: 0x40, script: 0x52, flags: 0x0}, - 1307: {region: 0x164, script: 0x52, flags: 0x0}, - 1308: {region: 0xce, script: 0x52, flags: 0x0}, + 1211: {region: 0x165, script: 0x55, flags: 0x0}, + 1212: {region: 0xb4, script: 0xdf, flags: 0x0}, + 1213: {region: 0x165, script: 0x55, flags: 0x0}, + 1214: {region: 0x161, script: 0x55, flags: 0x0}, + 1215: {region: 0x9e, script: 0x55, flags: 0x0}, + 1216: {region: 0x106, script: 0x55, flags: 0x0}, + 1217: {region: 0x13e, script: 0x55, flags: 0x0}, + 1218: {region: 0x11b, script: 0x55, flags: 0x0}, + 1219: {region: 0x165, script: 0x55, flags: 0x0}, + 1220: {region: 0x36, script: 0x55, flags: 0x0}, + 1221: {region: 0x60, script: 0x55, flags: 0x0}, + 1222: {region: 0xd1, script: 0x55, flags: 0x0}, + 1223: {region: 0x1, script: 0x55, flags: 0x0}, + 1224: {region: 0x106, script: 0x55, flags: 0x0}, + 1225: {region: 0x6a, script: 0x55, flags: 0x0}, + 1226: {region: 0x12f, script: 0x55, flags: 0x0}, + 1227: {region: 0x165, script: 0x55, flags: 0x0}, + 1228: {region: 0x36, script: 0x55, flags: 0x0}, + 1229: {region: 0x4e, script: 0x55, flags: 0x0}, + 1230: {region: 0x165, script: 0x55, flags: 0x0}, + 1231: {region: 0x6f, script: 0x28, flags: 0x0}, + 1232: {region: 0x165, script: 0x55, flags: 0x0}, + 1233: {region: 0xe7, script: 0x55, flags: 0x0}, + 1234: {region: 0x2f, script: 0x55, flags: 0x0}, + 1235: {region: 0x99, script: 0xd6, flags: 0x0}, + 1236: {region: 0x99, script: 0x20, flags: 0x0}, + 1237: {region: 0x165, script: 0x55, flags: 0x0}, + 1238: {region: 0x165, script: 0x55, flags: 0x0}, + 1239: {region: 0x165, script: 0x55, flags: 0x0}, + 1240: {region: 0x165, script: 0x55, flags: 0x0}, + 1241: {region: 0x165, script: 0x55, flags: 0x0}, + 1242: {region: 0x165, script: 0x55, flags: 0x0}, + 1243: {region: 0x165, script: 0x55, flags: 0x0}, + 1244: {region: 0x165, script: 0x55, flags: 0x0}, + 1245: {region: 0x165, script: 0x55, flags: 0x0}, + 1246: {region: 0x140, script: 0x55, flags: 0x0}, + 1247: {region: 0x165, script: 0x55, flags: 0x0}, + 1248: {region: 0x165, script: 0x55, flags: 0x0}, + 1249: {region: 0xa8, script: 0x5, flags: 0x0}, + 1250: {region: 0x165, script: 0x55, flags: 0x0}, + 1251: {region: 0x114, script: 0x55, flags: 0x0}, + 1252: {region: 0x165, script: 0x55, flags: 0x0}, + 1253: {region: 0x165, script: 0x55, flags: 0x0}, + 1254: {region: 0x165, script: 0x55, flags: 0x0}, + 1255: {region: 0x165, script: 0x55, flags: 0x0}, + 1256: {region: 0x99, script: 0x20, flags: 0x0}, + 1257: {region: 0x53, script: 0x37, flags: 0x0}, + 1258: {region: 0x165, script: 0x55, flags: 0x0}, + 1259: {region: 0x165, script: 0x55, flags: 0x0}, + 1260: {region: 0x41, script: 0x55, flags: 0x0}, + 1261: {region: 0x165, script: 0x55, flags: 0x0}, + 1262: {region: 0x12b, script: 0x18, flags: 0x0}, + 1263: {region: 0x165, script: 0x55, flags: 0x0}, + 1264: {region: 0x161, script: 0x55, flags: 0x0}, + 1265: {region: 0x165, script: 0x55, flags: 0x0}, + 1266: {region: 0x12b, script: 0x5d, flags: 0x0}, + 1267: {region: 0x12b, script: 0x5e, flags: 0x0}, + 1268: {region: 0x7d, script: 0x2a, flags: 0x0}, + 1269: {region: 0x53, script: 0x62, flags: 0x0}, + 1270: {region: 0x10b, script: 0x67, flags: 0x0}, + 1271: {region: 0x108, script: 0x71, flags: 0x0}, + 1272: {region: 0x99, script: 0x20, flags: 0x0}, + 1273: {region: 0x131, script: 0x55, flags: 0x0}, + 1274: {region: 0x165, script: 0x55, flags: 0x0}, + 1275: {region: 0x9c, script: 0x87, flags: 0x0}, + 1276: {region: 0x165, script: 0x55, flags: 0x0}, + 1277: {region: 0x15e, script: 0xbf, flags: 0x0}, + 1278: {region: 0x165, script: 0x55, flags: 0x0}, + 1279: {region: 0x165, script: 0x55, flags: 0x0}, + 1280: {region: 0xdb, script: 0x20, flags: 0x0}, + 1281: {region: 0x165, script: 0x55, flags: 0x0}, + 1282: {region: 0x165, script: 0x55, flags: 0x0}, + 1283: {region: 0xd1, script: 0x55, flags: 0x0}, + 1284: {region: 0x75, script: 0x55, flags: 0x0}, + 1285: {region: 0x165, script: 0x55, flags: 0x0}, + 1286: {region: 0x165, script: 0x55, flags: 0x0}, + 1287: {region: 0x52, script: 0x55, flags: 0x0}, + 1288: {region: 0x165, script: 0x55, flags: 0x0}, + 1289: {region: 0x165, script: 0x55, flags: 0x0}, + 1290: {region: 0x165, script: 0x55, flags: 0x0}, + 1291: {region: 0x52, script: 0x55, flags: 0x0}, + 1292: {region: 0x165, script: 0x55, flags: 0x0}, + 1293: {region: 0x165, script: 0x55, flags: 0x0}, + 1294: {region: 0x165, script: 0x55, flags: 0x0}, + 1295: {region: 0x165, script: 0x55, flags: 0x0}, + 1296: {region: 0x1, script: 0x3a, flags: 0x0}, + 1297: {region: 0x165, script: 0x55, flags: 0x0}, + 1298: {region: 0x165, script: 0x55, flags: 0x0}, + 1299: {region: 0x165, script: 0x55, flags: 0x0}, + 1300: {region: 0x165, script: 0x55, flags: 0x0}, + 1301: {region: 0x165, script: 0x55, flags: 0x0}, + 1302: {region: 0xd6, script: 0x55, flags: 0x0}, + 1303: {region: 0x165, script: 0x55, flags: 0x0}, + 1304: {region: 0x165, script: 0x55, flags: 0x0}, + 1305: {region: 0x165, script: 0x55, flags: 0x0}, + 1306: {region: 0x41, script: 0x55, flags: 0x0}, + 1307: {region: 0x165, script: 0x55, flags: 0x0}, + 1308: {region: 0xcf, script: 0x55, flags: 0x0}, 1309: {region: 0x4a, script: 0x3, flags: 0x1}, - 1310: {region: 0x164, script: 0x52, flags: 0x0}, - 1311: {region: 0x164, script: 0x52, flags: 0x0}, - 1312: {region: 0x164, script: 0x52, flags: 0x0}, - 1313: {region: 0x52, script: 0x52, flags: 0x0}, - 1314: {region: 0x10a, script: 0x52, flags: 0x0}, - 1316: {region: 0xa7, script: 0x5, flags: 0x0}, - 1317: {region: 0xd8, script: 0x52, flags: 0x0}, - 1318: {region: 0xb9, script: 0xd2, flags: 0x0}, + 1310: {region: 0x165, script: 0x55, flags: 0x0}, + 1311: {region: 0x165, script: 0x55, flags: 0x0}, + 1312: {region: 0x165, script: 0x55, flags: 0x0}, + 1313: {region: 0x53, script: 0x55, flags: 0x0}, + 1314: {region: 0x10b, script: 0x55, flags: 0x0}, + 1316: {region: 0xa8, script: 0x5, flags: 0x0}, + 1317: {region: 0xd9, script: 0x55, flags: 0x0}, + 1318: {region: 0xba, script: 0xd8, flags: 0x0}, 1319: {region: 0x4d, script: 0x14, flags: 0x1}, - 1320: {region: 0x164, script: 0x52, flags: 0x0}, - 1321: {region: 0x121, script: 0x52, flags: 0x0}, - 1322: {region: 0xcf, script: 0x52, flags: 0x0}, - 1323: {region: 0x164, script: 0x52, flags: 0x0}, - 1324: {region: 0x160, script: 0x52, flags: 0x0}, - 1326: {region: 0x12a, script: 0x52, flags: 0x0}, + 1320: {region: 0x165, script: 0x55, flags: 0x0}, + 1321: {region: 0x122, script: 0x55, flags: 0x0}, + 1322: {region: 0xd0, script: 0x55, flags: 0x0}, + 1323: {region: 0x165, script: 0x55, flags: 0x0}, + 1324: {region: 0x161, script: 0x55, flags: 0x0}, + 1326: {region: 0x12b, script: 0x55, flags: 0x0}, } // likelyLangList holds lists info associated with likelyLang. // Size: 388 bytes, 97 elements var likelyLangList = [97]likelyScriptRegion{ - 0: {region: 0x9b, script: 0x7, flags: 0x0}, - 1: {region: 0xa0, script: 0x6d, flags: 0x2}, - 2: {region: 0x11b, script: 0x78, flags: 0x2}, - 3: {region: 0x31, script: 0x52, flags: 0x0}, - 4: {region: 0x9a, script: 0x5, flags: 0x4}, - 5: {region: 0x9b, script: 0x5, flags: 0x4}, - 6: {region: 0x105, script: 0x1e, flags: 0x4}, - 7: {region: 0x9b, script: 0x5, flags: 0x2}, - 8: {region: 0x105, script: 0x1e, flags: 0x0}, - 9: {region: 0x37, script: 0x2a, flags: 0x2}, - 10: {region: 0x134, script: 0x52, flags: 0x0}, - 11: {region: 0x7a, script: 0xbd, flags: 0x2}, - 12: {region: 0x113, script: 0x52, flags: 0x0}, - 13: {region: 0x83, script: 0x1, flags: 0x2}, - 14: {region: 0x5c, script: 0x1d, flags: 0x0}, - 15: {region: 0x86, script: 0x57, flags: 0x2}, - 16: {region: 0xd5, script: 0x52, flags: 0x0}, - 17: {region: 0x51, script: 0x5, flags: 0x4}, - 18: {region: 0x10a, script: 0x5, flags: 0x4}, - 19: {region: 0xad, script: 0x1e, flags: 0x0}, - 20: {region: 0x23, script: 0x5, flags: 0x4}, - 21: {region: 0x52, script: 0x5, flags: 0x4}, - 22: {region: 0x9b, script: 0x5, flags: 0x4}, - 23: {region: 0xc4, script: 0x5, flags: 0x4}, - 24: {region: 0x52, script: 0x5, flags: 0x2}, - 25: {region: 0x12a, script: 0x52, flags: 0x0}, - 26: {region: 0xaf, script: 0x5, flags: 0x4}, - 27: {region: 0x9a, script: 0x5, flags: 0x2}, - 28: {region: 0xa4, script: 0x1e, flags: 0x0}, - 29: {region: 0x52, script: 0x5, flags: 0x4}, - 30: {region: 0x12a, script: 0x52, flags: 0x4}, - 31: {region: 0x52, script: 0x5, flags: 0x2}, - 32: {region: 0x12a, script: 0x52, flags: 0x2}, - 33: {region: 0xda, script: 0x20, flags: 0x0}, - 34: {region: 0x98, script: 0x55, flags: 0x2}, - 35: {region: 0x82, script: 0x52, flags: 0x0}, - 36: {region: 0x83, script: 0x70, flags: 0x4}, - 37: {region: 0x83, script: 0x70, flags: 0x2}, - 38: {region: 0xc4, script: 0x1e, flags: 0x0}, - 39: {region: 0x52, script: 0x66, flags: 0x4}, - 40: {region: 0x52, script: 0x66, flags: 0x2}, - 41: {region: 0xcf, script: 0x52, flags: 0x0}, - 42: {region: 0x49, script: 0x5, flags: 0x4}, - 43: {region: 0x94, script: 0x5, flags: 0x4}, - 44: {region: 0x98, script: 0x2f, flags: 0x0}, - 45: {region: 0xe7, script: 0x5, flags: 0x4}, - 46: {region: 0xe7, script: 0x5, flags: 0x2}, - 47: {region: 0x9b, script: 0x7c, flags: 0x0}, - 48: {region: 0x52, script: 0x7d, flags: 0x2}, - 49: {region: 0xb9, script: 0xd2, flags: 0x0}, - 50: {region: 0xd8, script: 0x52, flags: 0x4}, - 51: {region: 0xe7, script: 0x5, flags: 0x0}, - 52: {region: 0x98, script: 0x20, flags: 0x2}, - 53: {region: 0x98, script: 0x47, flags: 0x2}, - 54: {region: 0x98, script: 0xc0, flags: 0x2}, - 55: {region: 0x104, script: 0x1e, flags: 0x0}, - 56: {region: 0xbc, script: 0x52, flags: 0x4}, - 57: {region: 0x103, script: 0x52, flags: 0x4}, - 58: {region: 0x105, script: 0x52, flags: 0x4}, - 59: {region: 0x12a, script: 0x52, flags: 0x4}, - 60: {region: 0x123, script: 0x1e, flags: 0x0}, - 61: {region: 0xe7, script: 0x5, flags: 0x4}, - 62: {region: 0xe7, script: 0x5, flags: 0x2}, - 63: {region: 0x52, script: 0x5, flags: 0x0}, - 64: {region: 0xad, script: 0x1e, flags: 0x4}, - 65: {region: 0xc4, script: 0x1e, flags: 0x4}, - 66: {region: 0xad, script: 0x1e, flags: 0x2}, - 67: {region: 0x98, script: 0xe, flags: 0x0}, - 68: {region: 0xda, script: 0x20, flags: 0x4}, - 69: {region: 0xda, script: 0x20, flags: 0x2}, - 70: {region: 0x136, script: 0x52, flags: 0x0}, - 71: {region: 0x23, script: 0x5, flags: 0x4}, - 72: {region: 0x52, script: 0x1e, flags: 0x4}, - 73: {region: 0x23, script: 0x5, flags: 0x2}, - 74: {region: 0x8c, script: 0x35, flags: 0x0}, - 75: {region: 0x52, script: 0x34, flags: 0x4}, - 76: {region: 0x52, script: 0x34, flags: 0x2}, - 77: {region: 0x52, script: 0x34, flags: 0x0}, - 78: {region: 0x2e, script: 0x35, flags: 0x4}, - 79: {region: 0x3d, script: 0x35, flags: 0x4}, - 80: {region: 0x7a, script: 0x35, flags: 0x4}, - 81: {region: 0x7d, script: 0x35, flags: 0x4}, - 82: {region: 0x8c, script: 0x35, flags: 0x4}, - 83: {region: 0x94, script: 0x35, flags: 0x4}, - 84: {region: 0xc5, script: 0x35, flags: 0x4}, - 85: {region: 0xcf, script: 0x35, flags: 0x4}, - 86: {region: 0xe1, script: 0x35, flags: 0x4}, - 87: {region: 0xe4, script: 0x35, flags: 0x4}, - 88: {region: 0xe6, script: 0x35, flags: 0x4}, - 89: {region: 0x115, script: 0x35, flags: 0x4}, - 90: {region: 0x122, script: 0x35, flags: 0x4}, - 91: {region: 0x12d, script: 0x35, flags: 0x4}, - 92: {region: 0x134, script: 0x35, flags: 0x4}, - 93: {region: 0x13d, script: 0x35, flags: 0x4}, - 94: {region: 0x12d, script: 0x11, flags: 0x2}, - 95: {region: 0x12d, script: 0x30, flags: 0x2}, - 96: {region: 0x12d, script: 0x35, flags: 0x2}, + 0: {region: 0x9c, script: 0x7, flags: 0x0}, + 1: {region: 0xa1, script: 0x72, flags: 0x2}, + 2: {region: 0x11c, script: 0x7d, flags: 0x2}, + 3: {region: 0x32, script: 0x55, flags: 0x0}, + 4: {region: 0x9b, script: 0x5, flags: 0x4}, + 5: {region: 0x9c, script: 0x5, flags: 0x4}, + 6: {region: 0x106, script: 0x1e, flags: 0x4}, + 7: {region: 0x9c, script: 0x5, flags: 0x2}, + 8: {region: 0x106, script: 0x1e, flags: 0x0}, + 9: {region: 0x38, script: 0x2b, flags: 0x2}, + 10: {region: 0x135, script: 0x55, flags: 0x0}, + 11: {region: 0x7b, script: 0xc2, flags: 0x2}, + 12: {region: 0x114, script: 0x55, flags: 0x0}, + 13: {region: 0x84, script: 0x1, flags: 0x2}, + 14: {region: 0x5d, script: 0x1d, flags: 0x0}, + 15: {region: 0x87, script: 0x5a, flags: 0x2}, + 16: {region: 0xd6, script: 0x55, flags: 0x0}, + 17: {region: 0x52, script: 0x5, flags: 0x4}, + 18: {region: 0x10b, script: 0x5, flags: 0x4}, + 19: {region: 0xae, script: 0x1e, flags: 0x0}, + 20: {region: 0x24, script: 0x5, flags: 0x4}, + 21: {region: 0x53, script: 0x5, flags: 0x4}, + 22: {region: 0x9c, script: 0x5, flags: 0x4}, + 23: {region: 0xc5, script: 0x5, flags: 0x4}, + 24: {region: 0x53, script: 0x5, flags: 0x2}, + 25: {region: 0x12b, script: 0x55, flags: 0x0}, + 26: {region: 0xb0, script: 0x5, flags: 0x4}, + 27: {region: 0x9b, script: 0x5, flags: 0x2}, + 28: {region: 0xa5, script: 0x1e, flags: 0x0}, + 29: {region: 0x53, script: 0x5, flags: 0x4}, + 30: {region: 0x12b, script: 0x55, flags: 0x4}, + 31: {region: 0x53, script: 0x5, flags: 0x2}, + 32: {region: 0x12b, script: 0x55, flags: 0x2}, + 33: {region: 0xdb, script: 0x20, flags: 0x0}, + 34: {region: 0x99, script: 0x58, flags: 0x2}, + 35: {region: 0x83, script: 0x55, flags: 0x0}, + 36: {region: 0x84, script: 0x75, flags: 0x4}, + 37: {region: 0x84, script: 0x75, flags: 0x2}, + 38: {region: 0xc5, script: 0x1e, flags: 0x0}, + 39: {region: 0x53, script: 0x6b, flags: 0x4}, + 40: {region: 0x53, script: 0x6b, flags: 0x2}, + 41: {region: 0xd0, script: 0x55, flags: 0x0}, + 42: {region: 0x4a, script: 0x5, flags: 0x4}, + 43: {region: 0x95, script: 0x5, flags: 0x4}, + 44: {region: 0x99, script: 0x32, flags: 0x0}, + 45: {region: 0xe8, script: 0x5, flags: 0x4}, + 46: {region: 0xe8, script: 0x5, flags: 0x2}, + 47: {region: 0x9c, script: 0x81, flags: 0x0}, + 48: {region: 0x53, script: 0x82, flags: 0x2}, + 49: {region: 0xba, script: 0xd8, flags: 0x0}, + 50: {region: 0xd9, script: 0x55, flags: 0x4}, + 51: {region: 0xe8, script: 0x5, flags: 0x0}, + 52: {region: 0x99, script: 0x20, flags: 0x2}, + 53: {region: 0x99, script: 0x4a, flags: 0x2}, + 54: {region: 0x99, script: 0xc5, flags: 0x2}, + 55: {region: 0x105, script: 0x1e, flags: 0x0}, + 56: {region: 0xbd, script: 0x55, flags: 0x4}, + 57: {region: 0x104, script: 0x55, flags: 0x4}, + 58: {region: 0x106, script: 0x55, flags: 0x4}, + 59: {region: 0x12b, script: 0x55, flags: 0x4}, + 60: {region: 0x124, script: 0x1e, flags: 0x0}, + 61: {region: 0xe8, script: 0x5, flags: 0x4}, + 62: {region: 0xe8, script: 0x5, flags: 0x2}, + 63: {region: 0x53, script: 0x5, flags: 0x0}, + 64: {region: 0xae, script: 0x1e, flags: 0x4}, + 65: {region: 0xc5, script: 0x1e, flags: 0x4}, + 66: {region: 0xae, script: 0x1e, flags: 0x2}, + 67: {region: 0x99, script: 0xe, flags: 0x0}, + 68: {region: 0xdb, script: 0x20, flags: 0x4}, + 69: {region: 0xdb, script: 0x20, flags: 0x2}, + 70: {region: 0x137, script: 0x55, flags: 0x0}, + 71: {region: 0x24, script: 0x5, flags: 0x4}, + 72: {region: 0x53, script: 0x1e, flags: 0x4}, + 73: {region: 0x24, script: 0x5, flags: 0x2}, + 74: {region: 0x8d, script: 0x38, flags: 0x0}, + 75: {region: 0x53, script: 0x37, flags: 0x4}, + 76: {region: 0x53, script: 0x37, flags: 0x2}, + 77: {region: 0x53, script: 0x37, flags: 0x0}, + 78: {region: 0x2f, script: 0x38, flags: 0x4}, + 79: {region: 0x3e, script: 0x38, flags: 0x4}, + 80: {region: 0x7b, script: 0x38, flags: 0x4}, + 81: {region: 0x7e, script: 0x38, flags: 0x4}, + 82: {region: 0x8d, script: 0x38, flags: 0x4}, + 83: {region: 0x95, script: 0x38, flags: 0x4}, + 84: {region: 0xc6, script: 0x38, flags: 0x4}, + 85: {region: 0xd0, script: 0x38, flags: 0x4}, + 86: {region: 0xe2, script: 0x38, flags: 0x4}, + 87: {region: 0xe5, script: 0x38, flags: 0x4}, + 88: {region: 0xe7, script: 0x38, flags: 0x4}, + 89: {region: 0x116, script: 0x38, flags: 0x4}, + 90: {region: 0x123, script: 0x38, flags: 0x4}, + 91: {region: 0x12e, script: 0x38, flags: 0x4}, + 92: {region: 0x135, script: 0x38, flags: 0x4}, + 93: {region: 0x13e, script: 0x38, flags: 0x4}, + 94: {region: 0x12e, script: 0x11, flags: 0x2}, + 95: {region: 0x12e, script: 0x33, flags: 0x2}, + 96: {region: 0x12e, script: 0x38, flags: 0x2}, } type likelyLangScript struct { @@ -2924,307 +2935,307 @@ type likelyLangScript struct { // for a given regionID, lang and script are the index and size respectively // of the list in likelyRegionList. // TODO: exclude containers and user-definable regions from the list. -// Size: 1428 bytes, 357 elements -var likelyRegion = [357]likelyLangScript{ - 33: {lang: 0xd7, script: 0x52, flags: 0x0}, - 34: {lang: 0x3a, script: 0x5, flags: 0x0}, - 35: {lang: 0x0, script: 0x2, flags: 0x1}, - 38: {lang: 0x2, script: 0x2, flags: 0x1}, - 39: {lang: 0x4, script: 0x2, flags: 0x1}, - 41: {lang: 0x3be, script: 0x52, flags: 0x0}, - 42: {lang: 0x0, script: 0x52, flags: 0x0}, - 43: {lang: 0x13d, script: 0x52, flags: 0x0}, - 44: {lang: 0x419, script: 0x52, flags: 0x0}, - 45: {lang: 0x10c, script: 0x52, flags: 0x0}, - 47: {lang: 0x365, script: 0x52, flags: 0x0}, - 48: {lang: 0x442, script: 0x52, flags: 0x0}, - 49: {lang: 0x58, script: 0x52, flags: 0x0}, - 50: {lang: 0x6, script: 0x2, flags: 0x1}, - 52: {lang: 0xa5, script: 0xe, flags: 0x0}, - 53: {lang: 0x365, script: 0x52, flags: 0x0}, - 54: {lang: 0x15d, script: 0x52, flags: 0x0}, - 55: {lang: 0x7e, script: 0x1e, flags: 0x0}, - 56: {lang: 0x3a, script: 0x5, flags: 0x0}, - 57: {lang: 0x3d7, script: 0x52, flags: 0x0}, - 58: {lang: 0x15d, script: 0x52, flags: 0x0}, - 59: {lang: 0x15d, script: 0x52, flags: 0x0}, - 61: {lang: 0x31d, script: 0x52, flags: 0x0}, - 62: {lang: 0x13d, script: 0x52, flags: 0x0}, - 63: {lang: 0x39f, script: 0x52, flags: 0x0}, - 64: {lang: 0x3be, script: 0x52, flags: 0x0}, - 66: {lang: 0x8, script: 0x2, flags: 0x1}, - 68: {lang: 0x0, script: 0x52, flags: 0x0}, - 70: {lang: 0x71, script: 0x1e, flags: 0x0}, - 72: {lang: 0x510, script: 0x37, flags: 0x2}, - 73: {lang: 0x31d, script: 0x5, flags: 0x2}, - 74: {lang: 0x443, script: 0x52, flags: 0x0}, - 75: {lang: 0x15d, script: 0x52, flags: 0x0}, - 76: {lang: 0x15d, script: 0x52, flags: 0x0}, - 77: {lang: 0x10c, script: 0x52, flags: 0x0}, - 78: {lang: 0x15d, script: 0x52, flags: 0x0}, - 80: {lang: 0x13d, script: 0x52, flags: 0x0}, - 81: {lang: 0x15d, script: 0x52, flags: 0x0}, - 82: {lang: 0xa, script: 0x5, flags: 0x1}, - 83: {lang: 0x13d, script: 0x52, flags: 0x0}, - 84: {lang: 0x0, script: 0x52, flags: 0x0}, - 85: {lang: 0x13d, script: 0x52, flags: 0x0}, - 88: {lang: 0x13d, script: 0x52, flags: 0x0}, - 89: {lang: 0x3be, script: 0x52, flags: 0x0}, - 90: {lang: 0x39f, script: 0x52, flags: 0x0}, - 92: {lang: 0xf, script: 0x2, flags: 0x1}, - 93: {lang: 0xf9, script: 0x52, flags: 0x0}, - 95: {lang: 0x10c, script: 0x52, flags: 0x0}, - 97: {lang: 0x1, script: 0x52, flags: 0x0}, - 98: {lang: 0x100, script: 0x52, flags: 0x0}, - 100: {lang: 0x13d, script: 0x52, flags: 0x0}, - 102: {lang: 0x11, script: 0x2, flags: 0x1}, - 103: {lang: 0x13d, script: 0x52, flags: 0x0}, - 104: {lang: 0x13d, script: 0x52, flags: 0x0}, - 105: {lang: 0x13f, script: 0x52, flags: 0x0}, - 106: {lang: 0x3a, script: 0x5, flags: 0x0}, +// Size: 1432 bytes, 358 elements +var likelyRegion = [358]likelyLangScript{ + 34: {lang: 0xd7, script: 0x55, flags: 0x0}, + 35: {lang: 0x3a, script: 0x5, flags: 0x0}, + 36: {lang: 0x0, script: 0x2, flags: 0x1}, + 39: {lang: 0x2, script: 0x2, flags: 0x1}, + 40: {lang: 0x4, script: 0x2, flags: 0x1}, + 42: {lang: 0x3be, script: 0x55, flags: 0x0}, + 43: {lang: 0x0, script: 0x55, flags: 0x0}, + 44: {lang: 0x13d, script: 0x55, flags: 0x0}, + 45: {lang: 0x419, script: 0x55, flags: 0x0}, + 46: {lang: 0x10c, script: 0x55, flags: 0x0}, + 48: {lang: 0x365, script: 0x55, flags: 0x0}, + 49: {lang: 0x442, script: 0x55, flags: 0x0}, + 50: {lang: 0x58, script: 0x55, flags: 0x0}, + 51: {lang: 0x6, script: 0x2, flags: 0x1}, + 53: {lang: 0xa5, script: 0xe, flags: 0x0}, + 54: {lang: 0x365, script: 0x55, flags: 0x0}, + 55: {lang: 0x15d, script: 0x55, flags: 0x0}, + 56: {lang: 0x7e, script: 0x1e, flags: 0x0}, + 57: {lang: 0x3a, script: 0x5, flags: 0x0}, + 58: {lang: 0x3d7, script: 0x55, flags: 0x0}, + 59: {lang: 0x15d, script: 0x55, flags: 0x0}, + 60: {lang: 0x15d, script: 0x55, flags: 0x0}, + 62: {lang: 0x31d, script: 0x55, flags: 0x0}, + 63: {lang: 0x13d, script: 0x55, flags: 0x0}, + 64: {lang: 0x39f, script: 0x55, flags: 0x0}, + 65: {lang: 0x3be, script: 0x55, flags: 0x0}, + 67: {lang: 0x8, script: 0x2, flags: 0x1}, + 69: {lang: 0x0, script: 0x55, flags: 0x0}, + 71: {lang: 0x71, script: 0x1e, flags: 0x0}, + 73: {lang: 0x510, script: 0x3a, flags: 0x2}, + 74: {lang: 0x31d, script: 0x5, flags: 0x2}, + 75: {lang: 0x443, script: 0x55, flags: 0x0}, + 76: {lang: 0x15d, script: 0x55, flags: 0x0}, + 77: {lang: 0x15d, script: 0x55, flags: 0x0}, + 78: {lang: 0x10c, script: 0x55, flags: 0x0}, + 79: {lang: 0x15d, script: 0x55, flags: 0x0}, + 81: {lang: 0x13d, script: 0x55, flags: 0x0}, + 82: {lang: 0x15d, script: 0x55, flags: 0x0}, + 83: {lang: 0xa, script: 0x5, flags: 0x1}, + 84: {lang: 0x13d, script: 0x55, flags: 0x0}, + 85: {lang: 0x0, script: 0x55, flags: 0x0}, + 86: {lang: 0x13d, script: 0x55, flags: 0x0}, + 89: {lang: 0x13d, script: 0x55, flags: 0x0}, + 90: {lang: 0x3be, script: 0x55, flags: 0x0}, + 91: {lang: 0x39f, script: 0x55, flags: 0x0}, + 93: {lang: 0xf, script: 0x2, flags: 0x1}, + 94: {lang: 0xf9, script: 0x55, flags: 0x0}, + 96: {lang: 0x10c, script: 0x55, flags: 0x0}, + 98: {lang: 0x1, script: 0x55, flags: 0x0}, + 99: {lang: 0x100, script: 0x55, flags: 0x0}, + 101: {lang: 0x13d, script: 0x55, flags: 0x0}, + 103: {lang: 0x11, script: 0x2, flags: 0x1}, + 104: {lang: 0x13d, script: 0x55, flags: 0x0}, + 105: {lang: 0x13d, script: 0x55, flags: 0x0}, + 106: {lang: 0x13f, script: 0x55, flags: 0x0}, 107: {lang: 0x3a, script: 0x5, flags: 0x0}, - 108: {lang: 0x46d, script: 0x27, flags: 0x0}, - 109: {lang: 0x13d, script: 0x52, flags: 0x0}, - 110: {lang: 0x13, script: 0x2, flags: 0x1}, - 112: {lang: 0x10c, script: 0x52, flags: 0x0}, - 113: {lang: 0x150, script: 0x52, flags: 0x0}, - 114: {lang: 0x1be, script: 0x20, flags: 0x2}, - 117: {lang: 0x157, script: 0x52, flags: 0x0}, - 119: {lang: 0x15d, script: 0x52, flags: 0x0}, - 121: {lang: 0x15d, script: 0x52, flags: 0x0}, - 122: {lang: 0x15, script: 0x2, flags: 0x1}, - 124: {lang: 0x17, script: 0x3, flags: 0x1}, - 125: {lang: 0x15d, script: 0x52, flags: 0x0}, - 127: {lang: 0x21, script: 0x52, flags: 0x0}, - 129: {lang: 0x243, script: 0x52, flags: 0x0}, - 131: {lang: 0x15d, script: 0x52, flags: 0x0}, - 132: {lang: 0x15d, script: 0x52, flags: 0x0}, - 133: {lang: 0x13d, script: 0x52, flags: 0x0}, - 134: {lang: 0x1a, script: 0x2, flags: 0x1}, - 135: {lang: 0x0, script: 0x52, flags: 0x0}, - 136: {lang: 0x13d, script: 0x52, flags: 0x0}, - 138: {lang: 0x3be, script: 0x52, flags: 0x0}, - 140: {lang: 0x527, script: 0x35, flags: 0x0}, - 141: {lang: 0x0, script: 0x52, flags: 0x0}, - 142: {lang: 0x13d, script: 0x52, flags: 0x0}, - 143: {lang: 0x1cf, script: 0x52, flags: 0x0}, - 144: {lang: 0x1d2, script: 0x52, flags: 0x0}, - 145: {lang: 0x1d3, script: 0x52, flags: 0x0}, - 147: {lang: 0x13d, script: 0x52, flags: 0x0}, - 148: {lang: 0x1c, script: 0x2, flags: 0x1}, - 150: {lang: 0x1ba, script: 0x37, flags: 0x0}, - 152: {lang: 0x1e, script: 0x3, flags: 0x1}, - 154: {lang: 0x3a, script: 0x5, flags: 0x0}, - 155: {lang: 0x21, script: 0x2, flags: 0x1}, - 156: {lang: 0x1f6, script: 0x52, flags: 0x0}, - 157: {lang: 0x1f7, script: 0x52, flags: 0x0}, - 160: {lang: 0x3a, script: 0x5, flags: 0x0}, - 161: {lang: 0x1fe, script: 0x41, flags: 0x0}, - 163: {lang: 0x443, script: 0x52, flags: 0x0}, - 164: {lang: 0x288, script: 0x1e, flags: 0x0}, - 165: {lang: 0x23, script: 0x3, flags: 0x1}, - 167: {lang: 0x26, script: 0x2, flags: 0x1}, - 169: {lang: 0x252, script: 0x4b, flags: 0x0}, - 170: {lang: 0x252, script: 0x4b, flags: 0x0}, - 171: {lang: 0x3a, script: 0x5, flags: 0x0}, - 173: {lang: 0x3e0, script: 0x1e, flags: 0x0}, - 174: {lang: 0x28, script: 0x2, flags: 0x1}, - 175: {lang: 0x3a, script: 0x5, flags: 0x0}, - 177: {lang: 0x10c, script: 0x52, flags: 0x0}, - 178: {lang: 0x40a, script: 0xc1, flags: 0x0}, - 180: {lang: 0x439, script: 0x52, flags: 0x0}, - 181: {lang: 0x2be, script: 0x52, flags: 0x0}, - 182: {lang: 0x15d, script: 0x52, flags: 0x0}, - 183: {lang: 0x2c5, script: 0x52, flags: 0x0}, - 184: {lang: 0x3a, script: 0x5, flags: 0x0}, - 185: {lang: 0x2a, script: 0x2, flags: 0x1}, - 186: {lang: 0x15d, script: 0x52, flags: 0x0}, - 187: {lang: 0x2c, script: 0x2, flags: 0x1}, - 188: {lang: 0x430, script: 0x52, flags: 0x0}, - 189: {lang: 0x15d, script: 0x52, flags: 0x0}, - 190: {lang: 0x2ef, script: 0x52, flags: 0x0}, - 193: {lang: 0x2e, script: 0x2, flags: 0x1}, - 194: {lang: 0xa0, script: 0x52, flags: 0x0}, - 195: {lang: 0x30, script: 0x2, flags: 0x1}, - 196: {lang: 0x32, script: 0x2, flags: 0x1}, - 197: {lang: 0x34, script: 0x2, flags: 0x1}, - 199: {lang: 0x15d, script: 0x52, flags: 0x0}, - 200: {lang: 0x36, script: 0x2, flags: 0x1}, - 202: {lang: 0x31e, script: 0x52, flags: 0x0}, - 203: {lang: 0x38, script: 0x3, flags: 0x1}, - 204: {lang: 0x127, script: 0xd4, flags: 0x0}, - 206: {lang: 0x13d, script: 0x52, flags: 0x0}, - 207: {lang: 0x31d, script: 0x52, flags: 0x0}, - 208: {lang: 0x3be, script: 0x52, flags: 0x0}, - 209: {lang: 0x16, script: 0x52, flags: 0x0}, - 210: {lang: 0x15d, script: 0x52, flags: 0x0}, - 211: {lang: 0x1b2, script: 0x52, flags: 0x0}, - 213: {lang: 0x1b2, script: 0x5, flags: 0x2}, - 215: {lang: 0x13d, script: 0x52, flags: 0x0}, - 216: {lang: 0x365, script: 0x52, flags: 0x0}, - 217: {lang: 0x345, script: 0x52, flags: 0x0}, - 218: {lang: 0x34f, script: 0x20, flags: 0x0}, - 224: {lang: 0x3a, script: 0x5, flags: 0x0}, - 225: {lang: 0x13d, script: 0x52, flags: 0x0}, - 227: {lang: 0x13d, script: 0x52, flags: 0x0}, - 228: {lang: 0x15d, script: 0x52, flags: 0x0}, - 229: {lang: 0x484, script: 0x52, flags: 0x0}, - 230: {lang: 0x152, script: 0x52, flags: 0x0}, - 231: {lang: 0x3b, script: 0x3, flags: 0x1}, - 232: {lang: 0x3b1, script: 0x52, flags: 0x0}, - 233: {lang: 0x15d, script: 0x52, flags: 0x0}, - 235: {lang: 0x13d, script: 0x52, flags: 0x0}, - 236: {lang: 0x3a, script: 0x5, flags: 0x0}, - 237: {lang: 0x3be, script: 0x52, flags: 0x0}, - 239: {lang: 0x3a0, script: 0x52, flags: 0x0}, - 240: {lang: 0x192, script: 0x52, flags: 0x0}, - 242: {lang: 0x3a, script: 0x5, flags: 0x0}, - 257: {lang: 0x15d, script: 0x52, flags: 0x0}, - 259: {lang: 0x3e, script: 0x2, flags: 0x1}, - 260: {lang: 0x430, script: 0x1e, flags: 0x0}, - 261: {lang: 0x40, script: 0x2, flags: 0x1}, - 262: {lang: 0x3e3, script: 0x52, flags: 0x0}, - 263: {lang: 0x3a, script: 0x5, flags: 0x0}, - 265: {lang: 0x15d, script: 0x52, flags: 0x0}, - 266: {lang: 0x3a, script: 0x5, flags: 0x0}, - 267: {lang: 0x42, script: 0x2, flags: 0x1}, - 270: {lang: 0x414, script: 0x52, flags: 0x0}, - 271: {lang: 0x345, script: 0x52, flags: 0x0}, - 272: {lang: 0x44, script: 0x2, flags: 0x1}, - 274: {lang: 0x1f7, script: 0x52, flags: 0x0}, - 275: {lang: 0x15d, script: 0x52, flags: 0x0}, - 276: {lang: 0x427, script: 0x52, flags: 0x0}, - 277: {lang: 0x365, script: 0x52, flags: 0x0}, - 279: {lang: 0x3be, script: 0x52, flags: 0x0}, - 281: {lang: 0x13d, script: 0x52, flags: 0x0}, - 283: {lang: 0x46, script: 0x2, flags: 0x1}, - 287: {lang: 0x15d, script: 0x52, flags: 0x0}, - 288: {lang: 0x15d, script: 0x52, flags: 0x0}, - 289: {lang: 0x48, script: 0x2, flags: 0x1}, - 290: {lang: 0x4a, script: 0x3, flags: 0x1}, - 291: {lang: 0x4d, script: 0x2, flags: 0x1}, - 292: {lang: 0x475, script: 0x52, flags: 0x0}, - 293: {lang: 0x3be, script: 0x52, flags: 0x0}, - 294: {lang: 0x474, script: 0x52, flags: 0x0}, - 295: {lang: 0x4f, script: 0x2, flags: 0x1}, - 296: {lang: 0x480, script: 0x52, flags: 0x0}, - 298: {lang: 0x51, script: 0x4, flags: 0x1}, - 300: {lang: 0x49e, script: 0x52, flags: 0x0}, - 301: {lang: 0x55, script: 0x2, flags: 0x1}, - 302: {lang: 0x443, script: 0x52, flags: 0x0}, - 303: {lang: 0x57, script: 0x3, flags: 0x1}, - 304: {lang: 0x443, script: 0x52, flags: 0x0}, - 308: {lang: 0x510, script: 0x37, flags: 0x2}, - 309: {lang: 0x13d, script: 0x52, flags: 0x0}, - 310: {lang: 0x4ba, script: 0x52, flags: 0x0}, - 311: {lang: 0x1f7, script: 0x52, flags: 0x0}, - 314: {lang: 0x13d, script: 0x52, flags: 0x0}, - 317: {lang: 0x4c1, script: 0x52, flags: 0x0}, - 318: {lang: 0x8a, script: 0x52, flags: 0x0}, - 319: {lang: 0x15d, script: 0x52, flags: 0x0}, - 321: {lang: 0x419, script: 0x52, flags: 0x0}, - 332: {lang: 0x5a, script: 0x2, flags: 0x1}, - 349: {lang: 0x3a, script: 0x5, flags: 0x0}, - 350: {lang: 0x5c, script: 0x2, flags: 0x1}, - 355: {lang: 0x421, script: 0x52, flags: 0x0}, + 108: {lang: 0x3a, script: 0x5, flags: 0x0}, + 109: {lang: 0x46d, script: 0x28, flags: 0x0}, + 110: {lang: 0x13d, script: 0x55, flags: 0x0}, + 111: {lang: 0x13, script: 0x2, flags: 0x1}, + 113: {lang: 0x10c, script: 0x55, flags: 0x0}, + 114: {lang: 0x150, script: 0x55, flags: 0x0}, + 115: {lang: 0x1be, script: 0x20, flags: 0x2}, + 118: {lang: 0x157, script: 0x55, flags: 0x0}, + 120: {lang: 0x15d, script: 0x55, flags: 0x0}, + 122: {lang: 0x15d, script: 0x55, flags: 0x0}, + 123: {lang: 0x15, script: 0x2, flags: 0x1}, + 125: {lang: 0x17, script: 0x3, flags: 0x1}, + 126: {lang: 0x15d, script: 0x55, flags: 0x0}, + 128: {lang: 0x21, script: 0x55, flags: 0x0}, + 130: {lang: 0x243, script: 0x55, flags: 0x0}, + 132: {lang: 0x15d, script: 0x55, flags: 0x0}, + 133: {lang: 0x15d, script: 0x55, flags: 0x0}, + 134: {lang: 0x13d, script: 0x55, flags: 0x0}, + 135: {lang: 0x1a, script: 0x2, flags: 0x1}, + 136: {lang: 0x0, script: 0x55, flags: 0x0}, + 137: {lang: 0x13d, script: 0x55, flags: 0x0}, + 139: {lang: 0x3be, script: 0x55, flags: 0x0}, + 141: {lang: 0x527, script: 0x38, flags: 0x0}, + 142: {lang: 0x0, script: 0x55, flags: 0x0}, + 143: {lang: 0x13d, script: 0x55, flags: 0x0}, + 144: {lang: 0x1cf, script: 0x55, flags: 0x0}, + 145: {lang: 0x1d2, script: 0x55, flags: 0x0}, + 146: {lang: 0x1d3, script: 0x55, flags: 0x0}, + 148: {lang: 0x13d, script: 0x55, flags: 0x0}, + 149: {lang: 0x1c, script: 0x2, flags: 0x1}, + 151: {lang: 0x1ba, script: 0x3a, flags: 0x0}, + 153: {lang: 0x1e, script: 0x3, flags: 0x1}, + 155: {lang: 0x3a, script: 0x5, flags: 0x0}, + 156: {lang: 0x21, script: 0x2, flags: 0x1}, + 157: {lang: 0x1f6, script: 0x55, flags: 0x0}, + 158: {lang: 0x1f7, script: 0x55, flags: 0x0}, + 161: {lang: 0x3a, script: 0x5, flags: 0x0}, + 162: {lang: 0x1fe, script: 0x44, flags: 0x0}, + 164: {lang: 0x443, script: 0x55, flags: 0x0}, + 165: {lang: 0x288, script: 0x1e, flags: 0x0}, + 166: {lang: 0x23, script: 0x3, flags: 0x1}, + 168: {lang: 0x26, script: 0x2, flags: 0x1}, + 170: {lang: 0x252, script: 0x4e, flags: 0x0}, + 171: {lang: 0x252, script: 0x4e, flags: 0x0}, + 172: {lang: 0x3a, script: 0x5, flags: 0x0}, + 174: {lang: 0x3e0, script: 0x1e, flags: 0x0}, + 175: {lang: 0x28, script: 0x2, flags: 0x1}, + 176: {lang: 0x3a, script: 0x5, flags: 0x0}, + 178: {lang: 0x10c, script: 0x55, flags: 0x0}, + 179: {lang: 0x40a, script: 0xc6, flags: 0x0}, + 181: {lang: 0x439, script: 0x55, flags: 0x0}, + 182: {lang: 0x2be, script: 0x55, flags: 0x0}, + 183: {lang: 0x15d, script: 0x55, flags: 0x0}, + 184: {lang: 0x2c5, script: 0x55, flags: 0x0}, + 185: {lang: 0x3a, script: 0x5, flags: 0x0}, + 186: {lang: 0x2a, script: 0x2, flags: 0x1}, + 187: {lang: 0x15d, script: 0x55, flags: 0x0}, + 188: {lang: 0x2c, script: 0x2, flags: 0x1}, + 189: {lang: 0x430, script: 0x55, flags: 0x0}, + 190: {lang: 0x15d, script: 0x55, flags: 0x0}, + 191: {lang: 0x2ef, script: 0x55, flags: 0x0}, + 194: {lang: 0x2e, script: 0x2, flags: 0x1}, + 195: {lang: 0xa0, script: 0x55, flags: 0x0}, + 196: {lang: 0x30, script: 0x2, flags: 0x1}, + 197: {lang: 0x32, script: 0x2, flags: 0x1}, + 198: {lang: 0x34, script: 0x2, flags: 0x1}, + 200: {lang: 0x15d, script: 0x55, flags: 0x0}, + 201: {lang: 0x36, script: 0x2, flags: 0x1}, + 203: {lang: 0x31e, script: 0x55, flags: 0x0}, + 204: {lang: 0x38, script: 0x3, flags: 0x1}, + 205: {lang: 0x127, script: 0xda, flags: 0x0}, + 207: {lang: 0x13d, script: 0x55, flags: 0x0}, + 208: {lang: 0x31d, script: 0x55, flags: 0x0}, + 209: {lang: 0x3be, script: 0x55, flags: 0x0}, + 210: {lang: 0x16, script: 0x55, flags: 0x0}, + 211: {lang: 0x15d, script: 0x55, flags: 0x0}, + 212: {lang: 0x1b2, script: 0x55, flags: 0x0}, + 214: {lang: 0x1b2, script: 0x5, flags: 0x2}, + 216: {lang: 0x13d, script: 0x55, flags: 0x0}, + 217: {lang: 0x365, script: 0x55, flags: 0x0}, + 218: {lang: 0x345, script: 0x55, flags: 0x0}, + 219: {lang: 0x34f, script: 0x20, flags: 0x0}, + 225: {lang: 0x3a, script: 0x5, flags: 0x0}, + 226: {lang: 0x13d, script: 0x55, flags: 0x0}, + 228: {lang: 0x13d, script: 0x55, flags: 0x0}, + 229: {lang: 0x15d, script: 0x55, flags: 0x0}, + 230: {lang: 0x484, script: 0x55, flags: 0x0}, + 231: {lang: 0x152, script: 0x55, flags: 0x0}, + 232: {lang: 0x3b, script: 0x3, flags: 0x1}, + 233: {lang: 0x3b1, script: 0x55, flags: 0x0}, + 234: {lang: 0x15d, script: 0x55, flags: 0x0}, + 236: {lang: 0x13d, script: 0x55, flags: 0x0}, + 237: {lang: 0x3a, script: 0x5, flags: 0x0}, + 238: {lang: 0x3be, script: 0x55, flags: 0x0}, + 240: {lang: 0x3a0, script: 0x55, flags: 0x0}, + 241: {lang: 0x192, script: 0x55, flags: 0x0}, + 243: {lang: 0x3a, script: 0x5, flags: 0x0}, + 258: {lang: 0x15d, script: 0x55, flags: 0x0}, + 260: {lang: 0x3e, script: 0x2, flags: 0x1}, + 261: {lang: 0x430, script: 0x1e, flags: 0x0}, + 262: {lang: 0x40, script: 0x2, flags: 0x1}, + 263: {lang: 0x3e3, script: 0x55, flags: 0x0}, + 264: {lang: 0x3a, script: 0x5, flags: 0x0}, + 266: {lang: 0x15d, script: 0x55, flags: 0x0}, + 267: {lang: 0x3a, script: 0x5, flags: 0x0}, + 268: {lang: 0x42, script: 0x2, flags: 0x1}, + 271: {lang: 0x414, script: 0x55, flags: 0x0}, + 272: {lang: 0x345, script: 0x55, flags: 0x0}, + 273: {lang: 0x44, script: 0x2, flags: 0x1}, + 275: {lang: 0x1f7, script: 0x55, flags: 0x0}, + 276: {lang: 0x15d, script: 0x55, flags: 0x0}, + 277: {lang: 0x427, script: 0x55, flags: 0x0}, + 278: {lang: 0x365, script: 0x55, flags: 0x0}, + 280: {lang: 0x3be, script: 0x55, flags: 0x0}, + 282: {lang: 0x13d, script: 0x55, flags: 0x0}, + 284: {lang: 0x46, script: 0x2, flags: 0x1}, + 288: {lang: 0x15d, script: 0x55, flags: 0x0}, + 289: {lang: 0x15d, script: 0x55, flags: 0x0}, + 290: {lang: 0x48, script: 0x2, flags: 0x1}, + 291: {lang: 0x4a, script: 0x3, flags: 0x1}, + 292: {lang: 0x4d, script: 0x2, flags: 0x1}, + 293: {lang: 0x475, script: 0x55, flags: 0x0}, + 294: {lang: 0x3be, script: 0x55, flags: 0x0}, + 295: {lang: 0x474, script: 0x55, flags: 0x0}, + 296: {lang: 0x4f, script: 0x2, flags: 0x1}, + 297: {lang: 0x480, script: 0x55, flags: 0x0}, + 299: {lang: 0x51, script: 0x4, flags: 0x1}, + 301: {lang: 0x49e, script: 0x55, flags: 0x0}, + 302: {lang: 0x55, script: 0x2, flags: 0x1}, + 303: {lang: 0x443, script: 0x55, flags: 0x0}, + 304: {lang: 0x57, script: 0x3, flags: 0x1}, + 305: {lang: 0x443, script: 0x55, flags: 0x0}, + 309: {lang: 0x510, script: 0x3a, flags: 0x2}, + 310: {lang: 0x13d, script: 0x55, flags: 0x0}, + 311: {lang: 0x4ba, script: 0x55, flags: 0x0}, + 312: {lang: 0x1f7, script: 0x55, flags: 0x0}, + 315: {lang: 0x13d, script: 0x55, flags: 0x0}, + 318: {lang: 0x4c1, script: 0x55, flags: 0x0}, + 319: {lang: 0x8a, script: 0x55, flags: 0x0}, + 320: {lang: 0x15d, script: 0x55, flags: 0x0}, + 322: {lang: 0x419, script: 0x55, flags: 0x0}, + 333: {lang: 0x5a, script: 0x2, flags: 0x1}, + 350: {lang: 0x3a, script: 0x5, flags: 0x0}, + 351: {lang: 0x5c, script: 0x2, flags: 0x1}, + 356: {lang: 0x421, script: 0x55, flags: 0x0}, } // likelyRegionList holds lists info associated with likelyRegion. // Size: 376 bytes, 94 elements var likelyRegionList = [94]likelyLangScript{ 0: {lang: 0x147, script: 0x5, flags: 0x0}, - 1: {lang: 0x474, script: 0x52, flags: 0x0}, - 2: {lang: 0x42f, script: 0x52, flags: 0x0}, + 1: {lang: 0x474, script: 0x55, flags: 0x0}, + 2: {lang: 0x42f, script: 0x55, flags: 0x0}, 3: {lang: 0x2fd, script: 0x1e, flags: 0x0}, 4: {lang: 0x1d5, script: 0x8, flags: 0x0}, - 5: {lang: 0x272, script: 0x52, flags: 0x0}, - 6: {lang: 0xb7, script: 0x52, flags: 0x0}, + 5: {lang: 0x272, script: 0x55, flags: 0x0}, + 6: {lang: 0xb7, script: 0x55, flags: 0x0}, 7: {lang: 0x430, script: 0x1e, flags: 0x0}, - 8: {lang: 0x12c, script: 0xd6, flags: 0x0}, + 8: {lang: 0x12c, script: 0xdc, flags: 0x0}, 9: {lang: 0x34f, script: 0x20, flags: 0x0}, - 10: {lang: 0x527, script: 0x34, flags: 0x0}, + 10: {lang: 0x527, script: 0x37, flags: 0x0}, 11: {lang: 0x4aa, script: 0x5, flags: 0x0}, - 12: {lang: 0x51d, script: 0x35, flags: 0x0}, - 13: {lang: 0x521, script: 0x52, flags: 0x0}, - 14: {lang: 0x298, script: 0xd5, flags: 0x0}, - 15: {lang: 0x135, script: 0x2d, flags: 0x0}, - 16: {lang: 0x488, script: 0x52, flags: 0x0}, + 12: {lang: 0x51d, script: 0x38, flags: 0x0}, + 13: {lang: 0x521, script: 0x55, flags: 0x0}, + 14: {lang: 0x298, script: 0xdb, flags: 0x0}, + 15: {lang: 0x135, script: 0x30, flags: 0x0}, + 16: {lang: 0x488, script: 0x55, flags: 0x0}, 17: {lang: 0x3a, script: 0x5, flags: 0x0}, - 18: {lang: 0x15d, script: 0x52, flags: 0x0}, - 19: {lang: 0x27, script: 0x27, flags: 0x0}, - 20: {lang: 0x138, script: 0x52, flags: 0x0}, + 18: {lang: 0x15d, script: 0x55, flags: 0x0}, + 19: {lang: 0x27, script: 0x28, flags: 0x0}, + 20: {lang: 0x138, script: 0x55, flags: 0x0}, 21: {lang: 0x268, script: 0x5, flags: 0x2}, - 22: {lang: 0x510, script: 0x37, flags: 0x2}, - 23: {lang: 0x20e, script: 0x29, flags: 0x0}, + 22: {lang: 0x510, script: 0x3a, flags: 0x2}, + 23: {lang: 0x20e, script: 0x2a, flags: 0x0}, 24: {lang: 0x5, script: 0x1e, flags: 0x0}, - 25: {lang: 0x272, script: 0x52, flags: 0x0}, - 26: {lang: 0x135, script: 0x2d, flags: 0x0}, + 25: {lang: 0x272, script: 0x55, flags: 0x0}, + 26: {lang: 0x135, script: 0x30, flags: 0x0}, 27: {lang: 0x2fd, script: 0x1e, flags: 0x0}, - 28: {lang: 0x1df, script: 0x52, flags: 0x0}, + 28: {lang: 0x1df, script: 0x55, flags: 0x0}, 29: {lang: 0x31d, script: 0x5, flags: 0x0}, 30: {lang: 0x1bc, script: 0x20, flags: 0x0}, 31: {lang: 0x4b2, script: 0x5, flags: 0x0}, - 32: {lang: 0x234, script: 0x6b, flags: 0x0}, + 32: {lang: 0x234, script: 0x70, flags: 0x0}, 33: {lang: 0x147, script: 0x5, flags: 0x0}, - 34: {lang: 0x474, script: 0x52, flags: 0x0}, - 35: {lang: 0x248, script: 0x46, flags: 0x0}, + 34: {lang: 0x474, script: 0x55, flags: 0x0}, + 35: {lang: 0x248, script: 0x49, flags: 0x0}, 36: {lang: 0xe6, script: 0x5, flags: 0x0}, - 37: {lang: 0x224, script: 0xd5, flags: 0x0}, + 37: {lang: 0x224, script: 0xdb, flags: 0x0}, 38: {lang: 0x3a, script: 0x5, flags: 0x0}, - 39: {lang: 0x15d, script: 0x52, flags: 0x0}, - 40: {lang: 0x2b6, script: 0x4f, flags: 0x0}, - 41: {lang: 0x224, script: 0xd5, flags: 0x0}, + 39: {lang: 0x15d, script: 0x55, flags: 0x0}, + 40: {lang: 0x2b6, script: 0x52, flags: 0x0}, + 41: {lang: 0x224, script: 0xdb, flags: 0x0}, 42: {lang: 0x3a, script: 0x5, flags: 0x0}, - 43: {lang: 0x15d, script: 0x52, flags: 0x0}, - 44: {lang: 0x3da, script: 0x52, flags: 0x0}, + 43: {lang: 0x15d, script: 0x55, flags: 0x0}, + 44: {lang: 0x3da, script: 0x55, flags: 0x0}, 45: {lang: 0x4ac, script: 0x1e, flags: 0x0}, 46: {lang: 0x2fd, script: 0x1e, flags: 0x0}, - 47: {lang: 0x42f, script: 0x52, flags: 0x0}, - 48: {lang: 0x32f, script: 0x6b, flags: 0x0}, - 49: {lang: 0x211, script: 0x52, flags: 0x0}, + 47: {lang: 0x42f, script: 0x55, flags: 0x0}, + 48: {lang: 0x32f, script: 0x70, flags: 0x0}, + 49: {lang: 0x211, script: 0x55, flags: 0x0}, 50: {lang: 0x309, script: 0x1e, flags: 0x0}, 51: {lang: 0x240, script: 0x5, flags: 0x0}, - 52: {lang: 0x527, script: 0x35, flags: 0x0}, - 53: {lang: 0x3be, script: 0x52, flags: 0x0}, + 52: {lang: 0x527, script: 0x38, flags: 0x0}, + 53: {lang: 0x3be, script: 0x55, flags: 0x0}, 54: {lang: 0x3a, script: 0x5, flags: 0x0}, - 55: {lang: 0x15d, script: 0x52, flags: 0x0}, - 56: {lang: 0x2eb, script: 0x52, flags: 0x0}, + 55: {lang: 0x15d, script: 0x55, flags: 0x0}, + 56: {lang: 0x2eb, script: 0x55, flags: 0x0}, 57: {lang: 0x4b2, script: 0x5, flags: 0x0}, 58: {lang: 0x88, script: 0x20, flags: 0x0}, 59: {lang: 0x4b2, script: 0x5, flags: 0x0}, 60: {lang: 0x4b2, script: 0x5, flags: 0x0}, 61: {lang: 0xbe, script: 0x20, flags: 0x0}, - 62: {lang: 0x3da, script: 0x52, flags: 0x0}, + 62: {lang: 0x3da, script: 0x55, flags: 0x0}, 63: {lang: 0x7e, script: 0x1e, flags: 0x0}, 64: {lang: 0x3e0, script: 0x1e, flags: 0x0}, - 65: {lang: 0x265, script: 0x52, flags: 0x0}, - 66: {lang: 0x442, script: 0x52, flags: 0x0}, - 67: {lang: 0x510, script: 0x37, flags: 0x0}, - 68: {lang: 0x410, script: 0x52, flags: 0x0}, + 65: {lang: 0x265, script: 0x55, flags: 0x0}, + 66: {lang: 0x442, script: 0x55, flags: 0x0}, + 67: {lang: 0x510, script: 0x3a, flags: 0x0}, + 68: {lang: 0x410, script: 0x55, flags: 0x0}, 69: {lang: 0x4ac, script: 0x1e, flags: 0x0}, 70: {lang: 0x3a, script: 0x5, flags: 0x0}, - 71: {lang: 0x15d, script: 0x52, flags: 0x0}, - 72: {lang: 0x15d, script: 0x52, flags: 0x0}, + 71: {lang: 0x15d, script: 0x55, flags: 0x0}, + 72: {lang: 0x15d, script: 0x55, flags: 0x0}, 73: {lang: 0x35, script: 0x5, flags: 0x0}, - 74: {lang: 0x469, script: 0xd5, flags: 0x0}, + 74: {lang: 0x469, script: 0xdb, flags: 0x0}, 75: {lang: 0x2ea, script: 0x5, flags: 0x0}, - 76: {lang: 0x30d, script: 0x6b, flags: 0x0}, + 76: {lang: 0x30d, script: 0x70, flags: 0x0}, 77: {lang: 0x465, script: 0x1e, flags: 0x0}, 78: {lang: 0x147, script: 0x5, flags: 0x0}, 79: {lang: 0x3a, script: 0x5, flags: 0x0}, - 80: {lang: 0x15d, script: 0x52, flags: 0x0}, - 81: {lang: 0x488, script: 0x52, flags: 0x0}, + 80: {lang: 0x15d, script: 0x55, flags: 0x0}, + 81: {lang: 0x488, script: 0x55, flags: 0x0}, 82: {lang: 0x58, script: 0x5, flags: 0x0}, 83: {lang: 0x217, script: 0x1e, flags: 0x0}, - 84: {lang: 0x81, script: 0x2d, flags: 0x0}, - 85: {lang: 0x527, script: 0x35, flags: 0x0}, - 86: {lang: 0x48a, script: 0x52, flags: 0x0}, + 84: {lang: 0x81, script: 0x30, flags: 0x0}, + 85: {lang: 0x527, script: 0x38, flags: 0x0}, + 86: {lang: 0x48a, script: 0x55, flags: 0x0}, 87: {lang: 0x4ac, script: 0x1e, flags: 0x0}, - 88: {lang: 0x510, script: 0x37, flags: 0x0}, - 89: {lang: 0x3b1, script: 0x52, flags: 0x0}, - 90: {lang: 0x42f, script: 0x52, flags: 0x0}, + 88: {lang: 0x510, script: 0x3a, flags: 0x0}, + 89: {lang: 0x3b1, script: 0x55, flags: 0x0}, + 90: {lang: 0x42f, script: 0x55, flags: 0x0}, 91: {lang: 0x430, script: 0x1e, flags: 0x0}, - 92: {lang: 0x15d, script: 0x52, flags: 0x0}, + 92: {lang: 0x15d, script: 0x55, flags: 0x0}, 93: {lang: 0x444, script: 0x5, flags: 0x0}, } @@ -3234,94 +3245,101 @@ type likelyTag struct { script uint8 } -// Size: 192 bytes, 32 elements -var likelyRegionGroup = [32]likelyTag{ - 1: {lang: 0x138, region: 0xd5, script: 0x52}, - 2: {lang: 0x138, region: 0x134, script: 0x52}, - 3: {lang: 0x3be, region: 0x40, script: 0x52}, - 4: {lang: 0x138, region: 0x2e, script: 0x52}, - 5: {lang: 0x138, region: 0xd5, script: 0x52}, - 6: {lang: 0x13d, region: 0xce, script: 0x52}, - 7: {lang: 0x443, region: 0x12e, script: 0x52}, - 8: {lang: 0x3a, region: 0x6a, script: 0x5}, - 9: {lang: 0x443, region: 0x4a, script: 0x52}, - 10: {lang: 0x138, region: 0x160, script: 0x52}, - 11: {lang: 0x138, region: 0x134, script: 0x52}, - 12: {lang: 0x138, region: 0x134, script: 0x52}, - 13: {lang: 0x13d, region: 0x58, script: 0x52}, - 14: {lang: 0x527, region: 0x52, script: 0x34}, - 15: {lang: 0x1bc, region: 0x98, script: 0x20}, - 16: {lang: 0x1df, region: 0x94, script: 0x52}, - 17: {lang: 0x1f7, region: 0x9d, script: 0x52}, - 18: {lang: 0x138, region: 0x2e, script: 0x52}, - 19: {lang: 0x138, region: 0xe5, script: 0x52}, - 20: {lang: 0x138, region: 0x89, script: 0x52}, - 21: {lang: 0x419, region: 0x141, script: 0x52}, - 22: {lang: 0x527, region: 0x52, script: 0x34}, - 23: {lang: 0x4ba, region: 0x136, script: 0x52}, - 24: {lang: 0x3a, region: 0x107, script: 0x5}, - 25: {lang: 0x3e0, region: 0x105, script: 0x1e}, - 26: {lang: 0x3e0, region: 0x105, script: 0x1e}, - 27: {lang: 0x138, region: 0x7a, script: 0x52}, - 28: {lang: 0x10c, region: 0x5f, script: 0x52}, - 29: {lang: 0x13d, region: 0x1e, script: 0x52}, - 30: {lang: 0x138, region: 0x99, script: 0x52}, - 31: {lang: 0x138, region: 0x7a, script: 0x52}, +// Size: 198 bytes, 33 elements +var likelyRegionGroup = [33]likelyTag{ + 1: {lang: 0x138, region: 0xd6, script: 0x55}, + 2: {lang: 0x138, region: 0x135, script: 0x55}, + 3: {lang: 0x3be, region: 0x41, script: 0x55}, + 4: {lang: 0x138, region: 0x2f, script: 0x55}, + 5: {lang: 0x138, region: 0xd6, script: 0x55}, + 6: {lang: 0x13d, region: 0xcf, script: 0x55}, + 7: {lang: 0x443, region: 0x12f, script: 0x55}, + 8: {lang: 0x3a, region: 0x6b, script: 0x5}, + 9: {lang: 0x443, region: 0x4b, script: 0x55}, + 10: {lang: 0x138, region: 0x161, script: 0x55}, + 11: {lang: 0x138, region: 0x135, script: 0x55}, + 12: {lang: 0x138, region: 0x135, script: 0x55}, + 13: {lang: 0x13d, region: 0x59, script: 0x55}, + 14: {lang: 0x527, region: 0x53, script: 0x37}, + 15: {lang: 0x1bc, region: 0x99, script: 0x20}, + 16: {lang: 0x1df, region: 0x95, script: 0x55}, + 17: {lang: 0x1f7, region: 0x9e, script: 0x55}, + 18: {lang: 0x138, region: 0x2f, script: 0x55}, + 19: {lang: 0x138, region: 0xe6, script: 0x55}, + 20: {lang: 0x138, region: 0x8a, script: 0x55}, + 21: {lang: 0x419, region: 0x142, script: 0x55}, + 22: {lang: 0x527, region: 0x53, script: 0x37}, + 23: {lang: 0x4ba, region: 0x137, script: 0x55}, + 24: {lang: 0x3a, region: 0x108, script: 0x5}, + 25: {lang: 0x3e0, region: 0x106, script: 0x1e}, + 26: {lang: 0x3e0, region: 0x106, script: 0x1e}, + 27: {lang: 0x138, region: 0x7b, script: 0x55}, + 28: {lang: 0x10c, region: 0x60, script: 0x55}, + 30: {lang: 0x13d, region: 0x1f, script: 0x55}, + 31: {lang: 0x138, region: 0x9a, script: 0x55}, + 32: {lang: 0x138, region: 0x7b, script: 0x55}, } -// Size: 357 bytes, 357 elements -var regionToGroups = [357]uint8{ +// Size: 358 bytes, 358 elements +var regionToGroups = [358]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x04, // Entry 40 - 7F - 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, - 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08, 0x00, - 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, + 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, + 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x08, + 0x00, 0x04, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, // Entry 80 - BF - 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x01, 0x00, 0x04, 0x02, 0x00, 0x04, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, // Entry C0 - FF - 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x04, - 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, + 0x04, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Entry 100 - 13F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00, 0x00, - 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x04, 0x00, + 0x00, 0x04, 0x00, 0x04, 0x04, 0x05, 0x00, 0x00, // Entry 140 - 17F 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +} + +// Size: 18 bytes, 3 elements +var paradigmLocales = [3][3]uint16{ + 0: [3]uint16{0x138, 0x0, 0x7b}, + 1: [3]uint16{0x13d, 0x0, 0x1f}, + 2: [3]uint16{0x3be, 0x41, 0xee}, } type mutualIntelligibility struct { @@ -3349,8 +3367,8 @@ type regionIntelligibility struct { // matchLang holds pairs of langIDs of base languages that are typically // mutually intelligible. Each pair is associated with a confidence and // whether the intelligibility goes one or both ways. -// Size: 690 bytes, 115 elements -var matchLang = [115]mutualIntelligibility{ +// Size: 678 bytes, 113 elements +var matchLang = [113]mutualIntelligibility{ 0: {want: 0x1cf, have: 0xb7, distance: 0x4, oneway: false}, 1: {want: 0x405, have: 0xb7, distance: 0x4, oneway: false}, 2: {want: 0x405, have: 0x1cf, distance: 0x4, oneway: false}, @@ -3358,146 +3376,144 @@ var matchLang = [115]mutualIntelligibility{ 4: {want: 0x438, have: 0x1, distance: 0x4, oneway: false}, 5: {want: 0x1a1, have: 0x10c, distance: 0x4, oneway: true}, 6: {want: 0x293, have: 0x10c, distance: 0x4, oneway: true}, - 7: {want: 0x430, have: 0x1cf, distance: 0x5, oneway: false}, - 8: {want: 0x430, have: 0xb7, distance: 0x5, oneway: false}, - 9: {want: 0x100, have: 0x36d, distance: 0x8, oneway: false}, - 10: {want: 0x100, have: 0x345, distance: 0x8, oneway: false}, - 11: {want: 0x5, have: 0x3e0, distance: 0xa, oneway: true}, - 12: {want: 0xd, have: 0x138, distance: 0xa, oneway: true}, - 13: {want: 0x16, have: 0x365, distance: 0xa, oneway: true}, - 14: {want: 0x21, have: 0x138, distance: 0xa, oneway: true}, - 15: {want: 0x56, have: 0x13d, distance: 0xa, oneway: true}, - 16: {want: 0x58, have: 0x3e0, distance: 0xa, oneway: true}, - 17: {want: 0x71, have: 0x3e0, distance: 0xa, oneway: true}, - 18: {want: 0x75, have: 0x138, distance: 0xa, oneway: true}, - 19: {want: 0x82, have: 0x1bc, distance: 0xa, oneway: true}, - 20: {want: 0xa5, have: 0x138, distance: 0xa, oneway: true}, - 21: {want: 0xb2, have: 0x15d, distance: 0xa, oneway: true}, - 22: {want: 0xdd, have: 0x152, distance: 0xa, oneway: true}, - 23: {want: 0xe5, have: 0x138, distance: 0xa, oneway: true}, - 24: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true}, - 25: {want: 0xef, have: 0x15d, distance: 0xa, oneway: true}, - 26: {want: 0xf8, have: 0x15d, distance: 0xa, oneway: true}, - 27: {want: 0xff, have: 0x138, distance: 0xa, oneway: true}, - 28: {want: 0x12f, have: 0x138, distance: 0xa, oneway: true}, - 29: {want: 0x13b, have: 0x138, distance: 0xa, oneway: true}, - 30: {want: 0x13f, have: 0x150, distance: 0xa, oneway: true}, - 31: {want: 0x144, have: 0x13d, distance: 0xa, oneway: true}, - 32: {want: 0x157, have: 0x100, distance: 0xa, oneway: true}, - 33: {want: 0x16c, have: 0x365, distance: 0xa, oneway: true}, - 34: {want: 0x16d, have: 0x138, distance: 0xa, oneway: true}, - 35: {want: 0x16e, have: 0x138, distance: 0xa, oneway: true}, - 36: {want: 0x17c, have: 0x138, distance: 0xa, oneway: true}, - 37: {want: 0x18e, have: 0x13d, distance: 0xa, oneway: true}, - 38: {want: 0x192, have: 0x13d, distance: 0xa, oneway: true}, - 39: {want: 0x1a2, have: 0x1bc, distance: 0xa, oneway: true}, - 40: {want: 0x1b2, have: 0x138, distance: 0xa, oneway: true}, - 41: {want: 0x1b6, have: 0x138, distance: 0xa, oneway: true}, - 42: {want: 0x1d2, have: 0x15d, distance: 0xa, oneway: true}, - 43: {want: 0x1d5, have: 0x3e0, distance: 0xa, oneway: true}, - 44: {want: 0x1d7, have: 0x138, distance: 0xa, oneway: true}, - 45: {want: 0x1e5, have: 0x138, distance: 0xa, oneway: true}, - 46: {want: 0x1f6, have: 0x138, distance: 0xa, oneway: true}, - 47: {want: 0x20c, have: 0x1df, distance: 0xa, oneway: true}, - 48: {want: 0x20e, have: 0x138, distance: 0xa, oneway: true}, - 49: {want: 0x22b, have: 0x15d, distance: 0xa, oneway: true}, - 50: {want: 0x240, have: 0x3e0, distance: 0xa, oneway: true}, - 51: {want: 0x248, have: 0x138, distance: 0xa, oneway: true}, - 52: {want: 0x24f, have: 0x138, distance: 0xa, oneway: true}, - 53: {want: 0x263, have: 0x138, distance: 0xa, oneway: true}, - 54: {want: 0x272, have: 0x488, distance: 0xa, oneway: true}, - 55: {want: 0x288, have: 0x3e0, distance: 0xa, oneway: true}, - 56: {want: 0x28c, have: 0x1f7, distance: 0xa, oneway: true}, - 57: {want: 0x2a1, have: 0x138, distance: 0xa, oneway: true}, - 58: {want: 0x2b3, have: 0x15d, distance: 0xa, oneway: true}, - 59: {want: 0x2b6, have: 0x138, distance: 0xa, oneway: true}, - 60: {want: 0x2bc, have: 0x138, distance: 0xa, oneway: true}, - 61: {want: 0x2c1, have: 0x15d, distance: 0xa, oneway: true}, - 62: {want: 0x2eb, have: 0x138, distance: 0xa, oneway: true}, - 63: {want: 0x2ef, have: 0x15d, distance: 0xa, oneway: true}, - 64: {want: 0x2f8, have: 0x138, distance: 0xa, oneway: true}, - 65: {want: 0x2fd, have: 0x7e, distance: 0xa, oneway: true}, - 66: {want: 0x302, have: 0x138, distance: 0xa, oneway: true}, - 67: {want: 0x309, have: 0x3e0, distance: 0xa, oneway: true}, - 68: {want: 0x319, have: 0x1bc, distance: 0xa, oneway: true}, - 69: {want: 0x31d, have: 0x1df, distance: 0xa, oneway: true}, - 70: {want: 0x31e, have: 0x138, distance: 0xa, oneway: true}, - 71: {want: 0x32f, have: 0x138, distance: 0xa, oneway: true}, - 72: {want: 0x34f, have: 0x138, distance: 0xa, oneway: true}, - 73: {want: 0x368, have: 0x345, distance: 0xa, oneway: false}, - 74: {want: 0x368, have: 0x36d, distance: 0xa, oneway: true}, - 75: {want: 0x378, have: 0x138, distance: 0xa, oneway: true}, - 76: {want: 0x385, have: 0x138, distance: 0xa, oneway: true}, - 77: {want: 0x387, have: 0x138, distance: 0xa, oneway: true}, - 78: {want: 0x389, have: 0x15d, distance: 0xa, oneway: true}, - 79: {want: 0x38e, have: 0x138, distance: 0xa, oneway: true}, - 80: {want: 0x393, have: 0x138, distance: 0xa, oneway: true}, - 81: {want: 0x39b, have: 0x138, distance: 0xa, oneway: true}, - 82: {want: 0x3a3, have: 0x138, distance: 0xa, oneway: true}, - 83: {want: 0x3bc, have: 0x138, distance: 0xa, oneway: true}, - 84: {want: 0x3c2, have: 0x13d, distance: 0xa, oneway: true}, - 85: {want: 0x3d2, have: 0x10c, distance: 0xa, oneway: true}, - 86: {want: 0x3d7, have: 0x138, distance: 0xa, oneway: true}, - 87: {want: 0x3e3, have: 0x15d, distance: 0xa, oneway: true}, - 88: {want: 0x3e7, have: 0x1bc, distance: 0xa, oneway: true}, - 89: {want: 0x3f8, have: 0x138, distance: 0xa, oneway: true}, - 90: {want: 0x40a, have: 0x138, distance: 0xa, oneway: true}, - 91: {want: 0x421, have: 0x138, distance: 0xa, oneway: true}, - 92: {want: 0x427, have: 0x138, distance: 0xa, oneway: true}, - 93: {want: 0x42f, have: 0x138, distance: 0xa, oneway: true}, - 94: {want: 0x439, have: 0x138, distance: 0xa, oneway: true}, - 95: {want: 0x43c, have: 0x1df, distance: 0xa, oneway: true}, - 96: {want: 0x443, have: 0x138, distance: 0xa, oneway: true}, - 97: {want: 0x44e, have: 0x138, distance: 0xa, oneway: true}, - 98: {want: 0x45f, have: 0x138, distance: 0xa, oneway: true}, - 99: {want: 0x465, have: 0x3e0, distance: 0xa, oneway: true}, - 100: {want: 0x46d, have: 0x138, distance: 0xa, oneway: true}, - 101: {want: 0x474, have: 0x3e0, distance: 0xa, oneway: true}, - 102: {want: 0x3880, have: 0x138, distance: 0xa, oneway: true}, - 103: {want: 0x47e, have: 0x138, distance: 0xa, oneway: true}, - 104: {want: 0x480, have: 0x138, distance: 0xa, oneway: true}, - 105: {want: 0x492, have: 0x3e0, distance: 0xa, oneway: true}, - 106: {want: 0x49b, have: 0x138, distance: 0xa, oneway: true}, - 107: {want: 0x4aa, have: 0x527, distance: 0xa, oneway: true}, - 108: {want: 0x4b2, have: 0x138, distance: 0xa, oneway: true}, - 109: {want: 0x4ba, have: 0x3e0, distance: 0xa, oneway: true}, - 110: {want: 0x4e3, have: 0x15d, distance: 0xa, oneway: true}, - 111: {want: 0x4f0, have: 0x138, distance: 0xa, oneway: true}, - 112: {want: 0x510, have: 0x138, distance: 0xa, oneway: true}, - 113: {want: 0x516, have: 0x138, distance: 0xa, oneway: true}, - 114: {want: 0x52c, have: 0x138, distance: 0xa, oneway: true}, + 7: {want: 0x100, have: 0x36d, distance: 0x8, oneway: false}, + 8: {want: 0x100, have: 0x345, distance: 0x8, oneway: false}, + 9: {want: 0x5, have: 0x3e0, distance: 0xa, oneway: true}, + 10: {want: 0xd, have: 0x138, distance: 0xa, oneway: true}, + 11: {want: 0x16, have: 0x365, distance: 0xa, oneway: true}, + 12: {want: 0x21, have: 0x138, distance: 0xa, oneway: true}, + 13: {want: 0x56, have: 0x13d, distance: 0xa, oneway: true}, + 14: {want: 0x58, have: 0x3e0, distance: 0xa, oneway: true}, + 15: {want: 0x71, have: 0x3e0, distance: 0xa, oneway: true}, + 16: {want: 0x75, have: 0x138, distance: 0xa, oneway: true}, + 17: {want: 0x82, have: 0x1bc, distance: 0xa, oneway: true}, + 18: {want: 0xa5, have: 0x138, distance: 0xa, oneway: true}, + 19: {want: 0xb2, have: 0x15d, distance: 0xa, oneway: true}, + 20: {want: 0xdd, have: 0x152, distance: 0xa, oneway: true}, + 21: {want: 0xe5, have: 0x138, distance: 0xa, oneway: true}, + 22: {want: 0xe9, have: 0x3a, distance: 0xa, oneway: true}, + 23: {want: 0xef, have: 0x15d, distance: 0xa, oneway: true}, + 24: {want: 0xf8, have: 0x15d, distance: 0xa, oneway: true}, + 25: {want: 0xff, have: 0x138, distance: 0xa, oneway: true}, + 26: {want: 0x12f, have: 0x138, distance: 0xa, oneway: true}, + 27: {want: 0x13b, have: 0x138, distance: 0xa, oneway: true}, + 28: {want: 0x13f, have: 0x150, distance: 0xa, oneway: true}, + 29: {want: 0x144, have: 0x13d, distance: 0xa, oneway: true}, + 30: {want: 0x157, have: 0x100, distance: 0xa, oneway: true}, + 31: {want: 0x16c, have: 0x365, distance: 0xa, oneway: true}, + 32: {want: 0x16d, have: 0x138, distance: 0xa, oneway: true}, + 33: {want: 0x16e, have: 0x138, distance: 0xa, oneway: true}, + 34: {want: 0x17c, have: 0x138, distance: 0xa, oneway: true}, + 35: {want: 0x18e, have: 0x13d, distance: 0xa, oneway: true}, + 36: {want: 0x192, have: 0x13d, distance: 0xa, oneway: true}, + 37: {want: 0x1a2, have: 0x1bc, distance: 0xa, oneway: true}, + 38: {want: 0x1b2, have: 0x138, distance: 0xa, oneway: true}, + 39: {want: 0x1b6, have: 0x138, distance: 0xa, oneway: true}, + 40: {want: 0x1d2, have: 0x15d, distance: 0xa, oneway: true}, + 41: {want: 0x1d5, have: 0x3e0, distance: 0xa, oneway: true}, + 42: {want: 0x1d7, have: 0x138, distance: 0xa, oneway: true}, + 43: {want: 0x1e5, have: 0x138, distance: 0xa, oneway: true}, + 44: {want: 0x1f6, have: 0x138, distance: 0xa, oneway: true}, + 45: {want: 0x20c, have: 0x1df, distance: 0xa, oneway: true}, + 46: {want: 0x20e, have: 0x138, distance: 0xa, oneway: true}, + 47: {want: 0x22b, have: 0x15d, distance: 0xa, oneway: true}, + 48: {want: 0x240, have: 0x3e0, distance: 0xa, oneway: true}, + 49: {want: 0x248, have: 0x138, distance: 0xa, oneway: true}, + 50: {want: 0x24f, have: 0x138, distance: 0xa, oneway: true}, + 51: {want: 0x263, have: 0x138, distance: 0xa, oneway: true}, + 52: {want: 0x272, have: 0x488, distance: 0xa, oneway: true}, + 53: {want: 0x288, have: 0x3e0, distance: 0xa, oneway: true}, + 54: {want: 0x28c, have: 0x1f7, distance: 0xa, oneway: true}, + 55: {want: 0x2a1, have: 0x138, distance: 0xa, oneway: true}, + 56: {want: 0x2b3, have: 0x15d, distance: 0xa, oneway: true}, + 57: {want: 0x2b6, have: 0x138, distance: 0xa, oneway: true}, + 58: {want: 0x2bc, have: 0x138, distance: 0xa, oneway: true}, + 59: {want: 0x2c1, have: 0x15d, distance: 0xa, oneway: true}, + 60: {want: 0x2eb, have: 0x138, distance: 0xa, oneway: true}, + 61: {want: 0x2ef, have: 0x15d, distance: 0xa, oneway: true}, + 62: {want: 0x2f8, have: 0x138, distance: 0xa, oneway: true}, + 63: {want: 0x2fd, have: 0x7e, distance: 0xa, oneway: true}, + 64: {want: 0x302, have: 0x138, distance: 0xa, oneway: true}, + 65: {want: 0x309, have: 0x3e0, distance: 0xa, oneway: true}, + 66: {want: 0x319, have: 0x1bc, distance: 0xa, oneway: true}, + 67: {want: 0x31d, have: 0x1df, distance: 0xa, oneway: true}, + 68: {want: 0x31e, have: 0x138, distance: 0xa, oneway: true}, + 69: {want: 0x32f, have: 0x138, distance: 0xa, oneway: true}, + 70: {want: 0x34f, have: 0x138, distance: 0xa, oneway: true}, + 71: {want: 0x368, have: 0x345, distance: 0xa, oneway: false}, + 72: {want: 0x368, have: 0x36d, distance: 0xa, oneway: true}, + 73: {want: 0x378, have: 0x138, distance: 0xa, oneway: true}, + 74: {want: 0x385, have: 0x138, distance: 0xa, oneway: true}, + 75: {want: 0x387, have: 0x138, distance: 0xa, oneway: true}, + 76: {want: 0x389, have: 0x15d, distance: 0xa, oneway: true}, + 77: {want: 0x38e, have: 0x138, distance: 0xa, oneway: true}, + 78: {want: 0x393, have: 0x138, distance: 0xa, oneway: true}, + 79: {want: 0x39b, have: 0x138, distance: 0xa, oneway: true}, + 80: {want: 0x3a3, have: 0x138, distance: 0xa, oneway: true}, + 81: {want: 0x3bc, have: 0x138, distance: 0xa, oneway: true}, + 82: {want: 0x3c2, have: 0x13d, distance: 0xa, oneway: true}, + 83: {want: 0x3d2, have: 0x10c, distance: 0xa, oneway: true}, + 84: {want: 0x3d7, have: 0x138, distance: 0xa, oneway: true}, + 85: {want: 0x3e3, have: 0x15d, distance: 0xa, oneway: true}, + 86: {want: 0x3e7, have: 0x1bc, distance: 0xa, oneway: true}, + 87: {want: 0x3f8, have: 0x138, distance: 0xa, oneway: true}, + 88: {want: 0x40a, have: 0x138, distance: 0xa, oneway: true}, + 89: {want: 0x421, have: 0x138, distance: 0xa, oneway: true}, + 90: {want: 0x427, have: 0x138, distance: 0xa, oneway: true}, + 91: {want: 0x42f, have: 0x138, distance: 0xa, oneway: true}, + 92: {want: 0x439, have: 0x138, distance: 0xa, oneway: true}, + 93: {want: 0x43c, have: 0x1df, distance: 0xa, oneway: true}, + 94: {want: 0x443, have: 0x138, distance: 0xa, oneway: true}, + 95: {want: 0x44e, have: 0x138, distance: 0xa, oneway: true}, + 96: {want: 0x45f, have: 0x138, distance: 0xa, oneway: true}, + 97: {want: 0x465, have: 0x3e0, distance: 0xa, oneway: true}, + 98: {want: 0x46d, have: 0x138, distance: 0xa, oneway: true}, + 99: {want: 0x474, have: 0x3e0, distance: 0xa, oneway: true}, + 100: {want: 0x3880, have: 0x138, distance: 0xa, oneway: true}, + 101: {want: 0x47e, have: 0x138, distance: 0xa, oneway: true}, + 102: {want: 0x480, have: 0x138, distance: 0xa, oneway: true}, + 103: {want: 0x492, have: 0x3e0, distance: 0xa, oneway: true}, + 104: {want: 0x49b, have: 0x138, distance: 0xa, oneway: true}, + 105: {want: 0x4aa, have: 0x527, distance: 0xa, oneway: true}, + 106: {want: 0x4b2, have: 0x138, distance: 0xa, oneway: true}, + 107: {want: 0x4ba, have: 0x3e0, distance: 0xa, oneway: true}, + 108: {want: 0x4e3, have: 0x15d, distance: 0xa, oneway: true}, + 109: {want: 0x4f0, have: 0x138, distance: 0xa, oneway: true}, + 110: {want: 0x510, have: 0x138, distance: 0xa, oneway: true}, + 111: {want: 0x516, have: 0x138, distance: 0xa, oneway: true}, + 112: {want: 0x52c, have: 0x138, distance: 0xa, oneway: true}, } // matchScript holds pairs of scriptIDs where readers of one script // can typically also read the other. Each is associated with a confidence. // Size: 208 bytes, 26 elements var matchScript = [26]scriptIntelligibility{ - 0: {wantLang: 0x430, haveLang: 0x430, wantScript: 0x52, haveScript: 0x1e, distance: 0x5}, - 1: {wantLang: 0x430, haveLang: 0x430, wantScript: 0x1e, haveScript: 0x52, distance: 0x5}, - 2: {wantLang: 0x58, haveLang: 0x3e0, wantScript: 0x52, haveScript: 0x1e, distance: 0xa}, - 3: {wantLang: 0xa5, haveLang: 0x138, wantScript: 0xe, haveScript: 0x52, distance: 0xa}, + 0: {wantLang: 0x430, haveLang: 0x430, wantScript: 0x55, haveScript: 0x1e, distance: 0x5}, + 1: {wantLang: 0x430, haveLang: 0x430, wantScript: 0x1e, haveScript: 0x55, distance: 0x5}, + 2: {wantLang: 0x58, haveLang: 0x3e0, wantScript: 0x55, haveScript: 0x1e, distance: 0xa}, + 3: {wantLang: 0xa5, haveLang: 0x138, wantScript: 0xe, haveScript: 0x55, distance: 0xa}, 4: {wantLang: 0x1d5, haveLang: 0x3e0, wantScript: 0x8, haveScript: 0x1e, distance: 0xa}, - 5: {wantLang: 0x20e, haveLang: 0x138, wantScript: 0x29, haveScript: 0x52, distance: 0xa}, - 6: {wantLang: 0x248, haveLang: 0x138, wantScript: 0x46, haveScript: 0x52, distance: 0xa}, - 7: {wantLang: 0x24f, haveLang: 0x138, wantScript: 0x4a, haveScript: 0x52, distance: 0xa}, - 8: {wantLang: 0x2b6, haveLang: 0x138, wantScript: 0x4f, haveScript: 0x52, distance: 0xa}, - 9: {wantLang: 0x302, haveLang: 0x138, wantScript: 0x64, haveScript: 0x52, distance: 0xa}, - 10: {wantLang: 0x32f, haveLang: 0x138, wantScript: 0x6b, haveScript: 0x52, distance: 0xa}, - 11: {wantLang: 0x34f, haveLang: 0x138, wantScript: 0x20, haveScript: 0x52, distance: 0xa}, - 12: {wantLang: 0x393, haveLang: 0x138, wantScript: 0x75, haveScript: 0x52, distance: 0xa}, - 13: {wantLang: 0x39b, haveLang: 0x138, wantScript: 0x2f, haveScript: 0x52, distance: 0xa}, - 14: {wantLang: 0x3bc, haveLang: 0x138, wantScript: 0x5, haveScript: 0x52, distance: 0xa}, - 15: {wantLang: 0x3f8, haveLang: 0x138, wantScript: 0x5, haveScript: 0x52, distance: 0xa}, - 16: {wantLang: 0x40a, haveLang: 0x138, wantScript: 0xc1, haveScript: 0x52, distance: 0xa}, - 17: {wantLang: 0x44e, haveLang: 0x138, wantScript: 0xcd, haveScript: 0x52, distance: 0xa}, - 18: {wantLang: 0x45f, haveLang: 0x138, wantScript: 0xd0, haveScript: 0x52, distance: 0xa}, - 19: {wantLang: 0x46d, haveLang: 0x138, wantScript: 0x27, haveScript: 0x52, distance: 0xa}, - 20: {wantLang: 0x474, haveLang: 0x3e0, wantScript: 0x52, haveScript: 0x1e, distance: 0xa}, - 21: {wantLang: 0x4b2, haveLang: 0x138, wantScript: 0x5, haveScript: 0x52, distance: 0xa}, - 22: {wantLang: 0x4ba, haveLang: 0x3e0, wantScript: 0x52, haveScript: 0x1e, distance: 0xa}, - 23: {wantLang: 0x510, haveLang: 0x138, wantScript: 0x37, haveScript: 0x52, distance: 0xa}, - 24: {wantLang: 0x527, haveLang: 0x527, wantScript: 0x34, haveScript: 0x35, distance: 0xf}, - 25: {wantLang: 0x527, haveLang: 0x527, wantScript: 0x35, haveScript: 0x34, distance: 0x13}, + 5: {wantLang: 0x20e, haveLang: 0x138, wantScript: 0x2a, haveScript: 0x55, distance: 0xa}, + 6: {wantLang: 0x248, haveLang: 0x138, wantScript: 0x49, haveScript: 0x55, distance: 0xa}, + 7: {wantLang: 0x24f, haveLang: 0x138, wantScript: 0x4d, haveScript: 0x55, distance: 0xa}, + 8: {wantLang: 0x2b6, haveLang: 0x138, wantScript: 0x52, haveScript: 0x55, distance: 0xa}, + 9: {wantLang: 0x302, haveLang: 0x138, wantScript: 0x69, haveScript: 0x55, distance: 0xa}, + 10: {wantLang: 0x32f, haveLang: 0x138, wantScript: 0x70, haveScript: 0x55, distance: 0xa}, + 11: {wantLang: 0x34f, haveLang: 0x138, wantScript: 0x20, haveScript: 0x55, distance: 0xa}, + 12: {wantLang: 0x393, haveLang: 0x138, wantScript: 0x7a, haveScript: 0x55, distance: 0xa}, + 13: {wantLang: 0x39b, haveLang: 0x138, wantScript: 0x32, haveScript: 0x55, distance: 0xa}, + 14: {wantLang: 0x3bc, haveLang: 0x138, wantScript: 0x5, haveScript: 0x55, distance: 0xa}, + 15: {wantLang: 0x3f8, haveLang: 0x138, wantScript: 0x5, haveScript: 0x55, distance: 0xa}, + 16: {wantLang: 0x40a, haveLang: 0x138, wantScript: 0xc6, haveScript: 0x55, distance: 0xa}, + 17: {wantLang: 0x44e, haveLang: 0x138, wantScript: 0xd3, haveScript: 0x55, distance: 0xa}, + 18: {wantLang: 0x45f, haveLang: 0x138, wantScript: 0xd6, haveScript: 0x55, distance: 0xa}, + 19: {wantLang: 0x46d, haveLang: 0x138, wantScript: 0x28, haveScript: 0x55, distance: 0xa}, + 20: {wantLang: 0x474, haveLang: 0x3e0, wantScript: 0x55, haveScript: 0x1e, distance: 0xa}, + 21: {wantLang: 0x4b2, haveLang: 0x138, wantScript: 0x5, haveScript: 0x55, distance: 0xa}, + 22: {wantLang: 0x4ba, haveLang: 0x3e0, wantScript: 0x55, haveScript: 0x1e, distance: 0xa}, + 23: {wantLang: 0x510, haveLang: 0x138, wantScript: 0x3a, haveScript: 0x55, distance: 0xa}, + 24: {wantLang: 0x527, haveLang: 0x527, wantScript: 0x37, haveScript: 0x38, distance: 0xf}, + 25: {wantLang: 0x527, haveLang: 0x527, wantScript: 0x38, haveScript: 0x37, distance: 0x13}, } // Size: 90 bytes, 15 elements @@ -3510,128 +3526,133 @@ var matchRegion = [15]regionIntelligibility{ 5: {lang: 0x13d, script: 0x0, group: 0x83, distance: 0x4}, 6: {lang: 0x3be, script: 0x0, group: 0x3, distance: 0x4}, 7: {lang: 0x3be, script: 0x0, group: 0x83, distance: 0x4}, - 8: {lang: 0x527, script: 0x35, group: 0x2, distance: 0x4}, - 9: {lang: 0x527, script: 0x35, group: 0x82, distance: 0x4}, + 8: {lang: 0x527, script: 0x38, group: 0x2, distance: 0x4}, + 9: {lang: 0x527, script: 0x38, group: 0x82, distance: 0x4}, 10: {lang: 0x3a, script: 0x0, group: 0x80, distance: 0x5}, 11: {lang: 0x138, script: 0x0, group: 0x80, distance: 0x5}, 12: {lang: 0x13d, script: 0x0, group: 0x80, distance: 0x5}, 13: {lang: 0x3be, script: 0x0, group: 0x80, distance: 0x5}, - 14: {lang: 0x527, script: 0x35, group: 0x80, distance: 0x5}, + 14: {lang: 0x527, script: 0x38, group: 0x80, distance: 0x5}, } -// Size: 128 bytes, 32 elements -var regionContainment = [32]uint32{ - 0xffffffff, 0x000007a2, 0x00003044, 0x00000008, - 0x403c0010, 0x00000020, 0x00000040, 0x00000080, - 0x00000100, 0x00000200, 0x00000400, 0x2000384c, - 0x00001000, 0x00002000, 0x00004000, 0x00008000, - 0x00010000, 0x00020000, 0x00040000, 0x00080000, - 0x00100000, 0x00200000, 0x01c1c000, 0x00800000, - 0x01000000, 0x1e020000, 0x04000000, 0x08000000, - 0x10000000, 0x20002048, 0x40000000, 0x80000000, +// Size: 264 bytes, 33 elements +var regionContainment = [33]uint64{ + // Entry 0 - 1F + 0x00000001dfffffff, 0x00000000000007a2, 0x0000000000003044, 0x0000000000000008, + 0x00000000803c0010, 0x0000000000000020, 0x0000000000000040, 0x0000000000000080, + 0x0000000000000100, 0x0000000000000200, 0x0000000000000400, 0x000000004000384c, + 0x0000000000001000, 0x0000000000002000, 0x0000000000004000, 0x0000000000008000, + 0x0000000000010000, 0x0000000000020000, 0x0000000000040000, 0x0000000000080000, + 0x0000000000100000, 0x0000000000200000, 0x0000000001c1c000, 0x0000000000800000, + 0x0000000001000000, 0x000000001e020000, 0x0000000004000000, 0x0000000008000000, + 0x0000000010000000, 0x0000000020000000, 0x0000000040002048, 0x0000000080000000, + // Entry 20 - 3F + 0x0000000100000000, } // regionInclusion maps region identifiers to sets of regions in regionInclusionBits, // where each set holds all groupings that are directly connected in a region // containment graph. -// Size: 357 bytes, 357 elements -var regionInclusion = [357]uint8{ +// Size: 358 bytes, 358 elements +var regionInclusion = [358]uint8{ // Entry 0 - 3F 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, - 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x25, 0x25, 0x22, 0x23, - 0x25, 0x26, 0x21, 0x27, 0x28, 0x29, 0x2a, 0x25, - 0x2b, 0x23, 0x22, 0x25, 0x24, 0x29, 0x2c, 0x2d, - 0x23, 0x2e, 0x2c, 0x25, 0x2f, 0x30, 0x27, 0x25, + 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, + 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x26, 0x23, + 0x24, 0x26, 0x27, 0x22, 0x28, 0x29, 0x2a, 0x2b, + 0x26, 0x2c, 0x24, 0x23, 0x26, 0x25, 0x2a, 0x2d, + 0x2e, 0x24, 0x2f, 0x2d, 0x26, 0x30, 0x31, 0x28, // Entry 40 - 7F - 0x27, 0x25, 0x24, 0x30, 0x21, 0x31, 0x32, 0x33, - 0x2f, 0x21, 0x26, 0x26, 0x26, 0x34, 0x2c, 0x28, - 0x27, 0x26, 0x35, 0x27, 0x21, 0x33, 0x22, 0x20, - 0x25, 0x2c, 0x25, 0x21, 0x36, 0x2d, 0x34, 0x29, - 0x21, 0x2e, 0x37, 0x25, 0x25, 0x20, 0x38, 0x38, - 0x27, 0x37, 0x38, 0x38, 0x2e, 0x39, 0x2e, 0x1f, - 0x20, 0x37, 0x3a, 0x27, 0x3b, 0x2b, 0x20, 0x29, - 0x34, 0x26, 0x37, 0x25, 0x23, 0x27, 0x2b, 0x2c, + 0x26, 0x28, 0x26, 0x25, 0x31, 0x22, 0x32, 0x33, + 0x34, 0x30, 0x22, 0x27, 0x27, 0x27, 0x35, 0x2d, + 0x29, 0x28, 0x27, 0x36, 0x28, 0x22, 0x34, 0x23, + 0x21, 0x26, 0x2d, 0x26, 0x22, 0x37, 0x2e, 0x35, + 0x2a, 0x22, 0x2f, 0x38, 0x26, 0x26, 0x21, 0x39, + 0x39, 0x28, 0x38, 0x39, 0x39, 0x2f, 0x3a, 0x2f, + 0x20, 0x21, 0x38, 0x3b, 0x28, 0x3c, 0x2c, 0x21, + 0x2a, 0x35, 0x27, 0x38, 0x26, 0x24, 0x28, 0x2c, // Entry 80 - BF - 0x22, 0x2f, 0x2c, 0x2c, 0x25, 0x26, 0x39, 0x21, - 0x33, 0x3b, 0x2c, 0x27, 0x35, 0x21, 0x33, 0x39, - 0x25, 0x2d, 0x20, 0x38, 0x30, 0x37, 0x23, 0x2b, - 0x24, 0x21, 0x23, 0x24, 0x2b, 0x39, 0x2b, 0x25, - 0x23, 0x35, 0x20, 0x2e, 0x3c, 0x30, 0x3b, 0x2e, - 0x25, 0x35, 0x35, 0x23, 0x25, 0x3c, 0x30, 0x23, - 0x25, 0x34, 0x24, 0x2c, 0x31, 0x37, 0x29, 0x37, - 0x38, 0x38, 0x34, 0x32, 0x22, 0x25, 0x2e, 0x3b, + 0x2d, 0x23, 0x30, 0x2d, 0x2d, 0x26, 0x27, 0x3a, + 0x22, 0x34, 0x3c, 0x2d, 0x28, 0x36, 0x22, 0x34, + 0x3a, 0x26, 0x2e, 0x21, 0x39, 0x31, 0x38, 0x24, + 0x2c, 0x25, 0x22, 0x24, 0x25, 0x2c, 0x3a, 0x2c, + 0x26, 0x24, 0x36, 0x21, 0x2f, 0x3d, 0x31, 0x3c, + 0x2f, 0x26, 0x36, 0x36, 0x24, 0x26, 0x3d, 0x31, + 0x24, 0x26, 0x35, 0x25, 0x2d, 0x32, 0x38, 0x2a, + 0x38, 0x39, 0x39, 0x35, 0x33, 0x23, 0x26, 0x2f, // Entry C0 - FF - 0x20, 0x22, 0x2c, 0x30, 0x35, 0x35, 0x3b, 0x25, - 0x2c, 0x25, 0x39, 0x2e, 0x24, 0x2e, 0x33, 0x30, - 0x2e, 0x31, 0x3a, 0x2c, 0x2a, 0x2c, 0x20, 0x33, - 0x29, 0x2b, 0x24, 0x20, 0x3b, 0x23, 0x28, 0x2a, - 0x23, 0x33, 0x20, 0x27, 0x28, 0x3a, 0x30, 0x24, - 0x2d, 0x2f, 0x28, 0x25, 0x23, 0x39, 0x20, 0x3b, - 0x27, 0x20, 0x23, 0x20, 0x20, 0x1e, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x3c, 0x21, 0x23, 0x2d, 0x31, 0x36, 0x36, 0x3c, + 0x26, 0x2d, 0x26, 0x3a, 0x2f, 0x25, 0x2f, 0x34, + 0x31, 0x2f, 0x32, 0x3b, 0x2d, 0x2b, 0x2d, 0x21, + 0x34, 0x2a, 0x2c, 0x25, 0x21, 0x3c, 0x24, 0x29, + 0x2b, 0x24, 0x34, 0x21, 0x28, 0x29, 0x3b, 0x31, + 0x25, 0x2e, 0x30, 0x29, 0x26, 0x24, 0x3a, 0x21, + 0x3c, 0x28, 0x21, 0x24, 0x21, 0x21, 0x1f, 0x21, + 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, // Entry 100 - 13F - 0x20, 0x2e, 0x20, 0x2d, 0x22, 0x32, 0x2e, 0x23, - 0x3a, 0x2e, 0x38, 0x37, 0x30, 0x2c, 0x39, 0x2b, - 0x2d, 0x2c, 0x22, 0x2c, 0x2e, 0x27, 0x2e, 0x26, - 0x32, 0x33, 0x25, 0x23, 0x31, 0x21, 0x25, 0x26, - 0x21, 0x2c, 0x30, 0x3c, 0x28, 0x30, 0x3c, 0x38, - 0x28, 0x30, 0x23, 0x25, 0x28, 0x35, 0x2e, 0x32, - 0x2e, 0x20, 0x21, 0x20, 0x2f, 0x27, 0x3c, 0x22, - 0x25, 0x20, 0x27, 0x25, 0x25, 0x30, 0x3a, 0x28, + 0x21, 0x21, 0x2f, 0x21, 0x2e, 0x23, 0x33, 0x2f, + 0x24, 0x3b, 0x2f, 0x39, 0x38, 0x31, 0x2d, 0x3a, + 0x2c, 0x2e, 0x2d, 0x23, 0x2d, 0x2f, 0x28, 0x2f, + 0x27, 0x33, 0x34, 0x26, 0x24, 0x32, 0x22, 0x26, + 0x27, 0x22, 0x2d, 0x31, 0x3d, 0x29, 0x31, 0x3d, + 0x39, 0x29, 0x31, 0x24, 0x26, 0x29, 0x36, 0x2f, + 0x33, 0x2f, 0x21, 0x22, 0x21, 0x30, 0x28, 0x3d, + 0x23, 0x26, 0x21, 0x28, 0x26, 0x26, 0x31, 0x3b, // Entry 140 - 17F - 0x20, 0x28, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x22, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, - 0x20, 0x20, 0x20, 0x20, 0x23, 0x23, 0x2e, 0x22, - 0x31, 0x2e, 0x26, 0x2e, 0x20, + 0x29, 0x21, 0x29, 0x21, 0x21, 0x21, 0x21, 0x21, + 0x21, 0x21, 0x21, 0x21, 0x21, 0x23, 0x21, 0x21, + 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, + 0x21, 0x21, 0x21, 0x21, 0x21, 0x24, 0x24, 0x2f, + 0x23, 0x32, 0x2f, 0x27, 0x2f, 0x21, } // regionInclusionBits is an array of bit vectors where every vector represents // a set of region groupings. These sets are used to compute the distance // between two regions for the purpose of language matching. -// Size: 288 bytes, 72 elements -var regionInclusionBits = [72]uint32{ +// Size: 584 bytes, 73 elements +var regionInclusionBits = [73]uint64{ // Entry 0 - 1F - 0x82400813, 0x000007a3, 0x00003844, 0x20000808, - 0x403c0011, 0x00000022, 0x20000844, 0x00000082, - 0x00000102, 0x00000202, 0x00000402, 0x2000384d, - 0x00001804, 0x20002804, 0x00404000, 0x00408000, - 0x00410000, 0x02020000, 0x00040010, 0x00080010, - 0x00100010, 0x00200010, 0x01c1c001, 0x00c00000, - 0x01400000, 0x1e020001, 0x06000000, 0x0a000000, - 0x12000000, 0x20002848, 0x40000010, 0x80000001, + 0x0000000102400813, 0x00000000000007a3, 0x0000000000003844, 0x0000000040000808, + 0x00000000803c0011, 0x0000000000000022, 0x0000000040000844, 0x0000000000000082, + 0x0000000000000102, 0x0000000000000202, 0x0000000000000402, 0x000000004000384d, + 0x0000000000001804, 0x0000000040002804, 0x0000000000404000, 0x0000000000408000, + 0x0000000000410000, 0x0000000002020000, 0x0000000000040010, 0x0000000000080010, + 0x0000000000100010, 0x0000000000200010, 0x0000000001c1c001, 0x0000000000c00000, + 0x0000000001400000, 0x000000001e020001, 0x0000000006000000, 0x000000000a000000, + 0x0000000012000000, 0x0000000020000000, 0x0000000040002848, 0x0000000080000010, // Entry 20 - 3F - 0x00000001, 0x40000000, 0x00020000, 0x01000000, - 0x00008000, 0x00002000, 0x00000200, 0x00000008, - 0x00200000, 0x90000000, 0x00040000, 0x08000000, - 0x00000020, 0x84000000, 0x00000080, 0x00001000, - 0x00010000, 0x00000400, 0x04000000, 0x00000040, - 0x10000000, 0x00004000, 0x81000000, 0x88000000, - 0x00000100, 0x80020000, 0x00080000, 0x00100000, - 0x00800000, 0xffffffff, 0x82400fb3, 0xc27c0813, + 0x0000000100000001, 0x0000000000000001, 0x0000000080000000, 0x0000000000020000, + 0x0000000001000000, 0x0000000000008000, 0x0000000000002000, 0x0000000000000200, + 0x0000000000000008, 0x0000000000200000, 0x0000000110000000, 0x0000000000040000, + 0x0000000008000000, 0x0000000000000020, 0x0000000104000000, 0x0000000000000080, + 0x0000000000001000, 0x0000000000010000, 0x0000000000000400, 0x0000000004000000, + 0x0000000000000040, 0x0000000010000000, 0x0000000000004000, 0x0000000101000000, + 0x0000000108000000, 0x0000000000000100, 0x0000000100020000, 0x0000000000080000, + 0x0000000000100000, 0x0000000000800000, 0x00000001dfffffff, 0x0000000102400fb3, // Entry 40 - 5F - 0xa240385f, 0x83c1c813, 0x9e420813, 0x92000001, - 0x86000001, 0x81400001, 0x8a000001, 0x82020001, + 0x00000001827c0813, 0x000000014240385f, 0x0000000103c1c813, 0x000000011e420813, + 0x0000000112000001, 0x0000000106000001, 0x0000000101400001, 0x000000010a000001, + 0x0000000102020001, } // regionInclusionNext marks, for each entry in regionInclusionBits, the set of // all groups that are reachable from the groups set in the respective entry. -// Size: 72 bytes, 72 elements -var regionInclusionNext = [72]uint8{ +// Size: 73 bytes, 73 elements +var regionInclusionNext = [73]uint8{ // Entry 0 - 3F - 0x3d, 0x3e, 0x0b, 0x0b, 0x3f, 0x01, 0x0b, 0x01, - 0x01, 0x01, 0x01, 0x40, 0x0b, 0x0b, 0x16, 0x16, - 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x41, 0x16, - 0x16, 0x42, 0x19, 0x19, 0x19, 0x0b, 0x04, 0x00, - 0x00, 0x1e, 0x11, 0x18, 0x0f, 0x0d, 0x09, 0x03, - 0x15, 0x43, 0x12, 0x1b, 0x05, 0x44, 0x07, 0x0c, - 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x45, 0x46, - 0x08, 0x47, 0x13, 0x14, 0x17, 0x3d, 0x3d, 0x3d, + 0x3e, 0x3f, 0x0b, 0x0b, 0x40, 0x01, 0x0b, 0x01, + 0x01, 0x01, 0x01, 0x41, 0x0b, 0x0b, 0x16, 0x16, + 0x16, 0x19, 0x04, 0x04, 0x04, 0x04, 0x42, 0x16, + 0x16, 0x43, 0x19, 0x19, 0x19, 0x1d, 0x0b, 0x04, + 0x00, 0x00, 0x1f, 0x11, 0x18, 0x0f, 0x0d, 0x09, + 0x03, 0x15, 0x44, 0x12, 0x1b, 0x05, 0x45, 0x07, + 0x0c, 0x10, 0x0a, 0x1a, 0x06, 0x1c, 0x0e, 0x46, + 0x47, 0x08, 0x48, 0x13, 0x14, 0x17, 0x3e, 0x3e, // Entry 40 - 7F - 0x3d, 0x3d, 0x3d, 0x42, 0x42, 0x41, 0x42, 0x42, + 0x3e, 0x3e, 0x3e, 0x3e, 0x43, 0x43, 0x42, 0x43, + 0x43, } type parentRel struct { @@ -3644,11 +3665,11 @@ type parentRel struct { // Size: 414 bytes, 5 elements var parents = [5]parentRel{ - 0: {lang: 0x138, script: 0x0, maxScript: 0x52, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x24, 0x25, 0x2e, 0x33, 0x35, 0x3c, 0x41, 0x45, 0x47, 0x48, 0x49, 0x4f, 0x51, 0x5b, 0x5c, 0x60, 0x63, 0x6c, 0x72, 0x73, 0x74, 0x7a, 0x7b, 0x7e, 0x7f, 0x80, 0x82, 0x8b, 0x8c, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9e, 0x9f, 0xa3, 0xa6, 0xa8, 0xac, 0xb0, 0xb3, 0xb4, 0xbe, 0xc5, 0xc9, 0xca, 0xcb, 0xcd, 0xcf, 0xd1, 0xd4, 0xd5, 0xdc, 0xde, 0xdf, 0xe5, 0xe6, 0xe7, 0xea, 0xef, 0x106, 0x108, 0x109, 0x10a, 0x10c, 0x10d, 0x111, 0x116, 0x11a, 0x11c, 0x11e, 0x124, 0x128, 0x12b, 0x12c, 0x12e, 0x130, 0x138, 0x13b, 0x13e, 0x141, 0x160, 0x161, 0x163}}, - 1: {lang: 0x138, script: 0x0, maxScript: 0x52, toRegion: 0x1a, fromRegion: []uint16{0x2d, 0x4d, 0x5f, 0x62, 0x71, 0xd8, 0x10b, 0x10e}}, - 2: {lang: 0x13d, script: 0x0, maxScript: 0x52, toRegion: 0x1e, fromRegion: []uint16{0x2b, 0x3e, 0x40, 0x47, 0x50, 0x53, 0x55, 0x58, 0x64, 0x68, 0x88, 0x8e, 0xce, 0xd7, 0xe1, 0xe3, 0xeb, 0xf0, 0x119, 0x134, 0x135, 0x13a}}, - 3: {lang: 0x3be, script: 0x0, maxScript: 0x52, toRegion: 0xed, fromRegion: []uint16{0x29, 0x4d, 0x59, 0x85, 0x8a, 0xb6, 0xc5, 0xd0, 0x117, 0x125}}, - 4: {lang: 0x527, script: 0x35, maxScript: 0x35, toRegion: 0x8c, fromRegion: []uint16{0xc5}}, + 0: {lang: 0x138, script: 0x0, maxScript: 0x55, toRegion: 0x1, fromRegion: []uint16{0x1a, 0x25, 0x26, 0x2f, 0x34, 0x36, 0x3d, 0x42, 0x46, 0x48, 0x49, 0x4a, 0x50, 0x52, 0x5c, 0x5d, 0x61, 0x64, 0x6d, 0x73, 0x74, 0x75, 0x7b, 0x7c, 0x7f, 0x80, 0x81, 0x83, 0x8c, 0x8d, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9f, 0xa0, 0xa4, 0xa7, 0xa9, 0xad, 0xb1, 0xb4, 0xb5, 0xbf, 0xc6, 0xca, 0xcb, 0xcc, 0xce, 0xd0, 0xd2, 0xd5, 0xd6, 0xdd, 0xdf, 0xe0, 0xe6, 0xe7, 0xe8, 0xeb, 0xf0, 0x107, 0x109, 0x10a, 0x10b, 0x10d, 0x10e, 0x112, 0x117, 0x11b, 0x11d, 0x11f, 0x125, 0x129, 0x12c, 0x12d, 0x12f, 0x131, 0x139, 0x13c, 0x13f, 0x142, 0x161, 0x162, 0x164}}, + 1: {lang: 0x138, script: 0x0, maxScript: 0x55, toRegion: 0x1a, fromRegion: []uint16{0x2e, 0x4e, 0x60, 0x63, 0x72, 0xd9, 0x10c, 0x10f}}, + 2: {lang: 0x13d, script: 0x0, maxScript: 0x55, toRegion: 0x1f, fromRegion: []uint16{0x2c, 0x3f, 0x41, 0x48, 0x51, 0x54, 0x56, 0x59, 0x65, 0x69, 0x89, 0x8f, 0xcf, 0xd8, 0xe2, 0xe4, 0xec, 0xf1, 0x11a, 0x135, 0x136, 0x13b}}, + 3: {lang: 0x3be, script: 0x0, maxScript: 0x55, toRegion: 0xee, fromRegion: []uint16{0x2a, 0x4e, 0x5a, 0x86, 0x8b, 0xb7, 0xc6, 0xd1, 0x118, 0x126}}, + 4: {lang: 0x527, script: 0x38, maxScript: 0x38, toRegion: 0x8d, fromRegion: []uint16{0xc6}}, } -// Total table size 26496 bytes (25KiB); checksum: 6E24B15A +// Total table size 27175 bytes (26KiB); checksum: 569649CD diff --git a/vendor/golang.org/x/text/language/testdata/localeMatcherTest.txt b/vendor/golang.org/x/text/language/testdata/CLDRLocaleMatcherTest.txt similarity index 100% rename from vendor/golang.org/x/text/language/testdata/localeMatcherTest.txt rename to vendor/golang.org/x/text/language/testdata/CLDRLocaleMatcherTest.txt diff --git a/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt b/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt new file mode 100644 index 00000000..4f4c6093 --- /dev/null +++ b/vendor/golang.org/x/text/language/testdata/GoLocaleMatcherTest.txt @@ -0,0 +1,226 @@ +# basics +fr, en-GB, en ; en-GB ; en-GB +fr, en-GB, en ; en-US ; en +fr, en-GB, en ; fr-FR ; fr +fr, en-GB, en ; ja-JP ; fr + +# script fallbacks +zh-CN, zh-TW, iw ; zh-Hant ; zh-TW +zh-CN, zh-TW, iw ; zh ; zh-CN +zh-CN, zh-TW, iw ; zh-Hans-CN ; zh-CN +zh-CN, zh-TW, iw ; zh-Hant-HK ; zh-TW +zh-CN, zh-TW, iw ; he-IT ; iw ; iw + +# language-specific script fallbacks 1 +en, sr, nl ; sr-Latn ; sr +en, sr, nl ; sh ; sr # different script, but seems okay and is as CLDR suggests +en, sr, nl ; hr ; en +en, sr, nl ; bs ; en +en, sr, nl ; nl-Cyrl ; sr + +# language-specific script fallbacks 2 +en, sh ; sr ; sh +en, sh ; sr-Cyrl ; sh +en, sh ; hr ; sh + +# don't match hr to sr-Latn +en, sr-Latn ; hr ; en + +# both deprecated and not +fil, tl, iw, he ; he-IT ; he +fil, tl, iw, he ; he ; he +fil, tl, iw, he ; iw ; iw +fil, tl, iw, he ; fil-IT ; fil +fil, tl, iw, he ; fil ; fil +fil, tl, iw, he ; tl ; tl + +# nearby languages +en, fil, ro, nn ; tl ; fil +en, fil, ro, nn ; mo ; ro +en, fil, ro, nn ; nb ; nn +en, fil, ro, nn ; ja ; en + +# nearby languages: Nynorsk to Bokmål +en, nb ; nn ; nb + +# nearby languages: Danish does not match nn +en, nn ; da ; en + +# nearby languages: Danish matches no +en, no ; da ; no + +# nearby languages: Danish matches nb +en, nb ; da ; nb + +# prefer matching languages over language variants. +nn, en-GB ; no, en-US ; en-GB +nn, en-GB ; nb, en-US ; en-GB + +# deprecated version is closer than same language with other differences +nl, he, en-GB ; iw, en-US ; he + +# macro equivalent is closer than same language with other differences +nl, zh, en-GB, no ; cmn, en-US ; zh +nl, zh, en-GB, no ; nb, en-US ; no + +# legacy equivalent is closer than same language with other differences +nl, fil, en-GB ; tl, en-US ; fil + +# distinguish near equivalents +en, ro, mo, ro-MD ; ro ; ro +en, ro, mo, ro-MD ; mo ; mo +en, ro, mo, ro-MD ; ro-MD ; ro-MD + +# maximization of legacy +sr-Cyrl, sr-Latn, ro, ro-MD ; sh ; sr-Latn +sr-Cyrl, sr-Latn, ro, ro-MD ; mo ; ro-MD + +# empty + ; fr ; und + ; en ; und + +# private use subtags +fr, en-GB, x-bork, es-ES, es-419 ; x-piglatin ; fr +fr, en-GB, x-bork, es-ES, es-419 ; x-bork ; x-bork + +# grandfathered codes +fr, i-klingon, en-Latn-US ; en-GB-oed ; en-Latn-US +fr, i-klingon, en-Latn-US ; i-klingon ; tlh + + +# simple variant match +fr, en-GB, ja, es-ES, es-MX ; de, en-US ; en-GB +fr, en-GB, ja, es-ES, es-MX ; de, zh ; fr + +# best match for traditional Chinese +fr, zh-Hans-CN, en-US ; zh-TW ; zh-Hans-CN +fr, zh-Hans-CN, en-US ; zh-Hant ; zh-Hans-CN +fr, zh-Hans-CN, en-US ; zh-TW, en ; en-US +fr, zh-Hans-CN, en-US ; zh-Hant-CN, en ; en-US +fr, zh-Hans-CN, en-US ; zh-Hans, en ; zh-Hans-CN + +# more specific script should win in case regions are identical +af, af-Latn, af-Arab ; af ; af +af, af-Latn, af-Arab ; af-ZA ; af +af, af-Latn, af-Arab ; af-Latn-ZA ; af-Latn +af, af-Latn, af-Arab ; af-Latn ; af-Latn + +# more specific region should win +nl, nl-NL, nl-BE ; nl ; nl +nl, nl-NL, nl-BE ; nl-Latn ; nl +nl, nl-NL, nl-BE ; nl-Latn-NL ; nl-NL +nl, nl-NL, nl-BE ; nl-NL ; nl-NL + +# region may replace matched if matched is enclosing +es-419,es ; es-MX ; es-419 ; es-MX +es-419,es ; es-SG ; es + +# more specific region wins over more specific script +nl, nl-Latn, nl-NL, nl-BE ; nl ; nl +nl, nl-Latn, nl-NL, nl-BE ; nl-Latn ; nl-Latn +nl, nl-Latn, nl-NL, nl-BE ; nl-NL ; nl-NL +nl, nl-Latn, nl-NL, nl-BE ; nl-Latn-NL ; nl-NL + +# region distance Portuguese +pt, pt-PT ; pt-ES ; pt-PT + +# if no preferred locale specified, pick top language, not regional +en, fr, fr-CA, fr-CH ; fr-US ; fr #TODO: ; fr-u-rg-US + +# region distance German +de-AT, de-DE, de-CH ; de ; de-DE + +# en-AU is closer to en-GB than to en (which is en-US) +en, en-GB, es-ES, es-419 ; en-AU ; en-GB +en, en-GB, es-ES, es-419 ; es-MX ; es-419 ; es-MX +en, en-GB, es-ES, es-419 ; es-PT ; es-ES + +# undefined +it, fr ; und ; it + +# und does not match en +it, en ; und ; it + +# undefined in priority list +it, und ; und ; und +it, und ; en ; it + +# undefined +it, fr, zh ; und-FR ; fr +it, fr, zh ; und-CN ; zh +it, fr, zh ; und-Hans ; zh +it, fr, zh ; und-Hant ; zh +it, fr, zh ; und-Latn ; it + +# match on maximized tag +fr, en-GB, ja, es-ES, es-MX ; ja-JP, en-GB ; ja +fr, en-GB, ja, es-ES, es-MX ; ja-Jpan-JP, en-GB ; ja + +# pick best maximized tag +ja, ja-Jpan-US, ja-JP, en, ru ; ja-Jpan, ru ; ja +ja, ja-Jpan-US, ja-JP, en, ru ; ja-JP, ru ; ja-JP +ja, ja-Jpan-US, ja-JP, en, ru ; ja-US, ru ; ja-Jpan-US + +# termination: pick best maximized match +ja, ja-Jpan, ja-JP, en, ru ; ja-Jpan-JP, ru ; ja-JP +ja, ja-Jpan, ja-JP, en, ru ; ja-Jpan, ru ; ja-Jpan + +# same language over exact, but distinguish when user is explicit +fr, en-GB, ja, es-ES, es-MX ; ja, de ; ja +en, de, fr, ja ; de-CH, fr ; de # TODO: ; de-u-rg-CH +en-GB, nl ; en, nl ; en-GB +en-GB, nl ; en, nl, en-GB ; nl + +# parent relation preserved +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-150 ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-AU ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-BE ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-GG ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-GI ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-HK ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-IE ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-IM ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-IN ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-JE ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-MT ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-NZ ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-PK ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-SG ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-DE ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; en-MT ; en-GB +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-AR ; es-419 ; es-AR +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-BO ; es-419 ; es-BO +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-CL ; es-419 ; es-CL +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-CO ; es-419 ; es-CO +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-CR ; es-419 ; es-CR +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-CU ; es-419 ; es-CU +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-DO ; es-419 ; es-DO +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-EC ; es-419 ; es-EC +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-GT ; es-419 ; es-GT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-HN ; es-419 ; es-HN +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-MX ; es-419 ; es-MX +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-NI ; es-419 ; es-NI +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-PA ; es-419 ; es-PA +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-PE ; es-419 ; es-PE +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-PR ; es-419 ; es-PR +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-PT ; es +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-PY ; es-419 ; es-PY +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-SV ; es-419 ; es-SV +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-US ; es-419 +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-UY ; es-419 ; es-UY +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; es-VE ; es-419 ; es-VE +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-AO ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-CV ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-GW ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-MO ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-MZ ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-ST ; pt-PT +en, en-US, en-GB, es, es-419, pt, pt-BR, pt-PT, zh, zh-Hant, zh-Hant-HK ; pt-TL ; pt-PT + +# preserve extensions +en, de, sl-nedis ; de-FR-u-co-phonebk ; de ; de-u-co-phonebk +en, de, sl-nedis ; sl-nedis-u-cu-eur ; sl-nedis ; sl-nedis-u-cu-eur +en, de, sl-nedis ; sl-u-cu-eur ; sl-nedis ; sl-nedis-u-cu-eur +en, de, sl-nedis ; sl-HR-nedis-u-cu-eur ; sl-nedis ; sl-nedis-u-cu-eur +en, de, sl-nedis ; de-t-m0-iso-i0-pinyin ; de ; de-t-m0-iso-i0-pinyin + diff --git a/vendor/golang.org/x/text/message/doc.go b/vendor/golang.org/x/text/message/doc.go new file mode 100644 index 00000000..60424a68 --- /dev/null +++ b/vendor/golang.org/x/text/message/doc.go @@ -0,0 +1,95 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package message implements formatted I/O for localized strings with functions +// analogous to the fmt's print functions. It is a drop-in replacement for fmt. +// +// +// Localized Formatting +// +// A format string can be localized by replacing any of the print functions of +// fmt with an equivalent call to a Printer. +// +// p := message.NewPrinter(language.English) +// p.Println(123456.78) // Prints 123,456.78 +// +// p := message.NewPrinter(language.Bengali) +// p.Println(123456.78) // Prints ১,২৩,৪৫৬.৭৮ +// +// Printer currently supports numbers and specialized types for which packages +// exist in x/text. Other builtin types such as time.Time and slices are +// planned. +// +// Format strings largely have the same meaning as with fmt with the following +// notable exceptions: +// - flag # always resorts to fmt for printing +// - verb 'f', 'e', 'g', 'd' use localized formatting unless the '#' flag is +// specified. +// +// See package fmt for more options. +// +// +// Translation +// +// The format strings that are passed to Printf, Sprintf, Fprintf, or Errorf +// are used as keys to look up translations for the specified languages. +// More on how these need to be specified below. +// +// One can use arbitrary keys to distinguish between otherwise ambiguous +// strings: +// p := message.NewPrinter(language.English) +// p.Printf("archive(noun)") // Prints "archive" +// p.Printf("archive(verb)") // Prints "archive" +// +// p := message.NewPrinter(language.German) +// p.Printf("archive(noun)") // Prints "Archiv" +// p.Printf("archive(verb)") // Prints "archivieren" +// +// To retain the fallback functionality, use Key: +// p.Printf(message.Key("archive(noun)", "archive")) +// p.Printf(message.Key("archive(verb)", "archive")) +// +// +// Translation Pipeline +// +// Format strings that contain text need to be translated to support different +// locales. The first step is to extract strings that need to be translated. +// +// 1. Install gotext +// go get -u golang.org/x/text/cmd/gotext +// gotext -help +// +// 2. Mark strings in your source to be translated by using message.Printer, +// instead of the functions of the fmt package. +// +// 3. Extract the strings from your source +// +// gotext extract +// +// The output will be written to the textdata directory. +// +// 4. Send the files for translation +// +// It is planned to support multiple formats, but for now one will have to +// rewrite the JSON output to the desired format. +// +// 5. Inject translations into program +// +// 6. Repeat from 2 +// +// Right now this has to be done programmatically with calls to Set or +// SetString. These functions as well as the methods defined in +// see also package golang.org/x/text/message/catalog can be used to implement +// either dynamic or static loading of messages. +// +// +// Plural and Gender Forms +// +// Translated messages can vary based on the plural and gender forms of +// substitution values. In general, it is up to the translators to provide +// alternative translations for such forms. See the packages in +// golang.org/x/text/feature and golang.org/x/text/message/catalog for more +// information. +// +package message diff --git a/vendor/golang.org/x/text/message/examples_test.go b/vendor/golang.org/x/text/message/examples_test.go new file mode 100644 index 00000000..c73eaf90 --- /dev/null +++ b/vendor/golang.org/x/text/message/examples_test.go @@ -0,0 +1,42 @@ +// Copyright 2017 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package message_test + +import ( + "net/http" + + "golang.org/x/text/language" + "golang.org/x/text/message" +) + +func Example_http() { + // languages supported by this service: + matcher := language.NewMatcher(message.DefaultCatalog.Languages()) + + http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + lang, _ := r.Cookie("lang") + accept := r.Header.Get("Accept-Language") + fallback := "en" + tag, _ := language.MatchStrings(matcher, lang.String(), accept, fallback) + + p := message.NewPrinter(tag) + + p.Fprintln(w, "User language is", tag) + }) +} + +func ExamplePrinter_numbers() { + for _, lang := range []string{"en", "de", "de-CH", "fr", "bn"} { + p := message.NewPrinter(language.Make(lang)) + p.Printf("%-6s %g\n", lang, 123456.78) + } + + // Output: + // en 123,456.78 + // de 123.456,78 + // de-CH 123’456.78 + // fr 123 456,78 + // bn ১,২৩,৪৫৬.৭৮ +} diff --git a/vendor/golang.org/x/text/message/fmt_test.go b/vendor/golang.org/x/text/message/fmt_test.go index 0dbedcbc..2110bb53 100755 --- a/vendor/golang.org/x/text/message/fmt_test.go +++ b/vendor/golang.org/x/text/message/fmt_test.go @@ -475,10 +475,8 @@ var fmtTests = []struct { {"%.4b", float32(1.0), "8388608p-23"}, {"%.4b", -1.0, "-4503599627370496p-52"}, // Test correct f.intbuf boundary checks. - // TODO: the following cases won't work because of rounding errors. We can - // fix this if we expose the internals of strconv. - // {"%.68f", 1.0, zeroFill("1.", 68, "")}, // TODO(bug): rounding error - // {"%.68f", -1.0, zeroFill("-1.", 68, "")}, // TODO(bug): rounding error + {"%.68f", 1.0, zeroFill("1.", 68, "")}, + {"%.68f", -1.0, zeroFill("-1.", 68, "")}, // float infinites and NaNs {"%f", posInf, "∞"}, {"%.1f", negInf, "-∞"}, @@ -565,8 +563,8 @@ var fmtTests = []struct { // old test/fmt_test.go {"%e", 1.0, "1.000000\u202f×\u202f10⁰⁰"}, - {"%e", 1234.5678e3, "1.234570\u202f×\u202f10⁰⁶"}, - {"%e", 1234.5678e-8, "1.234570\u202f×\u202f10⁻⁰⁵"}, + {"%e", 1234.5678e3, "1.234568\u202f×\u202f10⁰⁶"}, + {"%e", 1234.5678e-8, "1.234568\u202f×\u202f10⁻⁰⁵"}, {"%e", -7.0, "-7.000000\u202f×\u202f10⁰⁰"}, {"%e", -1e-9, "-1.000000\u202f×\u202f10⁻⁰⁹"}, {"%f", 1234.5678e3, "1,234,567.800000"}, @@ -580,8 +578,8 @@ var fmtTests = []struct { {"%g", -1e-9, "-1\u202f×\u202f10⁻⁰⁹"}, {"%g", float32(-1e-9), "-1\u202f×\u202f10⁻⁰⁹"}, {"%E", 1.0, "1.000000\u202f×\u202f10⁰⁰"}, - {"%E", 1234.5678e3, "1.234570\u202f×\u202f10⁰⁶"}, - {"%E", 1234.5678e-8, "1.234570\u202f×\u202f10⁻⁰⁵"}, + {"%E", 1234.5678e3, "1.234568\u202f×\u202f10⁰⁶"}, + {"%E", 1234.5678e-8, "1.234568\u202f×\u202f10⁻⁰⁵"}, {"%E", -7.0, "-7.000000\u202f×\u202f10⁰⁰"}, {"%E", -1e-9, "-1.000000\u202f×\u202f10⁻⁰⁹"}, {"%G", 1234.5678e3, "1.2345678\u202f×\u202f10⁰⁶"}, diff --git a/vendor/golang.org/x/text/message/message.go b/vendor/golang.org/x/text/message/message.go index 92791236..ba4f95ab 100644 --- a/vendor/golang.org/x/text/message/message.go +++ b/vendor/golang.org/x/text/message/message.go @@ -2,15 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// Package message implements formatted I/O for localized strings with functions -// analogous to the fmt's print functions. -// -// These are the important differences with fmt: -// - Output varies per locale. -// - The '#' flag is used to bypass localization. -// -// NOTE: Under construction. See https://golang.org/design/12750-localization -// and its corresponding proposal issue https://golang.org/issues/12750. package message // import "golang.org/x/text/message" import ( @@ -150,6 +141,7 @@ func lookupAndFormat(p *Printer, r Reference, a []interface{}) { // Arg implements catmsg.Renderer. func (p *printer) Arg(i int) interface{} { // TODO, also return "ok" bool + i-- if uint(i) < uint(len(p.args)) { return p.args[i] } diff --git a/vendor/golang.org/x/text/message/print.go b/vendor/golang.org/x/text/message/print.go index 8c8a23f1..07feaa2b 100644 --- a/vendor/golang.org/x/text/message/print.go +++ b/vendor/golang.org/x/text/message/print.go @@ -237,7 +237,7 @@ func (p *printer) fmtFloat(v float64, size int, verb rune) { if p.fmt.sharp || p.fmt.sharpV { p.fmt.fmt_float(v, size, verb, -1) } else { - p.fmtVariableFloat(v, size, -1) + p.fmtVariableFloat(v, size) } case 'e', 'E': if p.fmt.sharp || p.fmt.sharpV { @@ -284,7 +284,7 @@ func (p *printer) initDecimal(minFrac, maxFrac int) { f.MinIntegerDigits = 1 f.MaxIntegerDigits = 0 f.MinFractionDigits = uint8(minFrac) - f.MaxFractionDigits = uint8(maxFrac) + f.MaxFractionDigits = int16(maxFrac) p.setFlags(f) f.PadRune = 0 if p.fmt.widPresent { @@ -308,8 +308,13 @@ func (p *printer) initDecimal(minFrac, maxFrac int) { func (p *printer) initScientific(minFrac, maxFrac int) { f := &p.toScientific - f.MinFractionDigits = uint8(minFrac) - f.MaxFractionDigits = uint8(maxFrac) + if maxFrac < 0 { + f.SetPrecision(maxFrac) + } else { + f.SetPrecision(maxFrac + 1) + f.MinFractionDigits = uint8(minFrac) + f.MaxFractionDigits = int16(maxFrac) + } f.MinExponentDigits = 2 p.setFlags(f) f.PadRune = 0 @@ -328,8 +333,6 @@ func (p *printer) initScientific(minFrac, maxFrac int) { func (p *printer) fmtDecimalInt(v uint64, isSigned bool) { var d number.Decimal - p.toDecimal.RoundingContext.Scale = 0 - d.ConvertInt(&p.toDecimal.RoundingContext, isSigned, v) f := &p.toDecimal if p.fmt.precPresent { @@ -344,6 +347,7 @@ func (p *printer) fmtDecimalInt(v uint64, isSigned bool) { } else { p.initDecimal(0, 0) } + d.ConvertInt(p.toDecimal.RoundingContext, isSigned, v) out := p.toDecimal.Format([]byte(nil), &d) p.Buffer.Write(out) @@ -354,22 +358,21 @@ func (p *printer) fmtDecimalFloat(v float64, size, prec int) { if p.fmt.precPresent { prec = p.fmt.prec } - p.toDecimal.RoundingContext.Scale = int32(prec) - d.ConvertFloat(&p.toDecimal.RoundingContext, v, size) - p.initDecimal(prec, prec) + d.ConvertFloat(p.toDecimal.RoundingContext, v, size) out := p.toDecimal.Format([]byte(nil), &d) p.Buffer.Write(out) } -func (p *printer) fmtVariableFloat(v float64, size, prec int) { +func (p *printer) fmtVariableFloat(v float64, size int) { + prec := -1 if p.fmt.precPresent { prec = p.fmt.prec } var d number.Decimal - p.toScientific.RoundingContext.Precision = int32(prec) - d.ConvertFloat(&p.toScientific.RoundingContext, v, size) + p.initScientific(0, prec) + d.ConvertFloat(p.toScientific.RoundingContext, v, size) // Copy logic of 'g' formatting from strconv. It is simplified a bit as // we don't have to mind having prec > len(d.Digits). @@ -407,10 +410,9 @@ func (p *printer) fmtScientific(v float64, size, prec int) { if p.fmt.precPresent { prec = p.fmt.prec } - p.toScientific.RoundingContext.Precision = int32(prec) - d.ConvertFloat(&p.toScientific.RoundingContext, v, size) - p.initScientific(prec, prec) + rc := p.toScientific.RoundingContext + d.ConvertFloat(rc, v, size) out := p.toScientific.Format([]byte(nil), &d) p.Buffer.Write(out) @@ -1038,7 +1040,7 @@ formatLoop: p.fmt.plusV = p.fmt.plus p.fmt.plus = false } - p.printArg(p.Arg(p.argNum), rune(c)) + p.printArg(p.Arg(p.argNum+1), rune(c)) p.argNum++ i++ continue formatLoop diff --git a/vendor/k8s.io/kubernetes/api/openapi-spec/swagger.json b/vendor/k8s.io/kubernetes/api/openapi-spec/swagger.json index 8fbf39b7..9fd9f266 100644 --- a/vendor/k8s.io/kubernetes/api/openapi-spec/swagger.json +++ b/vendor/k8s.io/kubernetes/api/openapi-spec/swagger.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Kubernetes", - "version": "v1.7.4" + "version": "v1.7.5" }, "paths": { "/api/": { diff --git a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/google/heapster-controller.yaml b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/google/heapster-controller.yaml index 91905873..50193277 100644 --- a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/google/heapster-controller.yaml +++ b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/google/heapster-controller.yaml @@ -23,29 +23,29 @@ metadata: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: heapster-v1.4.1 + name: heapster-v1.4.2 namespace: kube-system labels: k8s-app: heapster kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile - version: v1.4.1 + version: v1.4.2 spec: replicas: 1 selector: matchLabels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 template: metadata: labels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: containers: - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: heapster livenessProbe: httpGet: @@ -65,7 +65,7 @@ spec: - name: usr-ca-certs mountPath: /usr/share/ca-certificates readOnly: true - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: eventer command: - /eventer @@ -103,7 +103,7 @@ spec: - --memory={{ base_metrics_memory }} - --extra-memory={{metrics_memory_per_node}}Mi - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=heapster - --poll-period=300000 - --estimator=exponential @@ -132,7 +132,7 @@ spec: - --memory={{base_eventer_memory}} - --extra-memory={{eventer_memory_per_node}}Ki - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=eventer - --poll-period=300000 - --estimator=exponential diff --git a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml index c7e61604..70e8a069 100644 --- a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml +++ b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/googleinfluxdb/heapster-controller-combined.yaml @@ -23,29 +23,29 @@ metadata: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: heapster-v1.4.1 + name: heapster-v1.4.2 namespace: kube-system labels: k8s-app: heapster kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile - version: v1.4.1 + version: v1.4.2 spec: replicas: 1 selector: matchLabels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 template: metadata: labels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: containers: - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: heapster livenessProbe: httpGet: @@ -66,7 +66,7 @@ spec: - name: usr-ca-certs mountPath: /usr/share/ca-certificates readOnly: true - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: eventer command: - /eventer @@ -104,7 +104,7 @@ spec: - --memory={{ base_metrics_memory }} - --extra-memory={{ metrics_memory_per_node }}Mi - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=heapster - --poll-period=300000 - --estimator=exponential @@ -133,7 +133,7 @@ spec: - --memory={{ base_eventer_memory }} - --extra-memory={{ eventer_memory_per_node }}Ki - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=eventer - --poll-period=300000 - --estimator=exponential diff --git a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml index 5103cdbc..cce7040c 100644 --- a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml +++ b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/influxdb/heapster-controller.yaml @@ -23,29 +23,29 @@ metadata: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: heapster-v1.4.1 + name: heapster-v1.4.2 namespace: kube-system labels: k8s-app: heapster kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile - version: v1.4.1 + version: v1.4.2 spec: replicas: 1 selector: matchLabels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 template: metadata: labels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: containers: - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: heapster livenessProbe: httpGet: @@ -58,7 +58,7 @@ spec: - /heapster - --source=kubernetes.summary_api:'' - --sink=influxdb:http://monitoring-influxdb:8086 - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: eventer command: - /eventer @@ -89,7 +89,7 @@ spec: - --memory={{ base_metrics_memory }} - --extra-memory={{ metrics_memory_per_node }}Mi - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=heapster - --poll-period=300000 - --estimator=exponential @@ -118,7 +118,7 @@ spec: - --memory={{ base_eventer_memory }} - --extra-memory={{ eventer_memory_per_node }}Ki - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=eventer - --poll-period=300000 - --estimator=exponential diff --git a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml index 7fb8be16..8fec6ba9 100644 --- a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml +++ b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/stackdriver/heapster-controller.yaml @@ -21,29 +21,29 @@ metadata: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: heapster-v1.4.1 + name: heapster-v1.4.2 namespace: kube-system labels: k8s-app: heapster kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile - version: v1.4.1 + version: v1.4.2 spec: replicas: 1 selector: matchLabels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 template: metadata: labels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: containers: - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: heapster livenessProbe: httpGet: @@ -108,7 +108,7 @@ spec: - --memory={{ base_metrics_memory }} - --extra-memory={{metrics_memory_per_node}}Mi - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=heapster - --poll-period=300000 - --estimator=exponential diff --git a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml index ac2beda4..4004e61e 100644 --- a/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml +++ b/vendor/k8s.io/kubernetes/cluster/addons/cluster-monitoring/standalone/heapster-controller.yaml @@ -21,29 +21,29 @@ metadata: apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: heapster-v1.4.1 + name: heapster-v1.4.2 namespace: kube-system labels: k8s-app: heapster kubernetes.io/cluster-service: "true" addonmanager.kubernetes.io/mode: Reconcile - version: v1.4.1 + version: v1.4.2 spec: replicas: 1 selector: matchLabels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 template: metadata: labels: k8s-app: heapster - version: v1.4.1 + version: v1.4.2 annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: containers: - - image: gcr.io/google_containers/heapster-amd64:v1.4.1 + - image: gcr.io/google_containers/heapster-amd64:v1.4.2 name: heapster livenessProbe: httpGet: @@ -80,7 +80,7 @@ spec: - --memory={{ base_metrics_memory }} - --extra-memory={{ metrics_memory_per_node }}Mi - --threshold=5 - - --deployment=heapster-v1.4.1 + - --deployment=heapster-v1.4.2 - --container=heapster - --poll-period=300000 - --estimator=exponential diff --git a/vendor/k8s.io/kubernetes/cluster/gce/config-test.sh b/vendor/k8s.io/kubernetes/cluster/gce/config-test.sh index fda8dbd5..35e7f1a6 100755 --- a/vendor/k8s.io/kubernetes/cluster/gce/config-test.sh +++ b/vendor/k8s.io/kubernetes/cluster/gce/config-test.sh @@ -87,7 +87,7 @@ ETCD_QUORUM_READ="${ENABLE_ETCD_QUORUM_READ:-false}" MASTER_TAG="${INSTANCE_PREFIX}-master" NODE_TAG="${INSTANCE_PREFIX}-minion" -CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.100.0.0/14}" +CLUSTER_IP_RANGE="${CLUSTER_IP_RANGE:-10.64.0.0/14}" MASTER_IP_RANGE="${MASTER_IP_RANGE:-10.246.0.0/24}" # NODE_IP_RANGE is used when ENABLE_IP_ALIASES=true. It is the primary range in # the subnet and is the range used for node instance IPs. diff --git a/vendor/k8s.io/kubernetes/cluster/gce/util.sh b/vendor/k8s.io/kubernetes/cluster/gce/util.sh index dfe7c3b0..cf48d2af 100755 --- a/vendor/k8s.io/kubernetes/cluster/gce/util.sh +++ b/vendor/k8s.io/kubernetes/cluster/gce/util.sh @@ -305,7 +305,7 @@ function detect-node-names() { INSTANCE_GROUPS+=($(gcloud compute instance-groups managed list \ --zones "${ZONE}" --project "${PROJECT}" \ --regexp "${NODE_INSTANCE_PREFIX}-.+" \ - --format='value(instanceGroup)' || true)) + --format='value(name)' || true)) NODE_NAMES=() if [[ -n "${INSTANCE_GROUPS[@]:-}" ]]; then for group in "${INSTANCE_GROUPS[@]}"; do diff --git a/vendor/k8s.io/kubernetes/cluster/log-dump/log-dump.sh b/vendor/k8s.io/kubernetes/cluster/log-dump/log-dump.sh index 8d1378f5..a9cd50c9 100755 --- a/vendor/k8s.io/kubernetes/cluster/log-dump/log-dump.sh +++ b/vendor/k8s.io/kubernetes/cluster/log-dump/log-dump.sh @@ -27,6 +27,7 @@ readonly report_dir="${1:-_artifacts}" # check for a function named log_dump_custom_get_instances. If it's # defined, we assume the function can me called with one argument, the # role, which is either "master" or "node". +echo "Checking for custom logdump instances, if any" if [[ $(type -t log_dump_custom_get_instances) == "function" ]]; then readonly use_custom_instance_list=yes else @@ -53,13 +54,17 @@ readonly max_scp_processes=25 # This template spits out the external IPs and images for each node in the cluster in a format like so: # 52.32.7.85 gcr.io/google_containers/kube-apiserver:1355c18c32d7bef16125120bce194fad gcr.io/google_containers/kube-controller-manager:46365cdd8d28b8207950c3c21d1f3900 [...] +echo "Obtaining IPs and images for cluster nodes" readonly ips_and_images='{range .items[*]}{@.status.addresses[?(@.type == "ExternalIP")].address} {@.status.images[*].names[*]}{"\n"}{end}' function setup() { if [[ -z "${use_custom_instance_list}" ]]; then + echo "Obtaining KUBE_ROOT" KUBE_ROOT=$(dirname "${BASH_SOURCE}")/../.. : ${KUBE_CONFIG_FILE:="config-test.sh"} + echo "Sourcing kube-util.sh" source "${KUBE_ROOT}/cluster/kube-util.sh" + echo "Detecting project" detect-project &> /dev/null elif [[ -z "${LOG_DUMP_SSH_KEY:-}" ]]; then echo "LOG_DUMP_SSH_KEY not set, but required when using log_dump_custom_get_instances" diff --git a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/BUILD b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/BUILD index 4a757a8e..5109e1da 100644 --- a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/BUILD +++ b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/BUILD @@ -99,6 +99,7 @@ go_library( "//vendor/github.com/spf13/pflag:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/serializer:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/wait:go_default_library", "//vendor/k8s.io/apiserver/pkg/server/healthz:go_default_library", diff --git a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go index f30df0fa..e5bf649d 100644 --- a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go +++ b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/controllermanager.go @@ -33,6 +33,7 @@ import ( "time" "k8s.io/apimachinery/pkg/runtime/schema" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/wait" @@ -365,7 +366,10 @@ func GetAvailableResources(clientBuilder controller.ControllerClientBuilder) (ma resourceMap, err := discoveryClient.ServerResources() if err != nil { - return nil, fmt.Errorf("failed to get supported resources from server: %v", err) + utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err)) + } + if len(resourceMap) == 0 { + return nil, fmt.Errorf("unable to get any supported resources from server") } allResources := map[schema.GroupVersionResource]bool{} diff --git a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/core.go b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/core.go index 6d56428e..f4e896c5 100644 --- a/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/core.go +++ b/vendor/k8s.io/kubernetes/cmd/kube-controller-manager/app/core.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" utilfeature "k8s.io/apiserver/pkg/util/feature" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" @@ -285,7 +286,10 @@ func startGarbageCollectorController(ctx ControllerContext) (bool, error) { gcClientset := ctx.ClientBuilder.ClientOrDie("generic-garbage-collector") preferredResources, err := gcClientset.Discovery().ServerPreferredResources() if err != nil { - return true, fmt.Errorf("failed to get supported resources from server: %v", err) + utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err)) + } + if len(preferredResources) == 0 { + return true, fmt.Errorf("unable to get any supported resources from server: %v", err) } deletableResources := discovery.FilteredBy(discovery.SupportsAllVerbs{Verbs: []string{"get", "list", "watch", "patch", "update", "delete"}}, preferredResources) deletableGroupVersionResources, err := discovery.GroupVersionResources(deletableResources) diff --git a/vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json b/vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json index 89db5797..056fdc4c 100644 --- a/vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json +++ b/vendor/k8s.io/kubernetes/federation/apis/openapi-spec/swagger.json @@ -2,7 +2,7 @@ "swagger": "2.0", "info": { "title": "Generic API Server", - "version": "v1.7.4" + "version": "v1.7.5" }, "paths": { "/api/": { diff --git a/vendor/k8s.io/kubernetes/hack/.linted_packages b/vendor/k8s.io/kubernetes/hack/.linted_packages index 6a58a36c..e27e7889 100644 --- a/vendor/k8s.io/kubernetes/hack/.linted_packages +++ b/vendor/k8s.io/kubernetes/hack/.linted_packages @@ -202,6 +202,7 @@ pkg/controller/volume/attachdetach/util pkg/conversion pkg/conversion/queryparams pkg/credentialprovider/aws +pkg/credentialprovider/azure pkg/fieldpath pkg/fields pkg/hyperkube diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure.go index 0281acec..448f0643 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/azure/azure.go @@ -107,6 +107,12 @@ type Config struct { CloudProviderRateLimitQPS float32 `json:"cloudProviderRateLimitQPS" yaml:"cloudProviderRateLimitQPS"` // Rate limit Bucket Size CloudProviderRateLimitBucket int `json:"cloudProviderRateLimitBucket" yaml:"cloudProviderRateLimitBucket"` + + // Use instance metadata service where possible + UseInstanceMetadata bool `json:"useInstanceMetadata" yaml:"useInstanceMetadata"` + + // Use managed service identity for the virtual machine to access Azure ARM APIs + UseManagedIdentityExtension bool `json:"useManagedIdentityExtension"` } // Cloud holds the config and clients @@ -150,62 +156,62 @@ func decodePkcs12(pkcs []byte, password string) (*x509.Certificate, *rsa.Private return certificate, rsaPrivateKey, nil } -// newServicePrincipalToken creates a new service principal token based on the configuration -func newServicePrincipalToken(az *Cloud) (*adal.ServicePrincipalToken, error) { - oauthConfig, err := adal.NewOAuthConfig(az.Environment.ActiveDirectoryEndpoint, az.TenantID) +// GetServicePrincipalToken creates a new service principal token based on the configuration +func GetServicePrincipalToken(config *Config, env *azure.Environment) (*adal.ServicePrincipalToken, error) { + oauthConfig, err := adal.NewOAuthConfig(env.ActiveDirectoryEndpoint, config.TenantID) if err != nil { return nil, fmt.Errorf("creating the OAuth config: %v", err) } - if len(az.AADClientSecret) > 0 { + if config.UseManagedIdentityExtension { + glog.V(2).Infoln("azure: using managed identity extension to retrieve access token") + return adal.NewServicePrincipalTokenFromMSI( + *oauthConfig, + env.ServiceManagementEndpoint) + } + + if len(config.AADClientSecret) > 0 { + glog.V(2).Infoln("azure: using client_id+client_secret to retrieve access token") return adal.NewServicePrincipalToken( *oauthConfig, - az.AADClientID, - az.AADClientSecret, - az.Environment.ServiceManagementEndpoint) - } else if len(az.AADClientCertPath) > 0 && len(az.AADClientCertPassword) > 0 { - certData, err := ioutil.ReadFile(az.AADClientCertPath) + config.AADClientID, + config.AADClientSecret, + env.ServiceManagementEndpoint) + } + + if len(config.AADClientCertPath) > 0 && len(config.AADClientCertPassword) > 0 { + glog.V(2).Infoln("azure: using jwt client_assertion (client_cert+client_private_key) to retrieve access token") + certData, err := ioutil.ReadFile(config.AADClientCertPath) if err != nil { - return nil, fmt.Errorf("reading the client certificate from file %s: %v", az.AADClientCertPath, err) + return nil, fmt.Errorf("reading the client certificate from file %s: %v", config.AADClientCertPath, err) } - certificate, privateKey, err := decodePkcs12(certData, az.AADClientCertPassword) + certificate, privateKey, err := decodePkcs12(certData, config.AADClientCertPassword) if err != nil { return nil, fmt.Errorf("decoding the client certificate: %v", err) } return adal.NewServicePrincipalTokenFromCertificate( *oauthConfig, - az.AADClientID, + config.AADClientID, certificate, privateKey, - az.Environment.ServiceManagementEndpoint) - } else { - return nil, fmt.Errorf("No credentials provided for AAD application %s", az.AADClientID) + env.ServiceManagementEndpoint) } + + return nil, fmt.Errorf("No credentials provided for AAD application %s", config.AADClientID) } // NewCloud returns a Cloud with initialized clients func NewCloud(configReader io.Reader) (cloudprovider.Interface, error) { - var az Cloud - - configContents, err := ioutil.ReadAll(configReader) + config, env, err := ParseConfig(configReader) if err != nil { return nil, err } - err = yaml.Unmarshal(configContents, &az) - if err != nil { - return nil, err + az := Cloud{ + Config: *config, + Environment: *env, } - if az.Cloud == "" { - az.Environment = azure.PublicCloud - } else { - az.Environment, err = azure.EnvironmentFromName(az.Cloud) - if err != nil { - return nil, err - } - } - - servicePrincipalToken, err := newServicePrincipalToken(&az) + servicePrincipalToken, err := GetServicePrincipalToken(config, env) if err != nil { return nil, err } @@ -320,6 +326,31 @@ func NewCloud(configReader io.Reader) (cloudprovider.Interface, error) { return &az, nil } +// ParseConfig returns a parsed configuration and azure.Environment for an Azure cloudprovider config file +func ParseConfig(configReader io.Reader) (*Config, *azure.Environment, error) { + var config Config + + configContents, err := ioutil.ReadAll(configReader) + if err != nil { + return nil, nil, err + } + err = yaml.Unmarshal(configContents, &config) + if err != nil { + return nil, nil, err + } + + var env azure.Environment + if config.Cloud == "" { + env = azure.PublicCloud + } else { + env, err = azure.EnvironmentFromName(config.Cloud) + if err != nil { + return nil, nil, err + } + } + return &config, &env, nil +} + // Initialize passes a Kubernetes clientBuilder interface to the cloud provider func (az *Cloud) Initialize(clientBuilder controller.ControllerClientBuilder) {} diff --git a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vsphere.go b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vsphere.go index e4000467..457872b6 100644 --- a/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vsphere.go +++ b/vendor/k8s.io/kubernetes/pkg/cloudprovider/providers/vsphere/vsphere.go @@ -19,6 +19,7 @@ package vsphere import ( "errors" "fmt" + "hash/fnv" "io" "io/ioutil" "net" @@ -806,7 +807,7 @@ func (vs *VSphere) AttachDisk(vmDiskPath string, storagePolicyID string, nodeNam } scsiControllersOfRequiredType := getSCSIControllersOfType(vmDevices, diskControllerType) - scsiController := getAvailableSCSIController(scsiControllersOfRequiredType) + scsiController = getAvailableSCSIController(scsiControllersOfRequiredType) if scsiController == nil { glog.Errorf("cannot find SCSI controller in VM") // attempt clean up of scsi controller @@ -1401,7 +1402,9 @@ func (vs *VSphere) CreateVolume(volumeOptions *VolumeOptions) (volumePath string // Check if the VM exists in kubernetes cluster folder. // The kubernetes cluster folder - vs.cfg.Global.WorkingDir is where all the nodes in the kubernetes cluster are created. - dummyVMFullName := DummyVMPrefixName + "-" + volumeOptions.Name + fnvHash := fnv.New32a() + fnvHash.Write([]byte(volumeOptions.Name)) + dummyVMFullName := DummyVMPrefixName + "-" + fmt.Sprint(fnvHash.Sum32()) vmRegex := vs.cfg.Global.WorkingDir + dummyVMFullName dummyVM, err := f.VirtualMachine(ctx, vmRegex) if err != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/BUILD b/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/BUILD index af066337..c9dbe75c 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/BUILD @@ -21,6 +21,7 @@ go_library( "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1/unstructured:go_default_library", "//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/errors:go_default_library", + "//vendor/k8s.io/apimachinery/pkg/util/runtime:go_default_library", "//vendor/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//vendor/k8s.io/client-go/discovery:go_default_library", "//vendor/k8s.io/client-go/dynamic:go_default_library", diff --git a/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/namespaced_resources_deleter.go b/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/namespaced_resources_deleter.go index 2593428b..fcdc69ff 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/namespaced_resources_deleter.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/namespace/deletion/namespaced_resources_deleter.go @@ -29,6 +29,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" utilerrors "k8s.io/apimachinery/pkg/util/errors" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/sets" "k8s.io/client-go/discovery" "k8s.io/client-go/dynamic" @@ -165,7 +166,10 @@ func (d *namespacedResourcesDeleter) initOpCache() { // TODO(sttts): get rid of opCache and http 405 logic around it and trust discovery info resources, err := d.discoverResourcesFn() if err != nil { - glog.Fatalf("Failed to get supported resources: %v", err) + utilruntime.HandleError(fmt.Errorf("unable to get all supported resources from server: %v", err)) + } + if len(resources) == 0 { + glog.Fatalf("Unable to get any supported resources from server: %v", err) } deletableGroupVersionResources := []schema.GroupVersionResource{} for _, rl := range resources { diff --git a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_pod_control_test.go b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_pod_control_test.go index 0e376785..01c1cc3d 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_pod_control_test.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_pod_control_test.go @@ -391,34 +391,6 @@ func TestStatefulPodControlUpdatePodConflictSuccess(t *testing.T) { } } -func TestStatefulPodControlUpdatePodConflictFailure(t *testing.T) { - recorder := record.NewFakeRecorder(10) - set := newStatefulSet(3) - pod := newStatefulSetPod(set, 0) - fakeClient := &fake.Clientset{} - indexer := cache.NewIndexer(cache.MetaNamespaceKeyFunc, cache.Indexers{cache.NamespaceIndex: cache.MetaNamespaceIndexFunc}) - updatedPod := newStatefulSetPod(set, 0) - updatedPod.Spec.Hostname = "wrong" - indexer.Add(updatedPod) - podLister := corelisters.NewPodLister(indexer) - control := NewRealStatefulPodControl(fakeClient, nil, podLister, nil, recorder) - fakeClient.AddReactor("update", "pods", func(action core.Action) (bool, runtime.Object, error) { - update := action.(core.UpdateAction) - return true, update.GetObject(), apierrors.NewConflict(action.GetResource().GroupResource(), pod.Name, errors.New("conflict")) - - }) - pod.Name = "goo-0" - if err := control.UpdateStatefulPod(set, pod); err == nil { - t.Error("Failed update did not return an error") - } - events := collectEvents(recorder.Events) - if eventCount := len(events); eventCount != 1 { - t.Errorf("Expected 1 event for failed Pod update found %d", eventCount) - } else if !strings.Contains(events[0], v1.EventTypeWarning) { - t.Errorf("Expected normal event found %s", events[0]) - } -} - func TestStatefulPodControlDeletesStatefulPod(t *testing.T) { recorder := record.NewFakeRecorder(10) set := newStatefulSet(3) diff --git a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils.go b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils.go index c55a1e04..7d240c6c 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils.go @@ -116,9 +116,7 @@ func identityMatches(set *apps.StatefulSet, pod *v1.Pod) bool { return ordinal >= 0 && set.Name == parent && pod.Name == getPodName(set, ordinal) && - pod.Namespace == set.Namespace && - pod.Spec.Hostname == pod.Name && - pod.Spec.Subdomain == set.Spec.ServiceName + pod.Namespace == set.Namespace } // storageMatches returns true if pod's Volumes cover the set of PersistentVolumeClaims @@ -186,12 +184,18 @@ func updateStorage(set *apps.StatefulSet, pod *v1.Pod) { pod.Spec.Volumes = newVolumes } +func initIdentity(set *apps.StatefulSet, pod *v1.Pod) { + updateIdentity(set, pod) + // Set these immutable fields only on initial Pod creation, not updates. + pod.Spec.Hostname = pod.Name + pod.Spec.Subdomain = set.Spec.ServiceName +} + // updateIdentity updates pod's name, hostname, and subdomain to conform to set's name and headless service. func updateIdentity(set *apps.StatefulSet, pod *v1.Pod) { pod.Name = getPodName(set, getOrdinal(pod)) pod.Namespace = set.Namespace - pod.Spec.Hostname = pod.Name - pod.Spec.Subdomain = set.Spec.ServiceName + } // isRunningAndReady returns true if pod is in the PodRunning Phase, if it has a condition of PodReady, and if the init @@ -276,7 +280,7 @@ func getPodRevision(pod *v1.Pod) string { func newStatefulSetPod(set *apps.StatefulSet, ordinal int) *v1.Pod { pod, _ := controller.GetPodFromTemplate(&set.Spec.Template, set, newControllerRef(set)) pod.Name = getPodName(set, ordinal) - updateIdentity(set, pod) + initIdentity(set, pod) updateStorage(set, pod) return pod } diff --git a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils_test.go b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils_test.go index b27145e5..817078ca 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils_test.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/statefulset/stateful_set_utils_test.go @@ -79,16 +79,6 @@ func TestIdentityMatches(t *testing.T) { if identityMatches(set, pod) { t.Error("identity matches for a Pod with the wrong namespace") } - pod = newStatefulSetPod(set, 1) - pod.Spec.Hostname = "" - if identityMatches(set, pod) { - t.Error("identity matches for a Pod with no hostname") - } - pod = newStatefulSetPod(set, 1) - pod.Spec.Subdomain = "" - if identityMatches(set, pod) { - t.Error("identity matches for a Pod with no subdomain") - } } func TestStorageMatches(t *testing.T) { @@ -138,24 +128,6 @@ func TestUpdateIdentity(t *testing.T) { if !identityMatches(set, pod) { t.Error("updateIdentity failed to update the Pods namespace") } - pod = newStatefulSetPod(set, 1) - pod.Spec.Hostname = "" - if identityMatches(set, pod) { - t.Error("identity matches for a Pod with no hostname") - } - updateIdentity(set, pod) - if !identityMatches(set, pod) { - t.Error("updateIdentity failed to update the Pod's hostname") - } - pod = newStatefulSetPod(set, 1) - pod.Spec.Subdomain = "" - if identityMatches(set, pod) { - t.Error("identity matches for a Pod with no subdomain") - } - updateIdentity(set, pod) - if !identityMatches(set, pod) { - t.Error("updateIdentity failed to update the Pod's subdomain") - } } func TestUpdateStorage(t *testing.T) { diff --git a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go index 55253017..3bffc60a 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world.go @@ -125,10 +125,6 @@ type ActualStateOfWorld interface { // GetNodesToUpdateStatusFor returns the map of nodeNames to nodeToUpdateStatusFor GetNodesToUpdateStatusFor() map[types.NodeName]nodeToUpdateStatusFor - - // Removes the given node from the record of attach updates. The node's entire - // volumesToReportAsAttached list is removed. - RemoveNodeFromAttachUpdates(nodeName types.NodeName) error } // AttachedVolume represents a volume that is attached to a node. @@ -264,19 +260,6 @@ func (asw *actualStateOfWorld) AddVolumeToReportAsAttached( asw.addVolumeToReportAsAttached(volumeName, nodeName) } -func (asw *actualStateOfWorld) RemoveNodeFromAttachUpdates(nodeName types.NodeName) error { - asw.Lock() - defer asw.Unlock() - - _, nodeToUpdateExists := asw.nodesToUpdateStatusFor[nodeName] - if nodeToUpdateExists { - delete(asw.nodesToUpdateStatusFor, nodeName) - return nil - } - return fmt.Errorf("node %q does not exist in volumesToReportAsAttached list", - nodeName) -} - func (asw *actualStateOfWorld) AddVolumeNode( uniqueName v1.UniqueVolumeName, volumeSpec *volume.Spec, nodeName types.NodeName, devicePath string) (v1.UniqueVolumeName, error) { asw.Lock() diff --git a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world_test.go b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world_test.go index 88ae500d..fa19728b 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world_test.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/cache/actual_state_of_world_test.go @@ -1165,89 +1165,6 @@ func Test_updateNodeStatusUpdateNeededError(t *testing.T) { } } -// Test_RemoveNodeFromAttachUpdates_Positive expects an entire node entry to be removed -// from nodesToUpdateStatusFor -func Test_RemoveNodeFromAttachUpdates_Positive(t *testing.T) { - // Arrange - volumePluginMgr, _ := volumetesting.GetTestVolumePluginMgr(t) - asw := &actualStateOfWorld{ - attachedVolumes: make(map[v1.UniqueVolumeName]attachedVolume), - nodesToUpdateStatusFor: make(map[types.NodeName]nodeToUpdateStatusFor), - volumePluginMgr: volumePluginMgr, - } - nodeName := types.NodeName("node-1") - nodeToUpdate := nodeToUpdateStatusFor{ - nodeName: nodeName, - statusUpdateNeeded: true, - volumesToReportAsAttached: make(map[v1.UniqueVolumeName]v1.UniqueVolumeName), - } - asw.nodesToUpdateStatusFor[nodeName] = nodeToUpdate - - // Act - err := asw.RemoveNodeFromAttachUpdates(nodeName) - - // Assert - if err != nil { - t.Fatalf("RemoveNodeFromAttachUpdates should not return error, but got: %v", err) - } - if len(asw.nodesToUpdateStatusFor) > 0 { - t.Fatal("nodesToUpdateStatusFor should be empty as its only entry has been deleted.") - } -} - -// Test_RemoveNodeFromAttachUpdates_Negative_NodeDoesNotExist expects an error to be thrown -// when nodeName is not in nodesToUpdateStatusFor. -func Test_RemoveNodeFromAttachUpdates_Negative_NodeDoesNotExist(t *testing.T) { - // Arrange - volumePluginMgr, _ := volumetesting.GetTestVolumePluginMgr(t) - asw := &actualStateOfWorld{ - attachedVolumes: make(map[v1.UniqueVolumeName]attachedVolume), - nodesToUpdateStatusFor: make(map[types.NodeName]nodeToUpdateStatusFor), - volumePluginMgr: volumePluginMgr, - } - nodeName := types.NodeName("node-1") - nodeToUpdate := nodeToUpdateStatusFor{ - nodeName: nodeName, - statusUpdateNeeded: true, - volumesToReportAsAttached: make(map[v1.UniqueVolumeName]v1.UniqueVolumeName), - } - asw.nodesToUpdateStatusFor[nodeName] = nodeToUpdate - - // Act - err := asw.RemoveNodeFromAttachUpdates("node-2") - - // Assert - if err == nil { - t.Fatal("RemoveNodeFromAttachUpdates should return an error as the nodeName doesn't exist.") - } - if len(asw.nodesToUpdateStatusFor) != 1 { - t.Fatal("The length of nodesToUpdateStatusFor should not change because no operation was performed.") - } -} - -// Test_RemoveNodeFromAttachUpdates_Negative_Empty expects an error to be thrown -// when a nodesToUpdateStatusFor is empty. -func Test_RemoveNodeFromAttachUpdates_Negative_Empty(t *testing.T) { - // Arrange - volumePluginMgr, _ := volumetesting.GetTestVolumePluginMgr(t) - asw := &actualStateOfWorld{ - attachedVolumes: make(map[v1.UniqueVolumeName]attachedVolume), - nodesToUpdateStatusFor: make(map[types.NodeName]nodeToUpdateStatusFor), - volumePluginMgr: volumePluginMgr, - } - - // Act - err := asw.RemoveNodeFromAttachUpdates("node-1") - - // Assert - if err == nil { - t.Fatal("RemoveNodeFromAttachUpdates should return an error as nodeToUpdateStatusFor is empty.") - } - if len(asw.nodesToUpdateStatusFor) != 0 { - t.Fatal("The length of nodesToUpdateStatusFor should be 0.") - } -} - func verifyAttachedVolume( t *testing.T, attachedVolumes []AttachedVolume, diff --git a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler/reconciler.go b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler/reconciler.go index e66253cf..66169be4 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler/reconciler.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/reconciler/reconciler.go @@ -148,6 +148,11 @@ func (rc *reconciler) isMultiAttachForbidden(volumeSpec *volume.Spec) bool { // Only if this volume is a persistent volume, we have reliable information on wether it's allowed or not to // multi-attach. We trust in the individual volume implementations to not allow unsupported access modes if volumeSpec.PersistentVolume != nil { + // Check for persistent volume types which do not fail when trying to multi-attach + if volumeSpec.PersistentVolume.Spec.VsphereVolume != nil { + return false + } + if len(volumeSpec.PersistentVolume.Spec.AccessModes) == 0 { // No access mode specified so we don't know for sure. Let the attacher fail if needed return false diff --git a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go index 94db1f2b..818f3c6d 100644 --- a/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go +++ b/vendor/k8s.io/kubernetes/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go @@ -68,13 +68,11 @@ func (nsu *nodeStatusUpdater) UpdateNodeStatuses() error { nodeObj, err := nsu.nodeLister.Get(string(nodeName)) if errors.IsNotFound(err) { // If node does not exist, its status cannot be updated. - // Remove the node entry from the collection of attach updates, preventing the - // status updater from unnecessarily updating the node. + // Do nothing so that there is no retry until node is created. glog.V(2).Infof( "Could not update node status. Failed to find node %q in NodeInformer cache. Error: '%v'", nodeName, err) - nsu.actualStateOfWorld.RemoveNodeFromAttachUpdates(nodeName) continue } else if err != nil { // For all other errors, log error and reset flag statusUpdateNeeded diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/BUILD b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/BUILD index 4f52afc4..aacd43a5 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/BUILD @@ -17,11 +17,9 @@ go_library( "//pkg/credentialprovider:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest:go_default_library", - "//vendor/github.com/Azure/go-autorest/autorest/adal:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/azure:go_default_library", "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/spf13/pflag:go_default_library", - "//vendor/gopkg.in/yaml.v2:go_default_library", ], ) diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials.go index bdf618b9..257cbee5 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials.go @@ -17,14 +17,12 @@ limitations under the License. package azure import ( - "io/ioutil" + "io" + "os" "time" - yaml "gopkg.in/yaml.v2" - "github.com/Azure/azure-sdk-for-go/arm/containerregistry" "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" azureapi "github.com/Azure/go-autorest/autorest/azure" "github.com/golang/glog" "github.com/spf13/pflag" @@ -47,10 +45,12 @@ func init() { }) } +// RegistriesClient is a testable interface for the ACR client List operation. type RegistriesClient interface { List() (containerregistry.RegistryListResult, error) } +// NewACRProvider parses the specified configFile and returns a DockerConfigProvider func NewACRProvider(configFile *string) credentialprovider.DockerConfigProvider { return &acrProvider{ file: configFile, @@ -59,24 +59,16 @@ func NewACRProvider(configFile *string) credentialprovider.DockerConfigProvider type acrProvider struct { file *string - config azure.Config - environment azureapi.Environment + config *azure.Config + environment *azureapi.Environment registryClient RegistriesClient } -func (a *acrProvider) loadConfig(contents []byte) error { - err := yaml.Unmarshal(contents, &a.config) +func (a *acrProvider) loadConfig(rdr io.Reader) error { + var err error + a.config, a.environment, err = azure.ParseConfig(rdr) if err != nil { - return err - } - - if a.config.Cloud == "" { - a.environment = azureapi.PublicCloud - } else { - a.environment, err = azureapi.EnvironmentFromName(a.config.Cloud) - if err != nil { - return err - } + glog.Errorf("Failed to load azure credential file: %v", err) } return nil } @@ -86,27 +78,21 @@ func (a *acrProvider) Enabled() bool { glog.V(5).Infof("Azure config unspecified, disabling") return false } - contents, err := ioutil.ReadFile(*a.file) + + f, err := os.Open(*a.file) if err != nil { - glog.Errorf("Failed to load azure credential file: %v", err) - return false - } - if err := a.loadConfig(contents); err != nil { - glog.Errorf("Failed to parse azure credential file: %v", err) + glog.Errorf("Failed to load config from file: %s", *a.file) return false } + defer f.Close() - oauthConfig, err := adal.NewOAuthConfig(a.environment.ActiveDirectoryEndpoint, a.config.TenantID) + err = a.loadConfig(f) if err != nil { - glog.Errorf("Failed to get oauth config: %v", err) + glog.Errorf("Failed to load config from file: %s", *a.file) return false } - servicePrincipalToken, err := adal.NewServicePrincipalToken( - *oauthConfig, - a.config.AADClientID, - a.config.AADClientSecret, - a.environment.ServiceManagementEndpoint) + servicePrincipalToken, err := azure.GetServicePrincipalToken(a.config, a.environment) if err != nil { glog.Errorf("Failed to create service principal token: %v", err) return false diff --git a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials_test.go b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials_test.go index 8f697387..9d966fe6 100644 --- a/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials_test.go +++ b/vendor/k8s.io/kubernetes/pkg/credentialprovider/azure/azure_credentials_test.go @@ -17,6 +17,7 @@ limitations under the License. package azure import ( + "bytes" "testing" "github.com/Azure/azure-sdk-for-go/arm/containerregistry" @@ -66,7 +67,7 @@ func Test(t *testing.T) { provider := &acrProvider{ registryClient: fakeClient, } - provider.loadConfig([]byte(configStr)) + provider.loadConfig(bytes.NewBufferString(configStr)) creds := provider.Provide() diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go b/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go index 1d73a8a8..f7344eb7 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/exec.go @@ -135,6 +135,9 @@ func (*NsenterExecHandler) ExecInContainer(client libdocker.Interface, container type NativeExecHandler struct{} func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container *dockertypes.ContainerJSON, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize, timeout time.Duration) error { + done := make(chan struct{}) + defer close(done) + createOpts := dockertypes.ExecConfig{ Cmd: cmd, AttachStdin: stdin != nil, @@ -149,9 +152,23 @@ func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container // Have to start this before the call to client.StartExec because client.StartExec is a blocking // call :-( Otherwise, resize events don't get processed and the terminal never resizes. - kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) { - client.ResizeExecTTY(execObj.ID, int(size.Height), int(size.Width)) - }) + // + // We also have to delay attempting to send a terminal resize request to docker until after the + // exec has started; otherwise, the initial resize request will fail. + execStarted := make(chan struct{}) + go func() { + select { + case <-execStarted: + // client.StartExec has started the exec, so we can start resizing + case <-done: + // ExecInContainer has returned, so short-circuit + return + } + + kubecontainer.HandleResizing(resize, func(size remotecommand.TerminalSize) { + client.ResizeExecTTY(execObj.ID, int(size.Height), int(size.Width)) + }) + }() startOpts := dockertypes.ExecStartCheck{Detach: false, Tty: tty} streamOpts := libdocker.StreamOptions{ @@ -159,6 +176,7 @@ func (*NativeExecHandler) ExecInContainer(client libdocker.Interface, container OutputStream: stdout, ErrorStream: stderr, RawTerminal: tty, + ExecStarted: execStarted, } err = client.StartExec(execObj.ID, startOpts, streamOpts) if err != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go b/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go index f3bbc3f0..7fdfb03e 100644 --- a/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go +++ b/vendor/k8s.io/kubernetes/pkg/kubelet/dockershim/libdocker/kube_docker_client.go @@ -463,6 +463,15 @@ func (d *kubeDockerClient) StartExec(startExec string, opts dockertypes.ExecStar return err } defer resp.Close() + + if sopts.ExecStarted != nil { + // Send a message to the channel indicating that the exec has started. This is needed so + // interactive execs can handle resizing correctly - the request to resize the TTY has to happen + // after the call to d.client.ContainerExecAttach, and because d.holdHijackedConnection below + // blocks, we use sopts.ExecStarted to signal the caller that it's ok to resize. + sopts.ExecStarted <- struct{}{} + } + return d.holdHijackedConnection(sopts.RawTerminal || opts.Tty, sopts.InputStream, sopts.OutputStream, sopts.ErrorStream, resp) } @@ -593,6 +602,7 @@ type StreamOptions struct { InputStream io.Reader OutputStream io.Writer ErrorStream io.Writer + ExecStarted chan struct{} } // operationTimeout is the error returned when the docker operations are timeout. diff --git a/vendor/k8s.io/kubernetes/pkg/version/base.go b/vendor/k8s.io/kubernetes/pkg/version/base.go index 341b9d6b..93744386 100644 --- a/vendor/k8s.io/kubernetes/pkg/version/base.go +++ b/vendor/k8s.io/kubernetes/pkg/version/base.go @@ -51,7 +51,7 @@ var ( // semantic version is a git hash, but the version itself is no // longer the direct output of "git describe", but a slight // translation to be semver compliant. - gitVersion string = "v1.7.4+$Format:%h$" + gitVersion string = "v1.7.5+$Format:%h$" gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty" diff --git a/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go b/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go index 2959b53f..2f1e189b 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/flexvolume/unmounter.go @@ -51,23 +51,15 @@ func (f *flexVolumeUnmounter) TearDownAt(dir string) error { return nil } - notmnt, err := isNotMounted(f.mounter, dir) + call := f.plugin.NewDriverCall(unmountCmd) + call.Append(dir) + _, err := call.Run() + if isCmdNotSupportedErr(err) { + err = (*unmounterDefaults)(f).TearDownAt(dir) + } if err != nil { return err } - if notmnt { - glog.Warningf("Warning: Path: %v already unmounted", dir) - } else { - call := f.plugin.NewDriverCall(unmountCmd) - call.Append(dir) - _, err := call.Run() - if isCmdNotSupportedErr(err) { - err = (*unmounterDefaults)(f).TearDownAt(dir) - } - if err != nil { - return err - } - } // Flexvolume driver may remove the directory. Ignore if it does. if pathExists, pathErr := util.PathExists(dir); pathErr != nil { diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/BUILD b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/BUILD index 99d375f8..58825b40 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/BUILD +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/BUILD @@ -24,6 +24,7 @@ go_test( "//pkg/volume:go_default_library", "//pkg/volume/testing:go_default_library", "//vendor/github.com/codedellemc/goscaleio/types/v1:go_default_library", + "//vendor/github.com/golang/glog:go_default_library", "//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//vendor/k8s.io/apimachinery/pkg/types:go_default_library", "//vendor/k8s.io/client-go/util/testing:go_default_library", diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go index bfcb6f0d..8742905e 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_client.go @@ -45,7 +45,7 @@ type sioInterface interface { FindVolume(name string) (*siotypes.Volume, error) Volume(sioVolumeID) (*siotypes.Volume, error) CreateVolume(name string, sizeGB int64) (*siotypes.Volume, error) - AttachVolume(sioVolumeID) error + AttachVolume(sioVolumeID, bool) error DetachVolume(sioVolumeID) error DeleteVolume(sioVolumeID) error IID() (string, error) @@ -217,8 +217,9 @@ func (c *sioClient) CreateVolume(name string, sizeGB int64) (*siotypes.Volume, e return c.Volume(sioVolumeID(createResponse.ID)) } -// AttachVolume maps the scaleio volume to an sdc node. -func (c *sioClient) AttachVolume(id sioVolumeID) error { +// AttachVolume maps the scaleio volume to an sdc node. If the multipleMappings flag +// is true, ScaleIO will allow other SDC to map to that volume. +func (c *sioClient) AttachVolume(id sioVolumeID, multipleMappings bool) error { if err := c.init(); err != nil { glog.Error(log("failed to init'd client in attach volume: %v", err)) return err @@ -232,7 +233,7 @@ func (c *sioClient) AttachVolume(id sioVolumeID) error { params := &siotypes.MapVolumeSdcParam{ SdcID: iid, - AllowMultipleMappings: "false", + AllowMultipleMappings: strconv.FormatBool(multipleMappings), AllSdcs: "", } volClient := sio.NewVolume(c.client) diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go index ca10677d..83d5e498 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr.go @@ -27,7 +27,7 @@ import ( type storageInterface interface { CreateVolume(string, int64) (*siotypes.Volume, error) - AttachVolume(string) (string, error) + AttachVolume(string, bool) (string, error) IsAttached(string) (bool, error) DetachVolume(string) error DeleteVolume(string) error @@ -103,8 +103,9 @@ func (m *sioMgr) CreateVolume(volName string, sizeGB int64) (*siotypes.Volume, e return vol, nil } -// AttachVolume maps a ScaleIO volume to the running node -func (m *sioMgr) AttachVolume(volName string) (string, error) { +// AttachVolume maps a ScaleIO volume to the running node. If flag multiMaps, +// ScaleIO will allow other SDC to map to volume. +func (m *sioMgr) AttachVolume(volName string, multipleMappings bool) (string, error) { client, err := m.getClient() if err != nil { glog.Error(log("attach volume failed: %v", err)) @@ -139,7 +140,7 @@ func (m *sioMgr) AttachVolume(volName string) (string, error) { } // attach volume, get deviceName - if err := client.AttachVolume(sioVolumeID(vol.ID)); err != nil { + if err := client.AttachVolume(sioVolumeID(vol.ID), multipleMappings); err != nil { glog.Error(log("attachment for volume %s failed :%v", volName, err)) return "", err } diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr_test.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr_test.go index c8f4b449..3d580b6b 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr_test.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_mgr_test.go @@ -99,7 +99,7 @@ func TestMgrCreateVolume(t *testing.T) { func TestMgrAttachVolume(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - device, err := mgr.AttachVolume("test-vol-0001") + device, err := mgr.AttachVolume("test-vol-0001", false) if err != nil { t.Fatal(err) } @@ -111,8 +111,8 @@ func TestMgrAttachVolume(t *testing.T) { func TestMgrAttachVolume_AlreadyAttached(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - mgr.AttachVolume("test-vol-0001") - dev, err := mgr.AttachVolume("test-vol-0001") + mgr.AttachVolume("test-vol-0001", false) + dev, err := mgr.AttachVolume("test-vol-0001", false) if err != nil { t.Fatalf("unexpected error: %v", err) } @@ -124,7 +124,8 @@ func TestMgrAttachVolume_AlreadyAttached(t *testing.T) { func TestMgrAttachVolume_VolumeNotFoundError(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - _, err := mgr.AttachVolume("test-vol-0002") + _, err := mgr.AttachVolume("test-vol-0002", false) + if err == nil { t.Error("attachVolume should fail with volume not found error") } @@ -137,7 +138,7 @@ func TestMgrAttachVolume_WaitForAttachError(t *testing.T) { c := mgr.client.(*fakeSio) close(c.waitAttachCtrl) }() - _, err := mgr.AttachVolume("test-vol-0001") + _, err := mgr.AttachVolume("test-vol-0001", false) if err == nil { t.Error("attachVolume should fail with attach timeout error") } @@ -146,7 +147,7 @@ func TestMgrAttachVolume_WaitForAttachError(t *testing.T) { func TestMgrDetachVolume(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - mgr.AttachVolume("test-vol-0001") + mgr.AttachVolume("test-vol-0001", false) if err := mgr.DetachVolume("test-vol-0001"); err != nil { t.Fatal(err) } @@ -162,7 +163,7 @@ func TestMgrDetachVolume(t *testing.T) { func TestMgrDetachVolume_VolumeNotFound(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - mgr.AttachVolume("test-vol-0001") + mgr.AttachVolume("test-vol-0001", false) err := mgr.DetachVolume("test-vol-0002") if err == nil { t.Fatal("expected a volume not found failure") @@ -181,7 +182,7 @@ func TestMgrDetachVolume_VolumeNotAttached(t *testing.T) { func TestMgrDetachVolume_VolumeAlreadyDetached(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - mgr.AttachVolume("test-vol-0001") + mgr.AttachVolume("test-vol-0001", false) mgr.DetachVolume("test-vol-0001") err := mgr.DetachVolume("test-vol-0001") if err != nil { @@ -192,7 +193,7 @@ func TestMgrDetachVolume_VolumeAlreadyDetached(t *testing.T) { func TestMgrDetachVolume_WaitForDetachError(t *testing.T) { mgr := newTestMgr(t) mgr.CreateVolume("test-vol-0001", 8*1024*1024) - mgr.AttachVolume("test-vol-0001") + mgr.AttachVolume("test-vol-0001", false) err := mgr.DetachVolume("test-vol-0001") if err != nil { t.Error("detachVolume failed") @@ -227,6 +228,7 @@ type fakeSio struct { waitAttachCtrl chan struct{} waitDetachCtrl chan struct{} devs map[string]string + isMultiMap bool } func newFakeSio() *fakeSio { @@ -261,7 +263,8 @@ func (f *fakeSio) CreateVolume(volName string, sizeGB int64) (*siotypes.Volume, return f.volume, nil } -func (f *fakeSio) AttachVolume(id sioVolumeID) error { +func (f *fakeSio) AttachVolume(id sioVolumeID, multiMaps bool) error { + f.isMultiMap = multiMaps _, err := f.Volume(id) if err != nil { return err diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go index ff45c41b..04bf7079 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_plugin.go @@ -149,6 +149,7 @@ var _ volume.PersistentVolumePlugin = &sioPlugin{} func (p *sioPlugin) GetAccessModes() []api.PersistentVolumeAccessMode { return []api.PersistentVolumeAccessMode{ api.ReadWriteOnce, + api.ReadOnlyMany, } } diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go index 42cc31c9..2ee7d918 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util.go @@ -68,11 +68,13 @@ var ( nsSep = "%" sdcRootPath = "/opt/emc/scaleio/sdc/bin" - secretNotFoundErr = errors.New("secret not found") - configMapNotFoundErr = errors.New("configMap not found") - gatewayNotProvidedErr = errors.New("gateway not provided") - secretRefNotProvidedErr = errors.New("secret ref not provided") - systemNotProvidedErr = errors.New("secret not provided") + secretNotFoundErr = errors.New("secret not found") + configMapNotFoundErr = errors.New("configMap not found") + gatewayNotProvidedErr = errors.New("ScaleIO gateway not provided") + secretRefNotProvidedErr = errors.New("secret ref not provided") + systemNotProvidedErr = errors.New("ScaleIO system not provided") + storagePoolNotProvidedErr = errors.New("ScaleIO storage pool not provided") + protectionDomainNotProvidedErr = errors.New("ScaleIO protection domain not provided") ) // mapScaleIOVolumeSource maps attributes from a ScaleIOVolumeSource to config @@ -107,6 +109,12 @@ func validateConfigs(config map[string]string) error { if config[confKey.system] == "" { return systemNotProvidedErr } + if config[confKey.storagePool] == "" { + return storagePoolNotProvidedErr + } + if config[confKey.protectionDomain] == "" { + return protectionDomainNotProvidedErr + } return nil } @@ -119,8 +127,6 @@ func applyConfigDefaults(config map[string]string) { b = false } config[confKey.sslEnabled] = strconv.FormatBool(b) - config[confKey.protectionDomain] = defaultString(config[confKey.protectionDomain], "default") - config[confKey.storagePool] = defaultString(config[confKey.storagePool], "default") config[confKey.storageMode] = defaultString(config[confKey.storageMode], "ThinProvisioned") config[confKey.fsType] = defaultString(config[confKey.fsType], "xfs") b, err = strconv.ParseBool(config[confKey.readOnly]) diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util_test.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util_test.go index 2de09752..97e5512f 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util_test.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_util_test.go @@ -115,10 +115,10 @@ func TestUtilApplyConfigDefaults(t *testing.T) { if data[confKey.system] != "sio" { t.Error("Unexpected system value") } - if data[confKey.protectionDomain] != "default" { + if data[confKey.protectionDomain] != "" { t.Error("Unexpected protection domain value") } - if data[confKey.storagePool] != "default" { + if data[confKey.storagePool] != "" { t.Error("Unexpected storage pool value") } if data[confKey.volumeName] != "sio-vol" { diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go index 3abebd6a..b3c2177b 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume.go @@ -88,7 +88,7 @@ func (v *sioVolume) SetUpAt(dir string, fsGroup *int64) error { v.plugin.volumeMtx.LockKey(v.volSpecName) defer v.plugin.volumeMtx.UnlockKey(v.volSpecName) - glog.V(4).Info(log("setting up volume %s", v.volSpecName)) + glog.V(4).Info(log("setting up volume for PV.spec %s", v.volSpecName)) if err := v.setSioMgr(); err != nil { glog.Error(log("setup failed to create scalio manager: %v", err)) return err @@ -104,18 +104,36 @@ func (v *sioVolume) SetUpAt(dir string, fsGroup *int64) error { return nil } - // attach the volume and mount + // should multiple-mapping be enabled + enableMultiMaps := false + isROM := false + if v.spec.PersistentVolume != nil { + ams := v.spec.PersistentVolume.Spec.AccessModes + for _, am := range ams { + if am == api.ReadOnlyMany { + enableMultiMaps = true + isROM = true + } + } + } + glog.V(4).Info(log("multiple mapping enabled = %v", enableMultiMaps)) + volName := v.volName - devicePath, err := v.sioMgr.AttachVolume(volName) + devicePath, err := v.sioMgr.AttachVolume(volName, enableMultiMaps) if err != nil { glog.Error(log("setup of volume %v: %v", v.volSpecName, err)) return err } options := []string{} - if v.source.ReadOnly { - options = append(options, "ro") - } else { + switch { + default: + options = append(options, "rw") + case isROM && !v.source.ReadOnly: options = append(options, "rw") + case isROM: + options = append(options, "ro") + case v.source.ReadOnly: + options = append(options, "ro") } glog.V(4).Info(log("mounting device %s -> %s", devicePath, dir)) @@ -140,7 +158,12 @@ func (v *sioVolume) SetUpAt(dir string, fsGroup *int64) error { return err } - glog.V(4).Info(log("successfully setup volume %s attached %s:%s as %s", v.volSpecName, v.volName, devicePath, dir)) + if !v.readOnly && fsGroup != nil { + glog.V(4).Info(log("applying value FSGroup ownership")) + volume.SetVolumeOwnership(v, fsGroup) + } + + glog.V(4).Info(log("successfully setup PV %s: volume %s mapped as %s mounted at %s", v.volSpecName, v.volName, devicePath, dir)) return nil } @@ -191,7 +214,7 @@ func (v *sioVolume) TearDownAt(dir string) error { // use "last attempt wins" strategy to detach volume from node // only allow volume to detach when it is not busy (not being used by other pods) if !deviceBusy { - glog.V(4).Info(log("teardown is attempting to detach/unmap volume for %s", v.volSpecName)) + glog.V(4).Info(log("teardown is attempting to detach/unmap volume for PV %s", v.volSpecName)) if err := v.resetSioMgr(); err != nil { glog.Error(log("teardown failed, unable to reset scalio mgr: %v", err)) } @@ -224,7 +247,7 @@ func (v *sioVolume) Delete() error { return err } - glog.V(4).Info(log("successfully deleted pvc %s", v.volSpecName)) + glog.V(4).Info(log("successfully deleted PV %s with volume %s", v.volSpecName, v.volName)) return nil } @@ -234,17 +257,30 @@ func (v *sioVolume) Delete() error { var _ volume.Provisioner = &sioVolume{} func (v *sioVolume) Provision() (*api.PersistentVolume, error) { - glog.V(4).Info(log("attempting to dynamically provision pvc %v", v.options.PVName)) + glog.V(4).Info(log("attempting to dynamically provision pvc %v", v.options.PVC.Name)) if !volume.AccessModesContainedInAll(v.plugin.GetAccessModes(), v.options.PVC.Spec.AccessModes) { return nil, fmt.Errorf("invalid AccessModes %v: only AccessModes %v are supported", v.options.PVC.Spec.AccessModes, v.plugin.GetAccessModes()) } // setup volume attrributes - name := v.generateVolName() + genName := v.generateName("k8svol", 11) + var oneGig int64 = 1024 * 1024 * 1024 + var eightGig int64 = 8 * oneGig + capacity := v.options.PVC.Spec.Resources.Requests[api.ResourceName(api.ResourceStorage)] volSizeBytes := capacity.Value() - volSizeGB := int64(volume.RoundUpSize(volSizeBytes, 1024*1024*1024)) + volSizeGB := int64(volume.RoundUpSize(volSizeBytes, oneGig)) + + if volSizeBytes == 0 { + return nil, fmt.Errorf("invalid volume size of 0 specified") + } + + if volSizeBytes < eightGig { + volSizeGB = int64(volume.RoundUpSize(eightGig, oneGig)) + glog.V(4).Info(log("capacity less than 8Gi found, adjusted to %dGi", volSizeGB)) + + } // create sio manager if err := v.setSioMgrFromConfig(); err != nil { @@ -253,14 +289,15 @@ func (v *sioVolume) Provision() (*api.PersistentVolume, error) { } // create volume - vol, err := v.sioMgr.CreateVolume(name, volSizeGB) + volName := genName + vol, err := v.sioMgr.CreateVolume(volName, volSizeGB) if err != nil { glog.Error(log("provision failed while creating volume: %v", err)) return nil, err } // prepare data for pv - v.configData[confKey.volumeName] = name + v.configData[confKey.volumeName] = volName sslEnabled, err := strconv.ParseBool(v.configData[confKey.sslEnabled]) if err != nil { glog.Warning(log("failed to parse parameter sslEnabled, setting to false")) @@ -273,9 +310,10 @@ func (v *sioVolume) Provision() (*api.PersistentVolume, error) { } // describe created pv + pvName := genName pv := &api.PersistentVolume{ ObjectMeta: meta.ObjectMeta{ - Name: v.options.PVName, + Name: pvName, Namespace: v.options.PVC.Namespace, Labels: map[string]string{}, Annotations: map[string]string{ @@ -299,7 +337,7 @@ func (v *sioVolume) Provision() (*api.PersistentVolume, error) { ProtectionDomain: v.configData[confKey.protectionDomain], StoragePool: v.configData[confKey.storagePool], StorageMode: v.configData[confKey.storageMode], - VolumeName: name, + VolumeName: volName, FSType: v.configData[confKey.fsType], ReadOnly: readOnly, }, @@ -310,14 +348,14 @@ func (v *sioVolume) Provision() (*api.PersistentVolume, error) { pv.Spec.AccessModes = v.plugin.GetAccessModes() } - glog.V(4).Info(log("provisioner dynamically created pvc %v with volume %s successfully", pv.Name, vol.Name)) + glog.V(4).Info(log("provisioner created pv %v and volume %s successfully", pvName, vol.Name)) return pv, nil } // setSioMgr creates scaleio mgr from cached config data if found // otherwise, setups new config data and create mgr func (v *sioVolume) setSioMgr() error { - glog.V(4).Info(log("setting up sio mgr for vol %s", v.volSpecName)) + glog.V(4).Info(log("setting up sio mgr for spec %s", v.volSpecName)) podDir := v.plugin.host.GetPodPluginDir(v.podUID, sioPluginName) configName := path.Join(podDir, sioConfigFileName) if v.sioMgr == nil { @@ -455,6 +493,6 @@ func (v *sioVolume) setSioMgrFromSpec() error { return nil } -func (v *sioVolume) generateVolName() string { - return "sio-" + strings.Replace(string(uuid.NewUUID()), "-", "", -1)[0:25] +func (v *sioVolume) generateName(prefix string, size int) string { + return fmt.Sprintf("%s-%s", prefix, strings.Replace(string(uuid.NewUUID()), "-", "", -1)[0:size]) } diff --git a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume_test.go b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume_test.go index 536a8333..66099222 100644 --- a/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume_test.go +++ b/vendor/k8s.io/kubernetes/pkg/volume/scaleio/sio_volume_test.go @@ -23,6 +23,7 @@ import ( "strings" "testing" + "github.com/golang/glog" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" utiltesting "k8s.io/client-go/util/testing" @@ -149,6 +150,7 @@ func TestVolumeMounterUnmounter(t *testing.T) { VolumeName: testSioVol, FSType: "ext4", SecretRef: &api.LocalObjectReference{Name: "sio-secret"}, + ReadOnly: false, }, }, } @@ -191,6 +193,10 @@ func TestVolumeMounterUnmounter(t *testing.T) { } } + if sio.isMultiMap { + t.Errorf("SetUp() - expecting multiple volume disabled by default") + } + // rebuild spec builtSpec, err := sioPlug.ConstructVolumeSpec(volume.NewSpecFromVolume(vol).Name(), path) if err != nil { @@ -235,25 +241,23 @@ func TestVolumeProvisioner(t *testing.T) { plug, err := plugMgr.FindPluginByName(sioPluginName) if err != nil { - t.Errorf("Can't find the plugin %v", sioPluginName) + t.Fatalf("Can't find the plugin %v", sioPluginName) } sioPlug, ok := plug.(*sioPlugin) if !ok { - t.Errorf("Cannot assert plugin to be type sioPlugin") + t.Fatal("Cannot assert plugin to be type sioPlugin") } options := volume.VolumeOptions{ ClusterName: "testcluster", - PVName: "pvc-sio-dynamic-vol", PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, } + options.PVC.Name = "testpvc" options.PVC.Namespace = testns - // incomplete options, test should fail - _, err = sioPlug.NewProvisioner(options) - if err == nil { - t.Fatal("expected failure due to incomplete options") + options.PVC.Spec.AccessModes = []api.PersistentVolumeAccessMode{ + api.ReadOnlyMany, } options.Parameters = map[string]string{ @@ -288,10 +292,9 @@ func TestVolumeProvisioner(t *testing.T) { // validate provision actualSpecName := spec.Name actualVolName := spec.Spec.PersistentVolumeSource.ScaleIO.VolumeName - if !strings.HasPrefix(actualSpecName, "pvc-") { - t.Errorf("expecting volume name to start with pov-, got %s", actualSpecName) + if !strings.HasPrefix(actualSpecName, "k8svol-") { + t.Errorf("expecting volume name to start with k8svol-, got %s", actualSpecName) } - vol, err := sio.FindVolume(actualVolName) if err != nil { t.Fatalf("failed getting volume %v: %v", actualVolName, err) @@ -299,6 +302,9 @@ func TestVolumeProvisioner(t *testing.T) { if vol.Name != actualVolName { t.Errorf("expected volume name to be %s, got %s", actualVolName, vol.Name) } + if vol.SizeInKb != 8*1024*1024 { + glog.V(4).Info(log("unexpected volume size")) + } // mount dynamic vol sioMounter, err := sioPlug.NewMounter( @@ -315,8 +321,14 @@ func TestVolumeProvisioner(t *testing.T) { } sioVol.sioMgr.client = sio if err := sioMounter.SetUp(nil); err != nil { - t.Errorf("Expected success, got: %v", err) + t.Fatalf("Expected success, got: %v", err) + } + + // isMultiMap applied + if !sio.isMultiMap { + t.Errorf("SetUp() expecting attached volume with multi-mapping") } + // teardown dynamic vol sioUnmounter, err := sioPlug.NewUnmounter(spec.Name, podUID) if err != nil { @@ -351,3 +363,83 @@ func TestVolumeProvisioner(t *testing.T) { t.Errorf("Deleter did not delete path %v: %v", path, err) } } + +func TestVolumeProvisionerWithIncompleteConfig(t *testing.T) { + plugMgr, tmpDir := newPluginMgr(t) + defer os.RemoveAll(tmpDir) + + plug, err := plugMgr.FindPluginByName(sioPluginName) + if err != nil { + t.Fatalf("Can't find the plugin %v", sioPluginName) + } + sioPlug, ok := plug.(*sioPlugin) + if !ok { + t.Fatal("Cannot assert plugin to be type sioPlugin") + } + + options := volume.VolumeOptions{ + ClusterName: "testcluster", + PVName: "pvc-sio-dynamic-vol", + PVC: volumetest.CreateTestPVC("100Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, + } + options.PVC.Namespace = testns + + options.PVC.Spec.AccessModes = []api.PersistentVolumeAccessMode{ + api.ReadWriteOnce, + } + + // incomplete options, test should fail + _, err = sioPlug.NewProvisioner(options) + if err == nil { + t.Fatal("expected failure due to incomplete options") + } +} + +func TestVolumeProvisionerWithZeroCapacity(t *testing.T) { + plugMgr, tmpDir := newPluginMgr(t) + defer os.RemoveAll(tmpDir) + + plug, err := plugMgr.FindPluginByName(sioPluginName) + if err != nil { + t.Fatalf("Can't find the plugin %v", sioPluginName) + } + sioPlug, ok := plug.(*sioPlugin) + if !ok { + t.Fatal("Cannot assert plugin to be type sioPlugin") + } + + options := volume.VolumeOptions{ + ClusterName: "testcluster", + PVName: "pvc-sio-dynamic-vol", + PVC: volumetest.CreateTestPVC("0Mi", []api.PersistentVolumeAccessMode{api.ReadWriteOnce}), + PersistentVolumeReclaimPolicy: api.PersistentVolumeReclaimDelete, + } + options.PVC.Namespace = testns + + options.PVC.Spec.AccessModes = []api.PersistentVolumeAccessMode{ + api.ReadWriteOnce, + } + + options.Parameters = map[string]string{ + confKey.gateway: "http://test.scaleio:11111", + confKey.system: "sio", + confKey.protectionDomain: testSioPD, + confKey.storagePool: "default", + confKey.secretRef: "sio-secret", + } + + provisioner, _ := sioPlug.NewProvisioner(options) + sio := newFakeSio() + sioVol := provisioner.(*sioVolume) + if err := sioVol.setSioMgrFromConfig(); err != nil { + t.Fatalf("failed to create scaleio mgr from config: %v", err) + } + sioVol.sioMgr.client = sio + + _, err = provisioner.Provision() + if err == nil { + t.Fatalf("call to Provision() should fail with invalid capacity") + } + +} diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go index 828df443..8884c738 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch.go @@ -1138,7 +1138,7 @@ func mergePatchIntoOriginal(original, patch map[string]interface{}, t reflect.Ty return err } case !foundOriginal && !foundPatch: - return nil + continue } // Split all items into patch items and server-only items and then enforce the order. diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go index 507c8cff..7f6372db 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/util/strategicpatch/patch_test.go @@ -5966,6 +5966,75 @@ retainKeysMergingList: retainKeysMergingList: - name: bar - name: foo +`), + }, + }, + { + Description: "delete and reorder in one list, reorder in another", + StrategicMergePatchRawTestCaseData: StrategicMergePatchRawTestCaseData{ + Original: []byte(` +mergingList: +- name: a + value: a +- name: b + value: b +mergeItemPtr: +- name: c + value: c +- name: d + value: d +`), + Current: []byte(` +mergingList: +- name: a + value: a +- name: b + value: b +mergeItemPtr: +- name: c + value: c +- name: d + value: d +`), + Modified: []byte(` +mergingList: +- name: b + value: b +mergeItemPtr: +- name: d + value: d +- name: c + value: c +`), + TwoWay: []byte(` +$setElementOrder/mergingList: +- name: b +$setElementOrder/mergeItemPtr: +- name: d +- name: c +mergingList: +- $patch: delete + name: a +`), + ThreeWay: []byte(` +$setElementOrder/mergingList: +- name: b +$setElementOrder/mergeItemPtr: +- name: d +- name: c +mergingList: +- $patch: delete + name: a +`), + Result: []byte(` +mergingList: +- name: b + value: b +mergeItemPtr: +- name: d + value: d +- name: c + value: c `), }, }, @@ -5993,9 +6062,12 @@ func TestStrategicMergePatch(t *testing.T) { testThreeWayPatch(t, c) } - for _, c := range strategicMergePatchRawTestCases { - testTwoWayPatchForRawTestCase(t, c) - testThreeWayPatchForRawTestCase(t, c) + // run multiple times to exercise different map traversal orders + for i := 0; i < 10; i++ { + for _, c := range strategicMergePatchRawTestCases { + testTwoWayPatchForRawTestCase(t, c) + testThreeWayPatchForRawTestCase(t, c) + } } } diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go index 2dcea903..2153c16c 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go @@ -403,12 +403,8 @@ func (e *Store) WaitForInitialized(ctx genericapirequest.Context, obj runtime.Ob // shouldDeleteDuringUpdate checks if a Update is removing all the object's // finalizers. If so, it further checks if the object's -// DeletionGracePeriodSeconds is 0. If so, it returns true. If garbage collection -// is disabled it always returns false. +// DeletionGracePeriodSeconds is 0. If so, it returns true. func (e *Store) shouldDeleteDuringUpdate(ctx genericapirequest.Context, key string, obj, existing runtime.Object) bool { - if !e.EnableGarbageCollection { - return false - } newMeta, err := meta.Accessor(obj) if err != nil { utilruntime.HandleError(err) @@ -719,9 +715,18 @@ func shouldUpdateFinalizerDeleteDependents(e *Store, accessor metav1.Object, opt return shouldUpdate, shouldDeleteDependentInForeground } -// shouldUpdateFinalizers returns if we need to update the finalizers of the -// object, and the desired list of finalizers. -func shouldUpdateFinalizers(e *Store, accessor metav1.Object, options *metav1.DeleteOptions) (shouldUpdate bool, newFinalizers []string) { +// deletionFinalizersForGarbageCollection analyzes the object and delete options +// to determine whether the object is in need of finalization by the garbage +// collector. If so, returns the set of deletion finalizers to apply and a bool +// indicating whether the finalizer list has changed and is in need of updating. +// +// The finalizers returned are intended to be handled by the garbage collector. +// If garbage collection is disabled for the store, this function returns false +// to ensure finalizers aren't set which will never be cleared. +func deletionFinalizersForGarbageCollection(e *Store, accessor metav1.Object, options *metav1.DeleteOptions) (shouldUpdate bool, newFinalizers []string) { + if !e.EnableGarbageCollection { + return false, []string{} + } shouldUpdate1, shouldOrphan := shouldUpdateFinalizerOrphanDependents(e, accessor, options) shouldUpdate2, shouldDeleteDependentInForeground := shouldUpdateFinalizerDeleteDependents(e, accessor, options) oldFinalizers := accessor.GetFinalizers() @@ -766,72 +771,6 @@ func markAsDeleting(obj runtime.Object) (err error) { return nil } -// updateForGracefulDeletion and updateForGracefulDeletionAndFinalizers both -// implement deletion flows for graceful deletion. Graceful deletion is -// implemented as setting the deletion timestamp in an update. If the -// implementation of graceful deletion is changed, both of these methods -// should be changed together. - -// updateForGracefulDeletion updates the given object for graceful deletion by -// setting the deletion timestamp and grace period seconds and returns: -// -// 1. an error -// 2. a boolean indicating that the object was not found, but it should be -// ignored -// 3. a boolean indicating that the object's grace period is exhausted and it -// should be deleted immediately -// 4. a new output object with the state that was updated -// 5. a copy of the last existing state of the object -func (e *Store) updateForGracefulDeletion(ctx genericapirequest.Context, name, key string, options *metav1.DeleteOptions, preconditions storage.Preconditions, in runtime.Object) (err error, ignoreNotFound, deleteImmediately bool, out, lastExisting runtime.Object) { - lastGraceful := int64(0) - out = e.NewFunc() - err = e.Storage.GuaranteedUpdate( - ctx, - key, - out, - false, /* ignoreNotFound */ - &preconditions, - storage.SimpleUpdate(func(existing runtime.Object) (runtime.Object, error) { - graceful, pendingGraceful, err := rest.BeforeDelete(e.DeleteStrategy, ctx, existing, options) - if err != nil { - return nil, err - } - if pendingGraceful { - return nil, errAlreadyDeleting - } - if !graceful { - return nil, errDeleteNow - } - lastGraceful = *options.GracePeriodSeconds - lastExisting = existing - return existing, nil - }), - ) - switch err { - case nil: - if lastGraceful > 0 { - return nil, false, false, out, lastExisting - } - // If we are here, the registry supports grace period mechanism and - // we are intentionally delete gracelessly. In this case, we may - // enter a race with other k8s components. If other component wins - // the race, the object will not be found, and we should tolerate - // the NotFound error. See - // https://github.com/kubernetes/kubernetes/issues/19403 for - // details. - return nil, true, true, out, lastExisting - case errDeleteNow: - // we've updated the object to have a zero grace period, or it's already at 0, so - // we should fall through and truly delete the object. - return nil, false, true, out, lastExisting - case errAlreadyDeleting: - out, err = e.finalizeDelete(in, true) - return err, false, false, out, lastExisting - default: - return storeerr.InterpretUpdateError(err, e.QualifiedResource, name), false, false, out, lastExisting - } -} - // updateForGracefulDeletionAndFinalizers updates the given object for // graceful deletion and finalization by setting the deletion timestamp and // grace period seconds (graceful deletion) and updating the list of @@ -871,7 +810,7 @@ func (e *Store) updateForGracefulDeletionAndFinalizers(ctx genericapirequest.Con if err != nil { return nil, err } - shouldUpdate, newFinalizers := shouldUpdateFinalizers(e, existingAccessor, options) + shouldUpdate, newFinalizers := deletionFinalizersForGarbageCollection(e, existingAccessor, options) if shouldUpdate { existingAccessor.SetFinalizers(newFinalizers) } @@ -963,18 +902,12 @@ func (e *Store) Delete(ctx genericapirequest.Context, name string, options *meta // Handle combinations of graceful deletion and finalization by issuing // the correct updates. - if e.EnableGarbageCollection { - shouldUpdateFinalizers, _ := shouldUpdateFinalizers(e, accessor, options) - // TODO: remove the check, because we support no-op updates now. - if graceful || pendingFinalizers || shouldUpdateFinalizers { - err, ignoreNotFound, deleteImmediately, out, lastExisting = e.updateForGracefulDeletionAndFinalizers(ctx, name, key, options, preconditions, obj) - } - } else { - // TODO: remove the check on graceful, because we support no-op updates now. - if graceful { - err, ignoreNotFound, deleteImmediately, out, lastExisting = e.updateForGracefulDeletion(ctx, name, key, options, preconditions, obj) - } + shouldUpdateFinalizers, _ := deletionFinalizersForGarbageCollection(e, accessor, options) + // TODO: remove the check, because we support no-op updates now. + if graceful || pendingFinalizers || shouldUpdateFinalizers { + err, ignoreNotFound, deleteImmediately, out, lastExisting = e.updateForGracefulDeletionAndFinalizers(ctx, name, key, options, preconditions, obj) } + // !deleteImmediately covers all cases where err != nil. We keep both to be future-proof. if !deleteImmediately || err != nil { return out, false, err diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go index fa61ac97..096517a6 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store_test.go @@ -923,56 +923,62 @@ func TestGracefulStoreHandleFinalizers(t *testing.T) { testContext := genericapirequest.WithNamespace(genericapirequest.NewContext(), "test") destroyFunc, registry := NewTestGenericStoreRegistry(t) - registry.EnableGarbageCollection = true defaultDeleteStrategy := testRESTStrategy{scheme, names.SimpleNameGenerator, true, false, true} registry.DeleteStrategy = testGracefulStrategy{defaultDeleteStrategy} defer destroyFunc() - // create pod - _, err := registry.Create(testContext, podWithFinalizer, false) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - // delete the pod with grace period=0, the pod should still exist because it has a finalizer - _, wasDeleted, err := registry.Delete(testContext, podWithFinalizer.Name, metav1.NewDeleteOptions(0)) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } - if wasDeleted { - t.Errorf("unexpected, pod %s should not have been deleted immediately", podWithFinalizer.Name) - } - _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } + gcStates := []bool{true, false} + for _, gcEnabled := range gcStates { + t.Logf("garbage collection enabled: %t", gcEnabled) + registry.EnableGarbageCollection = gcEnabled - updatedPodWithFinalizer := &example.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", Finalizers: []string{"foo.com/x"}, ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, - Spec: example.PodSpec{NodeName: "machine"}, - } - _, _, err = registry.Update(testContext, updatedPodWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(updatedPodWithFinalizer, scheme)) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } + // create pod + _, err := registry.Create(testContext, podWithFinalizer, false) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } - // the object should still exist, because it still has a finalizer - _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } + // delete the pod with grace period=0, the pod should still exist because it has a finalizer + _, wasDeleted, err := registry.Delete(testContext, podWithFinalizer.Name, metav1.NewDeleteOptions(0)) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + if wasDeleted { + t.Errorf("unexpected, pod %s should not have been deleted immediately", podWithFinalizer.Name) + } + _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } - podWithNoFinalizer := &example.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, - Spec: example.PodSpec{NodeName: "anothermachine"}, - } - _, _, err = registry.Update(testContext, podWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(podWithNoFinalizer, scheme)) - if err != nil { - t.Fatalf("Unexpected error: %v", err) - } - // the pod should be removed, because its finalizer is removed - _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if !errors.IsNotFound(err) { - t.Fatalf("Unexpected error: %v", err) + updatedPodWithFinalizer := &example.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "foo", Finalizers: []string{"foo.com/x"}, ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, + Spec: example.PodSpec{NodeName: "machine"}, + } + _, _, err = registry.Update(testContext, updatedPodWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(updatedPodWithFinalizer, scheme)) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + // the object should still exist, because it still has a finalizer + _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + + podWithNoFinalizer := &example.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, + Spec: example.PodSpec{NodeName: "anothermachine"}, + } + _, _, err = registry.Update(testContext, podWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(podWithNoFinalizer, scheme)) + if err != nil { + t.Fatalf("Unexpected error: %v", err) + } + // the pod should be removed, because its finalizer is removed + _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if !errors.IsNotFound(err) { + t.Fatalf("Unexpected error: %v", err) + } } } @@ -1022,73 +1028,79 @@ func TestNonGracefulStoreHandleFinalizers(t *testing.T) { testContext := genericapirequest.WithNamespace(genericapirequest.NewContext(), "test") destroyFunc, registry := NewTestGenericStoreRegistry(t) - registry.EnableGarbageCollection = true + defer destroyFunc() - // create pod - _, err := registry.Create(testContext, podWithFinalizer, false) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } + gcStates := []bool{true, false} + for _, gcEnabled := range gcStates { + t.Logf("garbage collection enabled: %t", gcEnabled) + registry.EnableGarbageCollection = gcEnabled - // delete object with nil delete options doesn't delete the object - _, wasDeleted, err := registry.Delete(testContext, podWithFinalizer.Name, nil) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - if wasDeleted { - t.Errorf("unexpected, pod %s should not have been deleted immediately", podWithFinalizer.Name) - } + // create pod + _, err := registry.Create(testContext, podWithFinalizer, false) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } - // the object should still exist - obj, err := registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - podWithFinalizer, ok := obj.(*example.Pod) - if !ok { - t.Errorf("Unexpected object: %#v", obj) - } - if podWithFinalizer.ObjectMeta.DeletionTimestamp == nil { - t.Errorf("Expect the object to have DeletionTimestamp set, but got %#v", podWithFinalizer.ObjectMeta) - } - if podWithFinalizer.ObjectMeta.DeletionGracePeriodSeconds == nil || *podWithFinalizer.ObjectMeta.DeletionGracePeriodSeconds != 0 { - t.Errorf("Expect the object to have 0 DeletionGracePeriodSecond, but got %#v", podWithFinalizer.ObjectMeta) - } - if podWithFinalizer.Generation <= initialGeneration { - t.Errorf("Deletion didn't increase Generation.") - } + // delete object with nil delete options doesn't delete the object + _, wasDeleted, err := registry.Delete(testContext, podWithFinalizer.Name, nil) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + if wasDeleted { + t.Errorf("unexpected, pod %s should not have been deleted immediately", podWithFinalizer.Name) + } - updatedPodWithFinalizer := &example.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", Finalizers: []string{"foo.com/x"}, ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, - Spec: example.PodSpec{NodeName: "machine"}, - } - _, _, err = registry.Update(testContext, updatedPodWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(updatedPodWithFinalizer, scheme)) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } + // the object should still exist + obj, err := registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + podWithFinalizer, ok := obj.(*example.Pod) + if !ok { + t.Errorf("Unexpected object: %#v", obj) + } + if podWithFinalizer.ObjectMeta.DeletionTimestamp == nil { + t.Errorf("Expect the object to have DeletionTimestamp set, but got %#v", podWithFinalizer.ObjectMeta) + } + if podWithFinalizer.ObjectMeta.DeletionGracePeriodSeconds == nil || *podWithFinalizer.ObjectMeta.DeletionGracePeriodSeconds != 0 { + t.Errorf("Expect the object to have 0 DeletionGracePeriodSecond, but got %#v", podWithFinalizer.ObjectMeta) + } + if podWithFinalizer.Generation <= initialGeneration { + t.Errorf("Deletion didn't increase Generation.") + } - // the object should still exist, because it still has a finalizer - obj, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - podWithFinalizer, ok = obj.(*example.Pod) - if !ok { - t.Errorf("Unexpected object: %#v", obj) - } + updatedPodWithFinalizer := &example.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "foo", Finalizers: []string{"foo.com/x"}, ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, + Spec: example.PodSpec{NodeName: "machine"}, + } + _, _, err = registry.Update(testContext, updatedPodWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(updatedPodWithFinalizer, scheme)) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } - podWithNoFinalizer := &example.Pod{ - ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, - Spec: example.PodSpec{NodeName: "anothermachine"}, - } - _, _, err = registry.Update(testContext, podWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(podWithNoFinalizer, scheme)) - if err != nil { - t.Errorf("Unexpected error: %v", err) - } - // the pod should be removed, because its finalizer is removed - _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) - if !errors.IsNotFound(err) { - t.Errorf("Unexpected error: %v", err) + // the object should still exist, because it still has a finalizer + obj, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + podWithFinalizer, ok = obj.(*example.Pod) + if !ok { + t.Errorf("Unexpected object: %#v", obj) + } + + podWithNoFinalizer := &example.Pod{ + ObjectMeta: metav1.ObjectMeta{Name: "foo", ResourceVersion: podWithFinalizer.ObjectMeta.ResourceVersion}, + Spec: example.PodSpec{NodeName: "anothermachine"}, + } + _, _, err = registry.Update(testContext, podWithFinalizer.ObjectMeta.Name, rest.DefaultUpdatedObjectInfo(podWithNoFinalizer, scheme)) + if err != nil { + t.Errorf("Unexpected error: %v", err) + } + // the pod should be removed, because its finalizer is removed + _, err = registry.Get(testContext, podWithFinalizer.Name, &metav1.GetOptions{}) + if !errors.IsNotFound(err) { + t.Errorf("Unexpected error: %v", err) + } } } diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/discovery_client.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/discovery_client.go index 0ee46b86..011dd9ec 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/discovery_client.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/discovery/discovery_client.go @@ -183,7 +183,7 @@ func (d *DiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (r } // serverResources returns the supported resources for all groups and versions. -func (d *DiscoveryClient) serverResources(failEarly bool) ([]*metav1.APIResourceList, error) { +func (d *DiscoveryClient) serverResources() ([]*metav1.APIResourceList, error) { apiGroups, err := d.ServerGroups() if err != nil { return nil, err @@ -199,9 +199,6 @@ func (d *DiscoveryClient) serverResources(failEarly bool) ([]*metav1.APIResource if err != nil { // TODO: maybe restrict this to NotFound errors failedGroups[gv] = err - if failEarly { - return nil, &ErrGroupDiscoveryFailed{Groups: failedGroups} - } continue } @@ -245,7 +242,7 @@ func IsGroupDiscoveryFailedError(err error) bool { } // serverPreferredResources returns the supported resources with the version preferred by the server. -func (d *DiscoveryClient) serverPreferredResources(failEarly bool) ([]*metav1.APIResourceList, error) { +func (d *DiscoveryClient) serverPreferredResources() ([]*metav1.APIResourceList, error) { serverGroupList, err := d.ServerGroups() if err != nil { return nil, err @@ -265,9 +262,6 @@ func (d *DiscoveryClient) serverPreferredResources(failEarly bool) ([]*metav1.AP if err != nil { // TODO: maybe restrict this to NotFound errors failedGroups[groupVersion] = err - if failEarly { - return nil, &ErrGroupDiscoveryFailed{Groups: failedGroups} - } continue } @@ -312,9 +306,7 @@ func (d *DiscoveryClient) serverPreferredResources(failEarly bool) ([]*metav1.AP // ServerPreferredResources returns the supported resources with the version preferred by the // server. func (d *DiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error) { - return withRetries(defaultRetries, func(retryEarly bool) ([]*metav1.APIResourceList, error) { - return d.serverPreferredResources(retryEarly) - }) + return withRetries(defaultRetries, d.serverPreferredResources) } // ServerPreferredNamespacedResources returns the supported namespaced resources with the @@ -391,12 +383,11 @@ func (d *DiscoveryClient) OpenAPISchema() (*spec.Swagger, error) { } // withRetries retries the given recovery function in case the groups supported by the server change after ServerGroup() returns. -func withRetries(maxRetries int, f func(failEarly bool) ([]*metav1.APIResourceList, error)) ([]*metav1.APIResourceList, error) { +func withRetries(maxRetries int, f func() ([]*metav1.APIResourceList, error)) ([]*metav1.APIResourceList, error) { var result []*metav1.APIResourceList var err error for i := 0; i < maxRetries; i++ { - failEarly := i < maxRetries-1 - result, err = f(failEarly) + result, err = f() if err == nil { return result, nil } diff --git a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/pkg/version/base.go b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/pkg/version/base.go index 341b9d6b..93744386 100644 --- a/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/pkg/version/base.go +++ b/vendor/k8s.io/kubernetes/staging/src/k8s.io/client-go/pkg/version/base.go @@ -51,7 +51,7 @@ var ( // semantic version is a git hash, but the version itself is no // longer the direct output of "git describe", but a slight // translation to be semver compliant. - gitVersion string = "v1.7.4+$Format:%h$" + gitVersion string = "v1.7.5+$Format:%h$" gitCommit string = "$Format:%H$" // sha1 from git, output of $(git rev-parse HEAD) gitTreeState string = "not a git tree" // state of git tree, either "clean" or "dirty" diff --git a/vendor/k8s.io/kubernetes/test/e2e/framework/firewall_util.go b/vendor/k8s.io/kubernetes/test/e2e/framework/firewall_util.go index 2de58607..dfca1e4f 100644 --- a/vendor/k8s.io/kubernetes/test/e2e/framework/firewall_util.go +++ b/vendor/k8s.io/kubernetes/test/e2e/framework/firewall_util.go @@ -154,7 +154,7 @@ func GetClusterName(instancePrefix string) string { // Warning: this MUST be consistent with the CLUSTER_IP_RANGE set in // gce/config-test.sh. func GetClusterIpRange() string { - return "10.100.0.0/14" + return "10.64.0.0/14" } // GetE2eFirewalls returns all firewall rules we create for an e2e cluster. diff --git a/vendor/k8s.io/kubernetes/test/e2e/kubectl.go b/vendor/k8s.io/kubernetes/test/e2e/kubectl.go index 9e0f6f6a..ba80f039 100644 --- a/vendor/k8s.io/kubernetes/test/e2e/kubectl.go +++ b/vendor/k8s.io/kubernetes/test/e2e/kubectl.go @@ -206,6 +206,17 @@ var _ = framework.KubeDescribe("Kubectl alpha client", func() { It("should create a ScheduledJob", func() { framework.SkipIfMissingResource(f.ClientPool, ScheduledJobGroupVersionResource, f.Namespace.Name) + serverVersion, err := c.Discovery().ServerVersion() + if err != nil { + framework.Failf("Failed to get server version: %v", err) + } + sv, err := utilversion.ParseSemantic(serverVersion.GitVersion) + if err != nil { + framework.Failf("Failed to parse server version: %v", err) + } + if !sv.LessThan(utilversion.MustParseSemantic("v1.8.0")) { + framework.Skipf("scheduledjob/v2alpha1 generator not supported on cluster starting in 1.8") + } schedule := "*/5 * * * ?" framework.RunKubectlOrDie("run", sjName, "--restart=OnFailure", "--generator=scheduledjob/v2alpha1", diff --git a/vendor/k8s.io/kubernetes/test/e2e_node/conformance/run_test.sh b/vendor/k8s.io/kubernetes/test/e2e_node/conformance/run_test.sh index 3bc57d5f..95a1df2a 100755 --- a/vendor/k8s.io/kubernetes/test/e2e_node/conformance/run_test.sh +++ b/vendor/k8s.io/kubernetes/test/e2e_node/conformance/run_test.sh @@ -153,7 +153,7 @@ allow_privileged=true serialize_image_pulls=false config_dir=`mktemp -d` file_check_frequency=10s -pod_cidr=10.100.0.0/24 +pod_cidr=10.64.0.0/24 log_level=4 start_kubelet --api-servers $apiserver \ --volume-stats-agg-period $volume_stats_agg_period \ diff --git a/vendor/k8s.io/kubernetes/test/e2e_node/services/kubelet.go b/vendor/k8s.io/kubernetes/test/e2e_node/services/kubelet.go index 477155db..ea36add7 100644 --- a/vendor/k8s.io/kubernetes/test/e2e_node/services/kubelet.go +++ b/vendor/k8s.io/kubernetes/test/e2e_node/services/kubelet.go @@ -142,7 +142,7 @@ func (e *E2EServices) startKubelet() (*server, error) { // Note: this MUST be in sync with with the IP in // - cluster/gce/config-test.sh and // - test/e2e_node/conformance/run_test.sh. - "--pod-cidr", "10.100.0.0/24", + "--pod-cidr", "10.64.0.0/24", "--eviction-pressure-transition-period", "30s", // Apply test framework feature gates by default. This could also be overridden // by kubelet-flags. diff --git a/vendor/k8s.io/utils/HOWTOMOVE.md b/vendor/k8s.io/utils/HOWTOMOVE.md index 984e2052..49028998 100644 --- a/vendor/k8s.io/utils/HOWTOMOVE.md +++ b/vendor/k8s.io/utils/HOWTOMOVE.md @@ -8,6 +8,7 @@ It has 2 steps to move a pkg from other Kubernetes repos to `k8s.io/utils` repo: Copying should preserve all the git history associated with it. [Here](http://gbayer.com/development/moving-files-from-one-git-repository-to-another-preserving-history/) is a working approach. +Note: You may need to use `--allow-unrelated-histories` if you get error when running `git pull` following the post above. Then, you may need to restructure the package to make sure it has the following structure. diff --git a/vip-daemonset-proxy.yaml b/vip-daemonset-proxy.yaml index 8f68e0a8..8f8f6a15 100644 --- a/vip-daemonset-proxy.yaml +++ b/vip-daemonset-proxy.yaml @@ -22,7 +22,7 @@ spec: volumeMounts: - name: haproxy mountPath: /etc/haproxy - - image: aledbf/kube-keepalived-vip:0.15 + - image: aledbf/kube-keepalived-vip:0.17 name: kube-keepalived-vip securityContext: privileged: true diff --git a/vip-daemonset.yaml b/vip-daemonset.yaml index 6f969de4..004ad4f6 100644 --- a/vip-daemonset.yaml +++ b/vip-daemonset.yaml @@ -10,7 +10,7 @@ spec: spec: hostNetwork: true containers: - - image: aledbf/kube-keepalived-vip:0.15 + - image: aledbf/kube-keepalived-vip:0.17 name: kube-keepalived-vip imagePullPolicy: Always securityContext: diff --git a/vip-rc.yaml b/vip-rc.yaml index 5a1d7fd4..1e052a26 100644 --- a/vip-rc.yaml +++ b/vip-rc.yaml @@ -16,7 +16,7 @@ spec: spec: hostNetwork: true containers: - - image: aledbf/kube-keepalived-vip:0.15 + - image: aledbf/kube-keepalived-vip:0.17 name: kube-keepalived-vip imagePullPolicy: Always securityContext: