├── .envrc ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── feature_request.md │ └── question.md └── workflows │ ├── docker-image.yml │ └── go.yml ├── .gitignore ├── CONTRIBUTING.md ├── Dockerfile ├── LICENSE ├── README.md ├── asan_compile ├── cmd ├── hopper-master │ └── main.go └── hopper-node │ └── main.go ├── common ├── common.go ├── common.proto └── murmur.go ├── examples ├── binutils │ ├── Dockerfile │ ├── build-binutils.py │ ├── readelf │ │ ├── corpus │ │ │ ├── arvin │ │ │ ├── zcc │ │ │ └── zharf │ │ ├── master.sh │ │ ├── master_docker.sh │ │ ├── master_docker_dist.sh │ │ ├── node.sh │ │ ├── node_docker.sh │ │ └── node_docker_dist.sh │ ├── setup.sh │ └── setup_local.sh ├── jq │ ├── Dockerfile │ ├── README.md │ ├── corpus │ │ ├── 1.json │ │ ├── 2.json │ │ ├── 3.json │ │ ├── 4.json │ │ ├── 5.json │ │ ├── 6.json │ │ ├── 7.json │ │ ├── 8.json │ │ └── 9.json │ ├── master_docker.sh │ └── node_docker.sh ├── parse │ ├── corpus │ │ ├── 1 │ │ ├── 2 │ │ ├── 3 │ │ ├── 4 │ │ └── 5 │ ├── docker │ │ ├── master_docker.sh │ │ └── node_docker.sh │ ├── getdomain.c │ └── local │ │ ├── run_master.sh │ │ └── run_node.sh └── unsafe │ ├── in │ ├── 1 │ ├── 2 │ ├── 3 │ ├── 4 │ └── 5 │ └── unsafe_assign.c ├── flake.lock ├── flake.nix ├── go.mod ├── go.sum ├── gomod2nix.toml ├── images ├── arch.png ├── master.png ├── node.png └── tui.png ├── master ├── bloomfilter.go ├── master.go ├── mut.go └── pq.go ├── node ├── node.go └── utils.go ├── tui └── tui.go └── vendor ├── github.com ├── aymanbagabas │ └── go-osc52 │ │ ├── LICENSE │ │ ├── README.md │ │ └── osc52.go ├── bits-and-blooms │ └── bitset │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── azure-pipelines.yml │ │ ├── bitset.go │ │ ├── popcnt.go │ │ ├── popcnt_19.go │ │ ├── popcnt_amd64.go │ │ ├── popcnt_amd64.s │ │ ├── popcnt_generic.go │ │ ├── trailing_zeros_18.go │ │ └── trailing_zeros_19.go ├── charmbracelet │ ├── bubbletea │ │ ├── .gitignore │ │ ├── .golangci-soft.yml │ │ ├── .golangci.yml │ │ ├── CONTRIBUTING.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── commands.go │ │ ├── exec.go │ │ ├── key.go │ │ ├── logging.go │ │ ├── mouse.go │ │ ├── nil_renderer.go │ │ ├── options.go │ │ ├── renderer.go │ │ ├── screen.go │ │ ├── signals_unix.go │ │ ├── signals_windows.go │ │ ├── standard_renderer.go │ │ ├── tea.go │ │ ├── tty.go │ │ ├── tty_unix.go │ │ └── tty_windows.go │ └── lipgloss │ │ ├── .golangci-soft.yml │ │ ├── .golangci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── align.go │ │ ├── ansi_unix.go │ │ ├── ansi_windows.go │ │ ├── borders.go │ │ ├── color.go │ │ ├── get.go │ │ ├── join.go │ │ ├── position.go │ │ ├── runes.go │ │ ├── set.go │ │ ├── size.go │ │ ├── style.go │ │ ├── unset.go │ │ └── whitespace.go ├── containerd │ └── console │ │ ├── .golangci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── console.go │ │ ├── console_linux.go │ │ ├── console_unix.go │ │ ├── console_windows.go │ │ ├── console_zos.go │ │ ├── pty_freebsd_cgo.go │ │ ├── pty_freebsd_nocgo.go │ │ ├── pty_unix.go │ │ ├── tc_darwin.go │ │ ├── tc_freebsd_cgo.go │ │ ├── tc_freebsd_nocgo.go │ │ ├── tc_linux.go │ │ ├── tc_netbsd.go │ │ ├── tc_openbsd_cgo.go │ │ ├── tc_openbsd_nocgo.go │ │ ├── tc_solaris_cgo.go │ │ ├── tc_solaris_nocgo.go │ │ ├── tc_unix.go │ │ └── tc_zos.go ├── lucasb-eyer │ └── go-colorful │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── colorgens.go │ │ ├── colors.go │ │ ├── happy_palettegen.go │ │ ├── hexcolor.go │ │ ├── hsluv-snapshot-rev4.json │ │ ├── hsluv.go │ │ ├── soft_palettegen.go │ │ └── warm_palettegen.go ├── mattn │ ├── go-isatty │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── go.test.sh │ │ ├── isatty_bsd.go │ │ ├── isatty_others.go │ │ ├── isatty_plan9.go │ │ ├── isatty_solaris.go │ │ ├── isatty_tcgets.go │ │ └── isatty_windows.go │ ├── go-localereader │ │ ├── README.md │ │ ├── localereader.go │ │ ├── localereader_unix.go │ │ └── localereader_windows.go │ └── go-runewidth │ │ ├── LICENSE │ │ ├── README.md │ │ ├── runewidth.go │ │ ├── runewidth_appengine.go │ │ ├── runewidth_js.go │ │ ├── runewidth_posix.go │ │ ├── runewidth_table.go │ │ └── runewidth_windows.go ├── muesli │ ├── ansi │ │ ├── .gitignore │ │ ├── .golangci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ansi.go │ │ ├── buffer.go │ │ ├── compressor │ │ │ └── writer.go │ │ └── writer.go │ ├── cancelreader │ │ ├── .gitignore │ │ ├── .golangci-soft.yml │ │ ├── .golangci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── cancelreader.go │ │ ├── cancelreader_bsd.go │ │ ├── cancelreader_default.go │ │ ├── cancelreader_linux.go │ │ ├── cancelreader_select.go │ │ ├── cancelreader_unix.go │ │ └── cancelreader_windows.go │ ├── reflow │ │ ├── LICENSE │ │ ├── ansi │ │ │ ├── ansi.go │ │ │ ├── buffer.go │ │ │ └── writer.go │ │ ├── truncate │ │ │ └── truncate.go │ │ ├── wordwrap │ │ │ └── wordwrap.go │ │ └── wrap │ │ │ └── wrap.go │ └── termenv │ │ ├── .gitignore │ │ ├── .golangci-soft.yml │ │ ├── .golangci.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── ansi_compat.md │ │ ├── ansicolors.go │ │ ├── color.go │ │ ├── constants_linux.go │ │ ├── constants_solaris.go │ │ ├── constants_unix.go │ │ ├── copy.go │ │ ├── hyperlink.go │ │ ├── output.go │ │ ├── profile.go │ │ ├── screen.go │ │ ├── style.go │ │ ├── templatehelper.go │ │ ├── termenv.go │ │ ├── termenv_other.go │ │ ├── termenv_posix.go │ │ ├── termenv_solaris.go │ │ ├── termenv_unix.go │ │ └── termenv_windows.go └── rivo │ └── uniseg │ ├── LICENSE.txt │ ├── README.md │ ├── doc.go │ ├── grapheme.go │ └── properties.go ├── golang.org └── x │ ├── sys │ ├── LICENSE │ ├── PATENTS │ ├── internal │ │ └── unsafeheader │ │ │ └── unsafeheader.go │ ├── plan9 │ │ ├── asm.s │ │ ├── asm_plan9_386.s │ │ ├── asm_plan9_amd64.s │ │ ├── asm_plan9_arm.s │ │ ├── const_plan9.go │ │ ├── dir_plan9.go │ │ ├── env_plan9.go │ │ ├── errors_plan9.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── mksysnum_plan9.sh │ │ ├── pwd_go15_plan9.go │ │ ├── pwd_plan9.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_plan9.go │ │ ├── zsyscall_plan9_386.go │ │ ├── zsyscall_plan9_amd64.go │ │ ├── zsyscall_plan9_arm.go │ │ └── zsysnum_plan9.go │ ├── unix │ │ ├── .gitignore │ │ ├── README.md │ │ ├── affinity_linux.go │ │ ├── aliases.go │ │ ├── asm_aix_ppc64.s │ │ ├── asm_bsd_386.s │ │ ├── asm_bsd_amd64.s │ │ ├── asm_bsd_arm.s │ │ ├── asm_bsd_arm64.s │ │ ├── asm_bsd_riscv64.s │ │ ├── asm_linux_386.s │ │ ├── asm_linux_amd64.s │ │ ├── asm_linux_arm.s │ │ ├── asm_linux_arm64.s │ │ ├── asm_linux_loong64.s │ │ ├── asm_linux_mips64x.s │ │ ├── asm_linux_mipsx.s │ │ ├── asm_linux_ppc64x.s │ │ ├── asm_linux_riscv64.s │ │ ├── asm_linux_s390x.s │ │ ├── asm_openbsd_mips64.s │ │ ├── asm_solaris_amd64.s │ │ ├── asm_zos_s390x.s │ │ ├── bluetooth_linux.go │ │ ├── cap_freebsd.go │ │ ├── constants.go │ │ ├── dev_aix_ppc.go │ │ ├── dev_aix_ppc64.go │ │ ├── dev_darwin.go │ │ ├── dev_dragonfly.go │ │ ├── dev_freebsd.go │ │ ├── dev_linux.go │ │ ├── dev_netbsd.go │ │ ├── dev_openbsd.go │ │ ├── dev_zos.go │ │ ├── dirent.go │ │ ├── endian_big.go │ │ ├── endian_little.go │ │ ├── env_unix.go │ │ ├── epoll_zos.go │ │ ├── fcntl.go │ │ ├── fcntl_darwin.go │ │ ├── fcntl_linux_32bit.go │ │ ├── fdset.go │ │ ├── fstatfs_zos.go │ │ ├── gccgo.go │ │ ├── gccgo_c.c │ │ ├── gccgo_linux_amd64.go │ │ ├── ifreq_linux.go │ │ ├── ioctl.go │ │ ├── ioctl_linux.go │ │ ├── ioctl_zos.go │ │ ├── mkall.sh │ │ ├── mkerrors.sh │ │ ├── pagesize_unix.go │ │ ├── pledge_openbsd.go │ │ ├── ptrace_darwin.go │ │ ├── ptrace_ios.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── readdirent_getdents.go │ │ ├── readdirent_getdirentries.go │ │ ├── sockcmsg_dragonfly.go │ │ ├── sockcmsg_linux.go │ │ ├── sockcmsg_unix.go │ │ ├── sockcmsg_unix_other.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_aix.go │ │ ├── syscall_aix_ppc.go │ │ ├── syscall_aix_ppc64.go │ │ ├── syscall_bsd.go │ │ ├── syscall_darwin.1_12.go │ │ ├── syscall_darwin.1_13.go │ │ ├── syscall_darwin.go │ │ ├── syscall_darwin_amd64.go │ │ ├── syscall_darwin_arm64.go │ │ ├── syscall_darwin_libSystem.go │ │ ├── syscall_dragonfly.go │ │ ├── syscall_dragonfly_amd64.go │ │ ├── syscall_freebsd.go │ │ ├── syscall_freebsd_386.go │ │ ├── syscall_freebsd_amd64.go │ │ ├── syscall_freebsd_arm.go │ │ ├── syscall_freebsd_arm64.go │ │ ├── syscall_freebsd_riscv64.go │ │ ├── syscall_illumos.go │ │ ├── syscall_linux.go │ │ ├── syscall_linux_386.go │ │ ├── syscall_linux_alarm.go │ │ ├── syscall_linux_amd64.go │ │ ├── syscall_linux_amd64_gc.go │ │ ├── syscall_linux_arm.go │ │ ├── syscall_linux_arm64.go │ │ ├── syscall_linux_gc.go │ │ ├── syscall_linux_gc_386.go │ │ ├── syscall_linux_gc_arm.go │ │ ├── syscall_linux_gccgo_386.go │ │ ├── syscall_linux_gccgo_arm.go │ │ ├── syscall_linux_loong64.go │ │ ├── syscall_linux_mips64x.go │ │ ├── syscall_linux_mipsx.go │ │ ├── syscall_linux_ppc.go │ │ ├── syscall_linux_ppc64x.go │ │ ├── syscall_linux_riscv64.go │ │ ├── syscall_linux_s390x.go │ │ ├── syscall_linux_sparc64.go │ │ ├── syscall_netbsd.go │ │ ├── syscall_netbsd_386.go │ │ ├── syscall_netbsd_amd64.go │ │ ├── syscall_netbsd_arm.go │ │ ├── syscall_netbsd_arm64.go │ │ ├── syscall_openbsd.go │ │ ├── syscall_openbsd_386.go │ │ ├── syscall_openbsd_amd64.go │ │ ├── syscall_openbsd_arm.go │ │ ├── syscall_openbsd_arm64.go │ │ ├── syscall_openbsd_libc.go │ │ ├── syscall_openbsd_mips64.go │ │ ├── syscall_solaris.go │ │ ├── syscall_solaris_amd64.go │ │ ├── syscall_unix.go │ │ ├── syscall_unix_gc.go │ │ ├── syscall_unix_gc_ppc64x.go │ │ ├── syscall_zos_s390x.go │ │ ├── sysvshm_linux.go │ │ ├── sysvshm_unix.go │ │ ├── sysvshm_unix_other.go │ │ ├── timestruct.go │ │ ├── unveil_openbsd.go │ │ ├── xattr_bsd.go │ │ ├── zerrors_aix_ppc.go │ │ ├── zerrors_aix_ppc64.go │ │ ├── zerrors_darwin_amd64.go │ │ ├── zerrors_darwin_arm64.go │ │ ├── zerrors_dragonfly_amd64.go │ │ ├── zerrors_freebsd_386.go │ │ ├── zerrors_freebsd_amd64.go │ │ ├── zerrors_freebsd_arm.go │ │ ├── zerrors_freebsd_arm64.go │ │ ├── zerrors_freebsd_riscv64.go │ │ ├── zerrors_linux.go │ │ ├── zerrors_linux_386.go │ │ ├── zerrors_linux_amd64.go │ │ ├── zerrors_linux_arm.go │ │ ├── zerrors_linux_arm64.go │ │ ├── zerrors_linux_loong64.go │ │ ├── zerrors_linux_mips.go │ │ ├── zerrors_linux_mips64.go │ │ ├── zerrors_linux_mips64le.go │ │ ├── zerrors_linux_mipsle.go │ │ ├── zerrors_linux_ppc.go │ │ ├── zerrors_linux_ppc64.go │ │ ├── zerrors_linux_ppc64le.go │ │ ├── zerrors_linux_riscv64.go │ │ ├── zerrors_linux_s390x.go │ │ ├── zerrors_linux_sparc64.go │ │ ├── zerrors_netbsd_386.go │ │ ├── zerrors_netbsd_amd64.go │ │ ├── zerrors_netbsd_arm.go │ │ ├── zerrors_netbsd_arm64.go │ │ ├── zerrors_openbsd_386.go │ │ ├── zerrors_openbsd_amd64.go │ │ ├── zerrors_openbsd_arm.go │ │ ├── zerrors_openbsd_arm64.go │ │ ├── zerrors_openbsd_mips64.go │ │ ├── zerrors_solaris_amd64.go │ │ ├── zerrors_zos_s390x.go │ │ ├── zptrace_armnn_linux.go │ │ ├── zptrace_linux_arm64.go │ │ ├── zptrace_mipsnn_linux.go │ │ ├── zptrace_mipsnnle_linux.go │ │ ├── zptrace_x86_linux.go │ │ ├── zsyscall_aix_ppc.go │ │ ├── zsyscall_aix_ppc64.go │ │ ├── zsyscall_aix_ppc64_gc.go │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ ├── zsyscall_darwin_amd64.1_13.go │ │ ├── zsyscall_darwin_amd64.1_13.s │ │ ├── zsyscall_darwin_amd64.go │ │ ├── zsyscall_darwin_amd64.s │ │ ├── zsyscall_darwin_arm64.1_13.go │ │ ├── zsyscall_darwin_arm64.1_13.s │ │ ├── zsyscall_darwin_arm64.go │ │ ├── zsyscall_darwin_arm64.s │ │ ├── zsyscall_dragonfly_amd64.go │ │ ├── zsyscall_freebsd_386.go │ │ ├── zsyscall_freebsd_amd64.go │ │ ├── zsyscall_freebsd_arm.go │ │ ├── zsyscall_freebsd_arm64.go │ │ ├── zsyscall_freebsd_riscv64.go │ │ ├── zsyscall_illumos_amd64.go │ │ ├── zsyscall_linux.go │ │ ├── zsyscall_linux_386.go │ │ ├── zsyscall_linux_amd64.go │ │ ├── zsyscall_linux_arm.go │ │ ├── zsyscall_linux_arm64.go │ │ ├── zsyscall_linux_loong64.go │ │ ├── zsyscall_linux_mips.go │ │ ├── zsyscall_linux_mips64.go │ │ ├── zsyscall_linux_mips64le.go │ │ ├── zsyscall_linux_mipsle.go │ │ ├── zsyscall_linux_ppc.go │ │ ├── zsyscall_linux_ppc64.go │ │ ├── zsyscall_linux_ppc64le.go │ │ ├── zsyscall_linux_riscv64.go │ │ ├── zsyscall_linux_s390x.go │ │ ├── zsyscall_linux_sparc64.go │ │ ├── zsyscall_netbsd_386.go │ │ ├── zsyscall_netbsd_amd64.go │ │ ├── zsyscall_netbsd_arm.go │ │ ├── zsyscall_netbsd_arm64.go │ │ ├── zsyscall_openbsd_386.go │ │ ├── zsyscall_openbsd_386.s │ │ ├── zsyscall_openbsd_amd64.go │ │ ├── zsyscall_openbsd_amd64.s │ │ ├── zsyscall_openbsd_arm.go │ │ ├── zsyscall_openbsd_arm64.go │ │ ├── zsyscall_openbsd_arm64.s │ │ ├── zsyscall_openbsd_mips64.go │ │ ├── zsyscall_solaris_amd64.go │ │ ├── zsyscall_zos_s390x.go │ │ ├── zsysctl_openbsd_386.go │ │ ├── zsysctl_openbsd_amd64.go │ │ ├── zsysctl_openbsd_arm.go │ │ ├── zsysctl_openbsd_arm64.go │ │ ├── zsysctl_openbsd_mips64.go │ │ ├── zsysnum_darwin_amd64.go │ │ ├── zsysnum_darwin_arm64.go │ │ ├── zsysnum_dragonfly_amd64.go │ │ ├── zsysnum_freebsd_386.go │ │ ├── zsysnum_freebsd_amd64.go │ │ ├── zsysnum_freebsd_arm.go │ │ ├── zsysnum_freebsd_arm64.go │ │ ├── zsysnum_freebsd_riscv64.go │ │ ├── zsysnum_linux_386.go │ │ ├── zsysnum_linux_amd64.go │ │ ├── zsysnum_linux_arm.go │ │ ├── zsysnum_linux_arm64.go │ │ ├── zsysnum_linux_loong64.go │ │ ├── zsysnum_linux_mips.go │ │ ├── zsysnum_linux_mips64.go │ │ ├── zsysnum_linux_mips64le.go │ │ ├── zsysnum_linux_mipsle.go │ │ ├── zsysnum_linux_ppc.go │ │ ├── zsysnum_linux_ppc64.go │ │ ├── zsysnum_linux_ppc64le.go │ │ ├── zsysnum_linux_riscv64.go │ │ ├── zsysnum_linux_s390x.go │ │ ├── zsysnum_linux_sparc64.go │ │ ├── zsysnum_netbsd_386.go │ │ ├── zsysnum_netbsd_amd64.go │ │ ├── zsysnum_netbsd_arm.go │ │ ├── zsysnum_netbsd_arm64.go │ │ ├── zsysnum_openbsd_386.go │ │ ├── zsysnum_openbsd_amd64.go │ │ ├── zsysnum_openbsd_arm.go │ │ ├── zsysnum_openbsd_arm64.go │ │ ├── zsysnum_openbsd_mips64.go │ │ ├── zsysnum_zos_s390x.go │ │ ├── ztypes_aix_ppc.go │ │ ├── ztypes_aix_ppc64.go │ │ ├── ztypes_darwin_amd64.go │ │ ├── ztypes_darwin_arm64.go │ │ ├── ztypes_dragonfly_amd64.go │ │ ├── ztypes_freebsd_386.go │ │ ├── ztypes_freebsd_amd64.go │ │ ├── ztypes_freebsd_arm.go │ │ ├── ztypes_freebsd_arm64.go │ │ ├── ztypes_freebsd_riscv64.go │ │ ├── ztypes_illumos_amd64.go │ │ ├── ztypes_linux.go │ │ ├── ztypes_linux_386.go │ │ ├── ztypes_linux_amd64.go │ │ ├── ztypes_linux_arm.go │ │ ├── ztypes_linux_arm64.go │ │ ├── ztypes_linux_loong64.go │ │ ├── ztypes_linux_mips.go │ │ ├── ztypes_linux_mips64.go │ │ ├── ztypes_linux_mips64le.go │ │ ├── ztypes_linux_mipsle.go │ │ ├── ztypes_linux_ppc.go │ │ ├── ztypes_linux_ppc64.go │ │ ├── ztypes_linux_ppc64le.go │ │ ├── ztypes_linux_riscv64.go │ │ ├── ztypes_linux_s390x.go │ │ ├── ztypes_linux_sparc64.go │ │ ├── ztypes_netbsd_386.go │ │ ├── ztypes_netbsd_amd64.go │ │ ├── ztypes_netbsd_arm.go │ │ ├── ztypes_netbsd_arm64.go │ │ ├── ztypes_openbsd_386.go │ │ ├── ztypes_openbsd_amd64.go │ │ ├── ztypes_openbsd_arm.go │ │ ├── ztypes_openbsd_arm64.go │ │ ├── ztypes_openbsd_mips64.go │ │ ├── ztypes_solaris_amd64.go │ │ └── ztypes_zos_s390x.go │ └── windows │ │ ├── aliases.go │ │ ├── dll_windows.go │ │ ├── empty.s │ │ ├── env_windows.go │ │ ├── eventlog.go │ │ ├── exec_windows.go │ │ ├── memory_windows.go │ │ ├── mkerrors.bash │ │ ├── mkknownfolderids.bash │ │ ├── mksyscall.go │ │ ├── race.go │ │ ├── race0.go │ │ ├── security_windows.go │ │ ├── service.go │ │ ├── setupapi_windows.go │ │ ├── str.go │ │ ├── syscall.go │ │ ├── syscall_windows.go │ │ ├── types_windows.go │ │ ├── types_windows_386.go │ │ ├── types_windows_amd64.go │ │ ├── types_windows_arm.go │ │ ├── types_windows_arm64.go │ │ ├── zerrors_windows.go │ │ ├── zknownfolderids_windows.go │ │ └── zsyscall_windows.go │ ├── term │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── CONTRIBUTORS │ ├── LICENSE │ ├── PATENTS │ ├── README.md │ ├── codereview.cfg │ ├── term.go │ ├── term_plan9.go │ ├── term_unix.go │ ├── term_unix_bsd.go │ ├── term_unix_other.go │ ├── term_unsupported.go │ ├── term_windows.go │ └── terminal.go │ └── text │ ├── LICENSE │ ├── PATENTS │ └── transform │ └── transform.go └── modules.txt /.envrc: -------------------------------------------------------------------------------- 1 | use flake 2 | 3 | PATH_add ./result/bin/ 4 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a bug report 4 | title: '' 5 | labels: bug 6 | assignees: Cybergenik 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **Repro** 14 | Steps to reproduce the behavior: 15 | 1. 16 | 2. 17 | 3. 18 | ... 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Context** 27 | OS Master and Node are running on (`uname -v`): 28 | 29 | PUT name and version (if applicable): 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest a new feature! 4 | title: '' 5 | labels: enhancement 6 | assignees: Cybergenik 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Question 3 | about: Ask a question 4 | title: '' 5 | labels: question 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Docker Image CI 2 | 3 | on: 4 | push: 5 | branches: [ "main" ] 6 | pull_request: 7 | branches: [ "main" ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v3 17 | - name: Build Hopper Node docker image 18 | run: docker build . --file Dockerfile --tag hopper-node:$(date +%s) 19 | -------------------------------------------------------------------------------- /.github/workflows/go.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a golang project 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go 3 | 4 | name: Go 5 | 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ "main" ] 11 | 12 | jobs: 13 | 14 | build: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | 19 | - name: Set up Go 20 | uses: actions/setup-go@v3 21 | with: 22 | go-version: 1.23 23 | 24 | - name: Build 25 | run: go build -v ./... 26 | 27 | - name: Test 28 | run: go test -v ./... 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | demo.tape 8 | install/** 9 | binutils-* 10 | build/** 11 | hopper_out/** 12 | 13 | # Test binary, built with `go test -c` 14 | *.test 15 | 16 | # Output of the go coverage tool, specifically when used with LiteIDE 17 | *.out 18 | 19 | # Dependency directories (remove the comment below to include it) 20 | # vendor/ 21 | 22 | # Nix 23 | **/.direnv/ 24 | **/result/ 25 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thanks for contributing to the project! 4 | 5 | We want to make contributing to this project as easy and transparent as possible. 6 | 7 | ## Issues 8 | 9 | We use GitHub issues to track public bugs and feature requests. Please ensure your description is 10 | clear and has sufficient instructions to be able to reproduce the issue. 11 | 12 | ## Feature PRs 13 | 14 | We actively welcome your pull requests. 15 | 16 | 1. Make an issue outlining proposed feature. 17 | 2. Get approval from one of the core maintainers 18 | 3. Fork the repo and create your branch from `main` 19 | 4. Make changes and create PR 20 | 5. Link PR, with passing tests in the original issue 21 | 6. Get it reviewed & merged by a core maintainer 22 | 23 | ## Bug fix PRs 24 | 25 | For major vulnerability, please report them to [Cybergenik](mailto:cybergenik@gmail.com) immediately, **instead of making a public bug report**. 26 | 27 | For standard bug fixes: 28 | 29 | Same steps as a Feature PRs, except that your issue should also contain: 30 | - Some reasonable level of RCAing 31 | - A runnable repro script 32 | 33 | ## License 34 | 35 | By contributing to Hopper, you agree that your contributions will be licensed 36 | under the LICENSE file in the root directory of this source tree. 37 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.23-alpine AS builder 2 | 3 | WORKDIR /hopper 4 | COPY . . 5 | 6 | RUN go build -o hopper-master ./cmd/hopper-master \ 7 | && go build -o hopper-node ./cmd/hopper-node 8 | 9 | FROM debian:stable-slim 10 | 11 | COPY --from=builder /hopper/hopper-master /usr/local/bin/ 12 | COPY --from=builder /hopper/hopper-node /usr/local/bin/ 13 | COPY --from=builder /hopper/asan_compile /usr/local/bin/ 14 | 15 | ## Install clang utils 16 | RUN apt-get update && apt-get install -y --no-install-recommends \ 17 | libclang-dev llvm-dev lld libclang-rt-dev \ 18 | clang libasan8 clang-tools gcc g++ make \ 19 | wget git ca-certificates \ 20 | autoconf automake libtool m4 pkg-config build-essential \ 21 | && rm -rf /var/lib/apt/lists/* 22 | 23 | EXPOSE 6969/tcp 24 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Luciano 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /asan_compile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Small script to show what flags hopper requires. 4 | # 5 | 6 | # clang-15 7 | CC="clang" 8 | CXX="clang++" 9 | 10 | # Symbols, ASAN, Edge Coverage 11 | CFLAGS=" -g -O0 12 | -fsanitize=address 13 | -fno-omit-frame-pointer 14 | -fsanitize-address-use-after-scope 15 | -fsanitize-coverage=edge,trace-pc-guard 16 | -o target" 17 | 18 | $CC $CFLAGS $1 19 | 20 | -------------------------------------------------------------------------------- /common/common.go: -------------------------------------------------------------------------------- 1 | package common 2 | 3 | import ( 4 | "crypto/md5" 5 | "encoding/binary" 6 | ) 7 | 8 | type FTaskID uint64 9 | 10 | type BFHash [4]uint64 11 | 12 | func Hash(b []byte) FTaskID { 13 | sum := md5.Sum(b) 14 | return FTaskID(binary.BigEndian.Uint64([]byte(sum[:]))) 15 | } 16 | 17 | // baseHashes returns the four hash values of data that are used to create k 18 | // hashes 19 | func BloomHash(data []byte) BFHash { 20 | var d Digest128 // murmur hashing 21 | hash1, hash2, hash3, hash4 := d.Sum256(data) 22 | return [4]uint64{ 23 | hash1, hash2, hash3, hash4, 24 | } 25 | } 26 | 27 | type SeedInfo struct { 28 | NodeId uint64 29 | Id FTaskID 30 | Bytes []byte 31 | CovHash BFHash 32 | CovEdges uint64 33 | Crash bool 34 | } 35 | 36 | type Stats struct { 37 | Its uint64 38 | Port int 39 | Havoc uint64 40 | CrashN uint64 41 | SeedsN uint64 42 | ReadyToFuzzQ int 43 | EnergyMutationQ int 44 | MaxCov uint64 45 | UniqueCrashes int 46 | UniquePaths uint64 47 | Nodes int 48 | } 49 | 50 | type FTask struct { 51 | Id FTaskID 52 | Seed []byte 53 | Die bool 54 | } 55 | 56 | type FTaskArgs struct { 57 | } 58 | 59 | type UpdateReply struct { 60 | Log bool 61 | } 62 | 63 | type UpdateFTask struct { 64 | NodeId uint64 65 | Ok bool 66 | Id FTaskID 67 | CovHash BFHash 68 | CovEdges uint64 69 | Crash bool 70 | CrashMsg string 71 | } 72 | -------------------------------------------------------------------------------- /common/common.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | package hopper; 3 | 4 | import "google/protobuf/timestamp.proto"; 5 | 6 | 7 | service HopperMaster { 8 | rpc GetFTask() returns (FTask) {} 9 | rpc UpdateFTask(FTaskUpdate) returns (UpdateReply) {} 10 | } 11 | 12 | message FTask { 13 | uint64 task_id = 1; 14 | bytes seed = 2; 15 | bool die = 3; 16 | } 17 | 18 | message FTaskUpdate { 19 | uint64 node_id = 1; 20 | bool ok = 2; 21 | uint64 task_id = 3; 22 | repeated fixed64 coverage_hash = 4; 23 | uint64 covered_edges = 5; 24 | bool crash = 6; 25 | optional string crash_message = 7; 26 | } 27 | 28 | message UpdateReply { 29 | bool log_crash = 1; 30 | } 31 | -------------------------------------------------------------------------------- /examples/binutils/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM --platform=linux/amd64 hopper-node:latest 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | curl python3 tar xz-utils texinfo zlib1g-dev build-essential file 5 | # Build binutils 6 | WORKDIR /binutils 7 | COPY . . 8 | 9 | RUN ./build-binutils.py -t arm-linux-gnueabi 10 | 11 | RUN cp ./install/bin/arm-linux-gnueabi-readelf /readelf_target 12 | 13 | RUN rm -rf /hopper/examples/binutils/binutils-* /hopper/examples/binutils/install /hopper/examples/binutils/build 14 | -------------------------------------------------------------------------------- /examples/binutils/readelf/corpus/arvin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/examples/binutils/readelf/corpus/arvin -------------------------------------------------------------------------------- /examples/binutils/readelf/corpus/zcc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/examples/binutils/readelf/corpus/zcc -------------------------------------------------------------------------------- /examples/binutils/readelf/corpus/zharf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/examples/binutils/readelf/corpus/zharf -------------------------------------------------------------------------------- /examples/binutils/readelf/master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Logging: 4 | export HOPPER_LOG=1 5 | export HOPPER_LOG_INTERVAL=1 6 | 7 | mkdir hopper_out 8 | export HOPPER_OUT=$(pwd)"/hopper_out" 9 | ## Spawn Master 10 | go build ./cmd/hopper-master; 11 | ./hopper-master -I ./examples/binutils/readelf/in -H=20 #--no-tui 12 | 13 | -------------------------------------------------------------------------------- /examples/binutils/readelf/master_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # List: screen -list 4 | # Detach: Ctrl-a Ctrl-d 5 | # Attach: screen -r .master 6 | 7 | ## Create Hopper subnet 8 | docker network create hopper-readelf-subnet &> /dev/null 9 | 10 | # Master config 11 | HOPPER_OUT="/hopper_out" 12 | CORPUS_PATH="/readelf/corpus" 13 | HAVOC=20 14 | 15 | docker run -it --rm \ 16 | --name hopper-master-readelf \ 17 | --env TERM \ 18 | --env HOPPER_OUT=$HOPPER_OUT \ 19 | --env HOPPER_LOG=1 \ 20 | --env HOPPER_LOG_INTERVAL=10 \ 21 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 22 | --volume $(pwd)$CORPUS_PATH:$CORPUS_PATH \ 23 | --network hopper-readelf-subnet \ 24 | --publish 6969:6969 \ 25 | hopper-readelf:latest \ 26 | bash -c "hopper-master -I ${CORPUS_PATH} -H ${HAVOC}" 27 | 28 | ## Clean up subnet 29 | docker network rm -f hopper-readelf-subnet 30 | -------------------------------------------------------------------------------- /examples/binutils/readelf/master_docker_dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Master config 4 | HOPPER_OUT="/hopper_out" 5 | CORPUS_PATH="/corpus" 6 | HAVOC=20 7 | 8 | docker run -it --rm \ 9 | --name hopper-master-readelf \ 10 | --env TERM \ 11 | --env HOPPER_OUT=$HOPPER_OUT \ 12 | --env HOPPER_LOG=1 \ 13 | --env HOPPER_LOG_INTERVAL=10 \ 14 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 15 | --volume $(pwd)$CORPUS_PATH:$CORPUS_PATH \ 16 | --publish 6969:6969 \ 17 | hopper-readelf:latest \ 18 | bash -c "hopper-master -I ${CORPUS_PATH} -H ${HAVOC}" 19 | -------------------------------------------------------------------------------- /examples/binutils/readelf/node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export HOPPER_OUT=$(pwd)"/hopper_out" 6 | 7 | # Build readelf target 8 | if [ ! -f ./readelf_target ] 9 | then 10 | ./examples/binutils/build-binutils.py -t arm-linux-gnueabi 11 | cp ./examples/binutils/install/bin/arm-linux-gnueabi-readelf ./readelf_target 12 | rm -rf ./examples/binutils/binutils-* ./examples/binutils/install ./examples/binutils/build 13 | fi 14 | 15 | 16 | # build Node 17 | go build ./cmd/hopper-node 18 | 19 | # Create Nodes 20 | for ((i=$1;i<=$2;i++)) 21 | do 22 | nohup ./hopper-node -I $i -T ./readelf_target -M localhost --args '-a @@' &> /dev/null & 23 | done 24 | -------------------------------------------------------------------------------- /examples/binutils/readelf/node_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOPPER_OUT="/hopper_out" 4 | 5 | START_ID=$1 6 | NUM_NODES=$2 7 | 8 | ## Spawn Nodes 9 | for ((i=START_ID; i < START_ID + NUM_NODES; i++)); 10 | do 11 | nohup docker run --rm \ 12 | --name hopper-node-readelf-$i \ 13 | --env TERM \ 14 | --env HOPPER_OUT=$HOPPER_OUT \ 15 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 16 | --network hopper-readelf-subnet \ 17 | hopper-readelf:latest \ 18 | bash -c "hopper-node -I $i -T /readelf_target -M hopper-master-readelf --args '-a @@'" &> /dev/null & 19 | echo "Started hopper-node-readelf-${i}" 20 | done 21 | -------------------------------------------------------------------------------- /examples/binutils/readelf/node_docker_dist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | HOPPER_OUT="/hopper_out" 4 | LOCAL_OUT="/proj/hopper-tests-PG0/defcon" 5 | MASTER_IP="10.10.1.1" 6 | PORT="6969" 7 | 8 | START_ID=$1 9 | NUM_NODES=$2 10 | 11 | ## Spawn Nodes 12 | for ((i=START_ID; i < START_ID + NUM_NODES; i++)); 13 | do 14 | nohup docker run --rm \ 15 | --name hopper-node-readelf-$i \ 16 | --env TERM \ 17 | --env HOPPER_OUT=$HOPPER_OUT \ 18 | --volume $LOCAL_OUT:$HOPPER_OUT \ 19 | hopper-readelf:latest \ 20 | bash -c "hopper-node -I $i -T readelf_target -M $MASTER_IP -P $PORT --args '-a @@'" &> /dev/null & 21 | echo "Started hopper-node-readelf-${i}" 22 | done 23 | -------------------------------------------------------------------------------- /examples/binutils/setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # Update and install git and curl 6 | sudo apt-get update && sudo apt-get install -y git curl 7 | 8 | cd ~ 9 | # Install docker 10 | if ! command -v docker &> /dev/null 11 | then 12 | echo "Installing Docker" 13 | curl -fsSL https://get.docker.com -o get-docker.sh 14 | sudo sh get-docker.sh 15 | fi 16 | 17 | # Cleanup docker 18 | yes | sudo docker image prune 19 | yes | sudo docker container prune 20 | 21 | # Clone and build Hopper 22 | git clone https://github.com/Cybergenik/hopper.git 23 | cd hopper/ 24 | 25 | sudo docker build -t hopper-node . 26 | cd examples/binutils/ 27 | sudo docker build -t hopper-readelf . 28 | cd ~ 29 | cp ~/hopper/examples/binutils/readelf/master_docker.sh . 30 | cp ~/hopper/examples/binutils/readelf/node_docker.sh . 31 | rm -rf hopper 32 | -------------------------------------------------------------------------------- /examples/binutils/setup_local.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -xe 4 | 5 | # Update and install git and curl 6 | sudo apt-get update && sudo apt-get install -y git curl clang clang-tools gcc wget curl python3.9 tar xz-utils texinfo zlib1g-dev build-essential file 7 | 8 | cd ~ 9 | # Download Go 10 | wget -q https://go.dev/dl/go1.19.3.linux-amd64.tar.gz 11 | sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.3.linux-amd64.tar.gz && rm -rf go1.19.3.linux-amd64.tar.gz 12 | export PATH=$PATH:/usr/local/go/bin 13 | 14 | # Clone and build Hopper 15 | git clone https://github.com/Cybergenik/hopper.git 16 | cd hopper/ 17 | 18 | go build ./cmd/hopper-master 19 | go build ./cmd/hopper-node 20 | 21 | cd ~ 22 | # Build readelf 23 | ./hopper/examples/binutils/build-binutils.py -t arm-linux-gnueabi 24 | cp hopper/examples/binutils/install/bin/arm-linux-gnueabi-readelf ./readelf_target 25 | 26 | cd ~ 27 | # Copy run scripts 28 | cp hopper/hopper-master . 29 | cp hopper/hopper-node . 30 | cp -r hopper/examples/binutils/readelf/in . 31 | cp ~/hopper/examples/binutils/readelf/master.sh . 32 | cp ~/hopper/examples/binutils/readelf/node.sh . 33 | rm -rf hopper 34 | -------------------------------------------------------------------------------- /examples/jq/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM hopper-node:latest 2 | 3 | RUN apt-get update && apt-get install -y --no-install-recommends \ 4 | clang-14 clang-tools-14 libclang-14-dev llvm-14-dev lld-14 libclang-rt-14-dev \ 5 | && rm -rf /var/lib/apt/lists/* 6 | 7 | RUN git clone https://github.com/stedolan/jq.git /jq 8 | 9 | WORKDIR /jq 10 | 11 | RUN git submodule update --init --recursive 12 | 13 | RUN cd vendor/oniguruma && ./autogen.sh && cd ../.. 14 | 15 | RUN autoreconf -fi 16 | RUN CC=clang \ 17 | CXX=clang++ \ 18 | CFLAGS="-fsanitize=address -fno-omit-frame-pointer -fsanitize-address-use-after-scope -fsanitize-coverage=edge,trace-pc-guard" \ 19 | LDFLAGS="-fsanitize=address" \ 20 | ./configure 21 | 22 | RUN make -j$(nproc) 23 | 24 | RUN cp /jq/jq /usr/local/bin/ 25 | -------------------------------------------------------------------------------- /examples/jq/README.md: -------------------------------------------------------------------------------- 1 | # Fuzzing jq JSON Processor with Hopper 2 | 3 | This example demonstrates how to fuzz the popular [jq](https://stedolan.github.io/jq/) JSON processor using Hopper. 4 | 5 | ## Steps to Run 6 | 7 | 1. Clone hopper: 8 | ```bash 9 | git clone https://github.com/Cybergenik/hopper.git && cd hopper 10 | ``` 11 | 12 | 2. Build base Hopper image: 13 | ```bash 14 | docker build -t hopper-node . 15 | ``` 16 | 3. Build instrumented jq fuzzing image: 17 | 18 | ```bash 19 | cd examples/jq 20 | docker build -t hopper-jq . 21 | ``` 22 | 4. Prepare a corpus directory with JSON seeds (already included under `examples/jq/corpus`). 23 | 24 | 5. Run Hopper master, pointing to corpus, with havoc level 2 (example): 25 | ```bash 26 | ./master_docker.sh 27 | ``` 28 | 29 | 6. In a seperate shell, run one or more (ex: 10) Hopper fuzz nodes with the jq binary: 30 | 31 | ```bash 32 | ./node_docker.sh 1 10 33 | ``` 34 | 35 | *Uses --stdin to feed seeds through jq's stdin.* 36 | 37 | To see how the nodes and master are being run, look in the scripts 38 | `master_docker.sh` and `node_docker.sh`. Try changing the havoc level on the 39 | master, see how that affects fuzzing. 40 | 41 | ## Observe 42 | 43 | 1. Monitor the TUI from the Hopper master. 44 | 45 | 2. Review crashes saved by Hopper under the `HOPPER_OUT` directory. 46 | -------------------------------------------------------------------------------- /examples/jq/corpus/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": 1 3 | } 4 | -------------------------------------------------------------------------------- /examples/jq/corpus/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "bar": [1, 2, 3] 3 | } 4 | -------------------------------------------------------------------------------- /examples/jq/corpus/3.json: -------------------------------------------------------------------------------- 1 | { 2 | "baz": { 3 | "nested": true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /examples/jq/corpus/4.json: -------------------------------------------------------------------------------- 1 | { 2 | "user": { 3 | "id": 3521, 4 | "name": { 5 | "first": "Alyssa", 6 | "last": "O'Connor", 7 | "aliases": ["aly", "A. O’C"] 8 | }, 9 | "contact": { 10 | "email": "alyssa.o@example.com", 11 | "phones": ["+1-206-555-0198", null] 12 | }, 13 | "addresses": [ 14 | { 15 | "type": "home", 16 | "line1": "1234 ↪️ Elm St.", 17 | "city": "Seattle", 18 | "zip": "98101" 19 | }, 20 | { 21 | "type": "work", 22 | "line1": "", 23 | "line2": null, 24 | "city": "Redmond", 25 | "zip": "98052" 26 | } 27 | ] 28 | }, 29 | "roles": ["admin", "editor", "viewer"], 30 | "metadata": { 31 | "last_login": null, 32 | "preferences": { 33 | "theme": "dark", 34 | "notifications": { 35 | "email": true, 36 | "sms": false, 37 | "push": { "enabled": true, "sound": "chime" } 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /examples/jq/corpus/5.json: -------------------------------------------------------------------------------- 1 | [ 2 | [ 3 | { "id": 1, "values": [10, 20, 30] }, 4 | { "id": 2, "values": [] } 5 | ], 6 | [ 7 | { "id": 3, "values": [null, false, true, "mixed"] }, 8 | {} 9 | ], 10 | [] 11 | ] 12 | -------------------------------------------------------------------------------- /examples/jq/corpus/6.json: -------------------------------------------------------------------------------- 1 | { 2 | "metrics": { 3 | "pi": 3.141592653589793, 4 | "bigInt": 12345678901234567890, 5 | "small": 1.23e-4, 6 | "negLarge": -9.99E+307, 7 | "zero": 0 8 | }, 9 | "flags": [true, false, null, true], 10 | "thresholds": [0.0, 0.5, 1.0] 11 | } 12 | -------------------------------------------------------------------------------- /examples/jq/corpus/7.json: -------------------------------------------------------------------------------- 1 | { 2 | "textSamples": [ 3 | "Line1\nLine2\tTabbed \"Quoted\" \\ Backslash", 4 | "Emoji test: 😀 🤖 🚀", 5 | "Unicode blocks: 日本語, العربية, Русский", 6 | "\u0048\u0065\u006C\u006C\u006F" 7 | ], 8 | "notes": "Mixing raw and escaped Unicode" 9 | } 10 | -------------------------------------------------------------------------------- /examples/jq/corpus/8.json: -------------------------------------------------------------------------------- 1 | { 2 | "matrix": [ 3 | [[1, 2], [3, 4, [5, 6, [7]]]], 4 | [[{"x": 10}], [{"y": 20}, {"z": []}]] 5 | ], 6 | "emptyObject": {}, 7 | "emptyArray": [] 8 | } 9 | -------------------------------------------------------------------------------- /examples/jq/corpus/9.json: -------------------------------------------------------------------------------- 1 | { 2 | "services": [ 3 | { 4 | "name": "auth", 5 | "enabled": true, 6 | "endpoints": { 7 | "/login": { 8 | "methods": ["POST"], 9 | "rate_limit": 1000 10 | }, 11 | "/logout": { 12 | "methods": ["GET", "POST"], 13 | "rate_limit": null 14 | } 15 | } 16 | }, 17 | { 18 | "name": "data", 19 | "enabled": false, 20 | "settings": { 21 | "cache": { "ttl": 3600, "strategy": "LRU" }, 22 | "replicas": [ 23 | { "host": "db1.example.com", "port": 27017 }, 24 | { "host": "db2.example.com", "port": 27017 } 25 | ] 26 | } 27 | } 28 | ], 29 | "version": "2.7.0-beta", 30 | "debug": false 31 | } 32 | -------------------------------------------------------------------------------- /examples/jq/master_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Master config 5 | HOPPER_OUT="/hopper_out" 6 | CORPUS_PATH="/corpus" 7 | HAVOC=2 8 | 9 | # create docker subnet 10 | docker network create hopper-jq-subnet &> /dev/null 11 | 12 | docker run --rm -it \ 13 | --name hopper-master-jq \ 14 | --env TERM \ 15 | --env HOPPER_OUT=$HOPPER_OUT \ 16 | --env HOPPER_LOG=1 \ 17 | --env HOPPER_LOG_INTERVAL=10 \ 18 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 19 | --volume $(pwd)$CORPUS_PATH:$CORPUS_PATH \ 20 | --network hopper-jq-subnet \ 21 | --publish 6969:6969 \ 22 | hopper-jq:latest \ 23 | bash -c "hopper-master -I ${CORPUS_PATH} -H ${HAVOC} -P 6969" 24 | 25 | ## Clean up subnet 26 | docker network rm -f hopper-jq-subnet 27 | -------------------------------------------------------------------------------- /examples/jq/node_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ -z "$1" ] || [ -z "$2" ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | HOPPER_OUT="/hopper_out" 10 | 11 | START_ID=$1 12 | NUM_NODES=$2 13 | 14 | ## Spawn Nodes 15 | for ((i=START_ID; i < START_ID + NUM_NODES; i++)); 16 | do 17 | nohup docker run --rm \ 18 | --name hopper-node-jq-${i} \ 19 | --env TERM \ 20 | --env HOPPER_OUT=$HOPPER_OUT \ 21 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 22 | --network hopper-jq-subnet \ 23 | hopper-jq:latest \ 24 | bash -c "hopper-node -I $i -T /jq/jq -M hopper-master-jq -P 6969 --stdin" &> /dev/null & 25 | 26 | echo "Started hopper-node-jq-${i}" 27 | done 28 | -------------------------------------------------------------------------------- /examples/parse/corpus/1: -------------------------------------------------------------------------------- 1 | test@hello.com -------------------------------------------------------------------------------- /examples/parse/corpus/2: -------------------------------------------------------------------------------- 1 | hello@domain.com -------------------------------------------------------------------------------- /examples/parse/corpus/3: -------------------------------------------------------------------------------- 1 | test@domain.com -------------------------------------------------------------------------------- /examples/parse/corpus/4: -------------------------------------------------------------------------------- 1 | nothing.com -------------------------------------------------------------------------------- /examples/parse/corpus/5: -------------------------------------------------------------------------------- 1 | test@ -------------------------------------------------------------------------------- /examples/parse/docker/master_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # Master config 5 | HOPPER_OUT="/hopper_out" 6 | CORPUS_PATH="/corpus" 7 | HAVOC=10 8 | 9 | # create docker subnet 10 | docker network create hopper-parse-subnet 11 | 12 | docker run --rm -it \ 13 | --name hopper-master-parse \ 14 | --env TERM \ 15 | --env HOPPER_OUT=$HOPPER_OUT \ 16 | --env HOPPER_LOG=1 \ 17 | --env HOPPER_LOG_INTERVAL=10 \ 18 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 19 | --volume $(pwd)$CORPUS_PATH:$CORPUS_PATH \ 20 | --network hopper-parse-subnet \ 21 | --publish 6969:6969 \ 22 | hopper-node:latest \ 23 | bash -c "hopper-master -I ${CORPUS_PATH} -H ${HAVOC} -P 6969" 24 | 25 | ## Clean up subnet 26 | docker network rm --force hopper-parse-subnet 27 | -------------------------------------------------------------------------------- /examples/parse/docker/node_docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | if [ -z "$1" ] || [ -z "$2" ]; then 5 | echo "Usage: $0 " 6 | exit 1 7 | fi 8 | 9 | HOPPER_OUT="/hopper_out" 10 | TARGET="/getdomain.c" 11 | 12 | START_ID=$1 13 | NUM_NODES=$2 14 | 15 | ## Spawn Nodes 16 | for ((i=START_ID; i < START_ID + NUM_NODES; i++)); 17 | do 18 | nohup docker run --rm \ 19 | --name hopper-node-parse-${i} \ 20 | --env TERM \ 21 | --env HOPPER_OUT=$HOPPER_OUT \ 22 | --volume $(pwd)$HOPPER_OUT:$HOPPER_OUT \ 23 | --volume $(pwd)$TARGET:$TARGET \ 24 | --network hopper-parse-subnet \ 25 | hopper-node:latest \ 26 | bash -c "asan_compile /getdomain.c && 27 | hopper-node -I $i -T /target -M hopper-master-parse --raw --args '@@'" &> /dev/null & 28 | 29 | echo "Started hopper-parse-node-${i}" 30 | done 31 | -------------------------------------------------------------------------------- /examples/parse/getdomain.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void print_domain(char *domain) { 6 | printf("Domain is %s\n", domain); 7 | } 8 | 9 | char *parse(char *str) { 10 | 11 | char buffer[15]; 12 | char *token, *substr; 13 | 14 | if(!str) { 15 | return "NO"; 16 | } 17 | 18 | for (substr=str; ; substr=NULL) { 19 | token = strtok(substr, "@"); 20 | 21 | if (token==NULL) { 22 | break; 23 | } 24 | 25 | if (substr==NULL) { 26 | strcpy(buffer, token); 27 | print_domain(buffer); 28 | return "YES"; 29 | } 30 | } 31 | 32 | return "NO"; 33 | 34 | } 35 | 36 | int main(int argc, char **argv) { 37 | 38 | if (argc<2) { 39 | puts("./getdomain "); 40 | return 1; 41 | } 42 | 43 | printf("Domain is valid? %s\n", parse(strdup(argv[1]))); 44 | 45 | return 0; 46 | } 47 | //gcc -fsanitize=address -O1 -fno-omit-frame-pointer -g getdomain.c 48 | -------------------------------------------------------------------------------- /examples/parse/local/run_master.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -xe 4 | # Logging: 5 | #export HOPPER_LOG=1 6 | #export HOPPER_LOG_INTERVAL=1 7 | 8 | export HOPPER_OUT=$(pwd)"/hopper_out" 9 | 10 | mkdir hopper_out 11 | 12 | go build ./cmd/hopper-master; 13 | 14 | ./hopper-master -I ./examples/parse/in -H=5 15 | 16 | -------------------------------------------------------------------------------- /examples/parse/local/run_node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export HOPPER_OUT=$(pwd)"/hopper_out" 4 | 5 | go build ./cmd/hopper-node; 6 | ./compile examples/parse/getdomain.c 7 | 8 | for ((i=$1;i<=$2;i++)) 9 | do 10 | nohup ./hopper-node -I $i -T ./target --raw --args '@@' &> /dev/null & 11 | done 12 | -------------------------------------------------------------------------------- /examples/unsafe/in/1: -------------------------------------------------------------------------------- 1 | 99 -------------------------------------------------------------------------------- /examples/unsafe/in/2: -------------------------------------------------------------------------------- 1 | 0001 -------------------------------------------------------------------------------- /examples/unsafe/in/3: -------------------------------------------------------------------------------- 1 | 982 -------------------------------------------------------------------------------- /examples/unsafe/in/4: -------------------------------------------------------------------------------- 1 | 12 -------------------------------------------------------------------------------- /examples/unsafe/in/5: -------------------------------------------------------------------------------- 1 | 100 -------------------------------------------------------------------------------- /examples/unsafe/unsafe_assign.c: -------------------------------------------------------------------------------- 1 | int unsafe_assign(int* buf){ 2 | if (*buf > 1999){ 3 | free(buf); 4 | } 5 | else { 6 | *buf = 99; 7 | } 8 | return 0; 9 | } 10 | 11 | int main(int argc, char **argv) { 12 | 13 | if (argc<2) { 14 | puts("./unsafe_assign "); 15 | return 1; 16 | } 17 | 18 | int* val = malloc(sizeof(int)); 19 | *val = atoi(argv[2]); 20 | printf("Freeing %d\n", unsafe_assign(val)); 21 | printf("%d\n", *val); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /flake.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs = { 3 | nixpkgs.url = "flake:nixpkgs/master"; 4 | 5 | utils.url = "flake:flake-utils"; 6 | 7 | gomod2nix = { 8 | url = "github:nix-community/gomod2nix"; 9 | inputs.nixpkgs.follows = "nixpkgs"; 10 | inputs.utils.follows = "utils"; 11 | }; 12 | }; 13 | 14 | outputs = 15 | { self 16 | , nixpkgs 17 | , utils 18 | , gomod2nix 19 | , ... 20 | }: utils.lib.eachSystem [ 21 | "aarch64-darwin" 22 | "x86_64-darwin" 23 | "aarch64-linux" 24 | "x86_64-linux" 25 | ] 26 | (system: 27 | let 28 | pkgs = import nixpkgs { 29 | inherit system; 30 | overlays = [ 31 | gomod2nix.overlays.default 32 | ]; 33 | }; 34 | 35 | lib = pkgs.lib; 36 | 37 | stdenv = pkgs.stdenv; 38 | 39 | hopper = pkgs.buildGoApplication rec { 40 | name = "hopper"; 41 | 42 | src = lib.cleanSource ./.; 43 | 44 | modules = ./gomod2nix.toml; 45 | }; 46 | in 47 | { 48 | packages.default = hopper; 49 | 50 | devShells.default = pkgs.mkShell { 51 | packages = with pkgs; [ 52 | go 53 | gopls 54 | gomod2nix.packages.${system}.default 55 | 56 | llvmPackages.clang 57 | llvmPackages.bintools 58 | ]; 59 | }; 60 | 61 | formatter = pkgs.nixpkgs-fmt; 62 | } 63 | ); 64 | } 65 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/Cybergenik/hopper 2 | 3 | go 1.23 4 | 5 | require ( 6 | github.com/bits-and-blooms/bitset v1.5.0 7 | github.com/charmbracelet/bubbletea v0.23.1 8 | github.com/charmbracelet/lipgloss v0.6.0 9 | ) 10 | 11 | require ( 12 | github.com/aymanbagabas/go-osc52 v1.0.3 // indirect 13 | github.com/containerd/console v1.0.3 // indirect 14 | github.com/lucasb-eyer/go-colorful v1.2.0 // indirect 15 | github.com/mattn/go-isatty v0.0.16 // indirect 16 | github.com/mattn/go-localereader v0.0.1 // indirect 17 | github.com/mattn/go-runewidth v0.0.14 // indirect 18 | github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect 19 | github.com/muesli/cancelreader v0.2.2 // indirect 20 | github.com/muesli/reflow v0.3.0 // indirect 21 | github.com/muesli/termenv v0.13.0 // indirect 22 | github.com/rivo/uniseg v0.2.0 // indirect 23 | golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect 24 | golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect 25 | golang.org/x/text v0.3.8 // indirect 26 | ) 27 | -------------------------------------------------------------------------------- /images/arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/images/arch.png -------------------------------------------------------------------------------- /images/master.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/images/master.png -------------------------------------------------------------------------------- /images/node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/images/node.png -------------------------------------------------------------------------------- /images/tui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Cybergenik/hopper/60260a1d42a5a66988538911043e8b3f93d73dfa/images/tui.png -------------------------------------------------------------------------------- /vendor/github.com/aymanbagabas/go-osc52/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Ayman Bagabas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/aymanbagabas/go-osc52/README.md: -------------------------------------------------------------------------------- 1 | 2 | # go-osc52 3 | 4 |

