├── .github └── workflows │ └── test.yml ├── LICENSE ├── Makefile ├── README.md ├── _examples ├── columns │ └── main.go ├── confirm │ └── main.go ├── input │ └── main.go ├── listselect-long │ └── main.go ├── listselect │ └── main.go ├── multiselect-long │ └── main.go ├── multiselect │ └── main.go └── password │ └── main.go ├── components ├── button.go ├── checkbox.go ├── column_layout.go ├── frame.go ├── input.go ├── list-select.go ├── multi-list-select.go ├── password.go ├── row_layout.go ├── scrollbar.go ├── setup_test.go ├── spacer.go ├── text.go └── text_test.go ├── core ├── alignment.go ├── canvas.go ├── colour.go ├── colour_test.go ├── component.go ├── container.go ├── core.go ├── input.go ├── selector.go ├── size.go └── style.go ├── example_confirm.png ├── example_input.png ├── example_list.png ├── example_multi.png ├── example_password.png ├── go.mod ├── go.sum ├── new.go ├── vendor ├── github.com │ ├── davecgh │ │ └── go-spew │ │ │ ├── LICENSE │ │ │ └── spew │ │ │ ├── bypass.go │ │ │ ├── bypasssafe.go │ │ │ ├── common.go │ │ │ ├── config.go │ │ │ ├── doc.go │ │ │ ├── dump.go │ │ │ ├── format.go │ │ │ └── spew.go │ ├── gdamore │ │ ├── encoding │ │ │ ├── .appveyor.yml │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── ascii.go │ │ │ ├── charmap.go │ │ │ ├── doc.go │ │ │ ├── ebcdic.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── latin1.go │ │ │ ├── latin5.go │ │ │ └── utf8.go │ │ └── tcell │ │ │ └── v2 │ │ │ ├── .appveyor.yml │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── AUTHORS │ │ │ ├── CHANGESv2.adoc │ │ │ ├── LICENSE │ │ │ ├── README.adoc │ │ │ ├── TUTORIAL.adoc │ │ │ ├── attr.go │ │ │ ├── cell.go │ │ │ ├── charset_stub.go │ │ │ ├── charset_unix.go │ │ │ ├── charset_windows.go │ │ │ ├── color.go │ │ │ ├── colorfit.go │ │ │ ├── console_stub.go │ │ │ ├── console_win.go │ │ │ ├── doc.go │ │ │ ├── encoding.go │ │ │ ├── errors.go │ │ │ ├── event.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── interrupt.go │ │ │ ├── key.go │ │ │ ├── mouse.go │ │ │ ├── paste.go │ │ │ ├── resize.go │ │ │ ├── runes.go │ │ │ ├── screen.go │ │ │ ├── simulation.go │ │ │ ├── style.go │ │ │ ├── terminfo │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── TERMINALS.md │ │ │ ├── a │ │ │ │ ├── aixterm │ │ │ │ │ └── term.go │ │ │ │ ├── alacritty │ │ │ │ │ └── term.go │ │ │ │ └── ansi │ │ │ │ │ └── term.go │ │ │ ├── b │ │ │ │ └── beterm │ │ │ │ │ └── term.go │ │ │ ├── base │ │ │ │ └── base.go │ │ │ ├── c │ │ │ │ └── cygwin │ │ │ │ │ └── term.go │ │ │ ├── d │ │ │ │ └── dtterm │ │ │ │ │ └── term.go │ │ │ ├── dynamic │ │ │ │ └── dynamic.go │ │ │ ├── e │ │ │ │ └── emacs │ │ │ │ │ └── term.go │ │ │ ├── extended │ │ │ │ └── extended.go │ │ │ ├── g │ │ │ │ └── gnome │ │ │ │ │ └── term.go │ │ │ ├── gen.sh │ │ │ ├── h │ │ │ │ └── hpterm │ │ │ │ │ └── term.go │ │ │ ├── k │ │ │ │ ├── konsole │ │ │ │ │ └── term.go │ │ │ │ └── kterm │ │ │ │ │ └── term.go │ │ │ ├── l │ │ │ │ └── linux │ │ │ │ │ └── term.go │ │ │ ├── models.txt │ │ │ ├── p │ │ │ │ └── pcansi │ │ │ │ │ └── term.go │ │ │ ├── r │ │ │ │ └── rxvt │ │ │ │ │ └── term.go │ │ │ ├── s │ │ │ │ ├── screen │ │ │ │ │ └── term.go │ │ │ │ ├── simpleterm │ │ │ │ │ └── term.go │ │ │ │ └── sun │ │ │ │ │ └── term.go │ │ │ ├── t │ │ │ │ ├── termite │ │ │ │ │ └── term.go │ │ │ │ └── tmux │ │ │ │ │ └── term.go │ │ │ ├── terminfo.go │ │ │ ├── v │ │ │ │ ├── vt100 │ │ │ │ │ └── term.go │ │ │ │ ├── vt102 │ │ │ │ │ └── term.go │ │ │ │ ├── vt220 │ │ │ │ │ └── term.go │ │ │ │ ├── vt320 │ │ │ │ │ └── term.go │ │ │ │ ├── vt400 │ │ │ │ │ └── term.go │ │ │ │ ├── vt420 │ │ │ │ │ └── term.go │ │ │ │ └── vt52 │ │ │ │ │ └── term.go │ │ │ ├── w │ │ │ │ ├── wy50 │ │ │ │ │ └── term.go │ │ │ │ ├── wy60 │ │ │ │ │ └── term.go │ │ │ │ └── wy99_ansi │ │ │ │ │ └── term.go │ │ │ └── x │ │ │ │ ├── xfce │ │ │ │ └── term.go │ │ │ │ ├── xterm │ │ │ │ └── term.go │ │ │ │ ├── xterm_kitty │ │ │ │ └── term.go │ │ │ │ └── xterm_termite │ │ │ │ └── term.go │ │ │ ├── terms_default.go │ │ │ ├── terms_dynamic.go │ │ │ ├── terms_static.go │ │ │ ├── tscreen.go │ │ │ ├── tscreen_bsd.go │ │ │ ├── tscreen_darwin.go │ │ │ ├── tscreen_linux.go │ │ │ ├── tscreen_solaris.go │ │ │ ├── tscreen_stub.go │ │ │ └── tscreen_windows.go │ ├── lucasb-eyer │ │ └── go-colorful │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── colorgens.go │ │ │ ├── colors.go │ │ │ ├── go.mod │ │ │ ├── go.sum │ │ │ ├── happy_palettegen.go │ │ │ ├── hexcolor.go │ │ │ ├── soft_palettegen.go │ │ │ └── warm_palettegen.go │ ├── mattn │ │ └── go-runewidth │ │ │ ├── .travis.yml │ │ │ ├── LICENSE │ │ │ ├── README.mkd │ │ │ ├── go.mod │ │ │ ├── runewidth.go │ │ │ ├── runewidth_appengine.go │ │ │ ├── runewidth_js.go │ │ │ ├── runewidth_posix.go │ │ │ ├── runewidth_table.go │ │ │ └── runewidth_windows.go │ ├── pmezard │ │ └── go-difflib │ │ │ ├── LICENSE │ │ │ └── difflib │ │ │ └── difflib.go │ └── stretchr │ │ └── testify │ │ ├── LICENSE │ │ └── assert │ │ ├── assertion_compare.go │ │ ├── assertion_format.go │ │ ├── assertion_format.go.tmpl │ │ ├── assertion_forward.go │ │ ├── assertion_forward.go.tmpl │ │ ├── assertion_order.go │ │ ├── assertions.go │ │ ├── doc.go │ │ ├── errors.go │ │ ├── forward_assertions.go │ │ └── http_assertions.go ├── golang.org │ └── x │ │ ├── sys │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── unix │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── affinity_linux.go │ │ │ ├── aliases.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_darwin_386.s │ │ │ ├── asm_darwin_amd64.s │ │ │ ├── asm_darwin_arm.s │ │ │ ├── asm_darwin_arm64.s │ │ │ ├── asm_dragonfly_amd64.s │ │ │ ├── asm_freebsd_386.s │ │ │ ├── asm_freebsd_amd64.s │ │ │ ├── asm_freebsd_arm.s │ │ │ ├── asm_freebsd_arm64.s │ │ │ ├── asm_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_riscv64.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_netbsd_386.s │ │ │ ├── asm_netbsd_amd64.s │ │ │ ├── asm_netbsd_arm.s │ │ │ ├── asm_netbsd_arm64.s │ │ │ ├── asm_openbsd_386.s │ │ │ ├── asm_openbsd_amd64.s │ │ │ ├── asm_openbsd_arm.s │ │ │ ├── asm_openbsd_arm64.s │ │ │ ├── asm_solaris_amd64.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 │ │ │ ├── dirent.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── env_unix.go │ │ │ ├── errors_freebsd_386.go │ │ │ ├── errors_freebsd_amd64.go │ │ │ ├── errors_freebsd_arm.go │ │ │ ├── fcntl.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ioctl.go │ │ │ ├── mkall.sh │ │ │ ├── mkerrors.sh │ │ │ ├── pagesize_unix.go │ │ │ ├── pledge_openbsd.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_aix.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_aix_ppc64.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_386.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm.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_linux.go │ │ │ ├── syscall_linux_386.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_gccgo_386.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_linux_mips64x.go │ │ │ ├── syscall_linux_mipsx.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_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── timestruct.go │ │ │ ├── unveil_openbsd.go │ │ │ ├── xattr_bsd.go │ │ │ ├── zerrors_aix_ppc.go │ │ │ ├── zerrors_aix_ppc64.go │ │ │ ├── zerrors_darwin_386.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm.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_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.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_solaris_amd64.go │ │ │ ├── zptrace386_linux.go │ │ │ ├── zptracearm_linux.go │ │ │ ├── zptracemips_linux.go │ │ │ ├── zptracemipsle_linux.go │ │ │ ├── zsyscall_aix_ppc.go │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ ├── zsyscall_darwin_386.1_11.go │ │ │ ├── zsyscall_darwin_386.go │ │ │ ├── zsyscall_darwin_386.s │ │ │ ├── zsyscall_darwin_amd64.1_11.go │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ ├── zsyscall_darwin_arm.1_11.go │ │ │ ├── zsyscall_darwin_arm.go │ │ │ ├── zsyscall_darwin_arm.s │ │ │ ├── zsyscall_darwin_arm64.1_11.go │ │ │ ├── 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_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.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_amd64.go │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysctl_openbsd_arm64.go │ │ │ ├── zsysnum_darwin_386.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm.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_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.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 │ │ │ ├── ztypes_aix_ppc.go │ │ │ ├── ztypes_aix_ppc64.go │ │ │ ├── ztypes_darwin_386.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm.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_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.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_solaris_amd64.go │ │ └── text │ │ ├── AUTHORS │ │ ├── CONTRIBUTORS │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── encoding │ │ ├── encoding.go │ │ └── internal │ │ │ └── identifier │ │ │ ├── identifier.go │ │ │ └── mib.go │ │ └── transform │ │ └── transform.go ├── gopkg.in │ └── yaml.v3 │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── NOTICE │ │ ├── README.md │ │ ├── apic.go │ │ ├── decode.go │ │ ├── emitterc.go │ │ ├── encode.go │ │ ├── go.mod │ │ ├── parserc.go │ │ ├── readerc.go │ │ ├── resolve.go │ │ ├── scannerc.go │ │ ├── sorter.go │ │ ├── writerc.go │ │ ├── yaml.go │ │ ├── yamlh.go │ │ └── yamlprivateh.go └── modules.txt ├── widgets ├── confirm.go ├── inputbox.go ├── listselect.go ├── multiselect.go └── passwordinputbox.go └── window ├── base_canvas.go ├── base_canvas_test.go ├── cutout_canvas.go ├── cutout_canvas_test.go ├── window.go └── window_test.go /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | name: Test 3 | jobs: 4 | test: 5 | strategy: 6 | matrix: 7 | go-version: [1.14.x, 1.15.x] 8 | os: [ubuntu-latest, macos-latest, windows-latest] 9 | runs-on: ${{ matrix.os }} 10 | steps: 11 | - name: Install Go 12 | uses: actions/setup-go@v2 13 | with: 14 | go-version: ${{ matrix.go-version }} 15 | - name: Checkout code 16 | uses: actions/checkout@v2 17 | - name: Test 18 | run: make test 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | test: 3 | go test ./... -race -cover -v 4 | 5 | demo: 6 | go run _examples/columns/main.go 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flinch 2 | 3 | A collection of terminal-based widgets for richer Golang CLI apps. 4 | 5 | Ships with a library to build your own widgets/TUIs too. 6 | 7 | **Warning**: This module is experimental right now. 8 | 9 | ### Input 10 | 11 | ![](example_input.png) 12 | 13 | ```golang 14 | name, _ := widgets.Input("Enter your name...") 15 | ``` 16 | 17 | ### Password Input 18 | 19 | ![](example_password.png) 20 | 21 | ```golang 22 | password, _ := widgets.PasswordInput("Enter your password...") 23 | ``` 24 | 25 | ### List Selection 26 | 27 | ![](example_list.png) 28 | 29 | ```golang 30 | _, item, err := widgets.ListSelect( 31 | "Select an environment...", 32 | []string{ 33 | "Development", 34 | "Test", 35 | "Staging", 36 | "Production", 37 | }, 38 | ) 39 | ``` 40 | 41 | ### Multi List Selection 42 | 43 | ![](example_multi.png) 44 | 45 | ```golang 46 | _, items, err := widgets.MultiSelect( 47 | "Select an option...", 48 | options, 49 | ) 50 | ``` 51 | 52 | (scrollbars appear for long lists) 53 | 54 | ### Confirmation 55 | 56 | ![](example_confirm.png) 57 | 58 | ```golang 59 | userConfirmed, _ := widgets.Confirm("Are you sure?") 60 | ``` 61 | 62 | ## Try It Out 63 | 64 | You can play with the examples by running them directly, e.g. 65 | 66 | ```bash 67 | go run ./_examples/multiselect-long/ 68 | ``` 69 | 70 | ## Build Your Own Widgets 71 | 72 | Check out the [widgets](widgets) package for inspiration. 73 | -------------------------------------------------------------------------------- /_examples/columns/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/liamg/flinch/components" 5 | "github.com/liamg/flinch/core" 6 | window2 "github.com/liamg/flinch/window" 7 | ) 8 | 9 | func main() { 10 | 11 | window, err := window2.New() 12 | if err != nil { 13 | panic(err) 14 | } 15 | 16 | textA := components.NewText("AAAAA").SetAlignment(core.AlignCenter) 17 | textA.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 18 | textB := components.NewText("BBBBB").SetAlignment(core.AlignCenter) 19 | textB.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 20 | textC := components.NewText("CCCCC").SetAlignment(core.AlignCenter) 21 | textC.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 22 | 23 | //window.SetAlignment(core.AlignCenter) 24 | window.Add(textA) 25 | window.Add(textB) 26 | window.Add(textC) 27 | 28 | if err := window.Show(); err != nil { 29 | panic(err) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /_examples/confirm/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/liamg/flinch/widgets" 7 | ) 8 | 9 | func main() { 10 | 11 | confirmed, err := widgets.Confirm("Are you sure?") 12 | if err != nil { 13 | panic(err) 14 | } 15 | 16 | fmt.Printf("Confirmed: %t\n", confirmed) 17 | } 18 | -------------------------------------------------------------------------------- /_examples/input/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/liamg/flinch/widgets" 7 | ) 8 | 9 | func main() { 10 | 11 | name, err := widgets.Input("Enter your name...") 12 | if err == widgets.ErrInputCancelled { 13 | fmt.Println("User cancelled.") 14 | return 15 | } 16 | 17 | fmt.Printf("Hello, %s!\n", name) 18 | } 19 | -------------------------------------------------------------------------------- /_examples/listselect-long/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/liamg/flinch/widgets" 7 | ) 8 | 9 | func main() { 10 | 11 | var options []string 12 | for i := 0; i < 100; i++ { 13 | options = append(options, fmt.Sprintf("Option %d", i)) 14 | } 15 | 16 | _, item, err := widgets.ListSelect( 17 | "Select an option...", 18 | options, 19 | ) 20 | if err == widgets.ErrInputCancelled { 21 | fmt.Println("User cancelled.") 22 | return 23 | } 24 | 25 | fmt.Printf("You selected %s.\n", item) 26 | } 27 | -------------------------------------------------------------------------------- /_examples/listselect/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/liamg/flinch/widgets" 7 | ) 8 | 9 | func main() { 10 | 11 | _, item, err := widgets.ListSelect( 12 | "Select an environment...", 13 | []string{ 14 | "Development", 15 | "Test", 16 | "Staging", 17 | "Production", 18 | }, 19 | ) 20 | if err == widgets.ErrInputCancelled { 21 | fmt.Println("User cancelled.") 22 | return 23 | } 24 | 25 | fmt.Printf("You selected %s.\n", item) 26 | } 27 | -------------------------------------------------------------------------------- /_examples/multiselect-long/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/liamg/flinch/widgets" 8 | ) 9 | 10 | func main() { 11 | 12 | var options []string 13 | for i := 0; i < 100; i++ { 14 | options = append(options, fmt.Sprintf("Option %d", i)) 15 | } 16 | 17 | _, items, err := widgets.MultiSelect( 18 | "Select an option...", 19 | options, 20 | ) 21 | if err == widgets.ErrInputCancelled { 22 | fmt.Println("User cancelled.") 23 | return 24 | } 25 | 26 | fmt.Printf("You selected %s.\n", strings.Join(items, ", ")) 27 | } 28 | -------------------------------------------------------------------------------- /_examples/multiselect/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "strings" 6 | 7 | "github.com/liamg/flinch/widgets" 8 | ) 9 | 10 | func main() { 11 | 12 | _, items, err := widgets.MultiSelect( 13 | "Select one or more environment(s)...", 14 | []string{ 15 | "Development", 16 | "Test", 17 | "Staging", 18 | "Production", 19 | }, 20 | ) 21 | if err == widgets.ErrInputCancelled { 22 | fmt.Println("User cancelled.") 23 | return 24 | } 25 | 26 | fmt.Printf("You selected %s.\n", strings.Join(items, ", ")) 27 | } 28 | -------------------------------------------------------------------------------- /_examples/password/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | 6 | "github.com/liamg/flinch/widgets" 7 | ) 8 | 9 | func main() { 10 | 11 | password, err := widgets.PasswordInput("Enter your password...") 12 | if err == widgets.ErrInputCancelled { 13 | fmt.Println("User cancelled.") 14 | return 15 | } 16 | 17 | fmt.Printf("Your password is %s!\n", password) 18 | } 19 | -------------------------------------------------------------------------------- /components/button.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/core" 6 | ) 7 | 8 | type button struct { 9 | core.Sizer 10 | label string 11 | selected bool 12 | pressFunc func() 13 | } 14 | 15 | func NewButton(label string) *button { 16 | return &button{ 17 | label: label, 18 | } 19 | } 20 | 21 | func (l *button) Text() string { 22 | return l.label 23 | } 24 | 25 | func (l *button) Render(canvas core.Canvas) { 26 | 27 | st := core.StyleButton 28 | if l.selected { 29 | st = core.StyleButtonSelected 30 | } 31 | 32 | canvas.Fill(' ', st) 33 | size := canvas.Size() 34 | 35 | if l.selected { 36 | edges := st.GetButtonEdges() 37 | canvas.Set(0, 0, edges[0], st.ToggleInvert()) 38 | canvas.Set(size.W-1, 0, edges[1], st.ToggleInvert()) 39 | } 40 | 41 | for i := 0; i < len(l.label); i++ { 42 | canvas.Set(((size.W-len(l.label))/2)+i, 0, rune(l.label[i]), st) 43 | } 44 | } 45 | 46 | func (l *button) MinimumSize() core.Size { 47 | return core.Size{W: len(l.label) + 4, H: 1} 48 | } 49 | 50 | func (l *button) Deselect() { 51 | l.selected = false 52 | } 53 | 54 | func (l *button) Select() bool { 55 | if l.selected { 56 | return false 57 | } 58 | l.selected = true 59 | return true 60 | } 61 | 62 | func (l *button) Selected() bool { 63 | return l.selected 64 | } 65 | 66 | func (l *button) OnPress(f func()) { 67 | l.pressFunc = f 68 | } 69 | 70 | func (l *button) HandleKeypress(key *tcell.EventKey) { 71 | switch key.Key() { 72 | case tcell.KeyEnter: 73 | if l.pressFunc != nil { 74 | l.pressFunc() 75 | } 76 | case tcell.KeyRune: 77 | switch key.Rune() { 78 | case ' ': 79 | if l.pressFunc != nil { 80 | l.pressFunc() 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /components/checkbox.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/core" 6 | ) 7 | 8 | type checkbox struct { 9 | core.Sizer 10 | label string 11 | checked bool 12 | selected bool 13 | } 14 | 15 | func NewCheckbox(label string, checked bool) *checkbox { 16 | cb := &checkbox{ 17 | label: label, 18 | checked: checked, 19 | } 20 | cb.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 21 | return cb 22 | } 23 | 24 | func (t *checkbox) Text() string { 25 | return t.label 26 | } 27 | 28 | func (t *checkbox) SetChecked(checked bool) { 29 | t.checked = checked 30 | } 31 | 32 | func (t *checkbox) Render(canvas core.Canvas) { 33 | 34 | st := core.StyleDefault 35 | faint := core.StyleFaint 36 | if t.selected { 37 | st = core.StyleSelected 38 | faint = st 39 | } 40 | 41 | canvas.Fill(' ', st) 42 | 43 | canvas.Set(0, 0, '[', faint) 44 | canvas.Set(2, 0, ']', faint) 45 | 46 | if t.checked { 47 | canvas.Set(1, 0, '✔', st) 48 | } else { 49 | canvas.Set(1, 0, ' ', st) 50 | } 51 | 52 | for i := 0; i < len(t.label); i++ { 53 | canvas.Set(4+i, 0, rune(t.label[i]), st) 54 | } 55 | } 56 | 57 | func (t *checkbox) MinimumSize() core.Size { 58 | rw, rh := len(t.label)+4, 1 59 | return core.Size{W: rw, H: rh} 60 | } 61 | 62 | func (l *checkbox) Deselect() { 63 | l.selected = false 64 | } 65 | 66 | func (l *checkbox) Select() bool { 67 | if l.selected { 68 | return false 69 | } 70 | l.selected = true 71 | return true 72 | } 73 | 74 | func (l *checkbox) HandleKeypress(key *tcell.EventKey) { 75 | switch key.Key() { 76 | case tcell.KeyRune: 77 | switch key.Rune() { 78 | case ' ': 79 | l.checked = !l.checked 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /components/scrollbar.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import "github.com/liamg/flinch/core" 4 | 5 | func drawScrollbar(canvas core.Canvas, index int, size int, max int) { 6 | 7 | canvasSize := canvas.Size() 8 | height := (size * canvasSize.H) / max 9 | barPos := (index * canvasSize.H) / max 10 | 11 | for y := 0; y < canvasSize.H; y++ { 12 | if y >= barPos && y < barPos+height { 13 | canvas.Set(0, y, ' ', core.StyleDefault.ToggleInvert()) 14 | } else { 15 | canvas.Set(0, y, '│', core.StyleDefault) 16 | } 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /components/setup_test.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import "github.com/liamg/flinch/core" 4 | 5 | type testComponent struct { 6 | size core.Size 7 | canvas core.Canvas 8 | } 9 | 10 | func (t *testComponent) MinimumSize() core.Size { 11 | return t.size 12 | } 13 | 14 | func newTestComponent(size core.Size, canvas core.Canvas) *testComponent { 15 | return &testComponent{ 16 | size: size, 17 | canvas: canvas, 18 | } 19 | } 20 | 21 | func (t *testComponent) Render(canvas core.Canvas) { 22 | t.canvas = canvas 23 | } 24 | 25 | func (t *testComponent) Size() core.Size { 26 | return t.size 27 | } 28 | 29 | type testCanvas struct { 30 | cells map[int]map[int]rune 31 | x int 32 | y int 33 | size core.Size 34 | } 35 | 36 | func newTestCanvas(x, y int, size core.Size) *testCanvas { 37 | return &testCanvas{ 38 | x: x, 39 | y: y, 40 | size: size, 41 | } 42 | } 43 | 44 | func (t *testCanvas) Fill(r rune, st core.Style) { 45 | 46 | } 47 | 48 | func (t *testCanvas) Set(x, y int, r rune, s core.Style) { 49 | if t.cells == nil { 50 | t.cells = make(map[int]map[int]rune) 51 | } 52 | if _, ok := t.cells[x]; !ok { 53 | t.cells[x] = make(map[int]rune) 54 | } 55 | t.cells[x][y] = r 56 | } 57 | 58 | func (t *testCanvas) Get(x, y int) rune { 59 | col, ok := t.cells[x] 60 | if !ok { 61 | return 0 62 | } 63 | cell, ok := col[y] 64 | if !ok { 65 | return 0 66 | } 67 | return cell 68 | } 69 | 70 | func (t *testCanvas) Size() core.Size { 71 | return t.size 72 | } 73 | 74 | func (t *testCanvas) Cutout(x, y int, size core.Size) core.Canvas { 75 | return newTestCanvas(x, y, size) 76 | } 77 | -------------------------------------------------------------------------------- /components/spacer.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "github.com/liamg/flinch/core" 5 | ) 6 | 7 | type spacer struct { 8 | size core.Size 9 | } 10 | 11 | func NewSpacer(size core.Size) *spacer { 12 | return &spacer{ 13 | size: size, 14 | } 15 | } 16 | 17 | func (t *spacer) Render(_ core.Canvas) { 18 | 19 | } 20 | 21 | func (t *spacer) MinimumSize() core.Size { 22 | return t.size 23 | } 24 | -------------------------------------------------------------------------------- /components/text.go: -------------------------------------------------------------------------------- 1 | package components 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/liamg/flinch/core" 7 | ) 8 | 9 | type text struct { 10 | core.Sizer 11 | content string 12 | alignment core.Alignment 13 | style core.Style 14 | padSize int 15 | } 16 | 17 | func NewText(content string) *text { 18 | return &text{ 19 | content: content, 20 | style: core.StyleDefault, 21 | } 22 | } 23 | 24 | func (t *text) PadText(size int) { 25 | t.padSize = size 26 | } 27 | 28 | func (t *text) SetAlignment(j core.Alignment) *text { 29 | t.alignment = j 30 | return t 31 | } 32 | 33 | func (t *text) Text() string { 34 | return t.content 35 | } 36 | 37 | func (t *text) SetStyle(s core.Style) { 38 | t.style = s 39 | } 40 | 41 | func (t *text) cleanContent() string { 42 | return strings.Split(t.content, "\n")[0] 43 | } 44 | 45 | func (t *text) Render(canvas core.Canvas) { 46 | 47 | var x int 48 | size := canvas.Size() 49 | 50 | content := t.cleanContent() 51 | 52 | switch t.alignment { 53 | case core.AlignLeft: 54 | x = 0 55 | case core.AlignRight: 56 | x = size.W - len(content) 57 | case core.AlignCenter: 58 | x = (size.W - len(content)) / 2 59 | } 60 | 61 | for offset, r := range content { 62 | canvas.Set(x+offset+t.padSize, 0, r, t.style) 63 | } 64 | } 65 | 66 | func (t *text) MinimumSize() core.Size { 67 | return core.Size{ 68 | W: len(t.cleanContent()), 69 | H: 1, 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /core/alignment.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Alignment uint8 4 | 5 | const ( 6 | AlignLeft Alignment = iota 7 | AlignRight 8 | AlignCenter 9 | AlignTop = AlignLeft 10 | AlignBottom = AlignRight 11 | ) 12 | -------------------------------------------------------------------------------- /core/canvas.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Canvas interface { 4 | Fill(r rune, s Style) 5 | Set(x, y int, r rune, s Style) 6 | Size() Size 7 | Cutout(x, y int, s Size) Canvas 8 | } 9 | -------------------------------------------------------------------------------- /core/colour.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Colour [3]int32 4 | 5 | var ColourFgFaint = NewColour(128, 128, 128) 6 | 7 | func NewColour(r, g, b int32) Colour { 8 | return Colour([3]int32{r, g, b}) 9 | } 10 | 11 | func FaintColour(c Colour) Colour { 12 | if !c.IsDefault() { 13 | return NewColour( 14 | c.Red()/2, 15 | c.Green()/2, 16 | c.Blue()/2, 17 | ) 18 | } 19 | 20 | return ColourFgFaint 21 | } 22 | 23 | func (c Colour) Red() int32 { 24 | return c[0] 25 | } 26 | 27 | func (c Colour) Green() int32 { 28 | return c[1] 29 | } 30 | 31 | func (c Colour) Blue() int32 { 32 | return c[2] 33 | } 34 | 35 | func (c Colour) IsDefault() bool { 36 | return c[0] == 0 && c[1] == 0 && c[2] == 0 37 | } 38 | -------------------------------------------------------------------------------- /core/component.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Component interface { 4 | // Render draws the component to the provided canvas 5 | Render(canvas Canvas) 6 | // MinimumSize returns the minimum size required by the component 7 | MinimumSize() Size 8 | 9 | } 10 | -------------------------------------------------------------------------------- /core/container.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Container interface { 4 | Component 5 | Add(c Component) 6 | Remove(c Component) 7 | SetAlignment(alignment Alignment) 8 | } 9 | -------------------------------------------------------------------------------- /core/core.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | func init() { 4 | SetStyle(StyleInherit) 5 | } 6 | -------------------------------------------------------------------------------- /core/input.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | import "github.com/gdamore/tcell/v2" 4 | 5 | type Selectable interface { 6 | Component 7 | Select() bool 8 | Deselect() 9 | HandleKeypress(key *tcell.EventKey) 10 | } 11 | -------------------------------------------------------------------------------- /core/selector.go: -------------------------------------------------------------------------------- 1 | package core 2 | 3 | type Selector struct { 4 | selectedComponent Selectable 5 | } 6 | 7 | func NewSelector() *Selector { 8 | return &Selector{} 9 | } 10 | 11 | func (s *Selector) GetSelected() Selectable { 12 | return s.selectedComponent 13 | } 14 | 15 | func (s *Selector) Previous(components []Component) bool { 16 | return s.toggleSelect(components, -1) 17 | } 18 | 19 | func (s *Selector) Next(components []Component) bool { 20 | return s.Select(components) 21 | } 22 | 23 | func (s *Selector) Deselect() { 24 | if s.selectedComponent != nil { 25 | s.selectedComponent.Deselect() 26 | s.selectedComponent = nil 27 | } 28 | } 29 | 30 | func (s *Selector) Select(components []Component) bool { 31 | return s.toggleSelect(components, 1) 32 | } 33 | 34 | func (s *Selector) toggleSelect(components []Component, inc int) bool { 35 | 36 | var start int 37 | end := len(components) 38 | 39 | if inc < 0 { 40 | start = end 41 | end = 0 42 | } 43 | 44 | if s.selectedComponent != nil { 45 | if s.selectedComponent.Select() { 46 | // the component handled the tab itself, and selected a child component 47 | return true 48 | } 49 | } 50 | 51 | var currentFound bool 52 | 53 | // we need to select the next top-level component 54 | for i := start; i != end; i += inc { 55 | 56 | comp := components[i] 57 | 58 | sel, ok := comp.(Selectable) 59 | if !ok { 60 | continue 61 | } 62 | 63 | // if nothing is selected, take the first component we see 64 | if s.selectedComponent == nil && sel.Select() { 65 | s.selectedComponent = sel 66 | return true 67 | } 68 | 69 | // see if the selected component can itself select a new component 70 | if sel == s.selectedComponent { 71 | currentFound = true 72 | continue 73 | } 74 | 75 | if currentFound && sel.Select() { 76 | s.selectedComponent.Deselect() 77 | s.selectedComponent = sel 78 | return true 79 | } 80 | } 81 | 82 | // give up, we need to find something higher in the hierarchy to select 83 | return false 84 | } 85 | -------------------------------------------------------------------------------- /example_confirm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/example_confirm.png -------------------------------------------------------------------------------- /example_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/example_input.png -------------------------------------------------------------------------------- /example_list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/example_list.png -------------------------------------------------------------------------------- /example_multi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/example_multi.png -------------------------------------------------------------------------------- /example_password.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/example_password.png -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/liamg/flinch 2 | 3 | go 1.15 4 | 5 | require ( 6 | github.com/gdamore/tcell/v2 v2.1.0 7 | github.com/stretchr/testify v1.7.0 8 | ) 9 | -------------------------------------------------------------------------------- /go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= 4 | github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= 5 | github.com/gdamore/tcell/v2 v2.1.0 h1:UnSmozHgBkQi2PGsFr+rpdXuAPRRucMegpQp3Z3kDro= 6 | github.com/gdamore/tcell/v2 v2.1.0/go.mod h1:vSVL/GV5mCSlPC6thFP5kfOFdM9MGZcalipmpTxTgQA= 7 | github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= 8 | github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= 9 | github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= 10 | github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 11 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 12 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 13 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 14 | github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= 15 | github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 16 | golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10= 17 | golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 18 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 19 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 20 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 21 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 22 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 23 | -------------------------------------------------------------------------------- /new.go: -------------------------------------------------------------------------------- 1 | package flinch 2 | 3 | import "github.com/liamg/flinch/window" 4 | 5 | func New() (window.Window, error) { 6 | return window.New() 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright (c) 2012-2016 Dave Collins 4 | 5 | Permission to use, copy, modify, and distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /vendor/github.com/davecgh/go-spew/spew/bypasssafe.go: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 Dave Collins 2 | // 3 | // Permission to use, copy, modify, and distribute this software for any 4 | // purpose with or without fee is hereby granted, provided that the above 5 | // copyright notice and this permission notice appear in all copies. 6 | // 7 | // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 8 | // WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 9 | // MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 10 | // ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 11 | // WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 12 | // ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 13 | // OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 | 15 | // NOTE: Due to the following build constraints, this file will only be compiled 16 | // when the code is running on Google App Engine, compiled by GopherJS, or 17 | // "-tags safe" is added to the go build command line. The "disableunsafe" 18 | // tag is deprecated and thus should not be used. 19 | // +build js appengine safe disableunsafe 20 | 21 | package spew 22 | 23 | import "reflect" 24 | 25 | const ( 26 | // UnsafeDisabled is a build-time constant which specifies whether or 27 | // not access to the unsafe package is available. 28 | UnsafeDisabled = true 29 | ) 30 | 31 | // unsafeReflectValue typically converts the passed reflect.Value into a one 32 | // that bypasses the typical safety restrictions preventing access to 33 | // unaddressable and unexported data. However, doing this relies on access to 34 | // the unsafe package. This is a stub version which simply returns the passed 35 | // reflect.Value when the unsafe package is not available. 36 | func unsafeReflectValue(v reflect.Value) reflect.Value { 37 | return v 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | clone_folder: c:\gopath\src\github.com\gdamore\encoding 3 | environment: 4 | GOPATH: c:\gopath 5 | build_script: 6 | - go version 7 | - go env 8 | - SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% 9 | - go get -t ./... 10 | - go build 11 | - go install ./... 12 | test_script: 13 | - go test ./... 14 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.9.x 5 | - 1.10.x 6 | - 1.11.x 7 | - tip 8 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/README.md: -------------------------------------------------------------------------------- 1 | ## encoding 2 | 3 | [![Linux Status](https://img.shields.io/travis/gdamore/encoding.svg?label=linux)](https://travis-ci.org/gdamore/encoding) 4 | [![Windows Status](https://img.shields.io/appveyor/ci/gdamore/encoding.svg?label=windows)](https://ci.appveyor.com/project/gdamore/encoding) 5 | [![Apache License](https://img.shields.io/badge/license-APACHE2-blue.svg)](https://github.com/gdamore/encoding/blob/master/LICENSE) 6 | [![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://godoc.org/github.com/gdamore/encoding) 7 | [![Go Report Card](http://goreportcard.com/badge/gdamore/encoding)](http://goreportcard.com/report/gdamore/encoding) 8 | 9 | Package encoding provides a number of encodings that are missing from the 10 | standard Go [encoding]("https://godoc.org/golang.org/x/text/encoding") package. 11 | 12 | We hope that we can contribute these to the standard Go library someday. It 13 | turns out that some of these are useful for dealing with I/O streams coming 14 | from non-UTF friendly sources. 15 | 16 | The UTF8 Encoder is also useful for situations where valid UTF-8 might be 17 | carried in streams that contain non-valid UTF; in particular I use it for 18 | helping me cope with terminals that embed escape sequences in otherwise 19 | valid UTF-8. 20 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/ascii.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Garrett D'Amore 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package encoding 16 | 17 | import ( 18 | "golang.org/x/text/encoding" 19 | ) 20 | 21 | // ASCII represents the 7-bit US-ASCII scheme. It decodes directly to 22 | // UTF-8 without change, as all ASCII values are legal UTF-8. 23 | // Unicode values less than 128 (i.e. 7 bits) map 1:1 with ASCII. 24 | // It encodes runes outside of that to 0x1A, the ASCII substitution character. 25 | var ASCII encoding.Encoding 26 | 27 | func init() { 28 | amap := make(map[byte]rune) 29 | for i := 128; i <= 255; i++ { 30 | amap[byte(i)] = RuneError 31 | } 32 | 33 | cm := &Charmap{Map: amap} 34 | cm.Init() 35 | ASCII = cm 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Garrett D'Amore 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // Package encoding provides a few of the encoding structures that are 16 | // missing from the Go x/text/encoding tree. 17 | package encoding 18 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gdamore/encoding 2 | 3 | go 1.9 4 | 5 | require golang.org/x/text v0.3.0 6 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/go.sum: -------------------------------------------------------------------------------- 1 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 2 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 3 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/latin1.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Garrett D'Amore 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package encoding 16 | 17 | import ( 18 | "golang.org/x/text/encoding" 19 | ) 20 | 21 | // ISO8859_1 represents the 8-bit ISO8859-1 scheme. It decodes directly to 22 | // UTF-8 without change, as all ISO8859-1 values are legal UTF-8. 23 | // Unicode values less than 256 (i.e. 8 bits) map 1:1 with 8859-1. 24 | // It encodes runes outside of that to 0x1A, the ASCII substitution character. 25 | var ISO8859_1 encoding.Encoding 26 | 27 | func init() { 28 | cm := &Charmap{} 29 | cm.Init() 30 | 31 | // 8859-1 is the 8-bit identity map for Unicode. 32 | ISO8859_1 = cm 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/latin5.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Garrett D'Amore 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package encoding 16 | 17 | import ( 18 | "golang.org/x/text/encoding" 19 | ) 20 | 21 | // ISO8859_9 represents the 8-bit ISO8859-9 scheme. 22 | var ISO8859_9 encoding.Encoding 23 | 24 | func init() { 25 | cm := &Charmap{Map: map[byte]rune{ 26 | 0xD0: 'Ğ', 27 | 0xDD: 'İ', 28 | 0xDE: 'Ş', 29 | 0xF0: 'ğ', 30 | 0xFD: 'ı', 31 | 0xFE: 'ş', 32 | }} 33 | cm.Init() 34 | ISO8859_9 = cm 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/encoding/utf8.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 Garrett D'Amore 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package encoding 16 | 17 | import ( 18 | "golang.org/x/text/encoding" 19 | ) 20 | 21 | type validUtf8 struct{} 22 | 23 | // UTF8 is an encoding for UTF-8. All it does is verify that the UTF-8 24 | // in is valid. The main reason for its existence is that it will detect 25 | // and report ErrSrcShort or ErrDstShort, whereas the Nop encoding just 26 | // passes every byte, blithely. 27 | var UTF8 encoding.Encoding = validUtf8{} 28 | 29 | func (validUtf8) NewDecoder() *encoding.Decoder { 30 | return &encoding.Decoder{Transformer: encoding.UTF8Validator} 31 | } 32 | 33 | func (validUtf8) NewEncoder() *encoding.Encoder { 34 | return &encoding.Encoder{Transformer: encoding.UTF8Validator} 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | clone_folder: c:\gopath\src\github.com\gdamore\tcell 3 | environment: 4 | GOPATH: c:\gopath 5 | build_script: 6 | - go version 7 | - go env 8 | - SET PATH=%LOCALAPPDATA%\atom\bin;%GOPATH%\bin;%PATH% 9 | - go get -t ./... 10 | - go build 11 | - go install ./... 12 | test_script: 13 | - go test ./... 14 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/.gitignore: -------------------------------------------------------------------------------- 1 | coverage.txt 2 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.11.x 5 | - 1.15.x 6 | - master 7 | 8 | arch: 9 | - amd64 10 | - ppc64le 11 | 12 | before_install: 13 | - go get -t -v ./... 14 | 15 | script: 16 | - go test -race -coverprofile=coverage.txt -covermode=atomic 17 | 18 | after_success: 19 | - bash <(curl -s https://codecov.io/bash) 20 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/AUTHORS: -------------------------------------------------------------------------------- 1 | Garrett D'Amore 2 | Zachary Yedidia 3 | Junegunn Choi 4 | Staysail Systems, Inc. 5 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/attr.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | // AttrMask represents a mask of text attributes, apart from color. 18 | // Note that support for attributes may vary widely across terminals. 19 | type AttrMask int 20 | 21 | // Attributes are not colors, but affect the display of text. They can 22 | // be combined. 23 | const ( 24 | AttrBold AttrMask = 1 << iota 25 | AttrBlink 26 | AttrReverse 27 | AttrUnderline 28 | AttrDim 29 | AttrItalic 30 | AttrStrikeThrough 31 | AttrInvalid // Mark the style or attributes invalid 32 | AttrNone AttrMask = 0 // Just normal text. 33 | ) 34 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/charset_stub.go: -------------------------------------------------------------------------------- 1 | // +build plan9 nacl 2 | 3 | // Copyright 2015 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | func getCharset() string { 20 | return "" 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/charset_unix.go: -------------------------------------------------------------------------------- 1 | // +build !windows,!nacl,!plan9 2 | 3 | // Copyright 2016 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | import ( 20 | "os" 21 | "strings" 22 | ) 23 | 24 | func getCharset() string { 25 | // Determine the character set. This can help us later. 26 | // Per POSIX, we search for LC_ALL first, then LC_CTYPE, and 27 | // finally LANG. First one set wins. 28 | locale := "" 29 | if locale = os.Getenv("LC_ALL"); locale == "" { 30 | if locale = os.Getenv("LC_CTYPE"); locale == "" { 31 | locale = os.Getenv("LANG") 32 | } 33 | } 34 | if locale == "POSIX" || locale == "C" { 35 | return "US-ASCII" 36 | } 37 | if i := strings.IndexRune(locale, '@'); i >= 0 { 38 | locale = locale[:i] 39 | } 40 | if i := strings.IndexRune(locale, '.'); i >= 0 { 41 | locale = locale[i+1:] 42 | } else { 43 | // Default assumption, and on Linux we can see LC_ALL 44 | // without a character set, which we assume implies UTF-8. 45 | return "UTF-8" 46 | } 47 | // XXX: add support for aliases 48 | return locale 49 | } 50 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/charset_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | // Copyright 2015 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | func getCharset() string { 20 | return "UTF-16" 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/colorfit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | import ( 18 | "github.com/lucasb-eyer/go-colorful" 19 | "math" 20 | ) 21 | 22 | // FindColor attempts to find a given color, or the best match possible for it, 23 | // from the palette given. This is an expensive operation, so results should 24 | // be cached by the caller. 25 | func FindColor(c Color, palette []Color) Color { 26 | match := ColorDefault 27 | dist := float64(0) 28 | r, g, b := c.RGB() 29 | c1 := colorful.Color{ 30 | R: float64(r) / 255.0, 31 | G: float64(g) / 255.0, 32 | B: float64(b) / 255.0, 33 | } 34 | for _, d := range palette { 35 | r, g, b = d.RGB() 36 | c2 := colorful.Color{ 37 | R: float64(r) / 255.0, 38 | G: float64(g) / 255.0, 39 | B: float64(b) / 255.0, 40 | } 41 | // CIE94 is more accurate, but really really expensive. 42 | nd := c1.DistanceCIE76(c2) 43 | if math.IsNaN(nd) { 44 | nd = math.Inf(1) 45 | } 46 | if match == ColorDefault || nd < dist { 47 | match = d 48 | dist = nd 49 | } 50 | } 51 | return match 52 | } 53 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/console_stub.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | // Copyright 2015 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | // NewConsoleScreen returns a console based screen. This platform 20 | // doesn't have support for any, so it returns nil and a suitable error. 21 | func NewConsoleScreen() (Screen, error) { 22 | return nil, ErrNoScreen 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/event.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | import ( 18 | "time" 19 | ) 20 | 21 | // Event is a generic interface used for passing around Events. 22 | // Concrete types follow. 23 | type Event interface { 24 | // When reports the time when the event was generated. 25 | When() time.Time 26 | } 27 | 28 | // EventTime is a simple base event class, suitable for easy reuse. 29 | // It can be used to deliver actual timer events as well. 30 | type EventTime struct { 31 | when time.Time 32 | } 33 | 34 | // When returns the time stamp when the event occurred. 35 | func (e *EventTime) When() time.Time { 36 | return e.when 37 | } 38 | 39 | // SetEventTime sets the time of occurrence for the event. 40 | func (e *EventTime) SetEventTime(t time.Time) { 41 | e.when = t 42 | } 43 | 44 | // SetEventNow sets the time of occurrence for the event to the current time. 45 | func (e *EventTime) SetEventNow() { 46 | e.SetEventTime(time.Now()) 47 | } 48 | 49 | // EventHandler is anything that handles events. If the handler has 50 | // consumed the event, it should return true. False otherwise. 51 | type EventHandler interface { 52 | HandleEvent(Event) bool 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gdamore/tcell/v2 2 | 3 | go 1.12 4 | 5 | require ( 6 | github.com/gdamore/encoding v1.0.0 7 | github.com/lucasb-eyer/go-colorful v1.0.3 8 | github.com/mattn/go-runewidth v0.0.7 9 | golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 10 | golang.org/x/text v0.3.0 11 | ) 12 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/go.sum: -------------------------------------------------------------------------------- 1 | github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko= 2 | github.com/gdamore/encoding v1.0.0/go.mod h1:alR0ol34c49FCSBLjhosxzcPHQbf2trDkoo5dl+VrEg= 3 | github.com/lucasb-eyer/go-colorful v1.0.3 h1:QIbQXiugsb+q10B+MI+7DI1oQLdmnep86tWFlaaUAac= 4 | github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= 5 | github.com/mattn/go-runewidth v0.0.7 h1:Ei8KR0497xHyKJPAv59M1dkC+rOZCMBJ+t3fZ+twI54= 6 | github.com/mattn/go-runewidth v0.0.7/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= 7 | golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756 h1:9nuHUbU8dRnRRfj9KjWUVrJeoexdbeMjttk6Oh1rD10= 8 | golang.org/x/sys v0.0.0-20190626150813-e07cf5db2756/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 9 | golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= 10 | golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= 11 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/interrupt.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | import ( 18 | "time" 19 | ) 20 | 21 | // EventInterrupt is a generic wakeup event. Its can be used to 22 | // to request a redraw. It can carry an arbitrary payload, as well. 23 | type EventInterrupt struct { 24 | t time.Time 25 | v interface{} 26 | } 27 | 28 | // When returns the time when this event was created. 29 | func (ev *EventInterrupt) When() time.Time { 30 | return ev.t 31 | } 32 | 33 | // Data is used to obtain the opaque event payload. 34 | func (ev *EventInterrupt) Data() interface{} { 35 | return ev.v 36 | } 37 | 38 | // NewEventInterrupt creates an EventInterrupt with the given payload. 39 | func NewEventInterrupt(data interface{}) *EventInterrupt { 40 | return &EventInterrupt{t: time.Now(), v: data} 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/paste.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | import ( 18 | "time" 19 | ) 20 | 21 | // EventPaste is used to mark the start and end of a bracketed paste. 22 | // An event with .Start() true will be sent to mark the start. 23 | // Then a number of keys will be sent to indicate that the content 24 | // is pasted in. At the end, an event with .Start() false will be sent. 25 | type EventPaste struct { 26 | start bool 27 | t time.Time 28 | } 29 | 30 | // When returns the time when this EventMouse was created. 31 | func (ev *EventPaste) When() time.Time { 32 | return ev.t 33 | } 34 | 35 | // Start returns true if this is the start of a paste. 36 | func (ev *EventPaste) Start() bool { 37 | return ev.start 38 | } 39 | 40 | // End returns true if this is the end of a paste. 41 | func (ev *EventPaste) End() bool { 42 | return !ev.start 43 | } 44 | 45 | // NewEventPaste returns a new EventPaste. 46 | func NewEventPaste(start bool) *EventPaste { 47 | return &EventPaste{t: time.Now(), start: start} 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/resize.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package tcell 16 | 17 | import ( 18 | "time" 19 | ) 20 | 21 | // EventResize is sent when the window size changes. 22 | type EventResize struct { 23 | t time.Time 24 | w int 25 | h int 26 | } 27 | 28 | // NewEventResize creates an EventResize with the new updated window size, 29 | // which is given in character cells. 30 | func NewEventResize(width, height int) *EventResize { 31 | return &EventResize{t: time.Now(), w: width, h: height} 32 | } 33 | 34 | // When returns the time when the Event was created. 35 | func (ev *EventResize) When() time.Time { 36 | return ev.t 37 | } 38 | 39 | // Size returns the new window size as width, height in character cells. 40 | func (ev *EventResize) Size() (int, int) { 41 | return ev.w, ev.h 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/.gitignore: -------------------------------------------------------------------------------- 1 | mkinfo 2 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/README.md: -------------------------------------------------------------------------------- 1 | This package represents the parent for all terminals. 2 | 3 | In older versions of tcell we had (a couple of) different 4 | external file formats for the terminal database. Those are 5 | now removed. All terminal definitions are supplied by 6 | one of two methods: 7 | 8 | 1. Compiled Go code 9 | 10 | 2. For systems with terminfo and infocmp, dynamically 11 | generated at runtime. 12 | 13 | The Go code can be generated using the mkinfo utility in 14 | this directory. The database entry should be generated 15 | into a package in a directory named as the first character 16 | of the package name. (This permits us to group them all 17 | without having a huge directory of little packages.) 18 | 19 | It may be desirable to add new packages to the extended 20 | package, or -- rarely -- the base package. 21 | 22 | Applications which want to have the large set of terminal 23 | descriptions built into the binary can simply import the 24 | extended package. Otherwise a smaller reasonable default 25 | set (the base package) will be included instead. 26 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/TERMINALS.md: -------------------------------------------------------------------------------- 1 | TERMINALS 2 | ========= 3 | 4 | The best way to populate terminals on Debian is to install ncurses, 5 | ncurses-term, screen, tmux, rxvt-unicode, and dvtm. This populates the 6 | the terminfo database so that we can have a reasonable set of starting 7 | terminals. 8 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/a/ansi/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package ansi 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // ansi/pc-term compatible with color 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "ansi", 12 | Columns: 80, 13 | Lines: 24, 14 | Colors: 8, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J", 17 | AttrOff: "\x1b[0;10m", 18 | Underline: "\x1b[4m", 19 | Bold: "\x1b[1m", 20 | Blink: "\x1b[5m", 21 | Reverse: "\x1b[7m", 22 | SetFg: "\x1b[3%p1%dm", 23 | SetBg: "\x1b[4%p1%dm", 24 | SetFgBg: "\x1b[3%p1%d;4%p2%dm", 25 | ResetFgBg: "\x1b[39;49m", 26 | PadChar: "\x00", 27 | AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", 28 | EnterAcs: "\x1b[11m", 29 | ExitAcs: "\x1b[10m", 30 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 31 | CursorBack1: "\x1b[D", 32 | CursorUp1: "\x1b[A", 33 | KeyUp: "\x1b[A", 34 | KeyDown: "\x1b[B", 35 | KeyRight: "\x1b[C", 36 | KeyLeft: "\x1b[D", 37 | KeyInsert: "\x1b[L", 38 | KeyBackspace: "\b", 39 | KeyHome: "\x1b[H", 40 | KeyBacktab: "\x1b[Z", 41 | }) 42 | } 43 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/b/beterm/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package beterm 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // BeOS Terminal 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "beterm", 12 | Columns: 80, 13 | Lines: 25, 14 | Colors: 8, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J", 17 | AttrOff: "\x1b[0;10m", 18 | Underline: "\x1b[4m", 19 | Bold: "\x1b[1m", 20 | Reverse: "\x1b[7m", 21 | EnterKeypad: "\x1b[?4h", 22 | ExitKeypad: "\x1b[?4l", 23 | SetFg: "\x1b[3%p1%dm", 24 | SetBg: "\x1b[4%p1%dm", 25 | SetFgBg: "\x1b[3%p1%d;4%p2%dm", 26 | ResetFgBg: "\x1b[m", 27 | PadChar: "\x00", 28 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 29 | CursorBack1: "\b", 30 | CursorUp1: "\x1b[A", 31 | KeyUp: "\x1b[A", 32 | KeyDown: "\x1b[B", 33 | KeyRight: "\x1b[C", 34 | KeyLeft: "\x1b[D", 35 | KeyInsert: "\x1b[2~", 36 | KeyDelete: "\x1b[3~", 37 | KeyBackspace: "\b", 38 | KeyHome: "\x1b[1~", 39 | KeyEnd: "\x1b[4~", 40 | KeyPgUp: "\x1b[5~", 41 | KeyPgDn: "\x1b[6~", 42 | KeyF1: "\x1b[11~", 43 | KeyF2: "\x1b[12~", 44 | KeyF3: "\x1b[13~", 45 | KeyF4: "\x1b[14~", 46 | KeyF5: "\x1b[15~", 47 | KeyF6: "\x1b[16~", 48 | KeyF7: "\x1b[17~", 49 | KeyF8: "\x1b[18~", 50 | KeyF9: "\x1b[19~", 51 | KeyF10: "\x1b[20~", 52 | KeyF11: "\x1b[21~", 53 | KeyF12: "\x1b[22~", 54 | }) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/base/base.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The TCell Authors 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use file except in compliance with the License. 5 | // You may obtain a copy of the license at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | // This is just a "minimalist" set of the base terminal descriptions. 16 | // It should be sufficient for most applications. 17 | 18 | // Package base contains the base terminal descriptions that are likely 19 | // to be needed by any stock application. It is imported by default in the 20 | // terminfo package, so terminal types listed here will be available to any 21 | // tcell application. 22 | package base 23 | 24 | import ( 25 | // The following imports just register themselves -- 26 | // thse are the terminal types we aggregate in this package. 27 | _ "github.com/gdamore/tcell/v2/terminfo/a/ansi" 28 | _ "github.com/gdamore/tcell/v2/terminfo/v/vt100" 29 | _ "github.com/gdamore/tcell/v2/terminfo/v/vt102" 30 | _ "github.com/gdamore/tcell/v2/terminfo/v/vt220" 31 | _ "github.com/gdamore/tcell/v2/terminfo/x/xterm" 32 | ) 33 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/c/cygwin/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package cygwin 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // ANSI emulation for Cygwin 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "cygwin", 12 | Colors: 8, 13 | Bell: "\a", 14 | Clear: "\x1b[H\x1b[J", 15 | EnterCA: "\x1b7\x1b[?47h", 16 | ExitCA: "\x1b[2J\x1b[?47l\x1b8", 17 | AttrOff: "\x1b[0;10m", 18 | Underline: "\x1b[4m", 19 | Bold: "\x1b[1m", 20 | Reverse: "\x1b[7m", 21 | SetFg: "\x1b[3%p1%dm", 22 | SetBg: "\x1b[4%p1%dm", 23 | SetFgBg: "\x1b[3%p1%d;4%p2%dm", 24 | ResetFgBg: "\x1b[39;49m", 25 | PadChar: "\x00", 26 | AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", 27 | EnterAcs: "\x1b[11m", 28 | ExitAcs: "\x1b[10m", 29 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 30 | CursorBack1: "\b", 31 | CursorUp1: "\x1b[A", 32 | KeyUp: "\x1b[A", 33 | KeyDown: "\x1b[B", 34 | KeyRight: "\x1b[C", 35 | KeyLeft: "\x1b[D", 36 | KeyInsert: "\x1b[2~", 37 | KeyDelete: "\x1b[3~", 38 | KeyBackspace: "\b", 39 | KeyHome: "\x1b[1~", 40 | KeyEnd: "\x1b[4~", 41 | KeyPgUp: "\x1b[5~", 42 | KeyPgDn: "\x1b[6~", 43 | KeyF1: "\x1b[[A", 44 | KeyF2: "\x1b[[B", 45 | KeyF3: "\x1b[[C", 46 | KeyF4: "\x1b[[D", 47 | KeyF5: "\x1b[[E", 48 | KeyF6: "\x1b[17~", 49 | KeyF7: "\x1b[18~", 50 | KeyF8: "\x1b[19~", 51 | KeyF9: "\x1b[20~", 52 | KeyF10: "\x1b[21~", 53 | KeyF11: "\x1b[23~", 54 | KeyF12: "\x1b[24~", 55 | KeyF13: "\x1b[25~", 56 | KeyF14: "\x1b[26~", 57 | KeyF15: "\x1b[28~", 58 | KeyF16: "\x1b[29~", 59 | KeyF17: "\x1b[31~", 60 | KeyF18: "\x1b[32~", 61 | KeyF19: "\x1b[33~", 62 | KeyF20: "\x1b[34~", 63 | }) 64 | } 65 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/d/dtterm/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package dtterm 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // CDE desktop terminal 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "dtterm", 12 | Columns: 80, 13 | Lines: 24, 14 | Colors: 8, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J", 17 | ShowCursor: "\x1b[?25h", 18 | HideCursor: "\x1b[?25l", 19 | AttrOff: "\x1b[m\x0f", 20 | Underline: "\x1b[4m", 21 | Bold: "\x1b[1m", 22 | Dim: "\x1b[2m", 23 | Blink: "\x1b[5m", 24 | Reverse: "\x1b[7m", 25 | SetFg: "\x1b[3%p1%dm", 26 | SetBg: "\x1b[4%p1%dm", 27 | SetFgBg: "\x1b[3%p1%d;4%p2%dm", 28 | ResetFgBg: "\x1b[39;49m", 29 | PadChar: "\x00", 30 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 31 | EnterAcs: "\x0e", 32 | ExitAcs: "\x0f", 33 | EnableAcs: "\x1b(B\x1b)0", 34 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 35 | CursorBack1: "\b", 36 | CursorUp1: "\x1b[A", 37 | KeyUp: "\x1b[A", 38 | KeyDown: "\x1b[B", 39 | KeyRight: "\x1b[C", 40 | KeyLeft: "\x1b[D", 41 | KeyInsert: "\x1b[2~", 42 | KeyDelete: "\x1b[3~", 43 | KeyBackspace: "\b", 44 | KeyPgUp: "\x1b[5~", 45 | KeyPgDn: "\x1b[6~", 46 | KeyF1: "\x1b[11~", 47 | KeyF2: "\x1b[12~", 48 | KeyF3: "\x1b[13~", 49 | KeyF4: "\x1b[14~", 50 | KeyF5: "\x1b[15~", 51 | KeyF6: "\x1b[17~", 52 | KeyF7: "\x1b[18~", 53 | KeyF8: "\x1b[19~", 54 | KeyF9: "\x1b[20~", 55 | KeyF10: "\x1b[21~", 56 | KeyF11: "\x1b[23~", 57 | KeyF12: "\x1b[24~", 58 | KeyF13: "\x1b[25~", 59 | KeyF14: "\x1b[26~", 60 | KeyF15: "\x1b[28~", 61 | KeyF16: "\x1b[29~", 62 | KeyF17: "\x1b[31~", 63 | KeyF18: "\x1b[32~", 64 | KeyF19: "\x1b[33~", 65 | KeyF20: "\x1b[34~", 66 | KeyHelp: "\x1b[28~", 67 | }) 68 | } 69 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/e/emacs/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package emacs 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // gnu emacs term.el terminal emulation 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "eterm", 12 | Columns: 80, 13 | Lines: 24, 14 | Bell: "\a", 15 | Clear: "\x1b[H\x1b[J", 16 | EnterCA: "\x1b7\x1b[?47h", 17 | ExitCA: "\x1b[2J\x1b[?47l\x1b8", 18 | AttrOff: "\x1b[m", 19 | Underline: "\x1b[4m", 20 | Bold: "\x1b[1m", 21 | Reverse: "\x1b[7m", 22 | PadChar: "\x00", 23 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 24 | CursorBack1: "\b", 25 | CursorUp1: "\x1b[A", 26 | }) 27 | 28 | // Emacs term.el terminal emulator term-protocol-version 0.96 29 | terminfo.AddTerminfo(&terminfo.Terminfo{ 30 | Name: "eterm-color", 31 | Columns: 80, 32 | Lines: 24, 33 | Colors: 8, 34 | Bell: "\a", 35 | Clear: "\x1b[H\x1b[J", 36 | AttrOff: "\x1b[m", 37 | Underline: "\x1b[4m", 38 | Bold: "\x1b[1m", 39 | Blink: "\x1b[5m", 40 | Reverse: "\x1b[7m", 41 | SetFg: "\x1b[%p1%{30}%+%dm", 42 | SetBg: "\x1b[%p1%'('%+%dm", 43 | SetFgBg: "\x1b[%p1%{30}%+%d;%p2%'('%+%dm", 44 | ResetFgBg: "\x1b[39;49m", 45 | PadChar: "\x00", 46 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 47 | CursorBack1: "\b", 48 | CursorUp1: "\x1b[A", 49 | KeyUp: "\x1bOA", 50 | KeyDown: "\x1bOB", 51 | KeyRight: "\x1bOC", 52 | KeyLeft: "\x1bOD", 53 | KeyInsert: "\x1b[2~", 54 | KeyDelete: "\x1b[3~", 55 | KeyBackspace: "\u007f", 56 | KeyHome: "\x1b[1~", 57 | KeyEnd: "\x1b[4~", 58 | KeyPgUp: "\x1b[5~", 59 | KeyPgDn: "\x1b[6~", 60 | }) 61 | } 62 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/gen.sh: -------------------------------------------------------------------------------- 1 | while read line 2 | do 3 | case "$line" in 4 | *'|'*) 5 | alias=${line#*|} 6 | line=${line%|*} 7 | ;; 8 | *) 9 | alias=${line%%,*} 10 | ;; 11 | esac 12 | 13 | alias=${alias//-/_} 14 | direc=${alias:0:1} 15 | 16 | mkdir -p ${direc}/${alias} 17 | go run mkinfo.go -P ${alias} -go ${direc}/${alias}/term.go ${line//,/ } 18 | done < models.txt 19 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/h/hpterm/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package hpterm 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // hp X11 terminal emulator 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "hpterm", 12 | Aliases: []string{"X-hpterm"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b&a0y0C\x1bJ", 17 | AttrOff: "\x1b&d@\x0f", 18 | Underline: "\x1b&dD", 19 | Bold: "\x1b&dB", 20 | Dim: "\x1b&dH", 21 | Reverse: "\x1b&dB", 22 | EnterKeypad: "\x1b&s1A", 23 | ExitKeypad: "\x1b&s0A", 24 | PadChar: "\x00", 25 | EnterAcs: "\x0e", 26 | ExitAcs: "\x0f", 27 | SetCursor: "\x1b&a%p1%dy%p2%dC", 28 | CursorBack1: "\b", 29 | CursorUp1: "\x1bA", 30 | KeyUp: "\x1bA", 31 | KeyDown: "\x1bB", 32 | KeyRight: "\x1bC", 33 | KeyLeft: "\x1bD", 34 | KeyInsert: "\x1bQ", 35 | KeyDelete: "\x1bP", 36 | KeyBackspace: "\b", 37 | KeyHome: "\x1bh", 38 | KeyPgUp: "\x1bV", 39 | KeyPgDn: "\x1bU", 40 | KeyF1: "\x1bp", 41 | KeyF2: "\x1bq", 42 | KeyF3: "\x1br", 43 | KeyF4: "\x1bs", 44 | KeyF5: "\x1bt", 45 | KeyF6: "\x1bu", 46 | KeyF7: "\x1bv", 47 | KeyF8: "\x1bw", 48 | KeyClear: "\x1bJ", 49 | }) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/models.txt: -------------------------------------------------------------------------------- 1 | aixterm 2 | alacritty 3 | ansi 4 | beterm 5 | cygwin 6 | dtterm 7 | eterm,eterm-color|emacs 8 | gnome,gnome-256color 9 | hpterm 10 | konsole,konsole-256color 11 | kterm 12 | linux 13 | pcansi 14 | rxvt,rxvt-256color,rxvt-88color,rxvt-unicode,rxvt-unicode-256color 15 | screen,screen-256color 16 | st,st-256color|simpleterm 17 | sun,sun-color 18 | termite 19 | tmux 20 | vt52 21 | vt100 22 | vt102 23 | vt220 24 | vt320 25 | vt400 26 | vt420 27 | wy50 28 | wy60 29 | wy99-ansi,wy99a-ansi 30 | xfce 31 | xterm,xterm-88color,xterm-256color 32 | xterm-kitty 33 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/p/pcansi/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package pcansi 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // ibm-pc terminal programs claiming to be ansi 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "pcansi", 12 | Columns: 80, 13 | Lines: 24, 14 | Colors: 8, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J", 17 | AttrOff: "\x1b[0;10m", 18 | Underline: "\x1b[4m", 19 | Bold: "\x1b[1m", 20 | Blink: "\x1b[5m", 21 | Reverse: "\x1b[7m", 22 | SetFg: "\x1b[3%p1%dm", 23 | SetBg: "\x1b[4%p1%dm", 24 | SetFgBg: "\x1b[3%p1%d;4%p2%dm", 25 | ResetFgBg: "\x1b[37;40m", 26 | PadChar: "\x00", 27 | AltChars: "+\x10,\x11-\x18.\x190\xdb`\x04a\xb1f\xf8g\xf1h\xb0j\xd9k\xbfl\xdam\xc0n\xc5o~p\xc4q\xc4r\xc4s_t\xc3u\xb4v\xc1w\xc2x\xb3y\xf3z\xf2{\xe3|\xd8}\x9c~\xfe", 28 | EnterAcs: "\x1b[12m", 29 | ExitAcs: "\x1b[10m", 30 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 31 | CursorBack1: "\x1b[D", 32 | CursorUp1: "\x1b[A", 33 | KeyUp: "\x1b[A", 34 | KeyDown: "\x1b[B", 35 | KeyRight: "\x1b[C", 36 | KeyLeft: "\x1b[D", 37 | KeyBackspace: "\b", 38 | KeyHome: "\x1b[H", 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt100/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt100 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt100 (w/advanced video) 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt100", 12 | Aliases: []string{"vt100-am"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J$<50>", 17 | AttrOff: "\x1b[m\x0f$<2>", 18 | Underline: "\x1b[4m$<2>", 19 | Bold: "\x1b[1m$<2>", 20 | Blink: "\x1b[5m$<2>", 21 | Reverse: "\x1b[7m$<2>", 22 | EnterKeypad: "\x1b[?1h\x1b=", 23 | ExitKeypad: "\x1b[?1l\x1b>", 24 | PadChar: "\x00", 25 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 26 | EnterAcs: "\x0e", 27 | ExitAcs: "\x0f", 28 | EnableAcs: "\x1b(B\x1b)0", 29 | SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", 30 | CursorBack1: "\b", 31 | CursorUp1: "\x1b[A$<2>", 32 | KeyUp: "\x1bOA", 33 | KeyDown: "\x1bOB", 34 | KeyRight: "\x1bOC", 35 | KeyLeft: "\x1bOD", 36 | KeyBackspace: "\b", 37 | KeyF1: "\x1bOP", 38 | KeyF2: "\x1bOQ", 39 | KeyF3: "\x1bOR", 40 | KeyF4: "\x1bOS", 41 | KeyF5: "\x1bOt", 42 | KeyF6: "\x1bOu", 43 | KeyF7: "\x1bOv", 44 | KeyF8: "\x1bOl", 45 | KeyF9: "\x1bOw", 46 | KeyF10: "\x1bOx", 47 | }) 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt102/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt102 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt102 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt102", 12 | Columns: 80, 13 | Lines: 24, 14 | Bell: "\a", 15 | Clear: "\x1b[H\x1b[J$<50>", 16 | AttrOff: "\x1b[m\x0f$<2>", 17 | Underline: "\x1b[4m$<2>", 18 | Bold: "\x1b[1m$<2>", 19 | Blink: "\x1b[5m$<2>", 20 | Reverse: "\x1b[7m$<2>", 21 | EnterKeypad: "\x1b[?1h\x1b=", 22 | ExitKeypad: "\x1b[?1l\x1b>", 23 | PadChar: "\x00", 24 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 25 | EnterAcs: "\x0e", 26 | ExitAcs: "\x0f", 27 | EnableAcs: "\x1b(B\x1b)0", 28 | SetCursor: "\x1b[%i%p1%d;%p2%dH$<5>", 29 | CursorBack1: "\b", 30 | CursorUp1: "\x1b[A$<2>", 31 | KeyUp: "\x1bOA", 32 | KeyDown: "\x1bOB", 33 | KeyRight: "\x1bOC", 34 | KeyLeft: "\x1bOD", 35 | KeyBackspace: "\b", 36 | KeyF1: "\x1bOP", 37 | KeyF2: "\x1bOQ", 38 | KeyF3: "\x1bOR", 39 | KeyF4: "\x1bOS", 40 | KeyF5: "\x1bOt", 41 | KeyF6: "\x1bOu", 42 | KeyF7: "\x1bOv", 43 | KeyF8: "\x1bOl", 44 | KeyF9: "\x1bOw", 45 | KeyF10: "\x1bOx", 46 | }) 47 | } 48 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt220/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt220 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt220 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt220", 12 | Aliases: []string{"vt200"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[J", 17 | AttrOff: "\x1b[m\x1b(B", 18 | Underline: "\x1b[4m", 19 | Bold: "\x1b[1m", 20 | Blink: "\x1b[5m", 21 | Reverse: "\x1b[7m", 22 | PadChar: "\x00", 23 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 24 | EnterAcs: "\x1b(0$<2>", 25 | ExitAcs: "\x1b(B$<4>", 26 | EnableAcs: "\x1b)0", 27 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 28 | CursorBack1: "\b", 29 | CursorUp1: "\x1b[A", 30 | KeyUp: "\x1b[A", 31 | KeyDown: "\x1b[B", 32 | KeyRight: "\x1b[C", 33 | KeyLeft: "\x1b[D", 34 | KeyInsert: "\x1b[2~", 35 | KeyDelete: "\x1b[3~", 36 | KeyBackspace: "\b", 37 | KeyPgUp: "\x1b[5~", 38 | KeyPgDn: "\x1b[6~", 39 | KeyF1: "\x1bOP", 40 | KeyF2: "\x1bOQ", 41 | KeyF3: "\x1bOR", 42 | KeyF4: "\x1bOS", 43 | KeyF6: "\x1b[17~", 44 | KeyF7: "\x1b[18~", 45 | KeyF8: "\x1b[19~", 46 | KeyF9: "\x1b[20~", 47 | KeyF10: "\x1b[21~", 48 | KeyF11: "\x1b[23~", 49 | KeyF12: "\x1b[24~", 50 | KeyF13: "\x1b[25~", 51 | KeyF14: "\x1b[26~", 52 | KeyF17: "\x1b[31~", 53 | KeyF18: "\x1b[32~", 54 | KeyF19: "\x1b[33~", 55 | KeyF20: "\x1b[34~", 56 | KeyHelp: "\x1b[28~", 57 | }) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt320/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt320 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt320 7 bit terminal 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt320", 12 | Aliases: []string{"vt300"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b[H\x1b[2J", 17 | ShowCursor: "\x1b[?25h", 18 | HideCursor: "\x1b[?25l", 19 | AttrOff: "\x1b[m\x1b(B", 20 | Underline: "\x1b[4m", 21 | Bold: "\x1b[1m", 22 | Blink: "\x1b[5m", 23 | Reverse: "\x1b[7m", 24 | EnterKeypad: "\x1b[?1h\x1b=", 25 | ExitKeypad: "\x1b[?1l\x1b>", 26 | PadChar: "\x00", 27 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 28 | EnterAcs: "\x1b(0", 29 | ExitAcs: "\x1b(B", 30 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 31 | CursorBack1: "\b", 32 | CursorUp1: "\x1b[A", 33 | KeyUp: "\x1bOA", 34 | KeyDown: "\x1bOB", 35 | KeyRight: "\x1bOC", 36 | KeyLeft: "\x1bOD", 37 | KeyInsert: "\x1b[2~", 38 | KeyDelete: "\x1b[3~", 39 | KeyBackspace: "\u007f", 40 | KeyHome: "\x1b[1~", 41 | KeyPgUp: "\x1b[5~", 42 | KeyPgDn: "\x1b[6~", 43 | KeyF1: "\x1bOP", 44 | KeyF2: "\x1bOQ", 45 | KeyF3: "\x1bOR", 46 | KeyF4: "\x1bOS", 47 | KeyF6: "\x1b[17~", 48 | KeyF7: "\x1b[18~", 49 | KeyF8: "\x1b[19~", 50 | KeyF9: "\x1b[20~", 51 | KeyF10: "\x1b[21~", 52 | KeyF11: "\x1b[23~", 53 | KeyF12: "\x1b[24~", 54 | KeyF13: "\x1b[25~", 55 | KeyF14: "\x1b[26~", 56 | KeyF15: "\x1b[28~", 57 | KeyF16: "\x1b[29~", 58 | KeyF17: "\x1b[31~", 59 | KeyF18: "\x1b[32~", 60 | KeyF19: "\x1b[33~", 61 | KeyF20: "\x1b[34~", 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt400/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt400 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt400 24x80 column autowrap 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt400", 12 | Aliases: []string{"vt400-24", "dec-vt400"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Clear: "\x1b[H\x1b[J$<10/>", 16 | ShowCursor: "\x1b[?25h", 17 | HideCursor: "\x1b[?25l", 18 | AttrOff: "\x1b[m\x1b(B", 19 | Underline: "\x1b[4m", 20 | Bold: "\x1b[1m", 21 | Blink: "\x1b[5m", 22 | Reverse: "\x1b[7m", 23 | EnterKeypad: "\x1b[?1h\x1b=", 24 | ExitKeypad: "\x1b[?1l\x1b>", 25 | PadChar: "\x00", 26 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 27 | EnterAcs: "\x1b(0", 28 | ExitAcs: "\x1b(B", 29 | SetCursor: "\x1b[%i%p1%d;%p2%dH", 30 | CursorBack1: "\b", 31 | CursorUp1: "\x1b[A", 32 | KeyUp: "\x1bOA", 33 | KeyDown: "\x1bOB", 34 | KeyRight: "\x1bOC", 35 | KeyLeft: "\x1bOD", 36 | KeyBackspace: "\b", 37 | KeyF1: "\x1bOP", 38 | KeyF2: "\x1bOQ", 39 | KeyF3: "\x1bOR", 40 | KeyF4: "\x1bOS", 41 | KeyF6: "\x1b[17~", 42 | KeyF7: "\x1b[18~", 43 | KeyF8: "\x1b[19~", 44 | KeyF9: "\x1b[20~", 45 | }) 46 | } 47 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt420/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt420 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // DEC VT420 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt420", 12 | Columns: 80, 13 | Lines: 24, 14 | Bell: "\a", 15 | Clear: "\x1b[H\x1b[2J$<50>", 16 | ShowCursor: "\x1b[?25h", 17 | HideCursor: "\x1b[?25l", 18 | AttrOff: "\x1b[m\x1b(B$<2>", 19 | Underline: "\x1b[4m", 20 | Bold: "\x1b[1m$<2>", 21 | Blink: "\x1b[5m$<2>", 22 | Reverse: "\x1b[7m$<2>", 23 | EnterKeypad: "\x1b=", 24 | ExitKeypad: "\x1b>", 25 | PadChar: "\x00", 26 | AltChars: "``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~", 27 | EnterAcs: "\x1b(0$<2>", 28 | ExitAcs: "\x1b(B$<4>", 29 | EnableAcs: "\x1b)0", 30 | SetCursor: "\x1b[%i%p1%d;%p2%dH$<10>", 31 | CursorBack1: "\b", 32 | CursorUp1: "\x1b[A", 33 | KeyUp: "\x1b[A", 34 | KeyDown: "\x1b[B", 35 | KeyRight: "\x1b[C", 36 | KeyLeft: "\x1b[D", 37 | KeyInsert: "\x1b[2~", 38 | KeyDelete: "\x1b[3~", 39 | KeyBackspace: "\b", 40 | KeyPgUp: "\x1b[5~", 41 | KeyPgDn: "\x1b[6~", 42 | KeyF1: "\x1bOP", 43 | KeyF2: "\x1bOQ", 44 | KeyF3: "\x1bOR", 45 | KeyF4: "\x1bOS", 46 | KeyF5: "\x1b[17~", 47 | KeyF6: "\x1b[18~", 48 | KeyF7: "\x1b[19~", 49 | KeyF8: "\x1b[20~", 50 | KeyF9: "\x1b[21~", 51 | KeyF10: "\x1b[29~", 52 | }) 53 | } 54 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/v/vt52/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package vt52 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // dec vt52 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "vt52", 12 | Columns: 80, 13 | Lines: 24, 14 | Bell: "\a", 15 | Clear: "\x1bH\x1bJ", 16 | PadChar: "\x00", 17 | AltChars: "+h.k0affggolpnqprrss", 18 | EnterAcs: "\x1bF", 19 | ExitAcs: "\x1bG", 20 | SetCursor: "\x1bY%p1%' '%+%c%p2%' '%+%c", 21 | CursorBack1: "\x1bD", 22 | CursorUp1: "\x1bA", 23 | KeyUp: "\x1bA", 24 | KeyDown: "\x1bB", 25 | KeyRight: "\x1bC", 26 | KeyLeft: "\x1bD", 27 | KeyBackspace: "\b", 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/w/wy50/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package wy50 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // Wyse 50 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "wy50", 12 | Aliases: []string{"wyse50"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b+$<20>", 17 | ShowCursor: "\x1b`1", 18 | HideCursor: "\x1b`0", 19 | AttrOff: "\x1b(\x1bH\x03", 20 | Dim: "\x1b`7\x1b)", 21 | Reverse: "\x1b`6\x1b)", 22 | PadChar: "\x00", 23 | AltChars: "a;j5k3l2m1n8q:t4u9v=w0x6", 24 | EnterAcs: "\x1bH\x02", 25 | ExitAcs: "\x1bH\x03", 26 | SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", 27 | CursorBack1: "\b", 28 | CursorUp1: "\v", 29 | KeyUp: "\v", 30 | KeyDown: "\n", 31 | KeyRight: "\f", 32 | KeyLeft: "\b", 33 | KeyInsert: "\x1bQ", 34 | KeyDelete: "\x1bW", 35 | KeyBackspace: "\b", 36 | KeyHome: "\x1e", 37 | KeyPgUp: "\x1bJ", 38 | KeyPgDn: "\x1bK", 39 | KeyF1: "\x01@\r", 40 | KeyF2: "\x01A\r", 41 | KeyF3: "\x01B\r", 42 | KeyF4: "\x01C\r", 43 | KeyF5: "\x01D\r", 44 | KeyF6: "\x01E\r", 45 | KeyF7: "\x01F\r", 46 | KeyF8: "\x01G\r", 47 | KeyF9: "\x01H\r", 48 | KeyF10: "\x01I\r", 49 | KeyF11: "\x01J\r", 50 | KeyF12: "\x01K\r", 51 | KeyF13: "\x01L\r", 52 | KeyF14: "\x01M\r", 53 | KeyF15: "\x01N\r", 54 | KeyF16: "\x01O\r", 55 | KeyPrint: "\x1bP", 56 | KeyBacktab: "\x1bI", 57 | KeyShfHome: "\x1b{", 58 | }) 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terminfo/w/wy60/term.go: -------------------------------------------------------------------------------- 1 | // Generated automatically. DO NOT HAND-EDIT. 2 | 3 | package wy60 4 | 5 | import "github.com/gdamore/tcell/v2/terminfo" 6 | 7 | func init() { 8 | 9 | // Wyse 60 10 | terminfo.AddTerminfo(&terminfo.Terminfo{ 11 | Name: "wy60", 12 | Aliases: []string{"wyse60"}, 13 | Columns: 80, 14 | Lines: 24, 15 | Bell: "\a", 16 | Clear: "\x1b+$<100>", 17 | EnterCA: "\x1bw0", 18 | ExitCA: "\x1bw1", 19 | ShowCursor: "\x1b`1", 20 | HideCursor: "\x1b`0", 21 | AttrOff: "\x1b(\x1bH\x03\x1bG0\x1bcD", 22 | Underline: "\x1bG8", 23 | Dim: "\x1bGp", 24 | Blink: "\x1bG2", 25 | Reverse: "\x1bG4", 26 | PadChar: "\x00", 27 | AltChars: "+/,.0[a2fxgqh1ihjYk?lZm@nEqDtCu4vAwBx3yszr{c~~", 28 | EnterAcs: "\x1bcE", 29 | ExitAcs: "\x1bcD", 30 | SetCursor: "\x1b=%p1%' '%+%c%p2%' '%+%c", 31 | CursorBack1: "\b", 32 | CursorUp1: "\v", 33 | KeyUp: "\v", 34 | KeyDown: "\n", 35 | KeyRight: "\f", 36 | KeyLeft: "\b", 37 | KeyInsert: "\x1bQ", 38 | KeyDelete: "\x1bW", 39 | KeyBackspace: "\b", 40 | KeyHome: "\x1e", 41 | KeyPgUp: "\x1bJ", 42 | KeyPgDn: "\x1bK", 43 | KeyF1: "\x01@\r", 44 | KeyF2: "\x01A\r", 45 | KeyF3: "\x01B\r", 46 | KeyF4: "\x01C\r", 47 | KeyF5: "\x01D\r", 48 | KeyF6: "\x01E\r", 49 | KeyF7: "\x01F\r", 50 | KeyF8: "\x01G\r", 51 | KeyF9: "\x01H\r", 52 | KeyF10: "\x01I\r", 53 | KeyF11: "\x01J\r", 54 | KeyF12: "\x01K\r", 55 | KeyF13: "\x01L\r", 56 | KeyF14: "\x01M\r", 57 | KeyF15: "\x01N\r", 58 | KeyF16: "\x01O\r", 59 | KeyPrint: "\x1bP", 60 | KeyBacktab: "\x1bI", 61 | KeyShfHome: "\x1b{", 62 | }) 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terms_default.go: -------------------------------------------------------------------------------- 1 | // +build !tcell_minimal 2 | 3 | // Copyright 2019 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | import ( 20 | // This imports the default terminal entries. To disable, use the 21 | // tcell_minimal build tag. 22 | _ "github.com/gdamore/tcell/v2/terminfo/extended" 23 | ) 24 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terms_dynamic.go: -------------------------------------------------------------------------------- 1 | // +build !tcell_minimal,!nacl,!js,!zos,!plan9,!windows,!android 2 | 3 | // Copyright 2019 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | import ( 20 | // This imports a dynamic version of the terminal database, which 21 | // is built using infocmp. This relies on a working installation 22 | // of infocmp (typically supplied with ncurses). We only do this 23 | // for systems likely to have that -- i.e. UNIX based hosts. We 24 | // also don't support Android here, because you really don't want 25 | // to run external programs there. Generally the android terminals 26 | // will be automatically included anyway. 27 | "github.com/gdamore/tcell/v2/terminfo" 28 | "github.com/gdamore/tcell/v2/terminfo/dynamic" 29 | ) 30 | 31 | func loadDynamicTerminfo(term string) (*terminfo.Terminfo, error) { 32 | ti, _, e := dynamic.LoadTerminfo(term) 33 | if e != nil { 34 | return nil, e 35 | } 36 | return ti, nil 37 | } 38 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/terms_static.go: -------------------------------------------------------------------------------- 1 | // +build tcell_minimal nacl js zos plan9 windows android 2 | 3 | // Copyright 2019 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | import ( 20 | "errors" 21 | 22 | "github.com/gdamore/tcell/v2/terminfo" 23 | ) 24 | 25 | func loadDynamicTerminfo(_ string) (*terminfo.Terminfo, error) { 26 | return nil, errors.New("terminal type unsupported") 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/tscreen_stub.go: -------------------------------------------------------------------------------- 1 | // +build nacl plan9 2 | 3 | // Copyright 2015 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | // This stub file is for systems that have no termios. 20 | 21 | type termiosPrivate struct{} 22 | 23 | func (t *tScreen) termioInit() error { 24 | return ErrNoScreen 25 | } 26 | 27 | func (t *tScreen) termioFini() { 28 | } 29 | 30 | func (t *tScreen) getWinSize() (int, int, error) { 31 | return 0, 0, ErrNoScreen 32 | } 33 | 34 | func (t *tScreen) Beep() error { 35 | return ErrNoScreen 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/gdamore/tcell/v2/tscreen_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | // Copyright 2015 The TCell Authors 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use file except in compliance with the License. 7 | // You may obtain a copy of the license at 8 | // 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | package tcell 18 | 19 | // On Windows we don't have support for termios. We probably could, and 20 | // may should, in a cygwin type environment. Its not clear how to make 21 | // this all work nicely with both cygwin and Windows console, so we 22 | // decline to do so here. 23 | 24 | func (t *tScreen) termioInit() error { 25 | return ErrNoScreen 26 | } 27 | 28 | func (t *tScreen) termioFini() { 29 | return 30 | } 31 | 32 | func (t *tScreen) getWinSize() (int, int, error) { 33 | return 0, 0, ErrNoScreen 34 | } 35 | 36 | func (t *tScreen) getCharset() string { 37 | return "UTF-16LE" 38 | } 39 | 40 | func (t *tScreen) Beep() error { 41 | return ErrNoScreen 42 | } 43 | 44 | type termiosPrivate struct{} 45 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/.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 | # Vim swap files 11 | .*.sw? 12 | 13 | # Architecture specific extensions/prefixes 14 | *.[568vq] 15 | [568vq].out 16 | 17 | *.cgo1.go 18 | *.cgo2.c 19 | _cgo_defun.c 20 | _cgo_gotypes.go 21 | _cgo_export.* 22 | 23 | _testmain.go 24 | 25 | *.exe 26 | 27 | # Code coverage stuff 28 | coverage.out 29 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | install: 3 | - go get golang.org/x/tools/cmd/cover 4 | - go get github.com/mattn/goveralls 5 | script: 6 | - go test -v -covermode=count -coverprofile=coverage.out 7 | - if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci -repotoken $COVERALLS_TOKEN; fi 8 | -------------------------------------------------------------------------------- /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/colorgens.go: -------------------------------------------------------------------------------- 1 | // Various ways to generate single random colors 2 | 3 | package colorful 4 | 5 | import ( 6 | "math/rand" 7 | ) 8 | 9 | // Creates a random dark, "warm" color through a restricted HSV space. 10 | func FastWarmColor() Color { 11 | return Hsv( 12 | rand.Float64()*360.0, 13 | 0.5+rand.Float64()*0.3, 14 | 0.3+rand.Float64()*0.3) 15 | } 16 | 17 | // Creates a random dark, "warm" color through restricted HCL space. 18 | // This is slower than FastWarmColor but will likely give you colors which have 19 | // the same "warmness" if you run it many times. 20 | func WarmColor() (c Color) { 21 | for c = randomWarm(); !c.IsValid(); c = randomWarm() { 22 | } 23 | return 24 | } 25 | 26 | func randomWarm() Color { 27 | return Hcl( 28 | rand.Float64()*360.0, 29 | 0.1+rand.Float64()*0.3, 30 | 0.2+rand.Float64()*0.3) 31 | } 32 | 33 | // Creates a random bright, "pimpy" color through a restricted HSV space. 34 | func FastHappyColor() Color { 35 | return Hsv( 36 | rand.Float64()*360.0, 37 | 0.7+rand.Float64()*0.3, 38 | 0.6+rand.Float64()*0.3) 39 | } 40 | 41 | // Creates a random bright, "pimpy" color through restricted HCL space. 42 | // This is slower than FastHappyColor but will likely give you colors which 43 | // have the same "brightness" if you run it many times. 44 | func HappyColor() (c Color) { 45 | for c = randomPimp(); !c.IsValid(); c = randomPimp() { 46 | } 47 | return 48 | } 49 | 50 | func randomPimp() Color { 51 | return Hcl( 52 | rand.Float64()*360.0, 53 | 0.5+rand.Float64()*0.3, 54 | 0.5+rand.Float64()*0.3) 55 | } 56 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/lucasb-eyer/go-colorful 2 | 3 | go 1.12 4 | -------------------------------------------------------------------------------- /vendor/github.com/lucasb-eyer/go-colorful/go.sum: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liamg/flinch/c45d2bbdab775e56e905b0ba4fb663df76df6900/vendor/github.com/lucasb-eyer/go-colorful/go.sum -------------------------------------------------------------------------------- /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/hexcolor.go: -------------------------------------------------------------------------------- 1 | package colorful 2 | 3 | import ( 4 | "database/sql/driver" 5 | "fmt" 6 | "reflect" 7 | ) 8 | 9 | // A HexColor is a Color stored as a hex string "#rrggbb". It implements the 10 | // database/sql.Scanner and database/sql/driver.Value interfaces. 11 | type HexColor Color 12 | 13 | type errUnsupportedType struct { 14 | got interface{} 15 | want reflect.Type 16 | } 17 | 18 | func (hc *HexColor) Scan(value interface{}) error { 19 | s, ok := value.(string) 20 | if !ok { 21 | return errUnsupportedType{got: reflect.TypeOf(value), want: reflect.TypeOf("")} 22 | } 23 | c, err := Hex(s) 24 | if err != nil { 25 | return err 26 | } 27 | *hc = HexColor(c) 28 | return nil 29 | } 30 | 31 | func (hc *HexColor) Value() (driver.Value, error) { 32 | return Color(*hc).Hex(), nil 33 | } 34 | 35 | func (e errUnsupportedType) Error() string { 36 | return fmt.Sprintf("unsupported type: got %v, want a %s", e.got, e.want) 37 | } 38 | -------------------------------------------------------------------------------- /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-runewidth/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | go: 3 | - tip 4 | before_install: 5 | - go get github.com/mattn/goveralls 6 | - go get golang.org/x/tools/cmd/cover 7 | script: 8 | - $HOME/gopath/bin/goveralls -repotoken lAKAWPzcGsD3A8yBX3BGGtRUdJ6CaGERL 9 | -------------------------------------------------------------------------------- /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.mkd: -------------------------------------------------------------------------------- 1 | go-runewidth 2 | ============ 3 | 4 | [![Build Status](https://travis-ci.org/mattn/go-runewidth.png?branch=master)](https://travis-ci.org/mattn/go-runewidth) 5 | [![Coverage Status](https://coveralls.io/repos/mattn/go-runewidth/badge.png?branch=HEAD)](https://coveralls.io/r/mattn/go-runewidth?branch=HEAD) 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/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mattn/go-runewidth 2 | 3 | go 1.9 4 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package runewidth 4 | 5 | // IsEastAsian return true if the current locale is CJK 6 | func IsEastAsian() bool { 7 | return false 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_js.go: -------------------------------------------------------------------------------- 1 | // +build js 2 | // +build !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_posix.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | // +build !js 3 | // +build !appengine 4 | 5 | package runewidth 6 | 7 | import ( 8 | "os" 9 | "regexp" 10 | "strings" 11 | ) 12 | 13 | var reLoc = regexp.MustCompile(`^[a-z][a-z][a-z]?(?:_[A-Z][A-Z])?\.(.+)`) 14 | 15 | var mblenTable = map[string]int{ 16 | "utf-8": 6, 17 | "utf8": 6, 18 | "jis": 8, 19 | "eucjp": 3, 20 | "euckr": 2, 21 | "euccn": 2, 22 | "sjis": 2, 23 | "cp932": 2, 24 | "cp51932": 2, 25 | "cp936": 2, 26 | "cp949": 2, 27 | "cp950": 2, 28 | "big5": 2, 29 | "gbk": 2, 30 | "gb2312": 2, 31 | } 32 | 33 | func isEastAsian(locale string) bool { 34 | charset := strings.ToLower(locale) 35 | r := reLoc.FindStringSubmatch(locale) 36 | if len(r) == 2 { 37 | charset = strings.ToLower(r[1]) 38 | } 39 | 40 | if strings.HasSuffix(charset, "@cjk_narrow") { 41 | return false 42 | } 43 | 44 | for pos, b := range []byte(charset) { 45 | if b == '@' { 46 | charset = charset[:pos] 47 | break 48 | } 49 | } 50 | max := 1 51 | if m, ok := mblenTable[charset]; ok { 52 | max = m 53 | } 54 | if max > 1 && (charset[0] != 'u' || 55 | strings.HasPrefix(locale, "ja") || 56 | strings.HasPrefix(locale, "ko") || 57 | strings.HasPrefix(locale, "zh")) { 58 | return true 59 | } 60 | return false 61 | } 62 | 63 | // IsEastAsian return true if the current locale is CJK 64 | func IsEastAsian() bool { 65 | locale := os.Getenv("LC_CTYPE") 66 | if locale == "" { 67 | locale = os.Getenv("LANG") 68 | } 69 | 70 | // ignore C locale 71 | if locale == "POSIX" || locale == "C" { 72 | return false 73 | } 74 | if len(locale) > 1 && locale[0] == 'C' && (locale[1] == '.' || locale[1] == '-') { 75 | return false 76 | } 77 | 78 | return isEastAsian(locale) 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-runewidth/runewidth_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | // +build !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/pmezard/go-difflib/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013, Patrick Mezard 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | The names of its contributors may not be used to endorse or promote 14 | products derived from this software without specific prior written 15 | permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 18 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 20 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 23 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 24 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2012-2020 Mat Ryer, Tyler Bunnell and contributors. 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/stretchr/testify/assert/assertion_format.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentFormat}} 2 | func {{.DocInfo.Name}}f(t TestingT, {{.ParamsFormat}}) bool { 3 | if h, ok := t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(t, {{.ForwardedParamsFormat}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/assertion_forward.go.tmpl: -------------------------------------------------------------------------------- 1 | {{.CommentWithoutT "a"}} 2 | func (a *Assertions) {{.DocInfo.Name}}({{.Params}}) bool { 3 | if h, ok := a.t.(tHelper); ok { h.Helper() } 4 | return {{.DocInfo.Name}}(a.t, {{.ForwardedParams}}) 5 | } 6 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/doc.go: -------------------------------------------------------------------------------- 1 | // Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. 2 | // 3 | // Example Usage 4 | // 5 | // The following is a complete example using assert in a standard test function: 6 | // import ( 7 | // "testing" 8 | // "github.com/stretchr/testify/assert" 9 | // ) 10 | // 11 | // func TestSomething(t *testing.T) { 12 | // 13 | // var a string = "Hello" 14 | // var b string = "Hello" 15 | // 16 | // assert.Equal(t, a, b, "The two words should be the same.") 17 | // 18 | // } 19 | // 20 | // if you assert many times, use the format below: 21 | // 22 | // import ( 23 | // "testing" 24 | // "github.com/stretchr/testify/assert" 25 | // ) 26 | // 27 | // func TestSomething(t *testing.T) { 28 | // assert := assert.New(t) 29 | // 30 | // var a string = "Hello" 31 | // var b string = "Hello" 32 | // 33 | // assert.Equal(a, b, "The two words should be the same.") 34 | // } 35 | // 36 | // Assertions 37 | // 38 | // Assertions allow you to easily write test code, and are global funcs in the `assert` package. 39 | // All assertion functions take, as the first argument, the `*testing.T` object provided by the 40 | // testing framework. This allows the assertion funcs to write the failings and other details to 41 | // the correct place. 42 | // 43 | // Every assertion function also takes an optional string message as the final argument, 44 | // allowing custom error messages to be appended to the message the assertion method outputs. 45 | package assert 46 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/errors.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | import ( 4 | "errors" 5 | ) 6 | 7 | // AnError is an error instance useful for testing. If the code does not care 8 | // about error specifics, and only needs to return the error for example, this 9 | // error should be used to make the test code more readable. 10 | var AnError = errors.New("assert.AnError general error for testing") 11 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/testify/assert/forward_assertions.go: -------------------------------------------------------------------------------- 1 | package assert 2 | 3 | // Assertions provides assertion methods around the 4 | // TestingT interface. 5 | type Assertions struct { 6 | t TestingT 7 | } 8 | 9 | // New makes a new Assertions object for the specified TestingT. 10 | func New(t TestingT) *Assertions { 11 | return &Assertions{ 12 | t: t, 13 | } 14 | } 15 | 16 | //go:generate sh -c "cd ../_codegen && go build && cd - && ../_codegen/_codegen -output-package=assert -template=assertion_forward.go.tmpl -include-format-funcs" 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/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/sys/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/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /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/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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build go1.9 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | type Signal = syscall.Signal 13 | type Errno = syscall.Errno 14 | type SysProcAttr = syscall.SysProcAttr 15 | -------------------------------------------------------------------------------- /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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, AIX are implemented in runtime/syscall_aix.go 11 | // 12 | 13 | TEXT ·syscall6(SB),NOSPLIT,$0-88 14 | JMP syscall·syscall6(SB) 15 | 16 | TEXT ·rawSyscall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSyscall6(SB) 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, Darwin 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-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_darwin_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, Darwin 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 ·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_darwin_arm.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 | // +build !gccgo 6 | // +build arm,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for ARM, Darwin 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 ·Syscall9(SB),NOSPLIT,$0-52 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_darwin_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 | // +build !gccgo 6 | // +build arm64,darwin 7 | 8 | #include "textflag.h" 9 | 10 | // 11 | // System call support for AMD64, Darwin 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 | B syscall·Syscall(SB) 19 | 20 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 21 | B syscall·Syscall6(SB) 22 | 23 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 24 | B syscall·Syscall9(SB) 25 | 26 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 27 | B syscall·RawSyscall(SB) 28 | 29 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 30 | B syscall·RawSyscall6(SB) 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_dragonfly_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, DragonFly 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 ·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_freebsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, FreeBSD 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-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_freebsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, FreeBSD 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 ·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_freebsd_arm.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, FreeBSD 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-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_freebsd_arm64.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, FreeBSD 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 ·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_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for 386, Linux 11 | // 12 | 13 | // See ../runtime/sys_linux_386.s for the reason why we always use int 0x80 14 | // instead of the glibc-specific "CALL 0x10(GS)". 15 | #define INVOKE_SYSCALL INT $0x80 16 | 17 | // Just jump to package syscall's implementation for all these functions. 18 | // The runtime may know about them. 19 | 20 | TEXT ·Syscall(SB),NOSPLIT,$0-28 21 | JMP syscall·Syscall(SB) 22 | 23 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 24 | JMP syscall·Syscall6(SB) 25 | 26 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 27 | CALL runtime·entersyscall(SB) 28 | MOVL trap+0(FP), AX // syscall entry 29 | MOVL a1+4(FP), BX 30 | MOVL a2+8(FP), CX 31 | MOVL a3+12(FP), DX 32 | MOVL $0, SI 33 | MOVL $0, DI 34 | INVOKE_SYSCALL 35 | MOVL AX, r1+16(FP) 36 | MOVL DX, r2+20(FP) 37 | CALL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVL trap+0(FP), AX // syscall entry 48 | MOVL a1+4(FP), BX 49 | MOVL a2+8(FP), CX 50 | MOVL a3+12(FP), DX 51 | MOVL $0, SI 52 | MOVL $0, DI 53 | INVOKE_SYSCALL 54 | MOVL AX, r1+16(FP) 55 | MOVL DX, r2+20(FP) 56 | RET 57 | 58 | TEXT ·socketcall(SB),NOSPLIT,$0-36 59 | JMP syscall·socketcall(SB) 60 | 61 | TEXT ·rawsocketcall(SB),NOSPLIT,$0-36 62 | JMP syscall·rawsocketcall(SB) 63 | 64 | TEXT ·seek(SB),NOSPLIT,$0-28 65 | JMP syscall·seek(SB) 66 | -------------------------------------------------------------------------------- /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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for AMD64, Linux 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 | CALL runtime·entersyscall(SB) 24 | MOVQ a1+8(FP), DI 25 | MOVQ a2+16(FP), SI 26 | MOVQ a3+24(FP), DX 27 | MOVQ $0, R10 28 | MOVQ $0, R8 29 | MOVQ $0, R9 30 | MOVQ trap+0(FP), AX // syscall entry 31 | SYSCALL 32 | MOVQ AX, r1+32(FP) 33 | MOVQ DX, r2+40(FP) 34 | CALL 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 | MOVQ a1+8(FP), DI 45 | MOVQ a2+16(FP), SI 46 | MOVQ a3+24(FP), DX 47 | MOVQ $0, R10 48 | MOVQ $0, R8 49 | MOVQ $0, R9 50 | MOVQ trap+0(FP), AX // syscall entry 51 | SYSCALL 52 | MOVQ AX, r1+32(FP) 53 | MOVQ DX, r2+40(FP) 54 | RET 55 | 56 | TEXT ·gettimeofday(SB),NOSPLIT,$0-16 57 | JMP syscall·gettimeofday(SB) 58 | -------------------------------------------------------------------------------- /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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for arm, Linux 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-28 17 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 23 | BL runtime·entersyscall(SB) 24 | MOVW trap+0(FP), R7 25 | MOVW a1+4(FP), R0 26 | MOVW a2+8(FP), R1 27 | MOVW a3+12(FP), R2 28 | MOVW $0, R3 29 | MOVW $0, R4 30 | MOVW $0, R5 31 | SWI $0 32 | MOVW R0, r1+16(FP) 33 | MOVW $0, R0 34 | MOVW R0, r2+20(FP) 35 | BL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | B syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | B syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW trap+0(FP), R7 // syscall entry 46 | MOVW a1+4(FP), R0 47 | MOVW a2+8(FP), R1 48 | MOVW a3+12(FP), R2 49 | SWI $0 50 | MOVW R0, r1+16(FP) 51 | MOVW $0, R0 52 | MOVW R0, r2+20(FP) 53 | RET 54 | 55 | TEXT ·seek(SB),NOSPLIT,$0-28 56 | B syscall·seek(SB) 57 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build arm64 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 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-56 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 21 | BL runtime·entersyscall(SB) 22 | MOVD a1+8(FP), R0 23 | MOVD a2+16(FP), R1 24 | MOVD a3+24(FP), R2 25 | MOVD $0, R3 26 | MOVD $0, R4 27 | MOVD $0, R5 28 | MOVD trap+0(FP), R8 // syscall entry 29 | SVC 30 | MOVD R0, r1+32(FP) // r1 31 | MOVD R1, r2+40(FP) // r2 32 | BL runtime·exitsyscall(SB) 33 | RET 34 | 35 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 36 | B syscall·RawSyscall(SB) 37 | 38 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 39 | B syscall·RawSyscall6(SB) 40 | 41 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 42 | MOVD a1+8(FP), R0 43 | MOVD a2+16(FP), R1 44 | MOVD a3+24(FP), R2 45 | MOVD $0, R3 46 | MOVD $0, R4 47 | MOVD $0, R5 48 | MOVD trap+0(FP), R8 // syscall entry 49 | SVC 50 | MOVD R0, r1+32(FP) 51 | MOVD R1, r2+40(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build mips64 mips64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | JAL runtime·entersyscall(SB) 26 | MOVV a1+8(FP), R4 27 | MOVV a2+16(FP), R5 28 | MOVV a3+24(FP), R6 29 | MOVV R0, R7 30 | MOVV R0, R8 31 | MOVV R0, R9 32 | MOVV trap+0(FP), R2 // syscall entry 33 | SYSCALL 34 | MOVV R2, r1+32(FP) 35 | MOVV R3, r2+40(FP) 36 | JAL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | JMP syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | JMP syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVV a1+8(FP), R4 47 | MOVV a2+16(FP), R5 48 | MOVV a3+24(FP), R6 49 | MOVV R0, R7 50 | MOVV R0, R8 51 | MOVV R0, R9 52 | MOVV trap+0(FP), R2 // syscall entry 53 | SYSCALL 54 | MOVV R2, r1+32(FP) 55 | MOVV R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build mips mipsle 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for mips, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-28 19 | JMP syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 22 | JMP syscall·Syscall6(SB) 23 | 24 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 25 | JMP syscall·Syscall9(SB) 26 | 27 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-24 28 | JAL runtime·entersyscall(SB) 29 | MOVW a1+4(FP), R4 30 | MOVW a2+8(FP), R5 31 | MOVW a3+12(FP), R6 32 | MOVW R0, R7 33 | MOVW trap+0(FP), R2 // syscall entry 34 | SYSCALL 35 | MOVW R2, r1+16(FP) // r1 36 | MOVW R3, r2+20(FP) // r2 37 | JAL runtime·exitsyscall(SB) 38 | RET 39 | 40 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 41 | JMP syscall·RawSyscall(SB) 42 | 43 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 44 | JMP syscall·RawSyscall6(SB) 45 | 46 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 47 | MOVW a1+4(FP), R4 48 | MOVW a2+8(FP), R5 49 | MOVW a3+12(FP), R6 50 | MOVW trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVW R2, r1+16(FP) 53 | MOVW R3, r2+20(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build ppc64 ppc64le 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for ppc64, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R3 21 | MOVD a2+16(FP), R4 22 | MOVD a3+24(FP), R5 23 | MOVD R0, R6 24 | MOVD R0, R7 25 | MOVD R0, R8 26 | MOVD trap+0(FP), R9 // syscall entry 27 | SYSCALL R9 28 | MOVD R3, r1+32(FP) 29 | MOVD R4, r2+40(FP) 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 34 | MOVD a1+8(FP), R3 35 | MOVD a2+16(FP), R4 36 | MOVD a3+24(FP), R5 37 | MOVD R0, R6 38 | MOVD R0, R7 39 | MOVD R0, R8 40 | MOVD trap+0(FP), R9 // syscall entry 41 | SYSCALL R9 42 | MOVD R3, r1+32(FP) 43 | MOVD R4, r2+40(FP) 44 | RET 45 | -------------------------------------------------------------------------------- /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 | // +build riscv64,!gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV $0, A3 27 | MOV $0, A4 28 | MOV $0, A5 29 | MOV $0, A6 30 | MOV trap+0(FP), A7 // syscall entry 31 | ECALL 32 | MOV A0, r1+32(FP) // r1 33 | MOV A1, r2+40(FP) // r2 34 | CALL 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 | MOV a1+8(FP), A0 45 | MOV a2+16(FP), A1 46 | MOV a3+24(FP), A2 47 | MOV ZERO, A3 48 | MOV ZERO, A4 49 | MOV ZERO, A5 50 | MOV trap+0(FP), A7 // syscall entry 51 | ECALL 52 | MOV A0, r1+32(FP) 53 | MOV A1, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /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 | // +build s390x 6 | // +build linux 7 | // +build !gccgo 8 | 9 | #include "textflag.h" 10 | 11 | // 12 | // System calls for s390x, Linux 13 | // 14 | 15 | // Just jump to package syscall's implementation for all these functions. 16 | // The runtime may know about them. 17 | 18 | TEXT ·Syscall(SB),NOSPLIT,$0-56 19 | BR syscall·Syscall(SB) 20 | 21 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 22 | BR syscall·Syscall6(SB) 23 | 24 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 25 | BL runtime·entersyscall(SB) 26 | MOVD a1+8(FP), R2 27 | MOVD a2+16(FP), R3 28 | MOVD a3+24(FP), R4 29 | MOVD $0, R5 30 | MOVD $0, R6 31 | MOVD $0, R7 32 | MOVD trap+0(FP), R1 // syscall entry 33 | SYSCALL 34 | MOVD R2, r1+32(FP) 35 | MOVD R3, r2+40(FP) 36 | BL runtime·exitsyscall(SB) 37 | RET 38 | 39 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 40 | BR syscall·RawSyscall(SB) 41 | 42 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 43 | BR syscall·RawSyscall6(SB) 44 | 45 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 46 | MOVD a1+8(FP), R2 47 | MOVD a2+16(FP), R3 48 | MOVD a3+24(FP), R4 49 | MOVD $0, R5 50 | MOVD $0, R6 51 | MOVD $0, R7 52 | MOVD trap+0(FP), R1 // syscall entry 53 | SYSCALL 54 | MOVD R2, r1+32(FP) 55 | MOVD R3, r2+40(FP) 56 | RET 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_netbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, NetBSD 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-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_netbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, NetBSD 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 ·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_netbsd_arm.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, NetBSD 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-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_netbsd_arm64.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM64, NetBSD 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 | B syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | B syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | B syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | B syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | B syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for 386, OpenBSD 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-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_openbsd_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for AMD64, OpenBSD 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 ·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_openbsd_arm.s: -------------------------------------------------------------------------------- 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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ARM, OpenBSD 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-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_openbsd_arm64.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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for arm64, OpenBSD 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 ·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_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 | // +build !gccgo 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for amd64, Solaris are implemented in runtime/syscall_solaris.go 11 | // 12 | 13 | TEXT ·sysvicall6(SB),NOSPLIT,$0-88 14 | JMP syscall·sysvicall6(SB) 15 | 16 | TEXT ·rawSysvicall6(SB),NOSPLIT,$0-88 17 | JMP syscall·rawSysvicall6(SB) 18 | -------------------------------------------------------------------------------- /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 | ) 27 | 28 | // Socketoption Level 29 | const ( 30 | SOL_BLUETOOTH = 0x112 31 | SOL_HCI = 0x0 32 | SOL_L2CAP = 0x6 33 | SOL_RFCOMM = 0x12 34 | SOL_SCO = 0x11 35 | ) 36 | -------------------------------------------------------------------------------- /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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | const ( 10 | R_OK = 0x4 11 | W_OK = 0x2 12 | X_OK = 0x1 13 | ) 14 | -------------------------------------------------------------------------------- /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 | // +build aix 6 | // +build 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 | // +build aix 6 | // +build 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_linux.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 by the Linux kernel and glibc. 7 | // 8 | // The information below is extracted and adapted from bits/sysmacros.h in the 9 | // glibc sources: 10 | // 11 | // dev_t in glibc is 64-bit, with 32-bit major and minor numbers. glibc's 12 | // default encoding is MMMM Mmmm mmmM MMmm, where M is a hex digit of the major 13 | // number and m is a hex digit of the minor number. This is backward compatible 14 | // with legacy systems where dev_t is 16 bits wide, encoded as MMmm. It is also 15 | // backward compatible with the Linux kernel, which for some architectures uses 16 | // 32-bit dev_t, encoded as mmmM MMmm. 17 | 18 | package unix 19 | 20 | // Major returns the major component of a Linux device number. 21 | func Major(dev uint64) uint32 { 22 | major := uint32((dev & 0x00000000000fff00) >> 8) 23 | major |= uint32((dev & 0xfffff00000000000) >> 32) 24 | return major 25 | } 26 | 27 | // Minor returns the minor component of a Linux device number. 28 | func Minor(dev uint64) uint32 { 29 | minor := uint32((dev & 0x00000000000000ff) >> 0) 30 | minor |= uint32((dev & 0x00000ffffff00000) >> 12) 31 | return minor 32 | } 33 | 34 | // Mkdev returns a Linux device number generated from the given major and minor 35 | // components. 36 | func Mkdev(major, minor uint32) uint64 { 37 | dev := (uint64(major) & 0x00000fff) << 8 38 | dev |= (uint64(major) & 0xfffff000) << 32 39 | dev |= (uint64(minor) & 0x000000ff) << 0 40 | dev |= (uint64(minor) & 0xffffff00) << 12 41 | return dev 42 | } 43 | -------------------------------------------------------------------------------- /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/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 | // +build ppc64 s390x mips mips64 6 | 7 | package unix 8 | 9 | const isBigEndian = true 10 | -------------------------------------------------------------------------------- /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 | // +build 386 amd64 amd64p32 arm arm64 ppc64le mipsle mips64le 6 | 7 | package unix 8 | 9 | const isBigEndian = false 10 | -------------------------------------------------------------------------------- /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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // Unix environment variables. 8 | 9 | package unix 10 | 11 | import "syscall" 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/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 | // +build dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // fcntl64Syscall is usually SYS_FCNTL, but is overridden on 32-bit Linux 12 | // systems by flock_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 16 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 17 | valptr, _, errno := Syscall(fcntl64Syscall, 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 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 26 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 27 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 28 | if errno == 0 { 29 | return nil 30 | } 31 | return errno 32 | } 33 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // +build linux,386 linux,arm linux,mips linux,mipsle 2 | 3 | // Copyright 2014 The Go Authors. All rights reserved. 4 | // Use of this source code is governed by a BSD-style 5 | // license that can be found in the LICENSE file. 6 | 7 | package unix 8 | 9 | func init() { 10 | // On 32-bit Linux systems, the fcntl syscall that matches Go's 11 | // Flock_t type is SYS_FCNTL64, not SYS_FCNTL. 12 | fcntl64Syscall = SYS_FCNTL64 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_c.c: -------------------------------------------------------------------------------- 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 | // +build gccgo 6 | // +build !aix 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define _STRINGIFY2_(x) #x 13 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 14 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 15 | 16 | // Call syscall from C code because the gccgo support for calling from 17 | // Go to C does not support varargs functions. 18 | 19 | struct ret { 20 | uintptr_t r; 21 | uintptr_t err; 22 | }; 23 | 24 | struct ret 25 | gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 26 | { 27 | struct ret r; 28 | 29 | errno = 0; 30 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 31 | r.err = errno; 32 | return r; 33 | } 34 | 35 | uintptr_t 36 | gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9) 37 | { 38 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 39 | } 40 | -------------------------------------------------------------------------------- /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 | // +build gccgo,linux,amd64 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //extern gettimeofday 12 | func realGettimeofday(*Timeval, *byte) int32 13 | 14 | func gettimeofday(tv *Timeval) (err syscall.Errno) { 15 | r := realGettimeofday(tv, nil) 16 | if r < 0 { 17 | return syscall.GetErrno() 18 | } 19 | return 0 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ioctl.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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // IoctlSetWinsize performs an ioctl on fd with a *Winsize argument. 12 | // 13 | // To change fd's window size, the req argument should be TIOCSWINSZ. 14 | func IoctlSetWinsize(fd int, req uint, value *Winsize) error { 15 | // TODO: if we get the chance, remove the req parameter and 16 | // hardcode TIOCSWINSZ. 17 | err := ioctlSetWinsize(fd, req, value) 18 | runtime.KeepAlive(value) 19 | return err 20 | } 21 | 22 | // IoctlSetTermios performs an ioctl on fd with a *Termios. 23 | // 24 | // The req value will usually be TCSETA or TIOCSETA. 25 | func IoctlSetTermios(fd int, req uint, value *Termios) error { 26 | // TODO: if we get the chance, remove the req parameter. 27 | err := ioctlSetTermios(fd, req, value) 28 | runtime.KeepAlive(value) 29 | return err 30 | } 31 | -------------------------------------------------------------------------------- /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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | // For Unix, get the pagesize from the runtime. 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Getpagesize() int { 14 | return syscall.Getpagesize() 15 | } 16 | -------------------------------------------------------------------------------- /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 | // +build darwin,race linux,race freebsd,race 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | "unsafe" 12 | ) 13 | 14 | const raceenabled = true 15 | 16 | func raceAcquire(addr unsafe.Pointer) { 17 | runtime.RaceAcquire(addr) 18 | } 19 | 20 | func raceReleaseMerge(addr unsafe.Pointer) { 21 | runtime.RaceReleaseMerge(addr) 22 | } 23 | 24 | func raceReadRange(addr unsafe.Pointer, len int) { 25 | runtime.RaceReadRange(addr, len) 26 | } 27 | 28 | func raceWriteRange(addr unsafe.Pointer, len int) { 29 | runtime.RaceWriteRange(addr, len) 30 | } 31 | -------------------------------------------------------------------------------- /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 | // +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /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 | // +build aix dragonfly freebsd linux netbsd openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /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 | // +build darwin 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_linux.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 | // Socket control messages 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // UnixCredentials encodes credentials into a socket control message 12 | // for sending to another process. This can be used for 13 | // authentication. 14 | func UnixCredentials(ucred *Ucred) []byte { 15 | b := make([]byte, CmsgSpace(SizeofUcred)) 16 | h := (*Cmsghdr)(unsafe.Pointer(&b[0])) 17 | h.Level = SOL_SOCKET 18 | h.Type = SCM_CREDENTIALS 19 | h.SetLen(CmsgLen(SizeofUcred)) 20 | *((*Ucred)(cmsgData(h))) = *ucred 21 | return b 22 | } 23 | 24 | // ParseUnixCredentials decodes a socket control message that contains 25 | // credentials in a Ucred structure. To receive such a message, the 26 | // SO_PASSCRED option must be enabled on the socket. 27 | func ParseUnixCredentials(m *SocketControlMessage) (*Ucred, error) { 28 | if m.Header.Level != SOL_SOCKET { 29 | return nil, EINVAL 30 | } 31 | if m.Header.Type != SCM_CREDENTIALS { 32 | return nil, EINVAL 33 | } 34 | ucred := *(*Ucred)(unsafe.Pointer(&m.Data[0])) 35 | return &ucred, nil 36 | } 37 | -------------------------------------------------------------------------------- /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 | // +build aix darwin dragonfly freebsd linux netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + uitoa(uint(-val)) 12 | } 13 | return uitoa(uint(val)) 14 | } 15 | 16 | func uitoa(val uint) string { 17 | var buf [32]byte // big enough for int64 18 | i := len(buf) - 1 19 | for val >= 10 { 20 | buf[i] = byte(val%10 + '0') 21 | i-- 22 | val /= 10 23 | } 24 | buf[i] = byte(val + '0') 25 | return string(buf[i:]) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_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 | // +build aix 6 | // +build ppc 7 | 8 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) = setrlimit64 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 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 (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | 36 | func Fstat(fd int, stat *Stat_t) error { 37 | return fstat(fd, stat) 38 | } 39 | 40 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 41 | return fstatat(dirfd, path, stat, flags) 42 | } 43 | 44 | func Lstat(path string, stat *Stat_t) error { 45 | return lstat(path, stat) 46 | } 47 | 48 | func Stat(path string, statptr *Stat_t) error { 49 | return stat(path, statptr) 50 | } 51 | -------------------------------------------------------------------------------- /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 | // +build darwin,go1.12 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_darwin.go) 12 | func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 13 | func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 14 | func syscall_syscall6X(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) // 32-bit only 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_syscall6X syscall.syscall6X 22 | //go:linkname syscall_syscall9 syscall.syscall9 23 | //go:linkname syscall_rawSyscall syscall.rawSyscall 24 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 25 | 26 | // Find the entry point for f. See comments in runtime/proc.go for the 27 | // function of the same name. 28 | //go:nosplit 29 | func funcPC(f func()) uintptr { 30 | return **(**uintptr)(unsafe.Pointer(&f)) 31 | } 32 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_dragonfly_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 | // +build amd64,dragonfly 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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 | // +build 386,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: int32(sec), Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: int32(sec), Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_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 | // +build amd64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm.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 | // +build arm,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: int32(nsec)} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: int32(usec)} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint32(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint32(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_arm64.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 | // +build arm64,freebsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func setTimespec(sec, nsec int64) Timespec { 15 | return Timespec{Sec: sec, Nsec: nsec} 16 | } 17 | 18 | func setTimeval(sec, usec int64) Timeval { 19 | return Timeval{Sec: sec, Usec: usec} 20 | } 21 | 22 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 23 | k.Ident = uint64(fd) 24 | k.Filter = int16(mode) 25 | k.Flags = uint16(flags) 26 | } 27 | 28 | func (iov *Iovec) SetLen(length int) { 29 | iov.Len = uint64(length) 30 | } 31 | 32 | func (msghdr *Msghdr) SetControllen(length int) { 33 | msghdr.Controllen = uint32(length) 34 | } 35 | 36 | func (cmsg *Cmsghdr) SetLen(length int) { 37 | cmsg.Len = uint32(length) 38 | } 39 | 40 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 41 | var writtenOut uint64 = 0 42 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 43 | 44 | written = int(writtenOut) 45 | 46 | if e1 != 0 { 47 | err = e1 48 | } 49 | return 50 | } 51 | 52 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 53 | -------------------------------------------------------------------------------- /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 | // +build amd64,linux 6 | // +build !gccgo 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 | // +build linux,!gccgo 6 | 7 | package unix 8 | 9 | // SyscallNoError may be used instead of Syscall for syscalls that don't fail. 10 | func SyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 11 | 12 | // RawSyscallNoError may be used instead of RawSyscall for syscalls that don't 13 | // fail. 14 | func RawSyscallNoError(trap, a1, a2, a3 uintptr) (r1, r2 uintptr) 15 | -------------------------------------------------------------------------------- /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 | // +build linux,!gccgo,386 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // Underlying system call writes to newoffset via pointer. 12 | // Implemented in assembly to avoid allocation. 13 | func seek(fd int, offset int64, whence int) (newoffset int64, err syscall.Errno) 14 | 15 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 16 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (n int, err syscall.Errno) 17 | -------------------------------------------------------------------------------- /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 | // +build linux,gccgo,386 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | 22 | func socketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 23 | fd, _, err := Syscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 24 | return int(fd), err 25 | } 26 | 27 | func rawsocketcall(call int, a0, a1, a2, a3, a4, a5 uintptr) (int, syscall.Errno) { 28 | fd, _, err := RawSyscall(SYS_SOCKETCALL, uintptr(call), uintptr(unsafe.Pointer(&a0)), 0) 29 | return int(fd), err 30 | } 31 | -------------------------------------------------------------------------------- /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 | // +build linux,gccgo,arm 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func seek(fd int, offset int64, whence int) (int64, syscall.Errno) { 15 | var newoffset int64 16 | offsetLow := uint32(offset & 0xffffffff) 17 | offsetHigh := uint32((offset >> 32) & 0xffffffff) 18 | _, _, err := Syscall6(SYS__LLSEEK, uintptr(fd), uintptr(offsetHigh), uintptr(offsetLow), uintptr(unsafe.Pointer(&newoffset)), uintptr(whence), 0) 19 | return newoffset, err 20 | } 21 | -------------------------------------------------------------------------------- /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 | // +build 386,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | // +build amd64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | // +build arm,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | // +build arm64,netbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = uint32(mode) 20 | k.Flags = uint32(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | -------------------------------------------------------------------------------- /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 | // +build 386,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /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 | // +build amd64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /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 | // +build arm,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: int32(nsec)} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: int32(usec)} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint32(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint32(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /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 | // +build arm64,openbsd 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 18 | k.Ident = uint64(fd) 19 | k.Filter = int16(mode) 20 | k.Flags = uint16(flags) 21 | } 22 | 23 | func (iov *Iovec) SetLen(length int) { 24 | iov.Len = uint64(length) 25 | } 26 | 27 | func (msghdr *Msghdr) SetControllen(length int) { 28 | msghdr.Controllen = uint32(length) 29 | } 30 | 31 | func (cmsg *Cmsghdr) SetLen(length int) { 32 | cmsg.Len = uint32(length) 33 | } 34 | 35 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 36 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 37 | const SYS___SYSCTL = SYS_SYSCTL 38 | -------------------------------------------------------------------------------- /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 | // +build amd64,solaris 6 | 7 | package unix 8 | 9 | func setTimespec(sec, nsec int64) Timespec { 10 | return Timespec{Sec: sec, Nsec: nsec} 11 | } 12 | 13 | func setTimeval(sec, usec int64) Timeval { 14 | return Timeval{Sec: sec, Usec: usec} 15 | } 16 | 17 | func (iov *Iovec) SetLen(length int) { 18 | iov.Len = uint64(length) 19 | } 20 | 21 | func (cmsg *Cmsghdr) SetLen(length int) { 22 | cmsg.Len = uint32(length) 23 | } 24 | -------------------------------------------------------------------------------- /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 | // +build darwin dragonfly freebsd linux netbsd openbsd solaris 6 | // +build !gccgo,!ppc64le,!ppc64 7 | 8 | package unix 9 | 10 | import "syscall" 11 | 12 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 16 | -------------------------------------------------------------------------------- /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 | // +build linux 6 | // +build ppc64le ppc64 7 | // +build !gccgo 8 | 9 | package unix 10 | 11 | import "syscall" 12 | 13 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 14 | return syscall.Syscall(trap, a1, a2, a3) 15 | } 16 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 17 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 18 | } 19 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 20 | return syscall.RawSyscall(trap, a1, a2, a3) 21 | } 22 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 23 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 24 | } 25 | -------------------------------------------------------------------------------- /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/zptracearm_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(arm, arm64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build arm arm64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsArm is the registers used by arm binaries. 11 | type PtraceRegsArm struct { 12 | Uregs [18]uint32 13 | } 14 | 15 | // PtraceGetRegsArm fetches the registers used by arm binaries. 16 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 17 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 18 | } 19 | 20 | // PtraceSetRegsArm sets the registers used by arm binaries. 21 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 22 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 23 | } 24 | 25 | // PtraceRegsArm64 is the registers used by arm64 binaries. 26 | type PtraceRegsArm64 struct { 27 | Regs [31]uint64 28 | Sp uint64 29 | Pc uint64 30 | Pstate uint64 31 | } 32 | 33 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 34 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 35 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 36 | } 37 | 38 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 39 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 40 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 41 | } 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracemips_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mips, mips64). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mips mips64 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMips is the registers used by mips binaries. 11 | type PtraceRegsMips struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMips fetches the registers used by mips binaries. 22 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMips sets the registers used by mips binaries. 27 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64 is the registers used by mips64 binaries. 32 | type PtraceRegsMips64 struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 43 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 48 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptracemipsle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair(mipsle, mips64le). DO NOT EDIT. 2 | 3 | // +build linux 4 | // +build mipsle mips64le 5 | 6 | package unix 7 | 8 | import "unsafe" 9 | 10 | // PtraceRegsMipsle is the registers used by mipsle binaries. 11 | type PtraceRegsMipsle struct { 12 | Regs [32]uint64 13 | Lo uint64 14 | Hi uint64 15 | Epc uint64 16 | Badvaddr uint64 17 | Status uint64 18 | Cause uint64 19 | } 20 | 21 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 22 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 23 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 24 | } 25 | 26 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 27 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 28 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 29 | } 30 | 31 | // PtraceRegsMips64le is the registers used by mips64le binaries. 32 | type PtraceRegsMips64le struct { 33 | Regs [32]uint64 34 | Lo uint64 35 | Hi uint64 36 | Epc uint64 37 | Badvaddr uint64 38 | Status uint64 39 | Cause uint64 40 | } 41 | 42 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 43 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 44 | return ptrace(PTRACE_GETREGS, pid, 0, uintptr(unsafe.Pointer(regsout))) 45 | } 46 | 47 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 48 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 49 | return ptrace(PTRACE_SETREGS, pid, 0, uintptr(unsafe.Pointer(regs))) 50 | } 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/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/text/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/text/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009 The Go Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - "1.4.x" 5 | - "1.5.x" 6 | - "1.6.x" 7 | - "1.7.x" 8 | - "1.8.x" 9 | - "1.9.x" 10 | - "1.10.x" 11 | - "1.11.x" 12 | - "1.12.x" 13 | - "1.13.x" 14 | - "tip" 15 | 16 | go_import_path: gopkg.in/yaml.v3 17 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2011-2016 Canonical Ltd. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/go.mod: -------------------------------------------------------------------------------- 1 | module "gopkg.in/yaml.v3" 2 | 3 | require ( 4 | "gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405 5 | ) 6 | -------------------------------------------------------------------------------- /vendor/gopkg.in/yaml.v3/writerc.go: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2011-2019 Canonical Ltd 3 | // Copyright (c) 2006-2010 Kirill Simonov 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | // this software and associated documentation files (the "Software"), to deal in 7 | // the Software without restriction, including without limitation the rights to 8 | // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | // of the Software, and to permit persons to whom the Software is furnished to do 10 | // 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 | 23 | package yaml 24 | 25 | // Set the writer error and return false. 26 | func yaml_emitter_set_writer_error(emitter *yaml_emitter_t, problem string) bool { 27 | emitter.error = yaml_WRITER_ERROR 28 | emitter.problem = problem 29 | return false 30 | } 31 | 32 | // Flush the output buffer. 33 | func yaml_emitter_flush(emitter *yaml_emitter_t) bool { 34 | if emitter.write_handler == nil { 35 | panic("write handler not set") 36 | } 37 | 38 | // Check if the buffer is empty. 39 | if emitter.buffer_pos == 0 { 40 | return true 41 | } 42 | 43 | if err := emitter.write_handler(emitter, emitter.buffer[:emitter.buffer_pos]); err != nil { 44 | return yaml_emitter_set_writer_error(emitter, "write error: "+err.Error()) 45 | } 46 | emitter.buffer_pos = 0 47 | return true 48 | } 49 | -------------------------------------------------------------------------------- /widgets/confirm.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/components" 6 | "github.com/liamg/flinch/core" 7 | "github.com/liamg/flinch/window" 8 | ) 9 | 10 | // Confirm displays a yes/no dialog with the given message. If "Yes" is selected, true is returned. 11 | func Confirm(msg string) (bool, error) { 12 | 13 | win, err := window.New() 14 | if err != nil { 15 | return false, err 16 | } 17 | 18 | minLength := 50 19 | maxLength := minLength 20 | if len(msg) > maxLength { 21 | maxLength = len(msg) 22 | } 23 | 24 | minSize := core.SizeStrategyMultiple( 25 | core.SizeStrategyPercentage(80, 0), 26 | core.SizeStrategyAtLeast(core.Size{W: minLength, H: 1}), 27 | core.SizeStrategyAtMost(core.Size{W: maxLength + 8, H: 100}), 28 | ) 29 | 30 | text := components.NewText(msg) 31 | text.SetAlignment(core.AlignCenter) 32 | text.SetSizeStrategy(minSize) 33 | 34 | strip := components.NewColumnLayout() 35 | strip.SetSizeStrategy(minSize) 36 | strip.SetAlignment(core.AlignCenter) 37 | 38 | yes := components.NewButton("Yes") 39 | no := components.NewButton("No") 40 | strip.Add(yes) 41 | strip.Add(no) 42 | 43 | rows := components.NewRowLayout() 44 | rows.Add(text) 45 | rows.Add(components.NewSpacer(core.Size{H: 1})) 46 | rows.Add(strip) 47 | rows.SetAlignment(core.AlignCenter) 48 | 49 | win.SetAlignment(core.AlignCenter) 50 | win.Add(rows) 51 | 52 | yes.OnPress(func() { 53 | win.Close() 54 | }) 55 | 56 | no.OnPress(func() { 57 | win.Close() 58 | }) 59 | 60 | win.OnKeypress(func(key *tcell.EventKey) bool { 61 | switch key.Key() { 62 | case tcell.KeyLeft: 63 | no.Deselect() 64 | yes.Select() 65 | case tcell.KeyRight: 66 | yes.Deselect() 67 | no.Select() 68 | case tcell.KeyRune: 69 | switch key.Rune() { 70 | case 'y', 'Y': 71 | no.Deselect() 72 | yes.Select() 73 | win.Close() 74 | case 'n', 'N': 75 | yes.Deselect() 76 | no.Select() 77 | win.Close() 78 | } 79 | } 80 | return false 81 | }) 82 | 83 | if err := win.Show(); err != nil { 84 | return false, err 85 | } 86 | 87 | return yes.Selected(), nil 88 | } 89 | -------------------------------------------------------------------------------- /widgets/inputbox.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/components" 6 | "github.com/liamg/flinch/core" 7 | "github.com/liamg/flinch/window" 8 | ) 9 | 10 | func Input(msg string) (string, error) { 11 | 12 | win, err := window.New() 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | minLength := 50 18 | maxLength := minLength 19 | if len(msg) > maxLength { 20 | maxLength = len(msg) 21 | } 22 | 23 | minSize := core.SizeStrategyMultiple( 24 | core.SizeStrategyPercentage(80, 0), 25 | core.SizeStrategyAtLeast(core.Size{W: minLength, H: 1}), 26 | core.SizeStrategyAtMost(core.Size{W: maxLength + 8, H: 100}), 27 | ) 28 | 29 | inputbox := components.NewInput() 30 | inputbox.SetSizeStrategy(minSize) 31 | listFrame := components.NewFrame(inputbox) 32 | 33 | text := components.NewText(msg) 34 | text.PadText(1) 35 | text.SetSizeStrategy(minSize) 36 | 37 | strip := components.NewColumnLayout() 38 | strip.SetSizeStrategy(minSize) 39 | 40 | var selected bool 41 | 42 | inputbox.OnKeypress(func(key *tcell.EventKey) bool { 43 | switch key.Key() { 44 | case tcell.KeyEnter: 45 | selected = true 46 | win.Close() 47 | return true 48 | } 49 | return false 50 | }) 51 | 52 | help := components.NewText("ENTER to confirm, ESC to cancel") 53 | help.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 54 | help.SetAlignment(core.AlignRight) 55 | help.SetStyle(core.StyleFaint) 56 | strip.Add(help) 57 | 58 | rows := components.NewRowLayout() 59 | rows.Add(text) 60 | rows.Add(listFrame) 61 | rows.Add(components.NewSpacer(core.Size{H: 1})) 62 | rows.Add(strip) 63 | rows.SetAlignment(core.AlignCenter) 64 | 65 | win.SetAlignment(core.AlignCenter) 66 | win.Add(rows) 67 | 68 | if err := win.Show(); err != nil { 69 | return "", err 70 | } 71 | 72 | if !selected { 73 | return "", ErrInputCancelled 74 | } 75 | 76 | input := inputbox.GetInput() 77 | 78 | return input, nil 79 | } 80 | -------------------------------------------------------------------------------- /widgets/passwordinputbox.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/components" 6 | "github.com/liamg/flinch/core" 7 | "github.com/liamg/flinch/window" 8 | ) 9 | 10 | func PasswordInput(msg string) (string, error) { 11 | 12 | win, err := window.New() 13 | if err != nil { 14 | return "", err 15 | } 16 | 17 | minLength := 50 18 | maxLength := minLength 19 | if len(msg) > maxLength { 20 | maxLength = len(msg) 21 | } 22 | 23 | minSize := core.SizeStrategyMultiple( 24 | core.SizeStrategyPercentage(80, 0), 25 | core.SizeStrategyAtLeast(core.Size{W: minLength, H: 1}), 26 | core.SizeStrategyAtMost(core.Size{W: maxLength + 8, H: 100}), 27 | ) 28 | 29 | inputbox := components.NewPasswordInput() 30 | inputbox.SetSizeStrategy(minSize) 31 | listFrame := components.NewFrame(inputbox) 32 | 33 | text := components.NewText(msg) 34 | text.PadText(1) 35 | text.SetSizeStrategy(minSize) 36 | 37 | strip := components.NewColumnLayout() 38 | strip.SetSizeStrategy(minSize) 39 | 40 | var selected bool 41 | 42 | inputbox.OnKeypress(func(key *tcell.EventKey) bool { 43 | switch key.Key() { 44 | case tcell.KeyEnter: 45 | selected = true 46 | win.Close() 47 | return true 48 | } 49 | return false 50 | }) 51 | 52 | help := components.NewText("ENTER to confirm, ESC to cancel") 53 | help.SetAlignment(core.AlignRight) 54 | help.SetSizeStrategy(core.SizeStrategyMaximumWidth()) 55 | help.SetStyle(core.StyleFaint) 56 | strip.Add(help) 57 | 58 | rows := components.NewRowLayout() 59 | rows.Add(text) 60 | rows.Add(listFrame) 61 | rows.Add(components.NewSpacer(core.Size{H: 1})) 62 | rows.Add(strip) 63 | rows.SetAlignment(core.AlignCenter) 64 | 65 | win.SetAlignment(core.AlignCenter) 66 | win.Add(rows) 67 | 68 | if err := win.Show(); err != nil { 69 | return "", err 70 | } 71 | 72 | if !selected { 73 | return "", ErrInputCancelled 74 | } 75 | 76 | input := inputbox.GetInput() 77 | 78 | return input, nil 79 | } 80 | -------------------------------------------------------------------------------- /window/base_canvas.go: -------------------------------------------------------------------------------- 1 | package window 2 | 3 | import ( 4 | "github.com/gdamore/tcell/v2" 5 | "github.com/liamg/flinch/core" 6 | ) 7 | 8 | type baseCanvas struct { 9 | screen tcell.Screen 10 | } 11 | 12 | func NewBaseCanvas(screen tcell.Screen) *baseCanvas { 13 | return &baseCanvas{ 14 | screen: screen, 15 | } 16 | } 17 | 18 | func (c *baseCanvas) Set(x, y int, r rune, s core.Style) { 19 | c.screen.SetCell(x, y, s.Tcell(), r) 20 | } 21 | 22 | func (c *baseCanvas) Size() core.Size { 23 | w, h := c.screen.Size() 24 | return core.Size{ 25 | W: w, 26 | H: h, 27 | } 28 | } 29 | 30 | func (c *baseCanvas) Cutout(x, y int, size core.Size) core.Canvas { 31 | return NewCutoutCanvas(c, x, y, size) 32 | } 33 | 34 | func (c *baseCanvas) Fill(r rune, s core.Style) { 35 | size := c.Size() 36 | for x := 0; x < size.W; x++ { 37 | for y := 0; y < size.H; y++ { 38 | c.Set(x, y, r, s) 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /window/base_canvas_test.go: -------------------------------------------------------------------------------- 1 | package window 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/liamg/flinch/core" 7 | 8 | "github.com/gdamore/tcell/v2" 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestBaseCanvasSet(t *testing.T) { 13 | screen := tcell.NewSimulationScreen("") 14 | if err := screen.Init(); err != nil { 15 | t.Fatal(err) 16 | } 17 | defer screen.Fini() 18 | 19 | canvas := NewBaseCanvas(screen) 20 | canvas.Set(5, 5, 'x', core.StyleDefault) 21 | 22 | r, _, _, _ := screen.GetContent(5, 5) 23 | 24 | assert.Equal(t, 'x', r) 25 | 26 | } 27 | 28 | func TestBaseCanvasSize(t *testing.T) { 29 | screen := tcell.NewSimulationScreen("") 30 | if err := screen.Init(); err != nil { 31 | t.Fatal(err) 32 | } 33 | defer screen.Fini() 34 | 35 | canvas := NewBaseCanvas(screen) 36 | 37 | eW, eH := screen.Size() 38 | cSize := canvas.Size() 39 | 40 | assert.Equal(t, eW, cSize.W) 41 | assert.Equal(t, eH, cSize.H) 42 | } 43 | 44 | func TestBaseCanvasCutout(t *testing.T) { 45 | screen := tcell.NewSimulationScreen("") 46 | if err := screen.Init(); err != nil { 47 | t.Fatal(err) 48 | } 49 | defer screen.Fini() 50 | 51 | canvas := NewBaseCanvas(screen) 52 | child := canvas.Cutout(0, 0, core.Size{W: 5, H: 10}) 53 | 54 | cSize := child.Size() 55 | assert.Equal(t, 5, cSize.W) 56 | assert.Equal(t, 10, cSize.H) 57 | } 58 | -------------------------------------------------------------------------------- /window/cutout_canvas.go: -------------------------------------------------------------------------------- 1 | package window 2 | 3 | import ( 4 | "github.com/liamg/flinch/core" 5 | ) 6 | 7 | type cutoutCanvas struct { 8 | parent core.Canvas 9 | x int 10 | y int 11 | size core.Size 12 | } 13 | 14 | func NewCutoutCanvas(parent core.Canvas, x, y int, size core.Size) *cutoutCanvas { 15 | return &cutoutCanvas{ 16 | parent: parent, 17 | x: x, 18 | y: y, 19 | size: size, 20 | } 21 | } 22 | 23 | func (c *cutoutCanvas) Set(x, y int, r rune, s core.Style) { 24 | 25 | if x >= c.size.W { 26 | return 27 | } 28 | if y >= c.size.H { 29 | return 30 | } 31 | tX := c.x + x 32 | tY := c.y + y 33 | 34 | c.parent.Set(tX, tY, r, s) 35 | } 36 | 37 | func (c *cutoutCanvas) Size() core.Size { 38 | return c.size 39 | } 40 | 41 | func (c *cutoutCanvas) Cutout(x, y int, size core.Size) core.Canvas { 42 | return NewCutoutCanvas(c, x, y, size) 43 | } 44 | 45 | func (c *cutoutCanvas) Fill(r rune, s core.Style) { 46 | for x := 0; x < c.size.W; x++ { 47 | for y := 0; y < c.size.H; y++ { 48 | c.Set(x, y, r, s) 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /window/window_test.go: -------------------------------------------------------------------------------- 1 | package window 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/gdamore/tcell/v2" 7 | "github.com/stretchr/testify/assert" 8 | ) 9 | 10 | func getTermSize(t *testing.T) (int, int) { 11 | screen := tcell.NewSimulationScreen("") 12 | if err := screen.Init(); err != nil { 13 | t.Fatal(err) 14 | } 15 | defer screen.Fini() 16 | return screen.Size() 17 | } 18 | 19 | func TestWindowSize(t *testing.T) { 20 | 21 | w, h := getTermSize(t) 22 | 23 | win, err := New(WindowOptionSimulation()) 24 | if err != nil { 25 | t.Error(err) 26 | } 27 | 28 | aw, ah := win.Size() 29 | 30 | assert.Equal(t, w, aw) 31 | assert.Equal(t, h, ah) 32 | } 33 | --------------------------------------------------------------------------------