5 | Latest Release 6 | GoDoc 7 |

8 | 9 | A terminal Go library to copy text to clipboard from anywhere. It does so using [ANSI OSC52](https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands). The `Copy()` function defaults to copying text from terminals running locally. 10 | 11 | To use this over SSH, using [gliderlabs/ssh](https://github.com/gliderlabs/ssh), use `NewOutput(sshSession, sshSession.Environ())` and make sure you pass the `TERM` environment variable in your SSH connection. 12 | 13 | ```sh 14 | ssh -o SendEnv=TERM 15 | ``` 16 | 17 | Tmux users need to pass an additional environment variable `TMUX`. 18 | 19 | ```sh 20 | ssh -o SendEnv=TERM -o SendEnv=TMUX 21 | ``` 22 | 23 | # Credits 24 | 25 | * [vim-oscyank](https://github.com/ojroques/vim-oscyank) this is heavily inspired by vim-oscyank. -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | 26 | target 27 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | sudo: false 4 | 5 | branches: 6 | except: 7 | - release 8 | 9 | branches: 10 | only: 11 | - master 12 | - travis 13 | 14 | go: 15 | - "1.11.x" 16 | - tip 17 | 18 | matrix: 19 | allow_failures: 20 | - go: tip 21 | 22 | before_install: 23 | - if [ -n "$GH_USER" ]; then git config --global github.user ${GH_USER}; fi; 24 | - if [ -n "$GH_TOKEN" ]; then git config --global github.token ${GH_TOKEN}; fi; 25 | - go get github.com/mattn/goveralls 26 | 27 | before_script: 28 | - make deps 29 | 30 | script: 31 | - make qa 32 | 33 | after_failure: 34 | - cat ./target/test/report.xml 35 | 36 | after_success: 37 | - if [ "$TRAVIS_GO_VERSION" = "1.11.1" ]; then $HOME/gopath/bin/goveralls -covermode=count -coverprofile=target/report/coverage.out -service=travis-ci; fi; 38 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | # Go 2 | # Build your Go project. 3 | # Add steps that test, save build artifacts, deploy, and more: 4 | # https://docs.microsoft.com/azure/devops/pipelines/languages/go 5 | 6 | trigger: 7 | - master 8 | 9 | pool: 10 | vmImage: 'Ubuntu-16.04' 11 | 12 | variables: 13 | GOBIN: '$(GOPATH)/bin' # Go binaries path 14 | GOROOT: '/usr/local/go1.11' # Go installation path 15 | GOPATH: '$(system.defaultWorkingDirectory)/gopath' # Go workspace path 16 | modulePath: '$(GOPATH)/src/github.com/$(build.repository.name)' # Path to the module's code 17 | 18 | steps: 19 | - script: | 20 | mkdir -p '$(GOBIN)' 21 | mkdir -p '$(GOPATH)/pkg' 22 | mkdir -p '$(modulePath)' 23 | shopt -s extglob 24 | shopt -s dotglob 25 | mv !(gopath) '$(modulePath)' 26 | echo '##vso[task.prependpath]$(GOBIN)' 27 | echo '##vso[task.prependpath]$(GOROOT)/bin' 28 | displayName: 'Set up the Go workspace' 29 | 30 | - script: | 31 | go version 32 | go get -v -t -d ./... 33 | if [ -f Gopkg.toml ]; then 34 | curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh 35 | dep ensure 36 | fi 37 | go build -v . 38 | workingDirectory: '$(modulePath)' 39 | displayName: 'Get dependencies, then build' 40 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/popcnt.go: -------------------------------------------------------------------------------- 1 | package bitset 2 | 3 | // bit population count, take from 4 | // https://code.google.com/p/go/issues/detail?id=4988#c11 5 | // credit: https://code.google.com/u/arnehormann/ 6 | func popcount(x uint64) (n uint64) { 7 | x -= (x >> 1) & 0x5555555555555555 8 | x = (x>>2)&0x3333333333333333 + x&0x3333333333333333 9 | x += x >> 4 10 | x &= 0x0f0f0f0f0f0f0f0f 11 | x *= 0x0101010101010101 12 | return x >> 56 13 | } 14 | 15 | func popcntSliceGo(s []uint64) uint64 { 16 | cnt := uint64(0) 17 | for _, x := range s { 18 | cnt += popcount(x) 19 | } 20 | return cnt 21 | } 22 | 23 | func popcntMaskSliceGo(s, m []uint64) uint64 { 24 | cnt := uint64(0) 25 | for i := range s { 26 | cnt += popcount(s[i] &^ m[i]) 27 | } 28 | return cnt 29 | } 30 | 31 | func popcntAndSliceGo(s, m []uint64) uint64 { 32 | cnt := uint64(0) 33 | for i := range s { 34 | cnt += popcount(s[i] & m[i]) 35 | } 36 | return cnt 37 | } 38 | 39 | func popcntOrSliceGo(s, m []uint64) uint64 { 40 | cnt := uint64(0) 41 | for i := range s { 42 | cnt += popcount(s[i] | m[i]) 43 | } 44 | return cnt 45 | } 46 | 47 | func popcntXorSliceGo(s, m []uint64) uint64 { 48 | cnt := uint64(0) 49 | for i := range s { 50 | cnt += popcount(s[i] ^ m[i]) 51 | } 52 | return cnt 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/popcnt_19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package bitset 4 | 5 | import "math/bits" 6 | 7 | func popcntSlice(s []uint64) uint64 { 8 | var cnt int 9 | for _, x := range s { 10 | cnt += bits.OnesCount64(x) 11 | } 12 | return uint64(cnt) 13 | } 14 | 15 | func popcntMaskSlice(s, m []uint64) uint64 { 16 | var cnt int 17 | for i := range s { 18 | cnt += bits.OnesCount64(s[i] &^ m[i]) 19 | } 20 | return uint64(cnt) 21 | } 22 | 23 | func popcntAndSlice(s, m []uint64) uint64 { 24 | var cnt int 25 | for i := range s { 26 | cnt += bits.OnesCount64(s[i] & m[i]) 27 | } 28 | return uint64(cnt) 29 | } 30 | 31 | func popcntOrSlice(s, m []uint64) uint64 { 32 | var cnt int 33 | for i := range s { 34 | cnt += bits.OnesCount64(s[i] | m[i]) 35 | } 36 | return uint64(cnt) 37 | } 38 | 39 | func popcntXorSlice(s, m []uint64) uint64 { 40 | var cnt int 41 | for i := range s { 42 | cnt += bits.OnesCount64(s[i] ^ m[i]) 43 | } 44 | return uint64(cnt) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/popcnt_generic.go: -------------------------------------------------------------------------------- 1 | // +build !go1.9 2 | // +build !amd64 appengine 3 | 4 | package bitset 5 | 6 | func popcntSlice(s []uint64) uint64 { 7 | return popcntSliceGo(s) 8 | } 9 | 10 | func popcntMaskSlice(s, m []uint64) uint64 { 11 | return popcntMaskSliceGo(s, m) 12 | } 13 | 14 | func popcntAndSlice(s, m []uint64) uint64 { 15 | return popcntAndSliceGo(s, m) 16 | } 17 | 18 | func popcntOrSlice(s, m []uint64) uint64 { 19 | return popcntOrSliceGo(s, m) 20 | } 21 | 22 | func popcntXorSlice(s, m []uint64) uint64 { 23 | return popcntXorSliceGo(s, m) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/trailing_zeros_18.go: -------------------------------------------------------------------------------- 1 | // +build !go1.9 2 | 3 | package bitset 4 | 5 | var deBruijn = [...]byte{ 6 | 0, 1, 56, 2, 57, 49, 28, 3, 61, 58, 42, 50, 38, 29, 17, 4, 7 | 62, 47, 59, 36, 45, 43, 51, 22, 53, 39, 33, 30, 24, 18, 12, 5, 8 | 63, 55, 48, 27, 60, 41, 37, 16, 46, 35, 44, 21, 52, 32, 23, 11, 9 | 54, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9, 13, 8, 7, 6, 10 | } 11 | 12 | func trailingZeroes64(v uint64) uint { 13 | return uint(deBruijn[((v&-v)*0x03f79d71b4ca8b09)>>58]) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/bits-and-blooms/bitset/trailing_zeros_19.go: -------------------------------------------------------------------------------- 1 | // +build go1.9 2 | 3 | package bitset 4 | 5 | import "math/bits" 6 | 7 | func trailingZeroes64(v uint64) uint { 8 | return uint(bits.TrailingZeros64(v)) 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .envrc 3 | 4 | examples/fullscreen/fullscreen 5 | examples/help/help 6 | examples/http/http 7 | examples/list-default/list-default 8 | examples/list-fancy/list-fancy 9 | examples/list-simple/list-simple 10 | examples/mouse/mouse 11 | examples/pager/pager 12 | examples/progress-download/color_vortex.blend 13 | examples/progress-download/progress-download 14 | examples/simple/simple 15 | examples/spinner/spinner 16 | examples/textinput/textinput 17 | examples/textinputs/textinputs 18 | examples/views/views 19 | tutorials/basics/basics 20 | tutorials/commands/commands 21 | .idea 22 | coverage.txt 23 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/.golangci-soft.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | # - dupl 18 | - exhaustive 19 | # - exhaustivestruct 20 | - goconst 21 | - godot 22 | - godox 23 | - gomnd 24 | - gomoddirectives 25 | - goprintffuncname 26 | - ifshort 27 | # - lll 28 | - misspell 29 | - nakedret 30 | - nestif 31 | - noctx 32 | - nolintlint 33 | - prealloc 34 | - wrapcheck 35 | 36 | # disable default linters, they are already enabled in .golangci.yml 37 | disable: 38 | - deadcode 39 | - errcheck 40 | - gosimple 41 | - govet 42 | - ineffassign 43 | - staticcheck 44 | - structcheck 45 | - typecheck 46 | - unused 47 | - varcheck 48 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | - bodyclose 18 | - exportloopref 19 | - goimports 20 | - gosec 21 | - nilerr 22 | - predeclared 23 | - revive 24 | - rowserrcheck 25 | - sqlclosecheck 26 | - tparallel 27 | - unconvert 28 | - unparam 29 | - whitespace 30 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Pull requests are welcome for any changes. 4 | 5 | Consider opening an issue for larger changes to get feedback on the idea from the team. 6 | 7 | If your change touches parts of the Bubble Tea renderer or internals, make sure 8 | that all the examples in the `examples/` folder continue to run correctly. 9 | 10 | For commit messages, please use conventional commits[^1] to make it easier to 11 | generate release notes. 12 | 13 | [^1]: https://www.conventionalcommits.org/en/v1.0.0 14 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Charmbracelet, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/logging.go: -------------------------------------------------------------------------------- 1 | package tea 2 | 3 | import ( 4 | "log" 5 | "os" 6 | "unicode" 7 | ) 8 | 9 | // LogToFile sets up default logging to log to a file. This is helpful as we 10 | // can't print to the terminal since our TUI is occupying it. If the file 11 | // doesn't exist it will be created. 12 | // 13 | // Don't forget to close the file when you're done with it. 14 | // 15 | // f, err := LogToFile("debug.log", "debug") 16 | // if err != nil { 17 | // fmt.Println("fatal:", err) 18 | // os.Exit(1) 19 | // } 20 | // defer f.Close() 21 | func LogToFile(path string, prefix string) (*os.File, error) { 22 | f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) 23 | if err != nil { 24 | return nil, err 25 | } 26 | log.SetOutput(f) 27 | 28 | // Add a space after the prefix if a prefix is being specified and it 29 | // doesn't already have a trailing space. 30 | if len(prefix) > 0 { 31 | finalChar := prefix[len(prefix)-1] 32 | if !unicode.IsSpace(rune(finalChar)) { 33 | prefix += " " 34 | } 35 | } 36 | log.SetPrefix(prefix) 37 | 38 | return f, nil 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/nil_renderer.go: -------------------------------------------------------------------------------- 1 | package tea 2 | 3 | type nilRenderer struct{} 4 | 5 | func (n nilRenderer) start() {} 6 | func (n nilRenderer) stop() {} 7 | func (n nilRenderer) kill() {} 8 | func (n nilRenderer) write(v string) {} 9 | func (n nilRenderer) repaint() {} 10 | func (n nilRenderer) clearScreen() {} 11 | func (n nilRenderer) altScreen() bool { return false } 12 | func (n nilRenderer) enterAltScreen() {} 13 | func (n nilRenderer) exitAltScreen() {} 14 | func (n nilRenderer) showCursor() {} 15 | func (n nilRenderer) hideCursor() {} 16 | func (n nilRenderer) enableMouseCellMotion() {} 17 | func (n nilRenderer) disableMouseCellMotion() {} 18 | func (n nilRenderer) enableMouseAllMotion() {} 19 | func (n nilRenderer) disableMouseAllMotion() {} 20 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/signals_unix.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix 2 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris aix 3 | 4 | package tea 5 | 6 | import ( 7 | "os" 8 | "os/signal" 9 | "syscall" 10 | ) 11 | 12 | // listenForResize sends messages (or errors) when the terminal resizes. 13 | // Argument output should be the file descriptor for the terminal; usually 14 | // os.Stdout. 15 | func (p *Program) listenForResize(done chan struct{}) { 16 | sig := make(chan os.Signal, 1) 17 | signal.Notify(sig, syscall.SIGWINCH) 18 | 19 | defer func() { 20 | signal.Stop(sig) 21 | close(done) 22 | }() 23 | 24 | for { 25 | select { 26 | case <-p.ctx.Done(): 27 | return 28 | case <-sig: 29 | } 30 | 31 | p.checkResize() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/signals_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package tea 5 | 6 | // listenForResize is not available on windows because windows does not 7 | // implement syscall.SIGWINCH. 8 | func (p *Program) listenForResize(done chan struct{}) { 9 | close(done) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/tty_unix.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix 2 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris aix 3 | 4 | package tea 5 | 6 | import ( 7 | "os" 8 | 9 | "github.com/containerd/console" 10 | ) 11 | 12 | func (p *Program) initInput() error { 13 | // If input's a file, use console to manage it 14 | if f, ok := p.input.(*os.File); ok { 15 | c, err := console.ConsoleFromFile(f) 16 | if err != nil { 17 | return nil //nolint:nilerr // ignore error, this was just a test 18 | } 19 | p.console = c 20 | } 21 | 22 | return nil 23 | } 24 | 25 | // On unix systems, RestoreInput closes any TTYs we opened for input. Note that 26 | // we don't do this on Windows as it causes the prompt to not be drawn until 27 | // the terminal receives a keypress rather than appearing promptly after the 28 | // program exits. 29 | func (p *Program) restoreInput() error { 30 | if p.console != nil { 31 | return p.console.Reset() 32 | } 33 | return nil 34 | } 35 | 36 | func openInputTTY() (*os.File, error) { 37 | f, err := os.Open("/dev/tty") 38 | if err != nil { 39 | return nil, err 40 | } 41 | return f, nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/bubbletea/tty_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package tea 5 | 6 | import ( 7 | "os" 8 | 9 | "github.com/containerd/console" 10 | ) 11 | 12 | func (p *Program) initInput() error { 13 | // If input's a file, use console to manage it 14 | if f, ok := p.input.(*os.File); ok { 15 | // Save a reference to the current stdin then replace stdin with our 16 | // input. We do this so we can hand input off to containerd/console to 17 | // set raw mode, and do it in this fashion because the method 18 | // console.ConsoleFromFile isn't supported on Windows. 19 | p.windowsStdin = os.Stdin 20 | os.Stdin = f 21 | 22 | // Note: this will panic if it fails. 23 | c := console.Current() 24 | p.console = c 25 | } 26 | 27 | return nil 28 | } 29 | 30 | // restoreInput restores stdout in the event that we placed it aside to handle 31 | // input with CONIN$, above. 32 | func (p *Program) restoreInput() error { 33 | if p.windowsStdin != nil { 34 | os.Stdin = p.windowsStdin 35 | } 36 | 37 | return nil 38 | } 39 | 40 | // Open the Windows equivalent of a TTY. 41 | func openInputTTY() (*os.File, error) { 42 | f, err := os.OpenFile("CONIN$", os.O_RDWR, 0644) 43 | if err != nil { 44 | return nil, err 45 | } 46 | return f, nil 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/.golangci-soft.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | # - dupl 18 | - exhaustive 19 | # - exhaustivestruct 20 | - goconst 21 | - godot 22 | - godox 23 | - gomnd 24 | - gomoddirectives 25 | - goprintffuncname 26 | - ifshort 27 | # - lll 28 | - misspell 29 | - nakedret 30 | - nestif 31 | - noctx 32 | - nolintlint 33 | - prealloc 34 | - wrapcheck 35 | 36 | # disable default linters, they are already enabled in .golangci.yml 37 | disable: 38 | - deadcode 39 | - errcheck 40 | - gosimple 41 | - govet 42 | - ineffassign 43 | - staticcheck 44 | - structcheck 45 | - typecheck 46 | - unused 47 | - varcheck 48 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | - bodyclose 18 | - exportloopref 19 | - goimports 20 | - gosec 21 | - nilerr 22 | - predeclared 23 | - revive 24 | - rowserrcheck 25 | - sqlclosecheck 26 | - tparallel 27 | - unconvert 28 | - unparam 29 | - whitespace 30 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Charmbracelet, Inc 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/ansi_unix.go: -------------------------------------------------------------------------------- 1 | //go:build !windows 2 | // +build !windows 3 | 4 | package lipgloss 5 | 6 | // enableLegacyWindowsANSI is only needed on Windows. 7 | func enableLegacyWindowsANSI() {} 8 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/ansi_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | // +build windows 3 | 4 | package lipgloss 5 | 6 | import ( 7 | "sync" 8 | 9 | "github.com/muesli/termenv" 10 | ) 11 | 12 | var enableANSI sync.Once 13 | 14 | // enableANSIColors enables support for ANSI color sequences in the Windows 15 | // default console (cmd.exe and the PowerShell application). Note that this 16 | // only works with Windows 10. Also note that Windows Terminal supports colors 17 | // by default. 18 | func enableLegacyWindowsANSI() { 19 | enableANSI.Do(func() { 20 | _, _ = termenv.EnableWindowsANSIConsole() 21 | }) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/runes.go: -------------------------------------------------------------------------------- 1 | package lipgloss 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // StyleRunes applys a given style to runes at the given indicesin the string. 8 | // Note that you must provide styling options for both matched and unmatched 9 | // runes. Indices out of bounds will be ignored. 10 | func StyleRunes(str string, indices []int, matched, unmatched Style) string { 11 | // Convert slice of indices to a map for easier lookups 12 | m := make(map[int]struct{}) 13 | for _, i := range indices { 14 | m[i] = struct{}{} 15 | } 16 | 17 | var ( 18 | out strings.Builder 19 | group strings.Builder 20 | style Style 21 | runes = []rune(str) 22 | ) 23 | 24 | for i, r := range runes { 25 | group.WriteRune(r) 26 | 27 | _, matches := m[i] 28 | _, nextMatches := m[i+1] 29 | 30 | if matches != nextMatches || i == len(runes)-1 { 31 | // Flush 32 | if matches { 33 | style = matched 34 | } else { 35 | style = unmatched 36 | } 37 | out.WriteString(style.Render(group.String())) 38 | group.Reset() 39 | } 40 | } 41 | 42 | return out.String() 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/charmbracelet/lipgloss/size.go: -------------------------------------------------------------------------------- 1 | package lipgloss 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/muesli/reflow/ansi" 7 | ) 8 | 9 | // Width returns the cell width of characters in the string. ANSI sequences are 10 | // ignored and characters wider than one cell (such as Chinese characters and 11 | // emojis) are appropriately measured. 12 | // 13 | // You should use this instead of len(string) len([]rune(string) as neither 14 | // will give you accurate results. 15 | func Width(str string) (width int) { 16 | for _, l := range strings.Split(str, "\n") { 17 | w := ansi.PrintableRuneWidth(l) 18 | if w > width { 19 | width = w 20 | } 21 | } 22 | 23 | return width 24 | } 25 | 26 | // Height returns height of a string in cells. This is done simply by 27 | // counting \n characters. If your strings use \r\n for newlines you should 28 | // convert them to \n first, or simply write a separate function for measuring 29 | // height. 30 | func Height(str string) int { 31 | return strings.Count(str, "\n") + 1 32 | } 33 | 34 | // Size returns the width and height of the string in cells. ANSI sequences are 35 | // ignored and characters wider than one cell (such as Chinese characters and 36 | // emojis) are appropriately measured. 37 | func Size(str string) (width, height int) { 38 | width = Width(str) 39 | height = Height(str) 40 | return width, height 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/.golangci.yml: -------------------------------------------------------------------------------- 1 | linters: 2 | enable: 3 | - structcheck 4 | - varcheck 5 | - staticcheck 6 | - unconvert 7 | - gofmt 8 | - goimports 9 | - golint 10 | - ineffassign 11 | - vet 12 | - unused 13 | - misspell 14 | disable: 15 | - errcheck 16 | 17 | run: 18 | timeout: 3m 19 | skip-dirs: 20 | - vendor 21 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/README.md: -------------------------------------------------------------------------------- 1 | # console 2 | 3 | [![PkgGoDev](https://pkg.go.dev/badge/github.com/containerd/console)](https://pkg.go.dev/github.com/containerd/console) 4 | [![Build Status](https://github.com/containerd/console/workflows/CI/badge.svg)](https://github.com/containerd/console/actions?query=workflow%3ACI) 5 | [![Go Report Card](https://goreportcard.com/badge/github.com/containerd/console)](https://goreportcard.com/report/github.com/containerd/console) 6 | 7 | Golang package for dealing with consoles. Light on deps and a simple API. 8 | 9 | ## Modifying the current process 10 | 11 | ```go 12 | current := console.Current() 13 | defer current.Reset() 14 | 15 | if err := current.SetRaw(); err != nil { 16 | } 17 | ws, err := current.Size() 18 | current.Resize(ws) 19 | ``` 20 | 21 | ## Project details 22 | 23 | console is a containerd sub-project, licensed under the [Apache 2.0 license](./LICENSE). 24 | As a containerd sub-project, you will find the: 25 | * [Project governance](https://github.com/containerd/project/blob/master/GOVERNANCE.md), 26 | * [Maintainers](https://github.com/containerd/project/blob/master/MAINTAINERS), 27 | * and [Contributing guidelines](https://github.com/containerd/project/blob/master/CONTRIBUTING.md) 28 | 29 | information in our [`containerd/project`](https://github.com/containerd/project) repository. 30 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/pty_freebsd_cgo.go: -------------------------------------------------------------------------------- 1 | // +build freebsd,cgo 2 | 3 | /* 4 | Copyright The containerd Authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | 19 | package console 20 | 21 | import ( 22 | "fmt" 23 | "os" 24 | ) 25 | 26 | /* 27 | #include 28 | #include 29 | #include 30 | */ 31 | import "C" 32 | 33 | // openpt allocates a new pseudo-terminal and establishes a connection with its 34 | // control device. 35 | func openpt() (*os.File, error) { 36 | fd, err := C.posix_openpt(C.O_RDWR) 37 | if err != nil { 38 | return nil, fmt.Errorf("posix_openpt: %w", err) 39 | } 40 | if _, err := C.grantpt(fd); err != nil { 41 | C.close(fd) 42 | return nil, fmt.Errorf("grantpt: %w", err) 43 | } 44 | return os.NewFile(uintptr(fd), ""), nil 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/pty_freebsd_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build freebsd,!cgo 2 | 3 | /* 4 | Copyright The containerd Authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | 19 | package console 20 | 21 | import ( 22 | "os" 23 | ) 24 | 25 | // 26 | // Implementing the functions below requires cgo support. Non-cgo stubs 27 | // versions are defined below to enable cross-compilation of source code 28 | // that depends on these functions, but the resultant cross-compiled 29 | // binaries cannot actually be used. If the stub function(s) below are 30 | // actually invoked they will display an error message and cause the 31 | // calling process to exit. 32 | // 33 | 34 | func openpt() (*os.File, error) { 35 | panic("openpt() support requires cgo.") 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/pty_unix.go: -------------------------------------------------------------------------------- 1 | // +build darwin linux netbsd openbsd solaris 2 | 3 | /* 4 | Copyright The containerd Authors. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | */ 18 | 19 | package console 20 | 21 | import ( 22 | "os" 23 | 24 | "golang.org/x/sys/unix" 25 | ) 26 | 27 | // openpt allocates a new pseudo-terminal by opening the /dev/ptmx device 28 | func openpt() (*os.File, error) { 29 | return os.OpenFile("/dev/ptmx", unix.O_RDWR|unix.O_NOCTTY|unix.O_CLOEXEC, 0) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/tc_darwin.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The containerd Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package console 18 | 19 | import ( 20 | "fmt" 21 | "os" 22 | 23 | "golang.org/x/sys/unix" 24 | ) 25 | 26 | const ( 27 | cmdTcGet = unix.TIOCGETA 28 | cmdTcSet = unix.TIOCSETA 29 | ) 30 | 31 | // unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. 32 | // unlockpt should be called before opening the slave side of a pty. 33 | func unlockpt(f *os.File) error { 34 | return unix.IoctlSetPointerInt(int(f.Fd()), unix.TIOCPTYUNLK, 0) 35 | } 36 | 37 | // ptsname retrieves the name of the first available pts for the given master. 38 | func ptsname(f *os.File) (string, error) { 39 | n, err := unix.IoctlGetInt(int(f.Fd()), unix.TIOCPTYGNAME) 40 | if err != nil { 41 | return "", err 42 | } 43 | return fmt.Sprintf("/dev/pts/%d", n), nil 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/containerd/console/tc_zos.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright The containerd Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package console 18 | 19 | import ( 20 | "golang.org/x/sys/unix" 21 | ) 22 | 23 | const ( 24 | cmdTcGet = unix.TCGETS 25 | cmdTcSet = unix.TCSETS 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Lucas Beyer 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/happy_palettegen.go: -------------------------------------------------------------------------------- 1 | package colorful 2 | 3 | import ( 4 | "math/rand" 5 | ) 6 | 7 | // Uses the HSV color space to generate colors with similar S,V but distributed 8 | // evenly along their Hue. This is fast but not always pretty. 9 | // If you've got time to spare, use Lab (the non-fast below). 10 | func FastHappyPalette(colorsCount int) (colors []Color) { 11 | colors = make([]Color, colorsCount) 12 | 13 | for i := 0; i < colorsCount; i++ { 14 | colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.8+rand.Float64()*0.2, 0.65+rand.Float64()*0.2) 15 | } 16 | return 17 | } 18 | 19 | func HappyPalette(colorsCount int) ([]Color, error) { 20 | pimpy := func(l, a, b float64) bool { 21 | _, c, _ := LabToHcl(l, a, b) 22 | return 0.3 <= c && 0.4 <= l && l <= 0.8 23 | } 24 | return SoftPaletteEx(colorsCount, SoftPaletteSettings{pimpy, 50, true}) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/warm_palettegen.go: -------------------------------------------------------------------------------- 1 | package colorful 2 | 3 | import ( 4 | "math/rand" 5 | ) 6 | 7 | // Uses the HSV color space to generate colors with similar S,V but distributed 8 | // evenly along their Hue. This is fast but not always pretty. 9 | // If you've got time to spare, use Lab (the non-fast below). 10 | func FastWarmPalette(colorsCount int) (colors []Color) { 11 | colors = make([]Color, colorsCount) 12 | 13 | for i := 0; i < colorsCount; i++ { 14 | colors[i] = Hsv(float64(i)*(360.0/float64(colorsCount)), 0.55+rand.Float64()*0.2, 0.35+rand.Float64()*0.2) 15 | } 16 | return 17 | } 18 | 19 | func WarmPalette(colorsCount int) ([]Color, error) { 20 | warmy := func(l, a, b float64) bool { 21 | _, c, _ := LabToHcl(l, a, b) 22 | return 0.1 <= c && c <= 0.4 && 0.2 <= l && l <= 0.5 23 | } 24 | return SoftPaletteEx(colorsCount, SoftPaletteSettings{warmy, 50, true}) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly) && !appengine 2 | // +build darwin freebsd openbsd netbsd dragonfly 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build appengine || js || nacl || wasm 2 | // +build appengine js nacl wasm 3 | 4 | package isatty 5 | 6 | // IsTerminal returns true if the file descriptor is terminal which 7 | // is always false on js and appengine classic which is a sandboxed PaaS. 8 | func IsTerminal(fd uintptr) bool { 9 | return false 10 | } 11 | 12 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 13 | // terminal. This is also always false on this environment. 14 | func IsCygwinTerminal(fd uintptr) bool { 15 | return false 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine 2 | // +build linux aix zos 3 | // +build !appengine 4 | 5 | package isatty 6 | 7 | import "golang.org/x/sys/unix" 8 | 9 | // IsTerminal return true if the file descriptor is terminal. 10 | func IsTerminal(fd uintptr) bool { 11 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 12 | return err == nil 13 | } 14 | 15 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 16 | // terminal. This is also always false on this environment. 17 | func IsCygwinTerminal(fd uintptr) bool { 18 | return false 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-localereader/README.md: -------------------------------------------------------------------------------- 1 | # go-localereader 2 | 3 | CodePage decoder for Windows 4 | 5 | ## Usage 6 | 7 | ``` 8 | io.Copy(os.Stdout, localereader.NewAcpReader(bytes.Reader(bytesSjis))) 9 | ``` 10 | 11 | ## Installation 12 | 13 | ``` 14 | $ go get github.com/mattn/go-localereader 15 | ``` 16 | 17 | ## License 18 | 19 | MIT 20 | 21 | ## Author 22 | 23 | Yasuhiro Matsumoto (a.k.a. mattn) 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-localereader/localereader.go: -------------------------------------------------------------------------------- 1 | package localereader 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | func NewReader(r io.Reader) io.Reader { 9 | return newReader(r) 10 | } 11 | 12 | func UTF8(b []byte) ([]byte, error) { 13 | var buf bytes.Buffer 14 | n, err := io.Copy(&buf, newReader(bytes.NewReader(b))) 15 | if err != nil { 16 | return nil, err 17 | } 18 | return buf.Bytes()[:n], nil 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-localereader/localereader_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package localereader 4 | 5 | import ( 6 | "io" 7 | ) 8 | 9 | func newReader(r io.Reader) io.Reader { 10 | return r 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Yasuhiro Matsumoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/README.md: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://github.com/mattn/go-runewidth/workflows/test/badge.svg?branch=master)](https://github.com/mattn/go-runewidth/actions?query=workflow%3Atest) 5 | [![Codecov](https://codecov.io/gh/mattn/go-runewidth/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-runewidth) 6 | [![GoDoc](https://godoc.org/github.com/mattn/go-runewidth?status.svg)](http://godoc.org/github.com/mattn/go-runewidth) 7 | [![Go Report Card](https://goreportcard.com/badge/github.com/mattn/go-runewidth)](https://goreportcard.com/report/github.com/mattn/go-runewidth) 8 | 9 | Provides functions to get fixed width of the character or string. 10 | 11 | Usage 12 | ----- 13 | 14 | ```go 15 | runewidth.StringWidth("つのだ☆HIRO") == 12 16 | ``` 17 | 18 | 19 | Author 20 | ------ 21 | 22 | Yasuhiro Matsumoto 23 | 24 | License 25 | ------- 26 | 27 | under the MIT License: http://mattn.mit-license.org/2013 28 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | //go:build appengine 2 | // +build appengine 3 | 4 | package runewidth 5 | 6 | // IsEastAsian return true if the current locale is CJK 7 | func IsEastAsian() bool { 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | //go:build js && !appengine 2 | // +build js,!appengine 3 | 4 | package runewidth 5 | 6 | func IsEastAsian() bool { 7 | // TODO: Implement this for the web. Detect east asian in a compatible way, and return true. 8 | return false 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows && !appengine 2 | // +build windows,!appengine 3 | 4 | package runewidth 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | var ( 11 | kernel32 = syscall.NewLazyDLL("kernel32") 12 | procGetConsoleOutputCP = kernel32.NewProc("GetConsoleOutputCP") 13 | ) 14 | 15 | // IsEastAsian return true if the current locale is CJK 16 | func IsEastAsian() bool { 17 | r1, _, _ := procGetConsoleOutputCP.Call() 18 | if r1 == 0 { 19 | return false 20 | } 21 | 22 | switch int(r1) { 23 | case 932, 51932, 936, 949, 950: 24 | return true 25 | } 26 | 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | max-issues-per-linter: 0 6 | max-same-issues: 0 7 | 8 | linters: 9 | enable: 10 | - bodyclose 11 | - dupl 12 | - exportloopref 13 | - goconst 14 | - godot 15 | - godox 16 | - goimports 17 | - golint 18 | - goprintffuncname 19 | - gosec 20 | - ifshort 21 | - misspell 22 | - prealloc 23 | - rowserrcheck 24 | - sqlclosecheck 25 | - unconvert 26 | - unparam 27 | - whitespace 28 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Christian Muehlhaeuser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/README.md: -------------------------------------------------------------------------------- 1 | # ansi 2 | Raw ANSI sequence helpers 3 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/ansi.go: -------------------------------------------------------------------------------- 1 | package ansi 2 | 3 | const Marker = '\x1B' 4 | 5 | func IsTerminator(c rune) bool { 6 | return (c >= 0x40 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/ansi/buffer.go: -------------------------------------------------------------------------------- 1 | package ansi 2 | 3 | import ( 4 | "bytes" 5 | 6 | "github.com/mattn/go-runewidth" 7 | ) 8 | 9 | // Buffer is a buffer aware of ANSI escape sequences. 10 | type Buffer struct { 11 | bytes.Buffer 12 | } 13 | 14 | // PrintableRuneWidth returns the cell width of all printable runes in the 15 | // buffer. 16 | func (w Buffer) PrintableRuneWidth() int { 17 | return PrintableRuneWidth(w.String()) 18 | } 19 | 20 | // PrintableRuneWidth returns the cell width of the given string. 21 | func PrintableRuneWidth(s string) int { 22 | var n int 23 | var ansi bool 24 | 25 | for _, c := range s { 26 | if c == Marker { 27 | // ANSI escape sequence 28 | ansi = true 29 | } else if ansi { 30 | if IsTerminator(c) { 31 | // ANSI sequence terminated 32 | ansi = false 33 | } 34 | } else { 35 | n += runewidth.RuneWidth(c) 36 | } 37 | } 38 | 39 | return n 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/.golangci-soft.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | # - dupl 18 | - exhaustive 19 | # - exhaustivestruct 20 | - goconst 21 | - godot 22 | - godox 23 | - gomnd 24 | - gomoddirectives 25 | - goprintffuncname 26 | - ifshort 27 | # - lll 28 | - misspell 29 | - nakedret 30 | - nestif 31 | - noctx 32 | - nolintlint 33 | - prealloc 34 | - wrapcheck 35 | 36 | # disable default linters, they are already enabled in .golangci.yml 37 | disable: 38 | - deadcode 39 | - errcheck 40 | - gosimple 41 | - govet 42 | - ineffassign 43 | - staticcheck 44 | - structcheck 45 | - typecheck 46 | - unused 47 | - varcheck 48 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | - bodyclose 18 | - exportloopref 19 | - goimports 20 | - gosec 21 | - nilerr 22 | - predeclared 23 | - revive 24 | - rowserrcheck 25 | - sqlclosecheck 26 | - tparallel 27 | - unconvert 28 | - unparam 29 | - whitespace 30 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Erik Geiser and Christian Muehlhaeuser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/cancelreader_default.go: -------------------------------------------------------------------------------- 1 | //go:build !darwin && !windows && !linux && !solaris && !freebsd && !netbsd && !openbsd && !dragonfly 2 | // +build !darwin,!windows,!linux,!solaris,!freebsd,!netbsd,!openbsd,!dragonfly 3 | 4 | package cancelreader 5 | 6 | import "io" 7 | 8 | // NewReader returns a fallbackCancelReader that satisfies the CancelReader but 9 | // does not actually support cancellation. 10 | func NewReader(reader io.Reader) (CancelReader, error) { 11 | return newFallbackCancelReader(reader) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/cancelreader/cancelreader_unix.go: -------------------------------------------------------------------------------- 1 | //go:build solaris 2 | // +build solaris 3 | 4 | package cancelreader 5 | 6 | import ( 7 | "io" 8 | ) 9 | 10 | // NewReader returns a reader and a cancel function. If the input reader is a 11 | // File, the cancel function can be used to interrupt a blocking read call. 12 | // In this case, the cancel function returns true if the call was canceled 13 | // successfully. If the input reader is not a File or the file descriptor 14 | // is 1024 or larger, the cancel function does nothing and always returns false. 15 | // The generic unix implementation is based on the posix select syscall. 16 | func NewReader(reader io.Reader) (CancelReader, error) { 17 | return newSelectCancelReader(reader) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/reflow/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Christian Muehlhaeuser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/reflow/ansi/ansi.go: -------------------------------------------------------------------------------- 1 | package ansi 2 | 3 | const Marker = '\x1B' 4 | 5 | func IsTerminator(c rune) bool { 6 | return (c >= 0x40 && c <= 0x5a) || (c >= 0x61 && c <= 0x7a) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/reflow/ansi/buffer.go: -------------------------------------------------------------------------------- 1 | package ansi 2 | 3 | import ( 4 | "bytes" 5 | 6 | "github.com/mattn/go-runewidth" 7 | ) 8 | 9 | // Buffer is a buffer aware of ANSI escape sequences. 10 | type Buffer struct { 11 | bytes.Buffer 12 | } 13 | 14 | // PrintableRuneWidth returns the cell width of all printable runes in the 15 | // buffer. 16 | func (w Buffer) PrintableRuneWidth() int { 17 | return PrintableRuneWidth(w.String()) 18 | } 19 | 20 | // PrintableRuneWidth returns the cell width of the given string. 21 | func PrintableRuneWidth(s string) int { 22 | var n int 23 | var ansi bool 24 | 25 | for _, c := range s { 26 | if c == Marker { 27 | // ANSI escape sequence 28 | ansi = true 29 | } else if ansi { 30 | if IsTerminator(c) { 31 | // ANSI sequence terminated 32 | ansi = false 33 | } 34 | } else { 35 | n += runewidth.RuneWidth(c) 36 | } 37 | } 38 | 39 | return n 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, built with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | 14 | # Dependency directories (remove the comment below to include it) 15 | # vendor/ 16 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/.golangci-soft.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | # - dupl 18 | - exhaustive 19 | # - exhaustivestruct 20 | - goconst 21 | - godot 22 | - godox 23 | - gomnd 24 | - gomoddirectives 25 | - goprintffuncname 26 | - ifshort 27 | # - lll 28 | - misspell 29 | - nakedret 30 | - nestif 31 | - noctx 32 | - nolintlint 33 | - prealloc 34 | - wrapcheck 35 | 36 | # disable default linters, they are already enabled in .golangci.yml 37 | disable: 38 | - deadcode 39 | - errcheck 40 | - gosimple 41 | - govet 42 | - ineffassign 43 | - staticcheck 44 | - structcheck 45 | - typecheck 46 | - unused 47 | - varcheck 48 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/.golangci.yml: -------------------------------------------------------------------------------- 1 | run: 2 | tests: false 3 | 4 | issues: 5 | include: 6 | - EXC0001 7 | - EXC0005 8 | - EXC0011 9 | - EXC0012 10 | - EXC0013 11 | 12 | max-issues-per-linter: 0 13 | max-same-issues: 0 14 | 15 | linters: 16 | enable: 17 | - bodyclose 18 | - exportloopref 19 | - goimports 20 | - gosec 21 | - nilerr 22 | - predeclared 23 | - revive 24 | - rowserrcheck 25 | - sqlclosecheck 26 | - tparallel 27 | - unconvert 28 | - unparam 29 | - whitespace 30 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Christian Muehlhaeuser 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/ansi_compat.md: -------------------------------------------------------------------------------- 1 | ## Change Foreground Color 2 | 3 | This command should enable a blue foreground color: 4 | 5 | ```bash 6 | echo -ne "\033]10;#0000ff\007" 7 | ``` 8 | 9 | ## Change Background Color 10 | 11 | This command should enable a green background color: 12 | 13 | ```bash 14 | echo -ne "\033]11;#00ff00\007" 15 | ``` 16 | 17 | ## Change Cursor Color 18 | 19 | This command should enable a red cursor color: 20 | 21 | ```bash 22 | echo -ne "\033]12;#ff0000\007" 23 | ``` 24 | 25 | ## Query Color Scheme 26 | 27 | These two commands should print out the currently active color scheme: 28 | 29 | ```bash 30 | echo -ne "\033]10;?\033\\" 31 | echo -ne "\033]11;?\033\\" 32 | ``` 33 | 34 | ## Query Cursor Position 35 | 36 | This command should print out the current cursor position: 37 | 38 | ```bash 39 | echo -ne "\033[6n" 40 | ``` 41 | 42 | ## Set Window Title 43 | 44 | This command should set the window title to "Test": 45 | 46 | ```bash 47 | echo -ne "\033]2;Test\007" && sleep 10 48 | ``` 49 | 50 | ## Bracketed paste 51 | 52 | Enter this command, then paste a word from the clipboard. The text 53 | displayed on the terminal should contain the codes `200~` and `201~`: 54 | 55 | ```bash 56 | echo -ne "\033[?2004h" && sleep 10 57 | ``` 58 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/constants_linux.go: -------------------------------------------------------------------------------- 1 | package termenv 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | const ( 6 | tcgetattr = unix.TCGETS 7 | tcsetattr = unix.TCSETS 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/constants_solaris.go: -------------------------------------------------------------------------------- 1 | package termenv 2 | 3 | import "golang.org/x/sys/unix" 4 | 5 | const ( 6 | tcgetattr = unix.TCGETS 7 | tcsetattr = unix.TCSETS 8 | ) 9 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/constants_unix.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && !solaris && !illumos 2 | // +build darwin dragonfly freebsd netbsd openbsd 3 | // +build !solaris 4 | // +build !illumos 5 | 6 | package termenv 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | const ( 11 | tcgetattr = unix.TIOCGETA 12 | tcsetattr = unix.TIOCSETA 13 | ) 14 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/copy.go: -------------------------------------------------------------------------------- 1 | package termenv 2 | 3 | import ( 4 | "github.com/aymanbagabas/go-osc52" 5 | ) 6 | 7 | // Copy copies text to clipboard using OSC 52 escape sequence. 8 | func (o Output) Copy(str string) { 9 | out := osc52.NewOutput(o.tty, o.environ.Environ()) 10 | out.Copy(str) 11 | } 12 | 13 | // Copy copies text to clipboard using OSC 52 escape sequence. 14 | func Copy(str string) { 15 | output.Copy(str) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/hyperlink.go: -------------------------------------------------------------------------------- 1 | package termenv 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | // Hyperlink creates a hyperlink using OSC8. 8 | func Hyperlink(link, name string) string { 9 | return output.Hyperlink(link, name) 10 | } 11 | 12 | // Hyperlink creates a hyperlink using OSC8. 13 | func (o *Output) Hyperlink(link, name string) string { 14 | return fmt.Sprintf("\x1b]8;;%s\x1b\\%s\x1b]8;;\x1b\\", link, name) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/termenv_other.go: -------------------------------------------------------------------------------- 1 | //go:build js || plan9 || aix 2 | // +build js plan9 aix 3 | 4 | package termenv 5 | 6 | func colorProfile() Profile { 7 | return ANSI256 8 | } 9 | 10 | func (o Output) foregroundColor() Color { 11 | // default gray 12 | return ANSIColor(7) 13 | } 14 | 15 | func (o Output) backgroundColor() Color { 16 | // default black 17 | return ANSIColor(0) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/termenv_posix.go: -------------------------------------------------------------------------------- 1 | //go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd 2 | // +build darwin dragonfly freebsd linux netbsd openbsd 3 | 4 | package termenv 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func isForeground(fd int) bool { 11 | pgrp, err := unix.IoctlGetInt(fd, unix.TIOCGPGRP) 12 | if err != nil { 13 | return false 14 | } 15 | 16 | return pgrp == unix.Getpgrp() 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/muesli/termenv/termenv_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris || illumos 2 | // +build solaris illumos 3 | 4 | package termenv 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | func isForeground(fd int) bool { 11 | pgrp, err := unix.IoctlGetInt(fd, unix.TIOCGPGRP) 12 | if err != nil { 13 | return false 14 | } 15 | 16 | g, err := unix.Getpgrp() 17 | if err != nil { 18 | return false 19 | } 20 | 21 | return pgrp == g 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Oliver Kuederle 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/rivo/uniseg/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Package uniseg implements Unicode Text Segmentation according to Unicode 3 | Standard Annex #29 (http://unicode.org/reports/tr29/). 4 | 5 | At this point, only the determination of grapheme cluster boundaries is 6 | implemented. 7 | */ 8 | package uniseg 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/internal/unsafeheader/unsafeheader.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Package unsafeheader contains header declarations for the Go runtime's 6 | // slice and string implementations. 7 | // 8 | // This package allows x/sys to use types equivalent to 9 | // reflect.SliceHeader and reflect.StringHeader without introducing 10 | // a dependency on the (relatively heavy) "reflect" package. 11 | package unsafeheader 12 | 13 | import ( 14 | "unsafe" 15 | ) 16 | 17 | // Slice is the runtime representation of a slice. 18 | // It cannot be used safely or portably and its representation may change in a later release. 19 | type Slice struct { 20 | Data unsafe.Pointer 21 | Len int 22 | Cap int 23 | } 24 | 25 | // String is the runtime representation of a string. 26 | // It cannot be used safely or portably and its representation may change in a later release. 27 | type String struct { 28 | Data unsafe.Pointer 29 | Len int 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | TEXT ·use(SB),NOSPLIT,$0 8 | RET 9 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for 386, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-32 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-36 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$4-4 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // 8 | // System call support for amd64, Plan 9 9 | // 10 | 11 | // Just jump to package syscall's implementation for all these functions. 12 | // The runtime may know about them. 13 | 14 | TEXT ·Syscall(SB),NOSPLIT,$0-64 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 21 | JMP syscall·RawSyscall(SB) 22 | 23 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 24 | JMP syscall·RawSyscall6(SB) 25 | 26 | TEXT ·seek(SB),NOSPLIT,$0-56 27 | JMP syscall·seek(SB) 28 | 29 | TEXT ·exit(SB),NOSPLIT,$8-8 30 | JMP syscall·exit(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/asm_plan9_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | #include "textflag.h" 6 | 7 | // System call support for plan9 on arm 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-32 13 | JMP syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-44 16 | JMP syscall·Syscall6(SB) 17 | 18 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 19 | JMP syscall·RawSyscall(SB) 20 | 21 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·RawSyscall6(SB) 23 | 24 | TEXT ·seek(SB),NOSPLIT,$0-36 25 | JMP syscall·exit(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/const_plan9.go: -------------------------------------------------------------------------------- 1 | package plan9 2 | 3 | // Plan 9 Constants 4 | 5 | // Open modes 6 | const ( 7 | O_RDONLY = 0 8 | O_WRONLY = 1 9 | O_RDWR = 2 10 | O_TRUNC = 16 11 | O_CLOEXEC = 32 12 | O_EXCL = 0x1000 13 | ) 14 | 15 | // Rfork flags 16 | const ( 17 | RFNAMEG = 1 << 0 18 | RFENVG = 1 << 1 19 | RFFDG = 1 << 2 20 | RFNOTEG = 1 << 3 21 | RFPROC = 1 << 4 22 | RFMEM = 1 << 5 23 | RFNOWAIT = 1 << 6 24 | RFCNAMEG = 1 << 10 25 | RFCENVG = 1 << 11 26 | RFCFDG = 1 << 12 27 | RFREND = 1 << 13 28 | RFNOMNT = 1 << 14 29 | ) 30 | 31 | // Qid.Type bits 32 | const ( 33 | QTDIR = 0x80 34 | QTAPPEND = 0x40 35 | QTEXCL = 0x20 36 | QTMOUNT = 0x10 37 | QTAUTH = 0x08 38 | QTTMP = 0x04 39 | QTFILE = 0x00 40 | ) 41 | 42 | // Dir.Mode bits 43 | const ( 44 | DMDIR = 0x80000000 45 | DMAPPEND = 0x40000000 46 | DMEXCL = 0x20000000 47 | DMMOUNT = 0x10000000 48 | DMAUTH = 0x08000000 49 | DMTMP = 0x04000000 50 | DMREAD = 0x4 51 | DMWRITE = 0x2 52 | DMEXEC = 0x1 53 | ) 54 | 55 | const ( 56 | STATMAX = 65535 57 | ERRMAX = 128 58 | STATFIXLEN = 49 59 | ) 60 | 61 | // Mount and bind flags 62 | const ( 63 | MREPL = 0x0000 64 | MBEFORE = 0x0001 65 | MAFTER = 0x0002 66 | MORDER = 0x0003 67 | MCREATE = 0x0004 68 | MCACHE = 0x0010 69 | MMASK = 0x0017 70 | ) 71 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/env_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Plan 9 environment variables. 6 | 7 | package plan9 8 | 9 | import ( 10 | "syscall" 11 | ) 12 | 13 | func Getenv(key string) (value string, found bool) { 14 | return syscall.Getenv(key) 15 | } 16 | 17 | func Setenv(key, value string) error { 18 | return syscall.Setenv(key, value) 19 | } 20 | 21 | func Clearenv() { 22 | syscall.Clearenv() 23 | } 24 | 25 | func Environ() []string { 26 | return syscall.Environ() 27 | } 28 | 29 | func Unsetenv(key string) error { 30 | return syscall.Unsetenv(key) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/mksysnum_plan9.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright 2009 The Go Authors. All rights reserved. 3 | # Use of this source code is governed by a BSD-style 4 | # license that can be found in the LICENSE file. 5 | 6 | COMMAND="mksysnum_plan9.sh $@" 7 | 8 | cat <= 10 { 17 | buf[i] = byte(val%10 + '0') 18 | i-- 19 | val /= 10 20 | } 21 | buf[i] = byte(val + '0') 22 | return string(buf[i:]) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/plan9/zsysnum_plan9.go: -------------------------------------------------------------------------------- 1 | // mksysnum_plan9.sh /opt/plan9/sys/src/libc/9syscall/sys.h 2 | // MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT 3 | 4 | package plan9 5 | 6 | const ( 7 | SYS_SYSR1 = 0 8 | SYS_BIND = 2 9 | SYS_CHDIR = 3 10 | SYS_CLOSE = 4 11 | SYS_DUP = 5 12 | SYS_ALARM = 6 13 | SYS_EXEC = 7 14 | SYS_EXITS = 8 15 | SYS_FAUTH = 10 16 | SYS_SEGBRK = 12 17 | SYS_OPEN = 14 18 | SYS_OSEEK = 16 19 | SYS_SLEEP = 17 20 | SYS_RFORK = 19 21 | SYS_PIPE = 21 22 | SYS_CREATE = 22 23 | SYS_FD2PATH = 23 24 | SYS_BRK_ = 24 25 | SYS_REMOVE = 25 26 | SYS_NOTIFY = 28 27 | SYS_NOTED = 29 28 | SYS_SEGATTACH = 30 29 | SYS_SEGDETACH = 31 30 | SYS_SEGFREE = 32 31 | SYS_SEGFLUSH = 33 32 | SYS_RENDEZVOUS = 34 33 | SYS_UNMOUNT = 35 34 | SYS_SEMACQUIRE = 37 35 | SYS_SEMRELEASE = 38 36 | SYS_SEEK = 39 37 | SYS_FVERSION = 40 38 | SYS_ERRSTR = 41 39 | SYS_STAT = 42 40 | SYS_FSTAT = 43 41 | SYS_WSTAT = 44 42 | SYS_FWSTAT = 45 43 | SYS_MOUNT = 46 44 | SYS_AWAIT = 47 45 | SYS_PREAD = 50 46 | SYS_PWRITE = 51 47 | SYS_TSEMACQUIRE = 52 48 | SYS_NSEC = 53 49 | ) 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | // +build go1.9 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | type Signal = syscall.Signal 14 | type Errno = syscall.Errno 15 | type SysProcAttr = syscall.SysProcAttr 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 12 | // 13 | 14 | TEXT ·syscall6(SB),NOSPLIT,$0-88 15 | JMP syscall·syscall6(SB) 16 | 17 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSyscall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for 386 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for AMD64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | // +build freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for ARM64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | // +build darwin freebsd netbsd openbsd 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // System call support for RISCV64 BSD 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for AMD64, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOVQ a1+8(FP), DI 26 | MOVQ a2+16(FP), SI 27 | MOVQ a3+24(FP), DX 28 | MOVQ $0, R10 29 | MOVQ $0, R8 30 | MOVQ $0, R9 31 | MOVQ trap+0(FP), AX // syscall entry 32 | SYSCALL 33 | MOVQ AX, r1+32(FP) 34 | MOVQ DX, r2+40(FP) 35 | CALL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 45 | MOVQ a1+8(FP), DI 46 | MOVQ a2+16(FP), SI 47 | MOVQ a3+24(FP), DX 48 | MOVQ $0, R10 49 | MOVQ $0, R8 50 | MOVQ $0, R9 51 | MOVQ trap+0(FP), AX // syscall entry 52 | SYSCALL 53 | MOVQ AX, r1+32(FP) 54 | MOVQ DX, r2+40(FP) 55 | RET 56 | 57 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 58 | JMP syscall·gettimeofday(SB) 59 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for arm, Linux 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-28 18 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 24 | BL runtime·entersyscall(SB) 25 | MOVW trap+0(FP), R7 26 | MOVW a1+4(FP), R0 27 | MOVW a2+8(FP), R1 28 | MOVW a3+12(FP), R2 29 | MOVW $0, R3 30 | MOVW $0, R4 31 | MOVW $0, R5 32 | SWI $0 33 | MOVW R0, r1+16(FP) 34 | MOVW $0, R0 35 | MOVW R0, r2+20(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 40 | B syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 43 | B syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 46 | MOVW trap+0(FP), R7 // syscall entry 47 | MOVW a1+4(FP), R0 48 | MOVW a2+8(FP), R1 49 | MOVW a3+12(FP), R2 50 | SWI $0 51 | MOVW R0, r1+16(FP) 52 | MOVW $0, R0 53 | MOVW R0, r2+20(FP) 54 | RET 55 | 56 | TEXT ·seek(SB),NOSPLIT,$0-28 57 | B syscall·seek(SB) 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && arm64 && gc 6 | // +build linux 7 | // +build arm64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // Just jump to package syscall's implementation for all these functions. 13 | // The runtime may know about them. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | B syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | B syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | BL runtime·entersyscall(SB) 23 | MOVD a1+8(FP), R0 24 | MOVD a2+16(FP), R1 25 | MOVD a3+24(FP), R2 26 | MOVD $0, R3 27 | MOVD $0, R4 28 | MOVD $0, R5 29 | MOVD trap+0(FP), R8 // syscall entry 30 | SVC 31 | MOVD R0, r1+32(FP) // r1 32 | MOVD R1, r2+40(FP) // r2 33 | BL runtime·exitsyscall(SB) 34 | RET 35 | 36 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 37 | B syscall·RawSyscall(SB) 38 | 39 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 40 | B syscall·RawSyscall6(SB) 41 | 42 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 43 | MOVD a1+8(FP), R0 44 | MOVD a2+16(FP), R1 45 | MOVD a3+24(FP), R2 46 | MOVD $0, R3 47 | MOVD $0, R4 48 | MOVD $0, R5 49 | MOVD trap+0(FP), R8 // syscall entry 50 | SVC 51 | MOVD R0, r1+32(FP) 52 | MOVD R1, r2+40(FP) 53 | RET 54 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | // +build linux 7 | // +build loong64 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R11 // syscall entry 31 | SYSCALL 32 | MOVV R4, r1+32(FP) 33 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R11 // syscall entry 51 | SYSCALL 52 | MOVV R4, r1+32(FP) 53 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | // +build linux 7 | // +build mips64 mips64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | JAL runtime·entersyscall(SB) 27 | MOVV a1+8(FP), R4 28 | MOVV a2+16(FP), R5 29 | MOVV a3+24(FP), R6 30 | MOVV R0, R7 31 | MOVV R0, R8 32 | MOVV R0, R9 33 | MOVV trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVV R2, r1+32(FP) 36 | MOVV R3, r2+40(FP) 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVV a1+8(FP), R4 48 | MOVV a2+16(FP), R5 49 | MOVV a3+24(FP), R6 50 | MOVV R0, R7 51 | MOVV R0, R8 52 | MOVV R0, R9 53 | MOVV trap+0(FP), R2 // syscall entry 54 | SYSCALL 55 | MOVV R2, r1+32(FP) 56 | MOVV R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | // +build linux 7 | // +build mips mipsle 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for mips, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-28 20 | JMP syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 23 | JMP syscall·Syscall6(SB) 24 | 25 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 26 | JMP syscall·Syscall9(SB) 27 | 28 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 29 | JAL runtime·entersyscall(SB) 30 | MOVW a1+4(FP), R4 31 | MOVW a2+8(FP), R5 32 | MOVW a3+12(FP), R6 33 | MOVW R0, R7 34 | MOVW trap+0(FP), R2 // syscall entry 35 | SYSCALL 36 | MOVW R2, r1+16(FP) // r1 37 | MOVW R3, r2+20(FP) // r2 38 | JAL runtime·exitsyscall(SB) 39 | RET 40 | 41 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 42 | JMP syscall·RawSyscall(SB) 43 | 44 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 45 | JMP syscall·RawSyscall6(SB) 46 | 47 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 48 | MOVW a1+4(FP), R4 49 | MOVW a2+8(FP), R5 50 | MOVW a3+12(FP), R6 51 | MOVW trap+0(FP), R2 // syscall entry 52 | SYSCALL 53 | MOVW R2, r1+16(FP) 54 | MOVW R3, r2+20(FP) 55 | RET 56 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | // +build linux 7 | // +build ppc64 ppc64le 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for ppc64, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | BL runtime·entersyscall(SB) 21 | MOVD a1+8(FP), R3 22 | MOVD a2+16(FP), R4 23 | MOVD a3+24(FP), R5 24 | MOVD R0, R6 25 | MOVD R0, R7 26 | MOVD R0, R8 27 | MOVD trap+0(FP), R9 // syscall entry 28 | SYSCALL R9 29 | MOVD R3, r1+32(FP) 30 | MOVD R4, r2+40(FP) 31 | BL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 35 | MOVD a1+8(FP), R3 36 | MOVD a2+16(FP), R4 37 | MOVD a3+24(FP), R5 38 | MOVD R0, R6 39 | MOVD R0, R7 40 | MOVD R0, R8 41 | MOVD trap+0(FP), R9 // syscall entry 42 | SYSCALL R9 43 | MOVD R3, r1+32(FP) 44 | MOVD R4, r2+40(FP) 45 | RET 46 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | // +build riscv64 7 | // +build gc 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for linux/riscv64. 13 | // 14 | // Where available, just jump to package syscall's implementation of 15 | // these functions. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 24 | CALL runtime·entersyscall(SB) 25 | MOV a1+8(FP), A0 26 | MOV a2+16(FP), A1 27 | MOV a3+24(FP), A2 28 | MOV trap+0(FP), A7 // syscall entry 29 | ECALL 30 | MOV A0, r1+32(FP) // r1 31 | MOV A1, r2+40(FP) // r2 32 | CALL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | JMP syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | JMP syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOV a1+8(FP), A0 43 | MOV a2+16(FP), A1 44 | MOV a3+24(FP), A2 45 | MOV trap+0(FP), A7 // syscall entry 46 | ECALL 47 | MOV A0, r1+32(FP) 48 | MOV A1, r2+40(FP) 49 | RET 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | // +build linux 7 | // +build s390x 8 | // +build gc 9 | 10 | #include "textflag.h" 11 | 12 | // 13 | // System calls for s390x, Linux 14 | // 15 | 16 | // Just jump to package syscall's implementation for all these functions. 17 | // The runtime may know about them. 18 | 19 | TEXT ·Syscall(SB),NOSPLIT,$0-56 20 | BR syscall·Syscall(SB) 21 | 22 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 23 | BR syscall·Syscall6(SB) 24 | 25 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 26 | BL runtime·entersyscall(SB) 27 | MOVD a1+8(FP), R2 28 | MOVD a2+16(FP), R3 29 | MOVD a3+24(FP), R4 30 | MOVD $0, R5 31 | MOVD $0, R6 32 | MOVD $0, R7 33 | MOVD trap+0(FP), R1 // syscall entry 34 | SYSCALL 35 | MOVD R2, r1+32(FP) 36 | MOVD R3, r2+40(FP) 37 | BL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 41 | BR syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 44 | BR syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 47 | MOVD a1+8(FP), R2 48 | MOVD a2+16(FP), R3 49 | MOVD a3+24(FP), R4 50 | MOVD $0, R5 51 | MOVD $0, R6 52 | MOVD $0, R7 53 | MOVD trap+0(FP), R1 // syscall entry 54 | SYSCALL 55 | MOVD R2, r1+32(FP) 56 | MOVD R3, r2+40(FP) 57 | RET 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for mips64, OpenBSD 12 | // 13 | 14 | // Just jump to package syscall's implementation for all these functions. 15 | // The runtime may know about them. 16 | 17 | TEXT ·Syscall(SB),NOSPLIT,$0-56 18 | JMP syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | JMP syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | JMP syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | JMP syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | JMP syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | // +build gc 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 12 | // 13 | 14 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 15 | JMP syscall·sysvicall6(SB) 16 | 17 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 18 | JMP syscall·rawSysvicall6(SB) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | const ( 11 | R_OK = 0x4 12 | W_OK = 0x2 13 | X_OK = 0x1 14 | ) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc 6 | // +build aix,ppc 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev >> 16) & 0xffff) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32(dev & 0xffff) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | return uint64(((major) << 16) | (minor)) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | // +build aix,ppc64 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used AIX. 10 | 11 | package unix 12 | 13 | // Major returns the major component of a Linux device number. 14 | func Major(dev uint64) uint32 { 15 | return uint32((dev & 0x3fffffff00000000) >> 32) 16 | } 17 | 18 | // Minor returns the minor component of a Linux device number. 19 | func Minor(dev uint64) uint32 { 20 | return uint32((dev & 0x00000000ffffffff) >> 0) 21 | } 22 | 23 | // Mkdev returns a Linux device number generated from the given major and minor 24 | // components. 25 | func Mkdev(major, minor uint32) uint64 { 26 | var DEVNO64 uint64 27 | DEVNO64 = 0x8000000000000000 28 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | // +build zos,s390x 7 | 8 | // Functions to access/create device major and minor numbers matching the 9 | // encoding used by z/OS. 10 | // 11 | // The information below is extracted and adapted from macros. 12 | 13 | package unix 14 | 15 | // Major returns the major component of a z/OS device number. 16 | func Major(dev uint64) uint32 { 17 | return uint32((dev >> 16) & 0x0000FFFF) 18 | } 19 | 20 | // Minor returns the minor component of a z/OS device number. 21 | func Minor(dev uint64) uint32 { 22 | return uint32(dev & 0x0000FFFF) 23 | } 24 | 25 | // Mkdev returns a z/OS device number generated from the given major and minor 26 | // components. 27 | func Mkdev(major, minor uint32) uint64 { 28 | return (uint64(major) << 16) | uint64(minor) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | // +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64 7 | 8 | package unix 9 | 10 | const isBigEndian = true 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_little.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 6 | // +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh 7 | 8 | package unix 9 | 10 | const isBigEndian = false 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/env_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | // Unix environment variables. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | func Unsetenv(key string) error { 31 | return syscall.Unsetenv(key) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 13 | // systems by fcntl_linux_32bit.go to be SYS_FCNTL64. 14 | var fcntl64Syscall uintptr = SYS_FCNTL 15 | 16 | func fcntl(fd int, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 18 | var err error 19 | if errno != 0 { 20 | err = errno 21 | } 22 | return int(valptr), err 23 | } 24 | 25 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 26 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 27 | return fcntl(int(fd), cmd, arg) 28 | } 29 | 30 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 31 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 32 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 33 | if errno == 0 { 34 | return nil 35 | } 36 | return errno 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | // +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc 7 | 8 | package unix 9 | 10 | func init() { 11 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 12 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 13 | fcntl64Syscall = SYS_FCNTL64 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos 7 | 8 | package unix 9 | 10 | // Set adds fd to the set fds. 11 | func (fds *FdSet) Set(fd int) { 12 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 13 | } 14 | 15 | // Clear removes fd from the set fds. 16 | func (fds *FdSet) Clear(fd int) { 17 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 18 | } 19 | 20 | // IsSet returns whether fd is in the set fds. 21 | func (fds *FdSet) IsSet(fd int) bool { 22 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 23 | } 24 | 25 | // Zero clears the set fds. 26 | func (fds *FdSet) Zero() { 27 | for i := range fds.Bits { 28 | fds.Bits[i] = 0 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | // +build gccgo,linux,amd64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //extern gettimeofday 13 | func realGettimeofday(*Timeval, *byte) int32 14 | 15 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 16 | r := realGettimeofday(tv, nil) 17 | if r < 0 { 18 | return syscall.GetErrno() 19 | } 20 | return 0 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | // For Unix, get the pagesize from the runtime. 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Getpagesize() int { 15 | return syscall.Getpagesize() 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 11 | return ptrace1(request, pid, addr, data) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | // +build ios 7 | 8 | package unix 9 | 10 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 11 | return ENOTSUP 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | // +build darwin,race linux,race freebsd,race 7 | 8 | package unix 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | // +build aix dragonfly freebsd linux netbsd openbsd 7 | 8 | package unix 9 | 10 | // ReadDirent reads directory entries from fd and writes them into buf. 11 | func ReadDirent(fd int, buf []byte) (n int, err error) { 12 | return Getdents(fd, buf) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 6 | // +build darwin 7 | 8 | package unix 9 | 10 | import "unsafe" 11 | 12 | // ReadDirent reads directory entries from fd and writes them into buf. 13 | func ReadDirent(fd int, buf []byte) (n int, err error) { 14 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 15 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 16 | // actual system call is getdirentries64, 64 is a good guess. 17 | // TODO(rsc): Can we use a single global basep for all calls? 18 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 19 | return Getdirentries(fd, buf, base) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris 6 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 7 | 8 | package unix 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + uitoa(uint(-val)) 13 | } 14 | return uitoa(uint(val)) 15 | } 16 | 17 | func uitoa(val uint) string { 18 | var buf [32]byte // big enough for int64 19 | i := len(buf) - 1 20 | for val >= 10 { 21 | buf[i] = byte(val%10 + '0') 22 | i-- 23 | val /= 10 24 | } 25 | buf[i] = byte(val + '0') 26 | return string(buf[i:]) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin.1_12.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 && !go1.13 6 | // +build darwin,go1.12,!go1.13 7 | 8 | package unix 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const _SYS_GETDIRENTRIES64 = 344 15 | 16 | func Getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { 17 | // To implement this using libSystem we'd need syscall_syscallPtr for 18 | // fdopendir. However, syscallPtr was only added in Go 1.13, so we fall 19 | // back to raw syscalls for this func on Go 1.12. 20 | var p unsafe.Pointer 21 | if len(buf) > 0 { 22 | p = unsafe.Pointer(&buf[0]) 23 | } else { 24 | p = unsafe.Pointer(&_zero) 25 | } 26 | r0, _, e1 := Syscall6(_SYS_GETDIRENTRIES64, uintptr(fd), uintptr(p), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), 0, 0) 27 | n = int(r0) 28 | if e1 != 0 { 29 | return n, errnoErr(e1) 30 | } 31 | return n, nil 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && go1.12 6 | // +build darwin,go1.12 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_darwin.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 17 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 18 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 19 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 20 | 21 | //go:linkname syscall_syscall syscall.syscall 22 | //go:linkname syscall_syscall6 syscall.syscall6 23 | //go:linkname syscall_syscall6X syscall.syscall6X 24 | //go:linkname syscall_syscall9 syscall.syscall9 25 | //go:linkname syscall_rawSyscall syscall.rawSyscall 26 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 27 | //go:linkname syscall_syscallPtr syscall.syscallPtr 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | // +build linux 7 | // +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64 8 | 9 | package unix 10 | 11 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 12 | // values. 13 | 14 | //sys Alarm(seconds uint) (remaining uint, err error) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | // +build amd64,linux,gc 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | //go:noescape 13 | func gettimeofday(tv *Timeval) (err syscall.Errno) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | // +build linux,gc 7 | 8 | package unix 9 | 10 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 11 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 12 | 13 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 14 | // fail. 15 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 16 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc && 386 6 | // +build linux,gc,386 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | 16 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | // +build arm,gc,linux 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | // Underlying system call writes to newoffset via pointer. 13 | // Implemented in assembly to avoid allocation. 14 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | // +build linux,gccgo,386 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | 23 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 24 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 25 | return int(fd), err 26 | } 27 | 28 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 29 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 30 | return int(fd), err 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && arm 6 | // +build linux,gccgo,arm 7 | 8 | package unix 9 | 10 | import ( 11 | "syscall" 12 | "unsafe" 13 | ) 14 | 15 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 16 | var newoffset int64 17 | offsetLow := uint32(offset & 0xffffffff) 18 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 19 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 20 | return newoffset, err 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && netbsd 6 | // +build 386,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | // +build amd64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | // +build arm,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | // +build arm64,netbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = uint32(mode) 21 | k.Flags = uint32(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = int32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | // +build 386,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | // +build amd64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | // +build arm,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: int32(nsec)} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: int32(usec)} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint32(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint32(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | // +build arm64,openbsd 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 19 | k.Ident = uint64(fd) 20 | k.Filter = int16(mode) 21 | k.Flags = uint16(flags) 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetIovlen(length int) { 33 | msghdr.Iovlen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 41 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 42 | const SYS___SYSCTL = SYS_SYSCTL 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (openbsd && 386) || (openbsd && amd64) || (openbsd && arm64) 6 | // +build openbsd,386 openbsd,amd64 openbsd,arm64 7 | 8 | package unix 9 | 10 | import _ "unsafe" 11 | 12 | // Implemented in the runtime package (runtime/sys_openbsd3.go) 13 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 17 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 18 | 19 | //go:linkname syscall_syscall syscall.syscall 20 | //go:linkname syscall_syscall6 syscall.syscall6 21 | //go:linkname syscall_syscall10 syscall.syscall10 22 | //go:linkname syscall_rawSyscall syscall.rawSyscall 23 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 24 | 25 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 26 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | // +build amd64,solaris 7 | 8 | package unix 9 | 10 | func setTimespec(sec, nsec int64) Timespec { 11 | return Timespec{Sec: sec, Nsec: nsec} 12 | } 13 | 14 | func setTimeval(sec, usec int64) Timeval { 15 | return Timeval{Sec: sec, Usec: usec} 16 | } 17 | 18 | func (iov *Iovec) SetLen(length int) { 19 | iov.Len = uint64(length) 20 | } 21 | 22 | func (msghdr *Msghdr) SetIovlen(length int) { 23 | msghdr.Iovlen = int32(length) 24 | } 25 | 26 | func (cmsg *Cmsghdr) SetLen(length int) { 27 | cmsg.Len = uint32(length) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris) && gc && !ppc64le && !ppc64 6 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 7 | // +build gc 8 | // +build !ppc64le 9 | // +build !ppc64 10 | 11 | package unix 12 | 13 | import "syscall" 14 | 15 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 18 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 19 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | // +build linux 7 | // +build ppc64le ppc64 8 | // +build gc 9 | 10 | package unix 11 | 12 | import "syscall" 13 | 14 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall(trap, a1, a2, a3) 16 | } 17 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 19 | } 20 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall(trap, a1, a2, a3) 22 | } 23 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 24 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | // +build linux 7 | 8 | package unix 9 | 10 | import "runtime" 11 | 12 | // SysvShmCtl performs control operations on the shared memory segment 13 | // specified by id. 14 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 15 | if runtime.GOARCH == "arm" || 16 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 17 | cmd |= ipc_64 18 | } 19 | 20 | return shmctl(id, cmd, desc) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | // +build darwin,!ios 7 | 8 | package unix 9 | 10 | // SysvShmCtl performs control operations on the shared memory segment 11 | // specified by id. 12 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 13 | return shmctl(id, cmd, desc) 14 | } 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import ( 8 | "syscall" 9 | "unsafe" 10 | ) 11 | 12 | // Unveil implements the unveil syscall. 13 | // For more information see unveil(2). 14 | // Note that the special case of blocking further 15 | // unveil calls is handled by UnveilBlock. 16 | func Unveil(path string, flags string) error { 17 | pathPtr, err := syscall.BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := syscall.BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 26 | if e != 0 { 27 | return e 28 | } 29 | return nil 30 | } 31 | 32 | // UnveilBlock blocks future unveil calls. 33 | // For more information see unveil(2). 34 | func UnveilBlock() error { 35 | // Both pointers must be nil. 36 | var pathUnsafe, flagsUnsafe unsafe.Pointer 37 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 38 | if e != 0 { 39 | return e 40 | } 41 | return nil 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | // +build linux 5 | // +build arm arm64 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // PtraceRegsArm is the registers used by arm binaries. 12 | type PtraceRegsArm struct { 13 | Uregs [18]uint32 14 | } 15 | 16 | // PtraceGetRegsArm fetches the registers used by arm binaries. 17 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 18 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 19 | } 20 | 21 | // PtraceSetRegsArm sets the registers used by arm binaries. 22 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 23 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 24 | } 25 | 26 | // PtraceRegsArm64 is the registers used by arm64 binaries. 27 | type PtraceRegsArm64 struct { 28 | Regs [31]uint64 29 | Sp uint64 30 | Pc uint64 31 | Pstate uint64 32 | } 33 | 34 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 35 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 36 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 37 | } 38 | 39 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 40 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 41 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptrace(PTRACE_GETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptrace(PTRACE_SETREGSET, pid, uintptr(addr), uintptr(unsafe.Pointer(&iovec))) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,amd64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && amd64 && go1.13 5 | // +build darwin,amd64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm.go darwin amd64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.go: -------------------------------------------------------------------------------- 1 | // go run mksyscall.go -tags darwin,arm64,go1.13 syscall_darwin.1_13.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build darwin && arm64 && go1.13 5 | // +build darwin,arm64,go1.13 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var _ syscall.Errno 15 | 16 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 17 | 18 | func closedir(dir uintptr) (err error) { 19 | _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, uintptr(dir), 0, 0) 20 | if e1 != 0 { 21 | err = errnoErr(e1) 22 | } 23 | return 24 | } 25 | 26 | var libc_closedir_trampoline_addr uintptr 27 | 28 | //go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" 29 | 30 | // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT 31 | 32 | func readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) { 33 | r0, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, uintptr(dir), uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) 34 | res = Errno(r0) 35 | return 36 | } 37 | 38 | var libc_readdir_r_trampoline_addr uintptr 39 | 40 | //go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.1_13.s: -------------------------------------------------------------------------------- 1 | // go run mkasm.go darwin arm64 2 | // Code generated by the command above; DO NOT EDIT. 3 | 4 | //go:build go1.13 5 | // +build go1.13 6 | 7 | #include "textflag.h" 8 | 9 | TEXT libc_fdopendir_trampoline<>(SB),NOSPLIT,$0-0 10 | JMP libc_fdopendir(SB) 11 | 12 | GLOBL ·libc_fdopendir_trampoline_addr(SB), RODATA, $8 13 | DATA ·libc_fdopendir_trampoline_addr(SB)/8, $libc_fdopendir_trampoline<>(SB) 14 | 15 | TEXT libc_closedir_trampoline<>(SB),NOSPLIT,$0-0 16 | JMP libc_closedir(SB) 17 | 18 | GLOBL ·libc_closedir_trampoline_addr(SB), RODATA, $8 19 | DATA ·libc_closedir_trampoline_addr(SB)/8, $libc_closedir_trampoline<>(SB) 20 | 21 | TEXT libc_readdir_r_trampoline<>(SB),NOSPLIT,$0-0 22 | JMP libc_readdir_r(SB) 23 | 24 | GLOBL ·libc_readdir_r_trampoline_addr(SB), RODATA, $8 25 | DATA ·libc_readdir_r_trampoline_addr(SB)/8, $libc_readdir_r_trampoline<>(SB) 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ztypes_illumos_amd64.go: -------------------------------------------------------------------------------- 1 | // cgo -godefs types_illumos.go | go run mkpost.go 2 | // Code generated by the command above; see README.md. DO NOT EDIT. 3 | 4 | //go:build amd64 && illumos 5 | // +build amd64,illumos 6 | 7 | package unix 8 | 9 | const ( 10 | TUNNEWPPA = 0x540001 11 | TUNSETPPA = 0x540002 12 | 13 | I_STR = 0x5308 14 | I_POP = 0x5303 15 | I_PUSH = 0x5302 16 | I_LINK = 0x530c 17 | I_UNLINK = 0x530d 18 | I_PLINK = 0x5316 19 | I_PUNLINK = 0x5317 20 | 21 | IF_UNITSEL = -0x7ffb8cca 22 | ) 23 | 24 | type strbuf struct { 25 | Maxlen int32 26 | Len int32 27 | Buf *int8 28 | } 29 | 30 | type Strioctl struct { 31 | Cmd int32 32 | Timout int32 33 | Len int32 34 | Dp *int8 35 | } 36 | 37 | type Lifreq struct { 38 | Name [32]int8 39 | Lifru1 [4]byte 40 | Type uint32 41 | Lifru [336]byte 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && go1.9 6 | // +build windows,go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/empty.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.12 6 | // +build !go1.12 7 | 8 | // This file is here to allow bodyless functions with go:linkname for Go 1.11 9 | // and earlier (see https://golang.org/issue/23311). 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | // +build windows 7 | 8 | package windows 9 | 10 | const ( 11 | EVENTLOG_SUCCESS = 0 12 | EVENTLOG_ERROR_TYPE = 1 13 | EVENTLOG_WARNING_TYPE = 2 14 | EVENTLOG_INFORMATION_TYPE = 4 15 | EVENTLOG_AUDIT_SUCCESS = 8 16 | EVENTLOG_AUDIT_FAILURE = 16 17 | ) 18 | 19 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 20 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 21 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 22 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | // +build generate 7 | 8 | package windows 9 | 10 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 11 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | // +build windows,race 7 | 8 | package windows 9 | 10 | import ( 11 | "runtime" 12 | "unsafe" 13 | ) 14 | 15 | const raceenabled = true 16 | 17 | func raceAcquire(addr unsafe.Pointer) { 18 | runtime.RaceAcquire(addr) 19 | } 20 | 21 | func raceReleaseMerge(addr unsafe.Pointer) { 22 | runtime.RaceReleaseMerge(addr) 23 | } 24 | 25 | func raceReadRange(addr unsafe.Pointer, len int) { 26 | runtime.RaceReadRange(addr, len) 27 | } 28 | 29 | func raceWriteRange(addr unsafe.Pointer, len int) { 30 | runtime.RaceWriteRange(addr, len) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && !race 6 | // +build windows,!race 7 | 8 | package windows 9 | 10 | import ( 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = false 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | } 18 | 19 | func raceReleaseMerge(addr unsafe.Pointer) { 20 | } 21 | 22 | func raceReadRange(addr unsafe.Pointer, len int) { 23 | } 24 | 25 | func raceWriteRange(addr unsafe.Pointer, len int) { 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | // +build windows 7 | 8 | package windows 9 | 10 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 11 | if val < 0 { 12 | return "-" + itoa(-val) 13 | } 14 | var buf [32]byte // big enough for int64 15 | i := len(buf) - 1 16 | for val >= 10 { 17 | buf[i] = byte(val%10 + '0') 18 | i-- 19 | val /= 10 20 | } 21 | buf[i] = byte(val + '0') 22 | return string(buf[i:]) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/AUTHORS: -------------------------------------------------------------------------------- 1 | # This source code refers to The Go Authors for copyright purposes. 2 | # The master list of authors is in the main Go distribution, 3 | # visible at http://tip.golang.org/AUTHORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to Go 2 | 3 | Go is an open source project. 4 | 5 | It is the work of hundreds of contributors. We appreciate your help! 6 | 7 | ## Filing issues 8 | 9 | When [filing an issue](https://golang.org/issue/new), make sure to answer these five questions: 10 | 11 | 1. What version of Go are you using (`go version`)? 12 | 2. What operating system and processor architecture are you using? 13 | 3. What did you do? 14 | 4. What did you expect to see? 15 | 5. What did you see instead? 16 | 17 | General questions should go to the [golang-nuts mailing list](https://groups.google.com/group/golang-nuts) instead of the issue tracker. 18 | The gophers there will answer or ask you to file an issue if you've tripped over a bug. 19 | 20 | ## Contributing code 21 | 22 | Please read the [Contribution Guidelines](https://golang.org/doc/contribute.html) 23 | before sending patches. 24 | 25 | Unless otherwise noted, the Go source files are distributed under 26 | the BSD-style license found in the LICENSE file. 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This source code was written by the Go contributors. 2 | # The master list of contributors is in the main Go distribution, 3 | # visible at http://tip.golang.org/CONTRIBUTORS. 4 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/README.md: -------------------------------------------------------------------------------- 1 | # Go terminal/console support 2 | 3 | [![Go Reference](https://pkg.go.dev/badge/golang.org/x/term.svg)](https://pkg.go.dev/golang.org/x/term) 4 | 5 | This repository provides Go terminal and console support packages. 6 | 7 | ## Download/Install 8 | 9 | The easiest way to install is to run `go get -u golang.org/x/term`. You can 10 | also manually git clone the repository to `$GOPATH/src/golang.org/x/term`. 11 | 12 | ## Report Issues / Send Patches 13 | 14 | This repository uses Gerrit for code changes. To learn how to submit changes to 15 | this repository, see https://golang.org/doc/contribute.html. 16 | 17 | The main issue tracker for the term repository is located at 18 | https://github.com/golang/go/issues. Prefix your issue with "x/term:" in the 19 | subject line, so it is easy to find. 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/codereview.cfg: -------------------------------------------------------------------------------- 1 | issuerepo: golang/go 2 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_plan9.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package term 6 | 7 | import ( 8 | "fmt" 9 | "runtime" 10 | 11 | "golang.org/x/sys/plan9" 12 | ) 13 | 14 | type state struct{} 15 | 16 | func isTerminal(fd int) bool { 17 | path, err := plan9.Fd2path(fd) 18 | if err != nil { 19 | return false 20 | } 21 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 22 | } 23 | 24 | func makeRaw(fd int) (*State, error) { 25 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 26 | } 27 | 28 | func getState(fd int) (*State, error) { 29 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 30 | } 31 | 32 | func restore(fd int, state *State) error { 33 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 34 | } 35 | 36 | func getSize(fd int) (width, height int, err error) { 37 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 38 | } 39 | 40 | func readPassword(fd int) ([]byte, error) { 41 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_unix_bsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || dragonfly || freebsd || netbsd || openbsd 6 | // +build darwin dragonfly freebsd netbsd openbsd 7 | 8 | package term 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TIOCGETA 13 | const ioctlWriteTermios = unix.TIOCSETA 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || linux || solaris || zos 6 | // +build aix linux solaris zos 7 | 8 | package term 9 | 10 | import "golang.org/x/sys/unix" 11 | 12 | const ioctlReadTermios = unix.TCGETS 13 | const ioctlWriteTermios = unix.TCSETS 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/term/term_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9 6 | // +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!zos,!windows,!solaris,!plan9 7 | 8 | package term 9 | 10 | import ( 11 | "fmt" 12 | "runtime" 13 | ) 14 | 15 | type state struct{} 16 | 17 | func isTerminal(fd int) bool { 18 | return false 19 | } 20 | 21 | func makeRaw(fd int) (*State, error) { 22 | return nil, fmt.Errorf("terminal: MakeRaw not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 23 | } 24 | 25 | func getState(fd int) (*State, error) { 26 | return nil, fmt.Errorf("terminal: GetState not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 27 | } 28 | 29 | func restore(fd int, state *State) error { 30 | return fmt.Errorf("terminal: Restore not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 31 | } 32 | 33 | func getSize(fd int) (width, height int, err error) { 34 | return 0, 0, fmt.Errorf("terminal: GetSize not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 35 | } 36 | 37 | func readPassword(fd int) ([]byte, error) { 38 | return nil, fmt.Errorf("terminal: ReadPassword not implemented on %s/%s", runtime.GOOS, runtime.GOARCH) 39 | } 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | --------------------------------------------------------------------------------