├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── other.md ├── .gitignore ├── .travis.yml ├── CHANGELOG.md ├── LICENSE ├── Makefile ├── README.md ├── assets ├── demos │ └── demo.gif ├── logo │ ├── credits.md │ └── logo.png └── screenshots │ ├── battery.png │ └── minimal.png ├── build └── nfpm.yml ├── ci └── script.sh ├── colorschemes ├── default.go ├── default.json ├── default_dark.go ├── monokai.go ├── monokai.png ├── solarized.go ├── solarized.png ├── template.go └── vice.go ├── go.mod ├── go.sum ├── main.go ├── scripts └── download.sh ├── snap └── snapcraft.yaml ├── src ├── logging │ ├── logging_arm64.go │ └── logging_other.go ├── termui │ ├── drawille-go │ │ ├── LICENSE.md │ │ ├── README.md │ │ └── drawille.go │ ├── linegraph.go │ ├── sparkline.go │ └── table.go ├── utils │ ├── bytes.go │ ├── conversions.go │ ├── math.go │ └── xdg.go └── widgets │ ├── battery.go │ ├── cpu.go │ ├── disk.go │ ├── help.go │ ├── include │ ├── smc.c │ └── smc.h │ ├── mem.go │ ├── mem_freebsd.go │ ├── mem_other.go │ ├── net.go │ ├── proc.go │ ├── proc_freebsd.go │ ├── proc_linux.go │ ├── proc_other.go │ ├── proc_windows.go │ ├── statusbar.go │ ├── temp.go │ ├── temp_darwin.go │ ├── temp_freebsd.go │ ├── temp_linux.go │ ├── temp_openbsd.go │ └── temp_windows.go └── vendor ├── github.com ├── StackExchange │ └── wmi │ │ ├── LICENSE │ │ ├── README.md │ │ ├── swbemservices.go │ │ └── wmi.go ├── cjbassi │ └── drawille-go │ │ ├── LICENSE │ │ ├── README.md │ │ └── drawille.go ├── distatus │ └── battery │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── battery.go │ │ ├── battery_darwin.go │ │ ├── battery_freebsd_dragonfly_.go │ │ ├── battery_linux.go │ │ ├── battery_netbsd.go │ │ ├── battery_openbsd.go │ │ ├── battery_solaris.go │ │ ├── battery_windows.go │ │ ├── errors.go │ │ └── ioctl.go ├── docopt │ └── docopt.go │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.md │ │ ├── doc.go │ │ ├── docopt.go │ │ ├── error.go │ │ ├── opts.go │ │ ├── pattern.go │ │ ├── test_golang.docopt │ │ ├── testcases.docopt │ │ └── token.go ├── gizak │ └── termui │ │ └── v3 │ │ ├── .gitignore │ │ ├── CHANGELOG.md │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README.md │ │ ├── alignment.go │ │ ├── backend.go │ │ ├── block.go │ │ ├── buffer.go │ │ ├── canvas.go │ │ ├── doc.go │ │ ├── events.go │ │ ├── go.mod │ │ ├── go.sum │ │ ├── grid.go │ │ ├── render.go │ │ ├── style.go │ │ ├── style_parser.go │ │ ├── symbols.go │ │ ├── symbols_other.go │ │ ├── symbols_windows.go │ │ ├── theme.go │ │ └── utils.go ├── go-ole │ └── go-ole │ │ ├── .travis.yml │ │ ├── ChangeLog.md │ │ ├── LICENSE │ │ ├── README.md │ │ ├── appveyor.yml │ │ ├── com.go │ │ ├── com_func.go │ │ ├── connect.go │ │ ├── constants.go │ │ ├── error.go │ │ ├── error_func.go │ │ ├── error_windows.go │ │ ├── guid.go │ │ ├── iconnectionpoint.go │ │ ├── iconnectionpoint_func.go │ │ ├── iconnectionpoint_windows.go │ │ ├── iconnectionpointcontainer.go │ │ ├── iconnectionpointcontainer_func.go │ │ ├── iconnectionpointcontainer_windows.go │ │ ├── idispatch.go │ │ ├── idispatch_func.go │ │ ├── idispatch_windows.go │ │ ├── ienumvariant.go │ │ ├── ienumvariant_func.go │ │ ├── ienumvariant_windows.go │ │ ├── iinspectable.go │ │ ├── iinspectable_func.go │ │ ├── iinspectable_windows.go │ │ ├── iprovideclassinfo.go │ │ ├── iprovideclassinfo_func.go │ │ ├── iprovideclassinfo_windows.go │ │ ├── itypeinfo.go │ │ ├── itypeinfo_func.go │ │ ├── itypeinfo_windows.go │ │ ├── iunknown.go │ │ ├── iunknown_func.go │ │ ├── iunknown_windows.go │ │ ├── ole.go │ │ ├── oleutil │ │ ├── connection.go │ │ ├── connection_func.go │ │ ├── connection_windows.go │ │ ├── go-get.go │ │ └── oleutil.go │ │ ├── safearray.go │ │ ├── safearray_func.go │ │ ├── safearray_windows.go │ │ ├── safearrayconversion.go │ │ ├── safearrayslices.go │ │ ├── utility.go │ │ ├── variables.go │ │ ├── variant.go │ │ ├── variant_386.go │ │ ├── variant_amd64.go │ │ ├── variant_s390x.go │ │ ├── vt_string.go │ │ ├── winrt.go │ │ └── winrt_doc.go ├── mattn │ └── go-runewidth │ │ ├── .travis.yml │ │ ├── LICENSE │ │ ├── README.mkd │ │ ├── runewidth.go │ │ ├── runewidth_appengine.go │ │ ├── runewidth_js.go │ │ ├── runewidth_posix.go │ │ └── runewidth_windows.go ├── mitchellh │ └── go-wordwrap │ │ ├── LICENSE.md │ │ ├── README.md │ │ ├── go.mod │ │ └── wordwrap.go ├── nsf │ └── termbox-go │ │ ├── AUTHORS │ │ ├── LICENSE │ │ ├── README.md │ │ ├── api.go │ │ ├── api_common.go │ │ ├── api_windows.go │ │ ├── collect_terminfo.py │ │ ├── escwait.go │ │ ├── escwait_darwin.go │ │ ├── syscalls.go │ │ ├── syscalls_darwin.go │ │ ├── syscalls_darwin_amd64.go │ │ ├── syscalls_dragonfly.go │ │ ├── syscalls_freebsd.go │ │ ├── syscalls_linux.go │ │ ├── syscalls_netbsd.go │ │ ├── syscalls_openbsd.go │ │ ├── syscalls_windows.go │ │ ├── termbox.go │ │ ├── termbox_common.go │ │ ├── termbox_windows.go │ │ ├── terminfo.go │ │ └── terminfo_builtin.go └── shirou │ ├── gopsutil │ ├── LICENSE │ ├── cpu │ │ ├── cpu.go │ │ ├── cpu_darwin.go │ │ ├── cpu_darwin_cgo.go │ │ ├── cpu_darwin_nocgo.go │ │ ├── cpu_fallback.go │ │ ├── cpu_freebsd.go │ │ ├── cpu_freebsd_386.go │ │ ├── cpu_freebsd_amd64.go │ │ ├── cpu_linux.go │ │ ├── cpu_openbsd.go │ │ ├── cpu_solaris.go │ │ └── cpu_windows.go │ ├── disk │ │ ├── disk.go │ │ ├── disk_darwin.go │ │ ├── disk_darwin.h │ │ ├── disk_darwin_386.go │ │ ├── disk_darwin_amd64.go │ │ ├── disk_darwin_arm64.go │ │ ├── disk_darwin_cgo.go │ │ ├── disk_darwin_nocgo.go │ │ ├── disk_fallback.go │ │ ├── disk_freebsd.go │ │ ├── disk_freebsd_386.go │ │ ├── disk_freebsd_amd64.go │ │ ├── disk_linux.go │ │ ├── disk_openbsd.go │ │ ├── disk_openbsd_amd64.go │ │ ├── disk_solaris.go │ │ ├── disk_unix.go │ │ ├── disk_windows.go │ │ ├── types_freebsd.go │ │ └── types_openbsd.go │ ├── host │ │ ├── host.go │ │ ├── host_darwin.go │ │ ├── host_darwin_386.go │ │ ├── host_darwin_amd64.go │ │ ├── host_fallback.go │ │ ├── host_freebsd.go │ │ ├── host_freebsd_386.go │ │ ├── host_freebsd_amd64.go │ │ ├── host_freebsd_arm.go │ │ ├── host_linux.go │ │ ├── host_linux_386.go │ │ ├── host_linux_amd64.go │ │ ├── host_linux_arm.go │ │ ├── host_linux_arm64.go │ │ ├── host_linux_mips.go │ │ ├── host_linux_mips64.go │ │ ├── host_linux_mips64le.go │ │ ├── host_linux_mipsle.go │ │ ├── host_linux_ppc64le.go │ │ ├── host_linux_s390x.go │ │ ├── host_openbsd.go │ │ ├── host_openbsd_amd64.go │ │ ├── host_solaris.go │ │ ├── host_windows.go │ │ ├── types_darwin.go │ │ ├── types_freebsd.go │ │ ├── types_linux.go │ │ └── types_openbsd.go │ ├── internal │ │ └── common │ │ │ ├── binary.go │ │ │ ├── common.go │ │ │ ├── common_darwin.go │ │ │ ├── common_freebsd.go │ │ │ ├── common_linux.go │ │ │ ├── common_openbsd.go │ │ │ ├── common_unix.go │ │ │ └── common_windows.go │ ├── mem │ │ ├── mem.go │ │ ├── mem_darwin.go │ │ ├── mem_darwin_cgo.go │ │ ├── mem_darwin_nocgo.go │ │ ├── mem_fallback.go │ │ ├── mem_freebsd.go │ │ ├── mem_linux.go │ │ ├── mem_openbsd.go │ │ ├── mem_openbsd_amd64.go │ │ ├── mem_solaris.go │ │ ├── mem_windows.go │ │ └── types_openbsd.go │ ├── net │ │ ├── net.go │ │ ├── net_darwin.go │ │ ├── net_fallback.go │ │ ├── net_freebsd.go │ │ ├── net_linux.go │ │ ├── net_openbsd.go │ │ ├── net_unix.go │ │ └── net_windows.go │ └── process │ │ ├── process.go │ │ ├── process_darwin.go │ │ ├── process_darwin_386.go │ │ ├── process_darwin_amd64.go │ │ ├── process_fallback.go │ │ ├── process_freebsd.go │ │ ├── process_freebsd_386.go │ │ ├── process_freebsd_amd64.go │ │ ├── process_freebsd_arm.go │ │ ├── process_linux.go │ │ ├── process_openbsd.go │ │ ├── process_openbsd_amd64.go │ │ ├── process_posix.go │ │ ├── process_windows.go │ │ ├── process_windows_386.go │ │ ├── process_windows_amd64.go │ │ ├── types_darwin.go │ │ ├── types_freebsd.go │ │ └── types_openbsd.go │ └── w32 │ ├── AUTHORS │ ├── LICENSE │ ├── README.md │ ├── advapi32.go │ ├── comctl32.go │ ├── comdlg32.go │ ├── constants.go │ ├── dwmapi.go │ ├── gdi32.go │ ├── gdiplus.go │ ├── idispatch.go │ ├── istream.go │ ├── iunknown.go │ ├── kernel32.go │ ├── ole32.go │ ├── oleaut32.go │ ├── opengl32.go │ ├── psapi.go │ ├── shell32.go │ ├── typedef.go │ ├── user32.go │ ├── utils.go │ └── vars.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_s390x.s │ ├── asm_netbsd_386.s │ ├── asm_netbsd_amd64.s │ ├── asm_netbsd_arm.s │ ├── asm_openbsd_386.s │ ├── asm_openbsd_amd64.s │ ├── asm_openbsd_arm.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 │ ├── mkasm_darwin.go │ ├── mkerrors.sh │ ├── mkpost.go │ ├── mksyscall.go │ ├── mksyscall_aix_ppc.go │ ├── mksyscall_aix_ppc64.pl │ ├── mksyscall_solaris.pl │ ├── mksysctl_openbsd.pl │ ├── mksysnum.go │ ├── openbsd_pledge.go │ ├── openbsd_unveil.go │ ├── pagesize_unix.go │ ├── race.go │ ├── race0.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_openbsd.go │ ├── syscall_openbsd_386.go │ ├── syscall_openbsd_amd64.go │ ├── syscall_openbsd_arm.go │ ├── syscall_solaris.go │ ├── syscall_solaris_amd64.go │ ├── syscall_unix.go │ ├── syscall_unix_gc.go │ ├── syscall_unix_gc_ppc64x.go │ ├── timestruct.go │ ├── types_aix.go │ ├── types_darwin.go │ ├── types_dragonfly.go │ ├── types_freebsd.go │ ├── types_netbsd.go │ ├── types_openbsd.go │ ├── types_solaris.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_openbsd_386.go │ ├── zerrors_openbsd_amd64.go │ ├── zerrors_openbsd_arm.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_openbsd_386.go │ ├── zsyscall_openbsd_amd64.go │ ├── zsyscall_openbsd_arm.go │ ├── zsyscall_solaris_amd64.go │ ├── zsysctl_openbsd_386.go │ ├── zsysctl_openbsd_amd64.go │ ├── zsysctl_openbsd_arm.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_openbsd_386.go │ ├── zsysnum_openbsd_amd64.go │ ├── zsysnum_openbsd_arm.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_openbsd_386.go │ ├── ztypes_openbsd_amd64.go │ ├── ztypes_openbsd_arm.go │ └── ztypes_solaris_amd64.go │ └── windows │ ├── aliases.go │ ├── asm_windows_386.s │ ├── asm_windows_amd64.s │ ├── asm_windows_arm.s │ ├── dll_windows.go │ ├── env_windows.go │ ├── eventlog.go │ ├── exec_windows.go │ ├── memory_windows.go │ ├── mksyscall.go │ ├── race.go │ ├── race0.go │ ├── security_windows.go │ ├── service.go │ ├── str.go │ ├── syscall.go │ ├── syscall_windows.go │ ├── types_windows.go │ ├── types_windows_386.go │ ├── types_windows_amd64.go │ ├── types_windows_arm.go │ └── zsyscall_windows.go ├── howett.net └── plist │ ├── .gitlab-ci.yml │ ├── LICENSE │ ├── README.md │ ├── bplist.go │ ├── bplist_generator.go │ ├── bplist_parser.go │ ├── decode.go │ ├── doc.go │ ├── encode.go │ ├── fuzz.go │ ├── go.mod │ ├── marshal.go │ ├── must.go │ ├── plist.go │ ├── plist_types.go │ ├── text_generator.go │ ├── text_parser.go │ ├── text_tables.go │ ├── typeinfo.go │ ├── unmarshal.go │ ├── util.go │ ├── xml_generator.go │ ├── xml_parser.go │ ├── zerocopy.go │ └── zerocopy_appengine.go └── modules.txt /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Template to report bugs. 4 | --- 5 | 6 | 7 | 8 | 9 | Required information: 10 | 11 | - gotop version (`gotop -V`): 12 | - The output of `uname -a`: 13 | - Terminal emulator (e.g. iTerm or gnome terminal): 14 | - Any relevenat hardware info: 15 | - tmux version if using tmux: 16 | 17 | Also please copy or attach `~/.local/state/gotop/errors.log` if it exists and contains logs: 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/other.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Other 3 | about: No template. 4 | --- 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | dist/ 2 | gotop* 3 | 4 | # snap packaging specific 5 | /parts/ 6 | /prime/ 7 | /stage/ 8 | /*.snap 9 | /snap/.snapcraft/ 10 | /*_source.tar.bz2 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.11.x 5 | 6 | git: 7 | depth: 1 8 | 9 | env: 10 | global: 11 | - NAME=gotop 12 | 13 | matrix: 14 | include: 15 | # Linux 16 | - env: _GOOS=linux _GOARCH=amd64 17 | os: linux 18 | - env: _GOOS=linux _GOARCH=386 19 | os: linux 20 | - env: _GOOS=linux _GOARCH=arm GOARM=5 21 | os: linux 22 | - env: _GOOS=linux _GOARCH=arm GOARM=6 23 | os: linux 24 | - env: _GOOS=linux _GOARCH=arm GOARM=7 25 | os: linux 26 | - env: _GOOS=linux _GOARCH=arm64 27 | os: linux 28 | 29 | # OSX 30 | - env: _GOOS=darwin _GOARCH=amd64 31 | os: osx 32 | 33 | install: true 34 | script: ./ci/script.sh 35 | 36 | deploy: 37 | provider: releases 38 | api_key: $GITHUB_TOKEN 39 | file_glob: true 40 | file: "./dist/*" 41 | skip_cleanup: true 42 | on: 43 | tags: true 44 | 45 | if: tag IS present 46 | 47 | notifications: 48 | email: 49 | on_success: never 50 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # builds .rpm and .deb packages 2 | # requires dockerd to be running 3 | # builds the packages for amd64 4 | 5 | VERSION=$(shell go run main.go -V) 6 | ARCHIVE="gotop_$(VERSION)_linux_amd64" 7 | 8 | .PHONY: all 9 | all: dist/gotop.rpm dist/gotop.deb 10 | 11 | dist/gotop: 12 | @GOOS=linux GOARCH=amd64 go build -o $@ 13 | 14 | dist: 15 | @mkdir $@ 16 | 17 | dist/gotop.rpm: dist dist/gotop 18 | @docker run --rm \ 19 | -v "$(PWD)/build:/tmp/build" \ 20 | -v "$(PWD)/dist:/tmp/dist" \ 21 | -e "VERSION=$(VERSION)" \ 22 | goreleaser/nfpm pkg \ 23 | --config /tmp/build/nfpm.yml \ 24 | --target /tmp/dist/$(ARCHIVE).rpm 25 | 26 | dist/gotop.deb: dist dist/gotop 27 | @docker run --rm \ 28 | -v "$(PWD)/build:/tmp/build" \ 29 | -v "$(PWD)/dist:/tmp/dist" \ 30 | -e "VERSION=$(VERSION)" \ 31 | goreleaser/nfpm pkg \ 32 | --config /tmp/build/nfpm.yml \ 33 | --target /tmp/dist/$(ARCHIVE).deb 34 | 35 | .PHONY: clean 36 | clean: 37 | @-rm -rf dist 38 | -------------------------------------------------------------------------------- /assets/demos/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/assets/demos/demo.gif -------------------------------------------------------------------------------- /assets/logo/credits.md: -------------------------------------------------------------------------------- 1 | Logo created and contributed by [mdnazmulhasan27771](https://github.com/mdnazmulhasan27771) 2 | -------------------------------------------------------------------------------- /assets/logo/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/assets/logo/logo.png -------------------------------------------------------------------------------- /assets/screenshots/battery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/assets/screenshots/battery.png -------------------------------------------------------------------------------- /assets/screenshots/minimal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/assets/screenshots/minimal.png -------------------------------------------------------------------------------- /build/nfpm.yml: -------------------------------------------------------------------------------- 1 | name: "gotop" 2 | arch: "amd64" 3 | platform: "linux" 4 | version: "v${VERSION}" 5 | section: "default" 6 | priority: "extra" 7 | maintainer: "Caleb Bassi " 8 | description: | 9 | A terminal based graphical activity monitor inspired by gtop and vtop 10 | vendor: "Caleb Bassi" 11 | homepage: "https://github.com/cjbassi/gotop" 12 | license: "GNU Affero General Public License v3.0" 13 | bindir: "/usr/local/bin" 14 | files: 15 | /tmp/dist/gotop: "/usr/local/bin/gotop" 16 | -------------------------------------------------------------------------------- /ci/script.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | function main { 4 | # Check if any command failed 5 | ERROR=false 6 | 7 | GOARCH=${_GOARCH} 8 | GOOS=${_GOOS} 9 | 10 | if [[ ! ${GOARCH} ]]; then 11 | exit 12 | fi 13 | 14 | env GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -o ${NAME} || ERROR=true 15 | 16 | mkdir -p dist 17 | 18 | if [[ ${GOARCH} == "arm64" ]]; then 19 | FILE=${NAME}_${TRAVIS_BRANCH}_${GOOS}_arm8 20 | else 21 | FILE=${NAME}_${TRAVIS_BRANCH}_${GOOS}_${GOARCH}${GOARM} 22 | fi 23 | 24 | tar -czf dist/${FILE}.tgz ${NAME} || ERROR=true 25 | 26 | if [[ ${GOOS} == "linux" && ${GOARCH} == "amd64" ]]; then 27 | make all || ERROR=true 28 | rm dist/gotop 29 | fi 30 | 31 | if [ ${ERROR} == "true" ]; then 32 | exit 1 33 | fi 34 | } 35 | 36 | main 37 | -------------------------------------------------------------------------------- /colorschemes/default.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | var Default = Colorscheme{ 4 | Fg: 7, 5 | Bg: -1, 6 | 7 | BorderLabel: 7, 8 | BorderLine: 6, 9 | 10 | CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 11 | 12 | BattLines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 13 | 14 | MainMem: 5, 15 | SwapMem: 11, 16 | 17 | ProcCursor: 4, 18 | 19 | Sparkline: 4, 20 | 21 | DiskBar: 7, 22 | 23 | TempLow: 2, 24 | TempHigh: 1, 25 | } 26 | -------------------------------------------------------------------------------- /colorschemes/default.json: -------------------------------------------------------------------------------- 1 | // Example json file to put in `~/.config/gotop/{name}.json` and load with 2 | // `gotop -c {name}`. MUST DELETE THESE COMMENTS AND RENAME FILE in order to load. 3 | { 4 | "Fg": 7, 5 | "Bg": -1, 6 | 7 | "BorderLabel": 7, 8 | "BorderLine": 6, 9 | 10 | "CPULines": [4, 3, 2, 1, 5, 6, 7, 8], 11 | 12 | "BattLines": [4, 3, 2, 1, 5, 6, 7, 8], 13 | 14 | "MainMem": 5, 15 | "SwapMem": 11, 16 | 17 | "ProcCursor": 4, 18 | 19 | "Sparkline": 4, 20 | 21 | "DiskBar": 7, 22 | 23 | "TempLow": 2, 24 | "TempHigh": 1 25 | } 26 | -------------------------------------------------------------------------------- /colorschemes/default_dark.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | var DefaultDark = Colorscheme{ 4 | Fg: 235, 5 | Bg: -1, 6 | 7 | BorderLabel: 235, 8 | BorderLine: 6, 9 | 10 | CPULines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 11 | 12 | BattLines: []int{4, 3, 2, 1, 5, 6, 7, 8}, 13 | 14 | MainMem: 5, 15 | SwapMem: 3, 16 | 17 | ProcCursor: 33, 18 | 19 | Sparkline: 4, 20 | 21 | DiskBar: 252, 22 | 23 | TempLow: 2, 24 | TempHigh: 1, 25 | } 26 | -------------------------------------------------------------------------------- /colorschemes/monokai.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | var Monokai = Colorscheme{ 4 | Fg: 249, 5 | Bg: -1, 6 | 7 | BorderLabel: 249, 8 | BorderLine: 239, 9 | 10 | CPULines: []int{81, 70, 208, 197, 249, 141, 221, 186}, 11 | 12 | BattLines: []int{81, 70, 208, 197, 249, 141, 221, 186}, 13 | 14 | MainMem: 208, 15 | SwapMem: 186, 16 | 17 | ProcCursor: 197, 18 | 19 | Sparkline: 81, 20 | 21 | DiskBar: 102, 22 | 23 | TempLow: 70, 24 | TempHigh: 208, 25 | } 26 | -------------------------------------------------------------------------------- /colorschemes/monokai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/colorschemes/monokai.png -------------------------------------------------------------------------------- /colorschemes/solarized.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | var Solarized = Colorscheme{ 4 | Fg: 250, 5 | Bg: -1, 6 | 7 | BorderLabel: 250, 8 | BorderLine: 37, 9 | 10 | CPULines: []int{61, 33, 37, 64, 125, 160, 166, 136}, 11 | 12 | BattLines: []int{61, 33, 37, 64, 125, 160, 166, 136}, 13 | 14 | MainMem: 125, 15 | SwapMem: 166, 16 | 17 | ProcCursor: 136, 18 | 19 | Sparkline: 33, 20 | 21 | DiskBar: 245, 22 | 23 | TempLow: 64, 24 | TempHigh: 160, 25 | } 26 | -------------------------------------------------------------------------------- /colorschemes/solarized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cjbassi/gotop/65d76af83079f16b6082a5326023438e87b2a8dd/colorschemes/solarized.png -------------------------------------------------------------------------------- /colorschemes/template.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | /* 4 | The standard 256 terminal colors are supported. 5 | 6 | -1 = clear 7 | 8 | You can combine a color with 'Bold', 'Underline', or 'Reverse' by using bitwise OR ('|') and the name of the Color. 9 | For example, to get Bold red Labels, you would do 'Labels: 2 | Bold'. 10 | 11 | Once you've created a colorscheme, add an entry for it in the `handleColorscheme` function in 'main.go'. 12 | */ 13 | 14 | const ( 15 | Bold int = 1 << (iota + 9) 16 | Underline 17 | Reverse 18 | ) 19 | 20 | type Colorscheme struct { 21 | Name string 22 | Author string 23 | 24 | Fg int 25 | Bg int 26 | 27 | BorderLabel int 28 | BorderLine int 29 | 30 | // should add at least 8 here 31 | CPULines []int 32 | 33 | BattLines []int 34 | 35 | MainMem int 36 | SwapMem int 37 | 38 | ProcCursor int 39 | 40 | Sparkline int 41 | 42 | DiskBar int 43 | 44 | // colors the temperature number a different color if it's over a certain threshold 45 | TempLow int 46 | TempHigh int 47 | } 48 | -------------------------------------------------------------------------------- /colorschemes/vice.go: -------------------------------------------------------------------------------- 1 | package colorschemes 2 | 3 | var Vice = Colorscheme{ 4 | Fg: 231, 5 | Bg: -1, 6 | 7 | BorderLabel: 123, 8 | BorderLine: 102, 9 | 10 | CPULines: []int{212, 218, 123, 159, 229, 158, 183, 146}, 11 | 12 | BattLines: []int{212, 218, 123, 159, 229, 158, 183, 146}, 13 | 14 | MainMem: 201, 15 | SwapMem: 97, 16 | 17 | ProcCursor: 159, 18 | 19 | Sparkline: 183, 20 | 21 | DiskBar: 158, 22 | 23 | TempLow: 49, 24 | TempHigh: 197, 25 | } 26 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/cjbassi/gotop 2 | 3 | require ( 4 | github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect 5 | github.com/davecgh/go-spew v1.1.1 // indirect 6 | github.com/distatus/battery v0.9.0 7 | github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815 8 | github.com/gizak/termui/v3 v3.0.0 9 | github.com/go-ole/go-ole v1.2.1 // indirect 10 | github.com/mattn/go-runewidth v0.0.4 // indirect 11 | github.com/mitchellh/go-wordwrap v1.0.0 // indirect 12 | github.com/pmezard/go-difflib v1.0.0 // indirect 13 | github.com/shirou/gopsutil v2.18.11+incompatible 14 | github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 // indirect 15 | github.com/stretchr/testify v1.2.2 // indirect 16 | golang.org/x/sys v0.0.0-20190116161447-11f53e031339 // indirect 17 | howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /snap/snapcraft.yaml: -------------------------------------------------------------------------------- 1 | name: gotop-cjbassi 2 | base: core18 3 | version: determined-by-version-script 4 | version-script: git describe --always --tags --dirty 5 | summary: A terminal based graphical activity monitor inspired by gtop and vtop 6 | description: | 7 | Another terminal based graphical activity monitor, inspired by [gtop](https://github.com/aksakalli/gtop) and [vtop](https://github.com/MrRio/vtop), this time written in [Go](https://golang.org/)! 8 | 9 | grade: stable 10 | confinement: strict 11 | icon: assets/logo.png 12 | license: AGPL-3.0 13 | 14 | parts: 15 | gotop: 16 | source: . 17 | plugin: go 18 | go-importpath: github.com/cjbassi/gotop 19 | build-packages: 20 | - git-core 21 | - gcc 22 | 23 | plugs: 24 | # Required by the "Temperatures" widget 25 | hardware-observe: 26 | 27 | # Required by the "Disk Usage" widget 28 | mount-observe: 29 | 30 | # Required by the "Processes" widget 31 | system-observe: 32 | 33 | apps: 34 | gotop-cjbassi: 35 | command: bin/gotop 36 | environment: 37 | LANG: C.UTF-8 38 | LC_ALL: C.UTF-8 39 | -------------------------------------------------------------------------------- /src/logging/logging_arm64.go: -------------------------------------------------------------------------------- 1 | package logging 2 | 3 | import ( 4 | "os" 5 | "syscall" 6 | ) 7 | 8 | func StderrToLogfile(logfile *os.File) { 9 | syscall.Dup3(int(logfile.Fd()), 2, 0) 10 | } 11 | -------------------------------------------------------------------------------- /src/logging/logging_other.go: -------------------------------------------------------------------------------- 1 | // +build !arm64 2 | 3 | package logging 4 | 5 | import ( 6 | "os" 7 | "syscall" 8 | ) 9 | 10 | func StderrToLogfile(logfile *os.File) { 11 | syscall.Dup2(int(logfile.Fd()), 2) 12 | } 13 | -------------------------------------------------------------------------------- /src/termui/drawille-go/README.md: -------------------------------------------------------------------------------- 1 | GO-DRAWILLE 2 | =========== 3 | Drawing in the terminal with Unicode Braille characters. 4 | A [go](https://golang.org) port of [asciimoo's](https://github.com/asciimoo) [drawille](https://github.com/asciimoo/drawille) 5 | 6 | ### LICENSE 7 | 8 | ``` 9 | drawille-go is free software: you can redistribute it and/or modify 10 | it under the terms of the GNU Affero General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or 12 | (at your option) any later version. 13 | 14 | drawille-go is distributed in the hope that it will be useful, 15 | but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | GNU Affero General Public License for more details. 18 | 19 | You should have received a copy of the GNU Affero General Public License 20 | along with drawille-go. If not, see < http://www.gnu.org/licenses/ >. 21 | 22 | (C) 2014 by Adam Tauber, 23 | (C) 2014 by Jacob Hughes, 24 | ``` 25 | -------------------------------------------------------------------------------- /src/utils/bytes.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "math" 5 | ) 6 | 7 | var ( 8 | KB = uint64(math.Pow(2, 10)) 9 | MB = uint64(math.Pow(2, 20)) 10 | GB = uint64(math.Pow(2, 30)) 11 | TB = uint64(math.Pow(2, 40)) 12 | ) 13 | 14 | func CelsiusToFahrenheit(c int) int { 15 | return c*9/5 + 32 16 | } 17 | 18 | func BytesToKB(b uint64) float64 { 19 | return float64(b) / float64(KB) 20 | } 21 | 22 | func BytesToMB(b uint64) float64 { 23 | return float64(b) / float64(MB) 24 | } 25 | 26 | func BytesToGB(b uint64) float64 { 27 | return float64(b) / float64(GB) 28 | } 29 | 30 | func BytesToTB(b uint64) float64 { 31 | return float64(b) / float64(TB) 32 | } 33 | 34 | func ConvertBytes(b uint64) (float64, string) { 35 | switch { 36 | case b < KB: 37 | return float64(b), "B" 38 | case b < MB: 39 | return BytesToKB(b), "KB" 40 | case b < GB: 41 | return BytesToMB(b), "MB" 42 | case b < TB: 43 | return BytesToGB(b), "GB" 44 | default: 45 | return BytesToTB(b), "TB" 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/utils/conversions.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | func ConvertLocalizedString(s string) string { 8 | if strings.ContainsAny(s, ",") { 9 | return strings.Replace(s, ",", ".", 1) 10 | } else { 11 | return s 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/utils/math.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | func MaxInt(a, b int) int { 4 | if a > b { 5 | return a 6 | } 7 | return b 8 | } 9 | -------------------------------------------------------------------------------- /src/utils/xdg.go: -------------------------------------------------------------------------------- 1 | package utils 2 | 3 | import ( 4 | "os" 5 | "path/filepath" 6 | ) 7 | 8 | func GetConfigDir(name string) string { 9 | var basedir string 10 | if env := os.Getenv("XDG_CONFIG_HOME"); env != "" { 11 | basedir = env 12 | } else { 13 | basedir = filepath.Join(os.Getenv("HOME"), ".config") 14 | } 15 | return filepath.Join(basedir, name) 16 | } 17 | 18 | func GetLogDir(name string) string { 19 | var basedir string 20 | if env := os.Getenv("XDG_STATE_HOME"); env != "" { 21 | basedir = env 22 | } else { 23 | basedir = filepath.Join(os.Getenv("HOME"), ".local", "state") 24 | } 25 | return filepath.Join(basedir, name) 26 | } 27 | -------------------------------------------------------------------------------- /src/widgets/battery.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "math" 7 | "strconv" 8 | "time" 9 | 10 | "github.com/distatus/battery" 11 | 12 | ui "github.com/cjbassi/gotop/src/termui" 13 | ) 14 | 15 | type BatteryWidget struct { 16 | *ui.LineGraph 17 | updateInterval time.Duration 18 | } 19 | 20 | func NewBatteryWidget(horizontalScale int) *BatteryWidget { 21 | self := &BatteryWidget{ 22 | LineGraph: ui.NewLineGraph(), 23 | updateInterval: time.Minute, 24 | } 25 | self.Title = " Battery Status " 26 | self.HorizontalScale = horizontalScale 27 | 28 | // intentional duplicate 29 | // adds 2 datapoints to the graph, otherwise the dot is difficult to see 30 | self.update() 31 | self.update() 32 | 33 | go func() { 34 | for range time.NewTicker(self.updateInterval).C { 35 | self.Lock() 36 | self.update() 37 | self.Unlock() 38 | } 39 | }() 40 | 41 | return self 42 | } 43 | 44 | func makeId(i int) string { 45 | return "Batt" + strconv.Itoa(i) 46 | } 47 | 48 | func (self *BatteryWidget) update() { 49 | batteries, err := battery.GetAll() 50 | if err != nil { 51 | log.Printf("failed to get battery info: %v", err) 52 | return 53 | } 54 | for i, battery := range batteries { 55 | id := makeId(i) 56 | percentFull := math.Abs(battery.Current/battery.Full) * 100.0 57 | self.Data[id] = append(self.Data[id], percentFull) 58 | self.Labels[id] = fmt.Sprintf("%3.0f%% %.0f/%.0f", percentFull, math.Abs(battery.Current), math.Abs(battery.Full)) 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/widgets/mem_other.go: -------------------------------------------------------------------------------- 1 | // +build !freebsd 2 | 3 | package widgets 4 | 5 | import ( 6 | "log" 7 | 8 | psMem "github.com/shirou/gopsutil/mem" 9 | ) 10 | 11 | func (self *MemWidget) updateSwapMemory() { 12 | swapMemory, err := psMem.SwapMemory() 13 | if err != nil { 14 | log.Printf("failed to get swap memory info from gopsutil: %v", err) 15 | } else { 16 | self.renderMemInfo("Swap", MemoryInfo{ 17 | Total: swapMemory.Total, 18 | Used: swapMemory.Used, 19 | UsedPercent: swapMemory.UsedPercent, 20 | }) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/widgets/proc_linux.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "os/exec" 7 | "strconv" 8 | "strings" 9 | ) 10 | 11 | func getProcs() ([]Proc, error) { 12 | output, err := exec.Command("ps", "-axo", "pid:10,comm:50,pcpu:5,pmem:5,args").Output() 13 | if err != nil { 14 | return nil, fmt.Errorf("failed to execute 'ps' command: %v", err) 15 | } 16 | 17 | // converts to []string, removing trailing newline and header 18 | linesOfProcStrings := strings.Split(strings.TrimSuffix(string(output), "\n"), "\n")[1:] 19 | 20 | procs := []Proc{} 21 | for _, line := range linesOfProcStrings { 22 | pid, err := strconv.Atoi(strings.TrimSpace(line[0:10])) 23 | if err != nil { 24 | log.Printf("failed to convert PID to int: %v. line: %v", err, line) 25 | } 26 | cpu, err := strconv.ParseFloat(strings.TrimSpace(line[63:68]), 64) 27 | if err != nil { 28 | log.Printf("failed to convert CPU usage to float: %v. line: %v", err, line) 29 | } 30 | mem, err := strconv.ParseFloat(strings.TrimSpace(line[69:74]), 64) 31 | if err != nil { 32 | log.Printf("failed to convert Mem usage to float: %v. line: %v", err, line) 33 | } 34 | proc := Proc{ 35 | Pid: pid, 36 | CommandName: strings.TrimSpace(line[11:61]), 37 | FullCommand: line[74:], 38 | Cpu: cpu, 39 | Mem: mem, 40 | } 41 | procs = append(procs, proc) 42 | } 43 | 44 | return procs, nil 45 | } 46 | -------------------------------------------------------------------------------- /src/widgets/proc_windows.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | 7 | psProc "github.com/shirou/gopsutil/process" 8 | ) 9 | 10 | func getProcs() ([]Proc, error) { 11 | psProcs, err := psProc.Processes() 12 | if err != nil { 13 | return nil, fmt.Errorf("failed to get processes from gopsutil: %v", err) 14 | } 15 | 16 | procs := make([]Proc, len(psProcs)) 17 | for i, psProc := range psProcs { 18 | pid := psProc.Pid 19 | command, err := psProc.Name() 20 | if err != nil { 21 | log.Printf("failed to get process command from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) 22 | } 23 | cpu, err := psProc.CPUPercent() 24 | if err != nil { 25 | log.Printf("failed to get process cpu usage from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) 26 | } 27 | mem, err := psProc.MemoryPercent() 28 | if err != nil { 29 | log.Printf("failed to get process memeory usage from gopsutil: %v. psProc: %v. i: %v. pid: %v", err, psProc, i, pid) 30 | } 31 | 32 | procs[i] = Proc{ 33 | Pid: int(pid), 34 | CommandName: command, 35 | Cpu: cpu, 36 | Mem: float64(mem), 37 | // getting command args using gopsutil's Cmdline and CmdlineSlice wasn't 38 | // working the last time I tried it, so we're just reusing 'command' 39 | FullCommand: command, 40 | } 41 | } 42 | 43 | return procs, nil 44 | } 45 | -------------------------------------------------------------------------------- /src/widgets/statusbar.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "image" 5 | "log" 6 | "os" 7 | "time" 8 | 9 | ui "github.com/gizak/termui/v3" 10 | ) 11 | 12 | type StatusBar struct { 13 | ui.Block 14 | } 15 | 16 | func NewStatusBar() *StatusBar { 17 | self := &StatusBar{*ui.NewBlock()} 18 | self.Border = false 19 | return self 20 | } 21 | 22 | func (self *StatusBar) Draw(buf *ui.Buffer) { 23 | self.Block.Draw(buf) 24 | 25 | hostname, err := os.Hostname() 26 | if err != nil { 27 | log.Printf("could not get hostname: %v", err) 28 | return 29 | } 30 | buf.SetString( 31 | hostname, 32 | ui.NewStyle(ui.ColorWhite), 33 | image.Pt(self.Inner.Min.X, self.Inner.Min.Y+(self.Inner.Dy()/2)), 34 | ) 35 | 36 | currentTime := time.Now() 37 | formattedTime := currentTime.Format("15:04:05") 38 | buf.SetString( 39 | formattedTime, 40 | ui.NewStyle(ui.ColorWhite), 41 | image.Pt( 42 | self.Inner.Min.X+(self.Inner.Dx()/2)-len(formattedTime)/2, 43 | self.Inner.Min.Y+(self.Inner.Dy()/2), 44 | ), 45 | ) 46 | 47 | buf.SetString( 48 | "gotop", 49 | ui.NewStyle(ui.ColorWhite), 50 | image.Pt( 51 | self.Inner.Max.X-6, 52 | self.Inner.Min.Y+(self.Inner.Dy()/2), 53 | ), 54 | ) 55 | } 56 | -------------------------------------------------------------------------------- /src/widgets/temp_linux.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "log" 5 | "strings" 6 | 7 | psHost "github.com/shirou/gopsutil/host" 8 | 9 | "github.com/cjbassi/gotop/src/utils" 10 | ) 11 | 12 | func (self *TempWidget) update() { 13 | sensors, err := psHost.SensorsTemperatures() 14 | if err != nil { 15 | log.Printf("error recieved from gopsutil: %v", err) 16 | } 17 | for _, sensor := range sensors { 18 | // only sensors with input in their name are giving us live temp info 19 | if strings.Contains(sensor.SensorKey, "input") && sensor.Temperature != 0 { 20 | // removes '_input' from the end of the sensor name 21 | label := sensor.SensorKey[:strings.Index(sensor.SensorKey, "_input")] 22 | switch self.TempScale { 23 | case Fahrenheit: 24 | self.Data[label] = utils.CelsiusToFahrenheit(int(sensor.Temperature)) 25 | case Celcius: 26 | self.Data[label] = int(sensor.Temperature) 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/widgets/temp_windows.go: -------------------------------------------------------------------------------- 1 | package widgets 2 | 3 | import ( 4 | "log" 5 | 6 | psHost "github.com/shirou/gopsutil/host" 7 | 8 | "github.com/cjbassi/gotop/src/utils" 9 | ) 10 | 11 | func (self *TempWidget) update() { 12 | sensors, err := psHost.SensorsTemperatures() 13 | if err != nil { 14 | log.Printf("failed to get sensors from gopsutil: %v", err) 15 | return 16 | } 17 | for _, sensor := range sensors { 18 | if sensor.Temperature != 0 { 19 | switch self.TempScale { 20 | case Fahrenheit: 21 | self.Data[sensor.SensorKey] = utils.CelsiusToFahrenheit(int(sensor.Temperature)) 22 | case Celcius: 23 | self.Data[sensor.SensorKey] = int(sensor.Temperature) 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/StackExchange/wmi/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Stack Exchange 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 of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | 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, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/StackExchange/wmi/README.md: -------------------------------------------------------------------------------- 1 | wmi 2 | === 3 | 4 | Package wmi provides a WQL interface to Windows WMI. 5 | 6 | Note: It interfaces with WMI on the local machine, therefore it only runs on Windows. 7 | -------------------------------------------------------------------------------- /vendor/github.com/cjbassi/drawille-go/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Caleb Bassi 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/cjbassi/drawille-go/README.md: -------------------------------------------------------------------------------- 1 | # drawille-go 2 | 3 | A [drawille](https://github.com/asciimoo/drawille) implementation in Go with a more permissive license. 4 | 5 | Used in [termui](https://github.com/gizak/termui). 6 | -------------------------------------------------------------------------------- /vendor/github.com/distatus/battery/.gitignore: -------------------------------------------------------------------------------- 1 | cmd/battery/battery* 2 | coverage.html 3 | -------------------------------------------------------------------------------- /vendor/github.com/distatus/battery/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.3 5 | - 1.4 6 | - 1.5 7 | - 1.6 8 | - tip 9 | 10 | matrix: 11 | allow_failures: 12 | - go: tip 13 | -------------------------------------------------------------------------------- /vendor/github.com/distatus/battery/LICENSE.md: -------------------------------------------------------------------------------- 1 | battery 2 | Copyright (C) 2016 Karol 'Kenji Takahashi' Woźniak 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining 5 | a copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 16 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 17 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 18 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 19 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 20 | OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt.go/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | 24 | # coverage droppings 25 | profile.cov 26 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt.go/.travis.yml: -------------------------------------------------------------------------------- 1 | # Travis CI (http://travis-ci.org/) is a continuous integration 2 | # service for open source projects. This file configures it 3 | # to run unit tests for docopt-go. 4 | 5 | language: go 6 | 7 | go: 8 | - 1.4 9 | - 1.5 10 | - 1.6 11 | - 1.7 12 | - 1.8 13 | - 1.9 14 | - tip 15 | 16 | matrix: 17 | fast_finish: true 18 | 19 | before_install: 20 | - go get golang.org/x/tools/cmd/cover 21 | - go get github.com/mattn/goveralls 22 | 23 | install: 24 | - go get -d -v ./... && go build -v ./... 25 | 26 | script: 27 | - go vet -x ./... 28 | - go test -v ./... 29 | - go test -covermode=count -coverprofile=profile.cov . 30 | 31 | after_script: 32 | - $HOME/gopath/bin/goveralls -coverprofile=profile.cov -service=travis-ci 33 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt.go/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Keith Batten 4 | Copyright (c) 2016 David Irvine 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy of 7 | this software and associated documentation files (the "Software"), to deal in 8 | the Software without restriction, including without limitation the rights to 9 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 10 | the Software, and to permit persons to whom the Software is furnished to do so, 11 | subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt.go/error.go: -------------------------------------------------------------------------------- 1 | package docopt 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | type errorType int 8 | 9 | const ( 10 | errorUser errorType = iota 11 | errorLanguage 12 | ) 13 | 14 | func (e errorType) String() string { 15 | switch e { 16 | case errorUser: 17 | return "errorUser" 18 | case errorLanguage: 19 | return "errorLanguage" 20 | } 21 | return "" 22 | } 23 | 24 | // UserError records an error with program arguments. 25 | type UserError struct { 26 | msg string 27 | Usage string 28 | } 29 | 30 | func (e UserError) Error() string { 31 | return e.msg 32 | } 33 | func newUserError(msg string, f ...interface{}) error { 34 | return &UserError{fmt.Sprintf(msg, f...), ""} 35 | } 36 | 37 | // LanguageError records an error with the doc string. 38 | type LanguageError struct { 39 | msg string 40 | } 41 | 42 | func (e LanguageError) Error() string { 43 | return e.msg 44 | } 45 | func newLanguageError(msg string, f ...interface{}) error { 46 | return &LanguageError{fmt.Sprintf(msg, f...)} 47 | } 48 | 49 | var newError = fmt.Errorf 50 | -------------------------------------------------------------------------------- /vendor/github.com/docopt/docopt.go/test_golang.docopt: -------------------------------------------------------------------------------- 1 | r"""usage: prog [NAME_-2]...""" 2 | $ prog 10 20 3 | {"NAME_-2": ["10", "20"]} 4 | 5 | $ prog 10 6 | {"NAME_-2": ["10"]} 7 | 8 | $ prog 9 | {"NAME_-2": []} 10 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode/ 3 | .mypy_cache/ 4 | .idea 5 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Zack Guo 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 | 23 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: run-examples 2 | run-examples: 3 | @for file in _examples/*.go; do \ 4 | go run $$file; \ 5 | done; 6 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/alignment.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | type Alignment uint 4 | 5 | const ( 6 | AlignLeft Alignment = iota 7 | AlignCenter 8 | AlignRight 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/backend.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | package termui 6 | 7 | import ( 8 | tb "github.com/nsf/termbox-go" 9 | ) 10 | 11 | // Init initializes termbox-go and is required to render anything. 12 | // After initialization, the library must be finalized with `Close`. 13 | func Init() error { 14 | if err := tb.Init(); err != nil { 15 | return err 16 | } 17 | tb.SetInputMode(tb.InputEsc | tb.InputMouse) 18 | tb.SetOutputMode(tb.Output256) 19 | return nil 20 | } 21 | 22 | // Close closes termbox-go. 23 | func Close() { 24 | tb.Close() 25 | } 26 | 27 | func TerminalDimensions() (int, int) { 28 | tb.Sync() 29 | width, height := tb.Size() 30 | return width, height 31 | } 32 | 33 | func Clear() { 34 | tb.Clear(tb.ColorDefault, tb.Attribute(Theme.Default.Bg+1)) 35 | } 36 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/canvas.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | import ( 4 | "image" 5 | 6 | drawille "github.com/cjbassi/drawille-go" 7 | ) 8 | 9 | type Canvas struct { 10 | Block 11 | drawille.Canvas 12 | } 13 | 14 | func NewCanvas() *Canvas { 15 | return &Canvas{ 16 | Block: *NewBlock(), 17 | Canvas: *drawille.NewCanvas(), 18 | } 19 | } 20 | 21 | func (self *Canvas) SetPoint(p image.Point, color Color) { 22 | self.Canvas.SetPoint(p, drawille.Color(color)) 23 | } 24 | 25 | func (self *Canvas) SetLine(p0, p1 image.Point, color Color) { 26 | self.Canvas.SetLine(p0, p1, drawille.Color(color)) 27 | } 28 | 29 | func (self *Canvas) Draw(buf *Buffer) { 30 | for point, cell := range self.Canvas.GetCells() { 31 | if point.In(self.Rectangle) { 32 | convertedCell := Cell{ 33 | cell.Rune, 34 | Style{ 35 | Color(cell.Color), 36 | ColorClear, 37 | ModifierClear, 38 | }, 39 | } 40 | buf.SetCell(convertedCell, point) 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/doc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | /* 6 | Package termui is a library for creating terminal user interfaces (TUIs) using widgets. 7 | */ 8 | package termui 9 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/gizak/termui/v3 2 | 3 | require ( 4 | github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd 5 | github.com/mattn/go-runewidth v0.0.2 6 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 7 | github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d 8 | golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/go.sum: -------------------------------------------------------------------------------- 1 | github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd h1:XtfPmj9tQRilnrEmI1HjQhxXWRhEM+m8CACtaMJE/kM= 2 | github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd/go.mod h1:vjcQJUZJYD3MeVGhtZXSMnCHfUNZxsyYzJt90eCYxK4= 3 | github.com/mattn/go-runewidth v0.0.2 h1:UnlwIPBGaTZfPQ6T1IGzPI0EkYAQmT9fAEJ/poFC63o= 4 | github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 5 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= 6 | github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= 7 | github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840= 8 | github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= 9 | golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 h1:Pn8fQdvx+z1avAi7fdM2kRYWQNxGlavNDSyzrQg2SsU= 10 | golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= 11 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/render.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | package termui 6 | 7 | import ( 8 | "image" 9 | "sync" 10 | 11 | tb "github.com/nsf/termbox-go" 12 | ) 13 | 14 | type Drawable interface { 15 | GetRect() image.Rectangle 16 | SetRect(int, int, int, int) 17 | Draw(*Buffer) 18 | sync.Locker 19 | } 20 | 21 | func Render(items ...Drawable) { 22 | for _, item := range items { 23 | buf := NewBuffer(item.GetRect()) 24 | item.Lock() 25 | item.Draw(buf) 26 | item.Unlock() 27 | for point, cell := range buf.CellMap { 28 | if point.In(buf.Rectangle) { 29 | tb.SetCell( 30 | point.X, point.Y, 31 | cell.Rune, 32 | tb.Attribute(cell.Style.Fg+1)|tb.Attribute(cell.Style.Modifier), tb.Attribute(cell.Style.Bg+1), 33 | ) 34 | } 35 | } 36 | } 37 | tb.Flush() 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/symbols.go: -------------------------------------------------------------------------------- 1 | package termui 2 | 3 | const ( 4 | DOT = '•' 5 | ELLIPSES = '…' 6 | 7 | UP_ARROW = '▲' 8 | DOWN_ARROW = '▼' 9 | ) 10 | 11 | var ( 12 | BARS = [...]rune{' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█'} 13 | 14 | SHADED_BLOCKS = [...]rune{' ', '░', '▒', '▓', '█'} 15 | 16 | IRREGULAR_BLOCKS = [...]rune{ 17 | ' ', '▘', '▝', '▀', '▖', '▌', '▞', '▛', 18 | '▗', '▚', '▐', '▜', '▄', '▙', '▟', '█', 19 | } 20 | 21 | BRAILLE_OFFSET = '\u2800' 22 | BRAILLE = [4][2]rune{ 23 | {'\u0001', '\u0008'}, 24 | {'\u0002', '\u0010'}, 25 | {'\u0004', '\u0020'}, 26 | {'\u0040', '\u0080'}, 27 | } 28 | 29 | DOUBLE_BRAILLE = map[[2]int]rune{ 30 | [2]int{0, 0}: '⣀', 31 | [2]int{0, 1}: '⡠', 32 | [2]int{0, 2}: '⡐', 33 | [2]int{0, 3}: '⡈', 34 | 35 | [2]int{1, 0}: '⢄', 36 | [2]int{1, 1}: '⠤', 37 | [2]int{1, 2}: '⠔', 38 | [2]int{1, 3}: '⠌', 39 | 40 | [2]int{2, 0}: '⢂', 41 | [2]int{2, 1}: '⠢', 42 | [2]int{2, 2}: '⠒', 43 | [2]int{2, 3}: '⠊', 44 | 45 | [2]int{3, 0}: '⢁', 46 | [2]int{3, 1}: '⠡', 47 | [2]int{3, 2}: '⠑', 48 | [2]int{3, 3}: '⠉', 49 | } 50 | 51 | SINGLE_BRAILLE_LEFT = [4]rune{'\u2840', '⠄', '⠂', '⠁'} 52 | SINGLE_BRAILLE_RIGHT = [4]rune{'\u2880', '⠠', '⠐', '⠈'} 53 | ) 54 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/symbols_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | // +build !windows 6 | 7 | package termui 8 | 9 | const ( 10 | TOP_LEFT = '┌' 11 | TOP_RIGHT = '┐' 12 | BOTTOM_LEFT = '└' 13 | BOTTOM_RIGHT = '┘' 14 | 15 | VERTICAL_LINE = '│' 16 | HORIZONTAL_LINE = '─' 17 | 18 | VERTICAL_LEFT = '┤' 19 | VERTICAL_RIGHT = '├' 20 | HORIZONTAL_UP = '┴' 21 | HORIZONTAL_DOWN = '┬' 22 | 23 | QUOTA_LEFT = '«' 24 | QUOTA_RIGHT = '»' 25 | 26 | VERTICAL_DASH = '┊' 27 | HORIZONTAL_DASH = '┈' 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/gizak/termui/v3/symbols_windows.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 Zack Guo . All rights reserved. 2 | // Use of this source code is governed by a MIT license that can 3 | // be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package termui 8 | 9 | const ( 10 | TOP_LEFT = '+' 11 | TOP_RIGHT = '+' 12 | BOTTOM_LEFT = '+' 13 | BOTTOM_RIGHT = '+' 14 | 15 | VERTICAL_LINE = '|' 16 | HORIZONTAL_LINE = '-' 17 | 18 | VERTICAL_LEFT = '+' 19 | VERTICAL_RIGHT = '+' 20 | HORIZONTAL_UP = '+' 21 | HORIZONTAL_DOWN = '+' 22 | 23 | QUOTA_LEFT = '<' 24 | QUOTA_RIGHT = '>' 25 | 26 | VERTICAL_DASH = '|' 27 | HORIZONTAL_DASH = '-' 28 | ) 29 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | sudo: false 3 | 4 | go: 5 | - 1.1 6 | - 1.2 7 | - 1.3 8 | - 1.4 9 | - tip 10 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2013-2017 Yasuhiro Matsumoto, 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 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // errstr converts error code to string. 6 | func errstr(errno int) string { 7 | return "" 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/error_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "fmt" 7 | "syscall" 8 | "unicode/utf16" 9 | ) 10 | 11 | // errstr converts error code to string. 12 | func errstr(errno int) string { 13 | // ask windows for the remaining errors 14 | var flags uint32 = syscall.FORMAT_MESSAGE_FROM_SYSTEM | syscall.FORMAT_MESSAGE_ARGUMENT_ARRAY | syscall.FORMAT_MESSAGE_IGNORE_INSERTS 15 | b := make([]uint16, 300) 16 | n, err := syscall.FormatMessage(flags, 0, uint32(errno), 0, b, nil) 17 | if err != nil { 18 | return fmt.Sprintf("error %d (FormatMessage failed with: %v)", errno, err) 19 | } 20 | // trim terminating \r and \n 21 | for ; n > 0 && (b[n-1] == '\n' || b[n-1] == '\r'); n-- { 22 | } 23 | return string(utf16.Decode(b[:n])) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPoint struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointVtbl struct { 10 | IUnknownVtbl 11 | GetConnectionInterface uintptr 12 | GetConnectionPointContainer uintptr 13 | Advise uintptr 14 | Unadvise uintptr 15 | EnumConnections uintptr 16 | } 17 | 18 | func (v *IConnectionPoint) VTable() *IConnectionPointVtbl { 19 | return (*IConnectionPointVtbl)(unsafe.Pointer(v.RawVTable)) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | import "unsafe" 6 | 7 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 8 | return int32(0) 9 | } 10 | 11 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (uint32, error) { 12 | return uint32(0), NewError(E_NOTIMPL) 13 | } 14 | 15 | func (v *IConnectionPoint) Unadvise(cookie uint32) error { 16 | return NewError(E_NOTIMPL) 17 | } 18 | 19 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) (err error) { 20 | return NewError(E_NOTIMPL) 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpoint_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPoint) GetConnectionInterface(piid **GUID) int32 { 11 | // XXX: This doesn't look like it does what it's supposed to 12 | return release((*IUnknown)(unsafe.Pointer(v))) 13 | } 14 | 15 | func (v *IConnectionPoint) Advise(unknown *IUnknown) (cookie uint32, err error) { 16 | hr, _, _ := syscall.Syscall( 17 | v.VTable().Advise, 18 | 3, 19 | uintptr(unsafe.Pointer(v)), 20 | uintptr(unsafe.Pointer(unknown)), 21 | uintptr(unsafe.Pointer(&cookie))) 22 | if hr != 0 { 23 | err = NewError(hr) 24 | } 25 | return 26 | } 27 | 28 | func (v *IConnectionPoint) Unadvise(cookie uint32) (err error) { 29 | hr, _, _ := syscall.Syscall( 30 | v.VTable().Unadvise, 31 | 2, 32 | uintptr(unsafe.Pointer(v)), 33 | uintptr(cookie), 34 | 0) 35 | if hr != 0 { 36 | err = NewError(hr) 37 | } 38 | return 39 | } 40 | 41 | func (v *IConnectionPoint) EnumConnections(p *unsafe.Pointer) error { 42 | return NewError(E_NOTIMPL) 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IConnectionPointContainer struct { 6 | IUnknown 7 | } 8 | 9 | type IConnectionPointContainerVtbl struct { 10 | IUnknownVtbl 11 | EnumConnectionPoints uintptr 12 | FindConnectionPoint uintptr 13 | } 14 | 15 | func (v *IConnectionPointContainer) VTable() *IConnectionPointContainerVtbl { 16 | return (*IConnectionPointContainerVtbl)(unsafe.Pointer(v.RawVTable)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iconnectionpointcontainer_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *IConnectionPointContainer) EnumConnectionPoints(points interface{}) error { 11 | return NewError(E_NOTIMPL) 12 | } 13 | 14 | func (v *IConnectionPointContainer) FindConnectionPoint(iid *GUID, point **IConnectionPoint) (err error) { 15 | hr, _, _ := syscall.Syscall( 16 | v.VTable().FindConnectionPoint, 17 | 3, 18 | uintptr(unsafe.Pointer(v)), 19 | uintptr(unsafe.Pointer(iid)), 20 | uintptr(unsafe.Pointer(point))) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/idispatch_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getIDsOfName(disp *IDispatch, names []string) ([]int32, error) { 6 | return []int32{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func getTypeInfoCount(disp *IDispatch) (uint32, error) { 10 | return uint32(0), NewError(E_NOTIMPL) 11 | } 12 | 13 | func getTypeInfo(disp *IDispatch) (*ITypeInfo, error) { 14 | return nil, NewError(E_NOTIMPL) 15 | } 16 | 17 | func invoke(disp *IDispatch, dispid int32, dispatch int16, params ...interface{}) (*VARIANT, error) { 18 | return nil, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IEnumVARIANT struct { 6 | IUnknown 7 | } 8 | 9 | type IEnumVARIANTVtbl struct { 10 | IUnknownVtbl 11 | Next uintptr 12 | Skip uintptr 13 | Reset uintptr 14 | Clone uintptr 15 | } 16 | 17 | func (v *IEnumVARIANT) VTable() *IEnumVARIANTVtbl { 18 | return (*IEnumVARIANTVtbl)(unsafe.Pointer(v.RawVTable)) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (enum *IEnumVARIANT) Clone() (*IEnumVARIANT, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (enum *IEnumVARIANT) Reset() error { 10 | return NewError(E_NOTIMPL) 11 | } 12 | 13 | func (enum *IEnumVARIANT) Skip(celt uint) error { 14 | return NewError(E_NOTIMPL) 15 | } 16 | 17 | func (enum *IEnumVARIANT) Next(celt uint) (VARIANT, uint, error) { 18 | return NewVariant(VT_NULL, int64(0)), 0, NewError(E_NOTIMPL) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/ienumvariant_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (enum *IEnumVARIANT) Clone() (cloned *IEnumVARIANT, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | enum.VTable().Clone, 13 | 2, 14 | uintptr(unsafe.Pointer(enum)), 15 | uintptr(unsafe.Pointer(&cloned)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | 23 | func (enum *IEnumVARIANT) Reset() (err error) { 24 | hr, _, _ := syscall.Syscall( 25 | enum.VTable().Reset, 26 | 1, 27 | uintptr(unsafe.Pointer(enum)), 28 | 0, 29 | 0) 30 | if hr != 0 { 31 | err = NewError(hr) 32 | } 33 | return 34 | } 35 | 36 | func (enum *IEnumVARIANT) Skip(celt uint) (err error) { 37 | hr, _, _ := syscall.Syscall( 38 | enum.VTable().Skip, 39 | 2, 40 | uintptr(unsafe.Pointer(enum)), 41 | uintptr(celt), 42 | 0) 43 | if hr != 0 { 44 | err = NewError(hr) 45 | } 46 | return 47 | } 48 | 49 | func (enum *IEnumVARIANT) Next(celt uint) (array VARIANT, length uint, err error) { 50 | hr, _, _ := syscall.Syscall6( 51 | enum.VTable().Next, 52 | 4, 53 | uintptr(unsafe.Pointer(enum)), 54 | uintptr(celt), 55 | uintptr(unsafe.Pointer(&array)), 56 | uintptr(unsafe.Pointer(&length)), 57 | 0, 58 | 0) 59 | if hr != 0 { 60 | err = NewError(hr) 61 | } 62 | return 63 | } 64 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IInspectable struct { 6 | IUnknown 7 | } 8 | 9 | type IInspectableVtbl struct { 10 | IUnknownVtbl 11 | GetIIds uintptr 12 | GetRuntimeClassName uintptr 13 | GetTrustLevel uintptr 14 | } 15 | 16 | func (v *IInspectable) VTable() *IInspectableVtbl { 17 | return (*IInspectableVtbl)(unsafe.Pointer(v.RawVTable)) 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iinspectable_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *IInspectable) GetIids() ([]*GUID, error) { 6 | return []*GUID{}, NewError(E_NOTIMPL) 7 | } 8 | 9 | func (v *IInspectable) GetRuntimeClassName() (string, error) { 10 | return "", NewError(E_NOTIMPL) 11 | } 12 | 13 | func (v *IInspectable) GetTrustLevel() (uint32, error) { 14 | return uint32(0), NewError(E_NOTIMPL) 15 | } 16 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IProvideClassInfo struct { 6 | IUnknown 7 | } 8 | 9 | type IProvideClassInfoVtbl struct { 10 | IUnknownVtbl 11 | GetClassInfo uintptr 12 | } 13 | 14 | func (v *IProvideClassInfo) VTable() *IProvideClassInfoVtbl { 15 | return (*IProvideClassInfoVtbl)(unsafe.Pointer(v.RawVTable)) 16 | } 17 | 18 | func (v *IProvideClassInfo) GetClassInfo() (cinfo *ITypeInfo, err error) { 19 | cinfo, err = getClassInfo(v) 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iprovideclassinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func getClassInfo(disp *IProvideClassInfo) (tinfo *ITypeInfo, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | disp.VTable().GetClassInfo, 13 | 2, 14 | uintptr(unsafe.Pointer(disp)), 15 | uintptr(unsafe.Pointer(&tinfo)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type ITypeInfo struct { 6 | IUnknown 7 | } 8 | 9 | type ITypeInfoVtbl struct { 10 | IUnknownVtbl 11 | GetTypeAttr uintptr 12 | GetTypeComp uintptr 13 | GetFuncDesc uintptr 14 | GetVarDesc uintptr 15 | GetNames uintptr 16 | GetRefTypeOfImplType uintptr 17 | GetImplTypeFlags uintptr 18 | GetIDsOfNames uintptr 19 | Invoke uintptr 20 | GetDocumentation uintptr 21 | GetDllEntry uintptr 22 | GetRefTypeInfo uintptr 23 | AddressOfMember uintptr 24 | CreateInstance uintptr 25 | GetMops uintptr 26 | GetContainingTypeLib uintptr 27 | ReleaseTypeAttr uintptr 28 | ReleaseFuncDesc uintptr 29 | ReleaseVarDesc uintptr 30 | } 31 | 32 | func (v *ITypeInfo) VTable() *ITypeInfoVtbl { 33 | return (*ITypeInfoVtbl)(unsafe.Pointer(v.RawVTable)) 34 | } 35 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func (v *ITypeInfo) GetTypeAttr() (*TYPEATTR, error) { 6 | return nil, NewError(E_NOTIMPL) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/itypeinfo_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | "unsafe" 8 | ) 9 | 10 | func (v *ITypeInfo) GetTypeAttr() (tattr *TYPEATTR, err error) { 11 | hr, _, _ := syscall.Syscall( 12 | uintptr(v.VTable().GetTypeAttr), 13 | 2, 14 | uintptr(unsafe.Pointer(v)), 15 | uintptr(unsafe.Pointer(&tattr)), 16 | 0) 17 | if hr != 0 { 18 | err = NewError(hr) 19 | } 20 | return 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown.go: -------------------------------------------------------------------------------- 1 | package ole 2 | 3 | import "unsafe" 4 | 5 | type IUnknown struct { 6 | RawVTable *interface{} 7 | } 8 | 9 | type IUnknownVtbl struct { 10 | QueryInterface uintptr 11 | AddRef uintptr 12 | Release uintptr 13 | } 14 | 15 | type UnknownLike interface { 16 | QueryInterface(iid *GUID) (disp *IDispatch, err error) 17 | AddRef() int32 18 | Release() int32 19 | } 20 | 21 | func (v *IUnknown) VTable() *IUnknownVtbl { 22 | return (*IUnknownVtbl)(unsafe.Pointer(v.RawVTable)) 23 | } 24 | 25 | func (v *IUnknown) PutQueryInterface(interfaceID *GUID, obj interface{}) error { 26 | return reflectQueryInterface(v, v.VTable().QueryInterface, interfaceID, obj) 27 | } 28 | 29 | func (v *IUnknown) IDispatch(interfaceID *GUID) (dispatch *IDispatch, err error) { 30 | err = v.PutQueryInterface(interfaceID, &dispatch) 31 | return 32 | } 33 | 34 | func (v *IUnknown) IEnumVARIANT(interfaceID *GUID) (enum *IEnumVARIANT, err error) { 35 | err = v.PutQueryInterface(interfaceID, &enum) 36 | return 37 | } 38 | 39 | func (v *IUnknown) QueryInterface(iid *GUID) (*IDispatch, error) { 40 | return queryInterface(v, iid) 41 | } 42 | 43 | func (v *IUnknown) MustQueryInterface(iid *GUID) (disp *IDispatch) { 44 | unk, err := queryInterface(v, iid) 45 | if err != nil { 46 | panic(err) 47 | } 48 | return unk 49 | } 50 | 51 | func (v *IUnknown) AddRef() int32 { 52 | return addRef(v) 53 | } 54 | 55 | func (v *IUnknown) Release() int32 { 56 | return release(v) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 6 | return NewError(E_NOTIMPL) 7 | } 8 | 9 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 10 | return nil, NewError(E_NOTIMPL) 11 | } 12 | 13 | func addRef(unk *IUnknown) int32 { 14 | return 0 15 | } 16 | 17 | func release(unk *IUnknown) int32 { 18 | return 0 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/iunknown_windows.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "reflect" 7 | "syscall" 8 | "unsafe" 9 | ) 10 | 11 | func reflectQueryInterface(self interface{}, method uintptr, interfaceID *GUID, obj interface{}) (err error) { 12 | selfValue := reflect.ValueOf(self).Elem() 13 | objValue := reflect.ValueOf(obj).Elem() 14 | 15 | hr, _, _ := syscall.Syscall( 16 | method, 17 | 3, 18 | selfValue.UnsafeAddr(), 19 | uintptr(unsafe.Pointer(interfaceID)), 20 | objValue.Addr().Pointer()) 21 | if hr != 0 { 22 | err = NewError(hr) 23 | } 24 | return 25 | } 26 | 27 | func queryInterface(unk *IUnknown, iid *GUID) (disp *IDispatch, err error) { 28 | hr, _, _ := syscall.Syscall( 29 | unk.VTable().QueryInterface, 30 | 3, 31 | uintptr(unsafe.Pointer(unk)), 32 | uintptr(unsafe.Pointer(iid)), 33 | uintptr(unsafe.Pointer(&disp))) 34 | if hr != 0 { 35 | err = NewError(hr) 36 | } 37 | return 38 | } 39 | 40 | func addRef(unk *IUnknown) int32 { 41 | ret, _, _ := syscall.Syscall( 42 | unk.VTable().AddRef, 43 | 1, 44 | uintptr(unsafe.Pointer(unk)), 45 | 0, 46 | 0) 47 | return int32(ret) 48 | } 49 | 50 | func release(unk *IUnknown) int32 { 51 | ret, _, _ := syscall.Syscall( 52 | unk.VTable().Release, 53 | 1, 54 | uintptr(unsafe.Pointer(unk)), 55 | 0, 56 | 0) 57 | return int32(ret) 58 | } 59 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/connection_func.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package oleutil 4 | 5 | import ole "github.com/go-ole/go-ole" 6 | 7 | // ConnectObject creates a connection point between two services for communication. 8 | func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (uint32, error) { 9 | return 0, ole.NewError(ole.E_NOTIMPL) 10 | } 11 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/oleutil/go-get.go: -------------------------------------------------------------------------------- 1 | // This file is here so go get succeeds as without it errors with: 2 | // no buildable Go source files in ... 3 | // 4 | // +build !windows 5 | 6 | package oleutil 7 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearray.go: -------------------------------------------------------------------------------- 1 | // Package is meant to retrieve and process safe array data returned from COM. 2 | 3 | package ole 4 | 5 | // SafeArrayBound defines the SafeArray boundaries. 6 | type SafeArrayBound struct { 7 | Elements uint32 8 | LowerBound int32 9 | } 10 | 11 | // SafeArray is how COM handles arrays. 12 | type SafeArray struct { 13 | Dimensions uint16 14 | FeaturesFlag uint16 15 | ElementsSize uint32 16 | LocksAmount uint32 17 | Data uint32 18 | Bounds [16]byte 19 | } 20 | 21 | // SAFEARRAY is obsolete, exists for backwards compatibility. 22 | // Use SafeArray 23 | type SAFEARRAY SafeArray 24 | 25 | // SAFEARRAYBOUND is obsolete, exists for backwards compatibility. 26 | // Use SafeArrayBound 27 | type SAFEARRAYBOUND SafeArrayBound 28 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/safearrayslices.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "unsafe" 7 | ) 8 | 9 | func safeArrayFromByteSlice(slice []byte) *SafeArray { 10 | array, _ := safeArrayCreateVector(VT_UI1, 0, uint32(len(slice))) 11 | 12 | if array == nil { 13 | panic("Could not convert []byte to SAFEARRAY") 14 | } 15 | 16 | for i, v := range slice { 17 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(&v))) 18 | } 19 | return array 20 | } 21 | 22 | func safeArrayFromStringSlice(slice []string) *SafeArray { 23 | array, _ := safeArrayCreateVector(VT_BSTR, 0, uint32(len(slice))) 24 | 25 | if array == nil { 26 | panic("Could not convert []string to SAFEARRAY") 27 | } 28 | // SysAllocStringLen(s) 29 | for i, v := range slice { 30 | safeArrayPutElement(array, int64(i), uintptr(unsafe.Pointer(SysAllocStringLen(v)))) 31 | } 32 | return array 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variables.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package ole 4 | 5 | import ( 6 | "syscall" 7 | ) 8 | 9 | var ( 10 | modcombase = syscall.NewLazyDLL("combase.dll") 11 | modkernel32, _ = syscall.LoadDLL("kernel32.dll") 12 | modole32, _ = syscall.LoadDLL("ole32.dll") 13 | modoleaut32, _ = syscall.LoadDLL("oleaut32.dll") 14 | modmsvcrt, _ = syscall.LoadDLL("msvcrt.dll") 15 | moduser32, _ = syscall.LoadDLL("user32.dll") 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_386.go: -------------------------------------------------------------------------------- 1 | // +build 386 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_amd64.go: -------------------------------------------------------------------------------- 1 | // +build amd64 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/variant_s390x.go: -------------------------------------------------------------------------------- 1 | // +build s390x 2 | 3 | package ole 4 | 5 | type VARIANT struct { 6 | VT VT // 2 7 | wReserved1 uint16 // 4 8 | wReserved2 uint16 // 6 9 | wReserved3 uint16 // 8 10 | Val int64 // 16 11 | _ [8]byte // 24 12 | } 13 | -------------------------------------------------------------------------------- /vendor/github.com/go-ole/go-ole/winrt_doc.go: -------------------------------------------------------------------------------- 1 | // +build !windows 2 | 3 | package ole 4 | 5 | // RoInitialize 6 | func RoInitialize(thread_type uint32) (err error) { 7 | return NewError(E_NOTIMPL) 8 | } 9 | 10 | // RoActivateInstance 11 | func RoActivateInstance(clsid string) (ins *IInspectable, err error) { 12 | return nil, NewError(E_NOTIMPL) 13 | } 14 | 15 | // RoGetActivationFactory 16 | func RoGetActivationFactory(clsid string, iid *GUID) (ins *IInspectable, err error) { 17 | return nil, NewError(E_NOTIMPL) 18 | } 19 | 20 | // HString is handle string for pointers. 21 | type HString uintptr 22 | 23 | // NewHString returns a new HString for Go string. 24 | func NewHString(s string) (hstring HString, err error) { 25 | return HString(uintptr(0)), NewError(E_NOTIMPL) 26 | } 27 | 28 | // DeleteHString deletes HString. 29 | func DeleteHString(hstring HString) (err error) { 30 | return NewError(E_NOTIMPL) 31 | } 32 | 33 | // String returns Go string value of HString. 34 | func (h HString) String() string { 35 | return "" 36 | } 37 | -------------------------------------------------------------------------------- /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/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_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/mitchellh/go-wordwrap/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Mitchell Hashimoto 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 13 | all 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 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-wordwrap/README.md: -------------------------------------------------------------------------------- 1 | # go-wordwrap 2 | 3 | `go-wordwrap` (Golang package: `wordwrap`) is a package for Go that 4 | automatically wraps words into multiple lines. The primary use case for this 5 | is in formatting CLI output, but of course word wrapping is a generally useful 6 | thing to do. 7 | 8 | ## Installation and Usage 9 | 10 | Install using `go get github.com/mitchellh/go-wordwrap`. 11 | 12 | Full documentation is available at 13 | http://godoc.org/github.com/mitchellh/go-wordwrap 14 | 15 | Below is an example of its usage ignoring errors: 16 | 17 | ```go 18 | wrapped := wordwrap.WrapString("foo bar baz", 3) 19 | fmt.Println(wrapped) 20 | ``` 21 | 22 | Would output: 23 | 24 | ``` 25 | foo 26 | bar 27 | baz 28 | ``` 29 | 30 | ## Word Wrap Algorithm 31 | 32 | This library doesn't use any clever algorithm for word wrapping. The wrapping 33 | is actually very naive: whenever there is whitespace or an explicit linebreak. 34 | The goal of this library is for word wrapping CLI output, so the input is 35 | typically pretty well controlled human language. Because of this, the naive 36 | approach typically works just fine. 37 | 38 | In the future, we'd like to make the algorithm more advanced. We would do 39 | so without breaking the API. 40 | -------------------------------------------------------------------------------- /vendor/github.com/mitchellh/go-wordwrap/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/mitchellh/go-wordwrap 2 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/AUTHORS: -------------------------------------------------------------------------------- 1 | # Please keep this file sorted. 2 | 3 | Georg Reinke 4 | nsf 5 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2012 termbox-go authors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/escwait.go: -------------------------------------------------------------------------------- 1 | // +build !darwin 2 | 3 | package termbox 4 | 5 | // On all systems other than macOS, disable behavior which will wait before 6 | // deciding that the escape key was pressed, to account for partially send 7 | // escape sequences, especially with regard to lengthy mouse sequences. 8 | // See https://github.com/nsf/termbox-go/issues/132 9 | func enable_wait_for_escape_sequence() bool { 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/escwait_darwin.go: -------------------------------------------------------------------------------- 1 | package termbox 2 | 3 | // On macOS, enable behavior which will wait before deciding that the escape 4 | // key was pressed, to account for partially send escape sequences, especially 5 | // with regard to lengthy mouse sequences. 6 | // See https://github.com/nsf/termbox-go/issues/132 7 | func enable_wait_for_escape_sequence() bool { 8 | return true 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | package termbox 4 | 5 | /* 6 | #include 7 | #include 8 | */ 9 | import "C" 10 | 11 | type syscall_Termios C.struct_termios 12 | 13 | const ( 14 | syscall_IGNBRK = C.IGNBRK 15 | syscall_BRKINT = C.BRKINT 16 | syscall_PARMRK = C.PARMRK 17 | syscall_ISTRIP = C.ISTRIP 18 | syscall_INLCR = C.INLCR 19 | syscall_IGNCR = C.IGNCR 20 | syscall_ICRNL = C.ICRNL 21 | syscall_IXON = C.IXON 22 | syscall_OPOST = C.OPOST 23 | syscall_ECHO = C.ECHO 24 | syscall_ECHONL = C.ECHONL 25 | syscall_ICANON = C.ICANON 26 | syscall_ISIG = C.ISIG 27 | syscall_IEXTEN = C.IEXTEN 28 | syscall_CSIZE = C.CSIZE 29 | syscall_PARENB = C.PARENB 30 | syscall_CS8 = C.CS8 31 | syscall_VMIN = C.VMIN 32 | syscall_VTIME = C.VTIME 33 | 34 | // on darwin change these to (on *bsd too?): 35 | // C.TIOCGETA 36 | // C.TIOCSETA 37 | syscall_TCGETS = C.TCGETS 38 | syscall_TCSETS = C.TCSETS 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_darwin.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | // +build !amd64 5 | 6 | package termbox 7 | 8 | type syscall_Termios struct { 9 | Iflag uint32 10 | Oflag uint32 11 | Cflag uint32 12 | Lflag uint32 13 | Cc [20]uint8 14 | Ispeed uint32 15 | Ospeed uint32 16 | } 17 | 18 | const ( 19 | syscall_IGNBRK = 0x1 20 | syscall_BRKINT = 0x2 21 | syscall_PARMRK = 0x8 22 | syscall_ISTRIP = 0x20 23 | syscall_INLCR = 0x40 24 | syscall_IGNCR = 0x80 25 | syscall_ICRNL = 0x100 26 | syscall_IXON = 0x200 27 | syscall_OPOST = 0x1 28 | syscall_ECHO = 0x8 29 | syscall_ECHONL = 0x10 30 | syscall_ICANON = 0x100 31 | syscall_ISIG = 0x80 32 | syscall_IEXTEN = 0x400 33 | syscall_CSIZE = 0x300 34 | syscall_PARENB = 0x1000 35 | syscall_CS8 = 0x300 36 | syscall_VMIN = 0x10 37 | syscall_VTIME = 0x11 38 | 39 | syscall_TCGETS = 0x402c7413 40 | syscall_TCSETS = 0x802c7414 41 | ) 42 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint64 8 | Oflag uint64 9 | Cflag uint64 10 | Lflag uint64 11 | Cc [20]uint8 12 | Pad_cgo_0 [4]byte 13 | Ispeed uint64 14 | Ospeed uint64 15 | } 16 | 17 | const ( 18 | syscall_IGNBRK = 0x1 19 | syscall_BRKINT = 0x2 20 | syscall_PARMRK = 0x8 21 | syscall_ISTRIP = 0x20 22 | syscall_INLCR = 0x40 23 | syscall_IGNCR = 0x80 24 | syscall_ICRNL = 0x100 25 | syscall_IXON = 0x200 26 | syscall_OPOST = 0x1 27 | syscall_ECHO = 0x8 28 | syscall_ECHONL = 0x10 29 | syscall_ICANON = 0x100 30 | syscall_ISIG = 0x80 31 | syscall_IEXTEN = 0x400 32 | syscall_CSIZE = 0x300 33 | syscall_PARENB = 0x1000 34 | syscall_CS8 = 0x300 35 | syscall_VMIN = 0x10 36 | syscall_VTIME = 0x11 37 | 38 | syscall_TCGETS = 0x40487413 39 | syscall_TCSETS = 0x80487414 40 | ) 41 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed uint32 13 | Ospeed uint32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_freebsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed uint32 13 | Ospeed uint32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_linux.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | import "syscall" 7 | 8 | type syscall_Termios syscall.Termios 9 | 10 | const ( 11 | syscall_IGNBRK = syscall.IGNBRK 12 | syscall_BRKINT = syscall.BRKINT 13 | syscall_PARMRK = syscall.PARMRK 14 | syscall_ISTRIP = syscall.ISTRIP 15 | syscall_INLCR = syscall.INLCR 16 | syscall_IGNCR = syscall.IGNCR 17 | syscall_ICRNL = syscall.ICRNL 18 | syscall_IXON = syscall.IXON 19 | syscall_OPOST = syscall.OPOST 20 | syscall_ECHO = syscall.ECHO 21 | syscall_ECHONL = syscall.ECHONL 22 | syscall_ICANON = syscall.ICANON 23 | syscall_ISIG = syscall.ISIG 24 | syscall_IEXTEN = syscall.IEXTEN 25 | syscall_CSIZE = syscall.CSIZE 26 | syscall_PARENB = syscall.PARENB 27 | syscall_CS8 = syscall.CS8 28 | syscall_VMIN = syscall.VMIN 29 | syscall_VTIME = syscall.VTIME 30 | 31 | syscall_TCGETS = syscall.TCGETS 32 | syscall_TCSETS = syscall.TCSETS 33 | ) 34 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_netbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed int32 13 | Ospeed int32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/syscalls_openbsd.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs syscalls.go 3 | 4 | package termbox 5 | 6 | type syscall_Termios struct { 7 | Iflag uint32 8 | Oflag uint32 9 | Cflag uint32 10 | Lflag uint32 11 | Cc [20]uint8 12 | Ispeed int32 13 | Ospeed int32 14 | } 15 | 16 | const ( 17 | syscall_IGNBRK = 0x1 18 | syscall_BRKINT = 0x2 19 | syscall_PARMRK = 0x8 20 | syscall_ISTRIP = 0x20 21 | syscall_INLCR = 0x40 22 | syscall_IGNCR = 0x80 23 | syscall_ICRNL = 0x100 24 | syscall_IXON = 0x200 25 | syscall_OPOST = 0x1 26 | syscall_ECHO = 0x8 27 | syscall_ECHONL = 0x10 28 | syscall_ICANON = 0x100 29 | syscall_ISIG = 0x80 30 | syscall_IEXTEN = 0x400 31 | syscall_CSIZE = 0x300 32 | syscall_PARENB = 0x1000 33 | syscall_CS8 = 0x300 34 | syscall_VMIN = 0x10 35 | syscall_VTIME = 0x11 36 | 37 | syscall_TCGETS = 0x402c7413 38 | syscall_TCSETS = 0x802c7414 39 | ) 40 | -------------------------------------------------------------------------------- /vendor/github.com/nsf/termbox-go/termbox_common.go: -------------------------------------------------------------------------------- 1 | package termbox 2 | 3 | // private API, common OS agnostic part 4 | 5 | type cellbuf struct { 6 | width int 7 | height int 8 | cells []Cell 9 | } 10 | 11 | func (this *cellbuf) init(width, height int) { 12 | this.width = width 13 | this.height = height 14 | this.cells = make([]Cell, width*height) 15 | } 16 | 17 | func (this *cellbuf) resize(width, height int) { 18 | if this.width == width && this.height == height { 19 | return 20 | } 21 | 22 | oldw := this.width 23 | oldh := this.height 24 | oldcells := this.cells 25 | 26 | this.init(width, height) 27 | this.clear() 28 | 29 | minw, minh := oldw, oldh 30 | 31 | if width < minw { 32 | minw = width 33 | } 34 | if height < minh { 35 | minh = height 36 | } 37 | 38 | for i := 0; i < minh; i++ { 39 | srco, dsto := i*oldw, i*width 40 | src := oldcells[srco : srco+minw] 41 | dst := this.cells[dsto : dsto+minw] 42 | copy(dst, src) 43 | } 44 | } 45 | 46 | func (this *cellbuf) clear() { 47 | for i := range this.cells { 48 | c := &this.cells[i] 49 | c.Ch = ' ' 50 | c.Fg = foreground 51 | c.Bg = background 52 | } 53 | } 54 | 55 | const cursor_hidden = -1 56 | 57 | func is_cursor_hidden(x, y int) bool { 58 | return x == cursor_hidden || y == cursor_hidden 59 | } 60 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package cpu 5 | 6 | import "github.com/shirou/gopsutil/internal/common" 7 | 8 | func perCPUTimes() ([]TimesStat, error) { 9 | return []TimesStat{}, common.ErrNotImplementedError 10 | } 11 | 12 | func allCPUTimes() ([]TimesStat, error) { 13 | return []TimesStat{}, common.ErrNotImplementedError 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows 2 | 3 | package cpu 4 | 5 | import ( 6 | "context" 7 | 8 | "github.com/shirou/gopsutil/internal/common" 9 | ) 10 | 11 | func Times(percpu bool) ([]TimesStat, error) { 12 | return TimesWithContext(context.Background(), percpu) 13 | } 14 | 15 | func TimesWithContext(ctx context.Context, percpu bool) ([]TimesStat, error) { 16 | return []TimesStat{}, common.ErrNotImplementedError 17 | } 18 | 19 | func Info() ([]InfoStat, error) { 20 | return InfoWithContext(context.Background()) 21 | } 22 | 23 | func InfoWithContext(ctx context.Context) ([]InfoStat, error) { 24 | return []InfoStat{}, common.ErrNotImplementedError 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd_386.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint32 5 | Nice uint32 6 | Sys uint32 7 | Intr uint32 8 | Idle uint32 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/cpu/cpu_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | package cpu 2 | 3 | type cpuTimes struct { 4 | User uint64 5 | Nice uint64 6 | Sys uint64 7 | Intr uint64 8 | Idle uint64 9 | } 10 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_darwin_nocgo.go: -------------------------------------------------------------------------------- 1 | // +build darwin 2 | // +build !cgo 3 | 4 | package disk 5 | 6 | import ( 7 | "context" 8 | 9 | "github.com/shirou/gopsutil/internal/common" 10 | ) 11 | 12 | func IOCounters(names ...string) (map[string]IOCountersStat, error) { 13 | return IOCountersWithContext(context.Background(), names...) 14 | } 15 | 16 | func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { 17 | return nil, common.ErrNotImplementedError 18 | } 19 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/disk/disk_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!windows,!solaris 2 | 3 | package disk 4 | 5 | import ( 6 | "context" 7 | 8 | "github.com/shirou/gopsutil/internal/common" 9 | ) 10 | 11 | func IOCounters(names ...string) (map[string]IOCountersStat, error) { 12 | return IOCountersWithContext(context.Background(), names...) 13 | } 14 | 15 | func IOCountersWithContext(ctx context.Context, names ...string) (map[string]IOCountersStat, error) { 16 | return nil, common.ErrNotImplementedError 17 | } 18 | 19 | func Partitions(all bool) ([]PartitionStat, error) { 20 | return PartitionsWithContext(context.Background(), all) 21 | } 22 | 23 | func PartitionsWithContext(ctx context.Context, all bool) ([]PartitionStat, error) { 24 | return []PartitionStat{}, common.ErrNotImplementedError 25 | } 26 | 27 | func Usage(path string) (*UsageStat, error) { 28 | return UsageWithContext(context.Background(), path) 29 | } 30 | 31 | func UsageWithContext(ctx context.Context, path string) (*UsageStat, error) { 32 | return nil, common.ErrNotImplementedError 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | type Timeval struct { 18 | Sec int32 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_darwin_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_darwin.go 3 | 4 | package host 5 | 6 | type Utmpx struct { 7 | User [256]int8 8 | ID [4]int8 9 | Line [32]int8 10 | Pid int32 11 | Type int16 12 | Pad_cgo_0 [6]byte 13 | Tv Timeval 14 | Host [256]int8 15 | Pad [16]uint32 16 | } 17 | type Timeval struct { 18 | Sec int32 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_386.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO why should 197 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // X__ut_spare [64]int8 38 | } 39 | 40 | type Timeval struct { 41 | Sec [4]byte 42 | Usec [3]byte 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO: why should 197, not 0x118 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // Host [128]int8 38 | // X__ut_spare [64]int8 39 | } 40 | 41 | type Timeval struct { 42 | Sec [4]byte 43 | Usec [3]byte 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_freebsd_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_freebsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmpx = 197 // TODO: why should 197, not 0x118 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [16]int8 25 | Host [16]int8 26 | Time int32 27 | } 28 | 29 | type Utmpx struct { 30 | Type int16 31 | Tv Timeval 32 | Id [8]int8 33 | Pid int32 34 | User [32]int8 35 | Line [16]int8 36 | Host [125]int8 37 | // Host [128]int8 38 | // X__ut_spare [64]int8 39 | } 40 | 41 | type Timeval struct { 42 | Sec [4]byte 43 | Usec [3]byte 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_386.go: -------------------------------------------------------------------------------- 1 | // ATTENTION - FILE MANUAL FIXED AFTER CGO. 2 | // Fixed line: Tv _Ctype_struct_timeval -> Tv UtTv 3 | // Created by cgo -godefs, MANUAL FIXED 4 | // cgo -godefs types_linux.go 5 | 6 | package host 7 | 8 | const ( 9 | sizeofPtr = 0x4 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x4 13 | sizeofLongLong = 0x8 14 | sizeOfUtmp = 0x180 15 | ) 16 | 17 | type ( 18 | _C_short int16 19 | _C_int int32 20 | _C_long int32 21 | _C_long_long int64 22 | ) 23 | 24 | type utmp struct { 25 | Type int16 26 | Pad_cgo_0 [2]byte 27 | Pid int32 28 | Line [32]int8 29 | ID [4]int8 30 | User [32]int8 31 | Host [256]int8 32 | Exit exit_status 33 | Session int32 34 | Tv UtTv 35 | Addr_v6 [4]int32 36 | X__unused [20]int8 37 | } 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | type UtTv struct { 43 | Sec int32 44 | Usec int32 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv _Ctype_struct___0 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int64 42 | Usec int64 43 | } 44 | 45 | type _Ctype_struct___0 struct { 46 | Sec int32 47 | Usec int32 48 | } 49 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_arm.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go | sed "s/uint8/int8/g" 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int32 42 | Usec int32 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__glibc_reserved [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int64 42 | Usec int64 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_mips.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int32 42 | Usec int32 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_mips64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int32 42 | Usec int32 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_mips64le.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int32 42 | Usec int32 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_mipsle.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_linux.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x4 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x4 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x180 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int32 19 | _C_long_long int64 20 | ) 21 | 22 | type utmp struct { 23 | Type int16 24 | Pad_cgo_0 [2]byte 25 | Pid int32 26 | Line [32]int8 27 | Id [4]int8 28 | User [32]int8 29 | Host [256]int8 30 | Exit exit_status 31 | Session int32 32 | Tv timeval 33 | Addr_v6 [4]int32 34 | X__unused [20]int8 35 | } 36 | type exit_status struct { 37 | Termination int16 38 | Exit int16 39 | } 40 | type timeval struct { 41 | Sec int32 42 | Usec int32 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_ppc64le.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build ppc64le 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types_linux.go 5 | 6 | package host 7 | 8 | const ( 9 | sizeofPtr = 0x8 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x8 13 | sizeofLongLong = 0x8 14 | sizeOfUtmp = 0x180 15 | ) 16 | 17 | type ( 18 | _C_short int16 19 | _C_int int32 20 | _C_long int64 21 | _C_long_long int64 22 | ) 23 | 24 | type utmp struct { 25 | Type int16 26 | Pad_cgo_0 [2]byte 27 | Pid int32 28 | Line [32]int8 29 | Id [4]int8 30 | User [32]int8 31 | Host [256]int8 32 | Exit exit_status 33 | Session int32 34 | Tv timeval 35 | Addr_v6 [4]int32 36 | X__glibc_reserved [20]int8 37 | } 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | type timeval struct { 43 | Sec int64 44 | Usec int64 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_linux_s390x.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | // +build s390x 3 | // Created by cgo -godefs - DO NOT EDIT 4 | // cgo -godefs types_linux.go 5 | 6 | package host 7 | 8 | const ( 9 | sizeofPtr = 0x8 10 | sizeofShort = 0x2 11 | sizeofInt = 0x4 12 | sizeofLong = 0x8 13 | sizeofLongLong = 0x8 14 | sizeOfUtmp = 0x180 15 | ) 16 | 17 | type ( 18 | _C_short int16 19 | _C_int int32 20 | _C_long int64 21 | _C_long_long int64 22 | ) 23 | 24 | type utmp struct { 25 | Type int16 26 | Pad_cgo_0 [2]byte 27 | Pid int32 28 | Line [32]int8 29 | Id [4]int8 30 | User [32]int8 31 | Host [256]int8 32 | Exit exit_status 33 | Session int32 34 | Tv timeval 35 | Addr_v6 [4]int32 36 | X__glibc_reserved [20]int8 37 | } 38 | type exit_status struct { 39 | Termination int16 40 | Exit int16 41 | } 42 | type timeval struct { 43 | Sec int64 44 | Usec int64 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/host_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Created by cgo -godefs - DO NOT EDIT 2 | // cgo -godefs types_openbsd.go 3 | 4 | package host 5 | 6 | const ( 7 | sizeofPtr = 0x8 8 | sizeofShort = 0x2 9 | sizeofInt = 0x4 10 | sizeofLong = 0x8 11 | sizeofLongLong = 0x8 12 | sizeOfUtmp = 0x130 13 | ) 14 | 15 | type ( 16 | _C_short int16 17 | _C_int int32 18 | _C_long int64 19 | _C_long_long int64 20 | ) 21 | 22 | type Utmp struct { 23 | Line [8]int8 24 | Name [32]int8 25 | Host [256]int8 26 | Time int64 27 | } 28 | type Timeval struct { 29 | Sec int64 30 | Usec int64 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_darwin.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | // plus hand editing about timeval 3 | 4 | /* 5 | Input to cgo -godefs. 6 | */ 7 | 8 | package host 9 | 10 | /* 11 | #include 12 | #include 13 | */ 14 | import "C" 15 | 16 | type Utmpx C.struct_utmpx 17 | type Timeval C.struct_timeval 18 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_freebsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #define KERNEL 11 | #include 12 | #include 13 | #include 14 | 15 | enum { 16 | sizeofPtr = sizeof(void*), 17 | }; 18 | 19 | */ 20 | import "C" 21 | 22 | // Machine characteristics; for internal use. 23 | 24 | const ( 25 | sizeofPtr = C.sizeofPtr 26 | sizeofShort = C.sizeof_short 27 | sizeofInt = C.sizeof_int 28 | sizeofLong = C.sizeof_long 29 | sizeofLongLong = C.sizeof_longlong 30 | sizeOfUtmpx = C.sizeof_struct_utmpx 31 | ) 32 | 33 | // Basic types 34 | 35 | type ( 36 | _C_short C.short 37 | _C_int C.int 38 | _C_long C.long 39 | _C_long_long C.longlong 40 | ) 41 | 42 | type Utmp C.struct_utmp 43 | type Utmpx C.struct_utmpx 44 | type Timeval C.struct_timeval 45 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_linux.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #include 11 | #include 12 | 13 | enum { 14 | sizeofPtr = sizeof(void*), 15 | }; 16 | 17 | */ 18 | import "C" 19 | 20 | // Machine characteristics; for internal use. 21 | 22 | const ( 23 | sizeofPtr = C.sizeofPtr 24 | sizeofShort = C.sizeof_short 25 | sizeofInt = C.sizeof_int 26 | sizeofLong = C.sizeof_long 27 | sizeofLongLong = C.sizeof_longlong 28 | sizeOfUtmp = C.sizeof_struct_utmp 29 | ) 30 | 31 | // Basic types 32 | 33 | type ( 34 | _C_short C.short 35 | _C_int C.int 36 | _C_long C.long 37 | _C_long_long C.longlong 38 | ) 39 | 40 | type utmp C.struct_utmp 41 | type exit_status C.struct_exit_status 42 | type timeval C.struct_timeval 43 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/host/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package host 8 | 9 | /* 10 | #define KERNEL 11 | #include 12 | #include 13 | #include 14 | 15 | enum { 16 | sizeofPtr = sizeof(void*), 17 | }; 18 | 19 | */ 20 | import "C" 21 | 22 | // Machine characteristics; for internal use. 23 | 24 | const ( 25 | sizeofPtr = C.sizeofPtr 26 | sizeofShort = C.sizeof_short 27 | sizeofInt = C.sizeof_int 28 | sizeofLong = C.sizeof_long 29 | sizeofLongLong = C.sizeof_longlong 30 | sizeOfUtmp = C.sizeof_struct_utmp 31 | ) 32 | 33 | // Basic types 34 | 35 | type ( 36 | _C_short C.short 37 | _C_int C.int 38 | _C_long C.long 39 | _C_long_long C.longlong 40 | ) 41 | 42 | type Utmp C.struct_utmp 43 | type Timeval C.struct_timeval 44 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/internal/common/common_linux.go: -------------------------------------------------------------------------------- 1 | // +build linux 2 | 3 | package common 4 | 5 | import ( 6 | "os" 7 | "os/exec" 8 | "strings" 9 | ) 10 | 11 | func DoSysctrl(mib string) ([]string, error) { 12 | sysctl, err := exec.LookPath("/sbin/sysctl") 13 | if err != nil { 14 | return []string{}, err 15 | } 16 | cmd := exec.Command(sysctl, "-n", mib) 17 | cmd.Env = getSysctrlEnv(os.Environ()) 18 | out, err := cmd.Output() 19 | if err != nil { 20 | return []string{}, err 21 | } 22 | v := strings.Replace(string(out), "{ ", "", 1) 23 | v = strings.Replace(string(v), " }", "", 1) 24 | values := strings.Fields(string(v)) 25 | 26 | return values, nil 27 | } 28 | 29 | func NumProcs() (uint64, error) { 30 | f, err := os.Open(HostProc()) 31 | if err != nil { 32 | return 0, err 33 | } 34 | defer f.Close() 35 | 36 | list, err := f.Readdirnames(-1) 37 | if err != nil { 38 | return 0, err 39 | } 40 | return uint64(len(list)), err 41 | } 42 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/mem_fallback.go: -------------------------------------------------------------------------------- 1 | // +build !darwin,!linux,!freebsd,!openbsd,!solaris,!windows 2 | 3 | package mem 4 | 5 | import ( 6 | "context" 7 | 8 | "github.com/shirou/gopsutil/internal/common" 9 | ) 10 | 11 | func VirtualMemory() (*VirtualMemoryStat, error) { 12 | return VirtualMemoryWithContext(context.Background()) 13 | } 14 | 15 | func VirtualMemoryWithContext(ctx context.Context) (*VirtualMemoryStat, error) { 16 | return nil, common.ErrNotImplementedError 17 | } 18 | 19 | func SwapMemory() (*SwapMemoryStat, error) { 20 | return SwapMemoryWithContext(context.Background()) 21 | } 22 | 23 | func SwapMemoryWithContext(ctx context.Context) (*SwapMemoryStat, error) { 24 | return nil, common.ErrNotImplementedError 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/mem/types_openbsd.go: -------------------------------------------------------------------------------- 1 | // +build ignore 2 | 3 | /* 4 | Input to cgo -godefs. 5 | */ 6 | 7 | package mem 8 | 9 | /* 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | */ 16 | import "C" 17 | 18 | // Machine characteristics; for internal use. 19 | 20 | const ( 21 | CTLVm = 2 22 | CTLVfs = 10 23 | VmUvmexp = 4 // get uvmexp 24 | VfsGeneric = 0 25 | VfsBcacheStat = 3 26 | ) 27 | 28 | const ( 29 | sizeOfUvmexp = C.sizeof_struct_uvmexp 30 | sizeOfBcachestats = C.sizeof_struct_bcachestats 31 | ) 32 | 33 | type Uvmexp C.struct_uvmexp 34 | type Bcachestats C.struct_bcachestats 35 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_386.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint32 9 | WorkingSetSize uint32 10 | QuotaPeakPagedPoolUsage uint32 11 | QuotaPagedPoolUsage uint32 12 | QuotaPeakNonPagedPoolUsage uint32 13 | QuotaNonPagedPoolUsage uint32 14 | PagefileUsage uint32 15 | PeakPagefileUsage uint32 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/gopsutil/process/process_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // +build windows 2 | 3 | package process 4 | 5 | type PROCESS_MEMORY_COUNTERS struct { 6 | CB uint32 7 | PageFaultCount uint32 8 | PeakWorkingSetSize uint64 9 | WorkingSetSize uint64 10 | QuotaPeakPagedPoolUsage uint64 11 | QuotaPagedPoolUsage uint64 12 | QuotaPeakNonPagedPoolUsage uint64 13 | QuotaNonPagedPoolUsage uint64 14 | PagefileUsage uint64 15 | PeakPagefileUsage uint64 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/AUTHORS: -------------------------------------------------------------------------------- 1 | # This is the official list of 'w32' authors for copyright purposes. 2 | 3 | # Names should be added to this file as 4 | # Name or Organization 5 | # The email address is not required for organizations. 6 | 7 | # Please keep the list sorted. 8 | 9 | # Contributors 10 | # ============ 11 | 12 | Allen Dang 13 | Benny Siegert 14 | Bruno Bigras 15 | Gerald Rosenberg 16 | Michael Henke -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/README.md: -------------------------------------------------------------------------------- 1 | About w32 2 | ========== 3 | 4 | w32 is a wrapper of windows apis for the Go Programming Language. 5 | 6 | It wraps win32 apis to "Go style" to make them easier to use. 7 | 8 | Setup 9 | ===== 10 | 11 | 1. Make sure you have a working Go installation and build environment, 12 | see this go-nuts post for details: 13 | http://groups.google.com/group/golang-nuts/msg/5c87630a84f4fd0c 14 | 15 | Updated versions of the Windows Go build are available here: 16 | http://code.google.com/p/gomingw/downloads/list 17 | 18 | 2. Create a "gopath" directory if you do not have one yet and set the 19 | GOPATH variable accordingly. For example: 20 | mkdir -p go-externals/src 21 | export GOPATH=${PWD}/go-externals 22 | 23 | 3. go get github.com/AllenDang/w32 24 | 25 | 4. go install github.com/AllenDang/w32... 26 | 27 | Contribute 28 | ========== 29 | 30 | Contributions in form of design, code, documentation, bug reporting or other 31 | ways you see fit are very welcome. 32 | 33 | Thank You! 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/comdlg32.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 windows 6 | 7 | package w32 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var ( 15 | modcomdlg32 = syscall.NewLazyDLL("comdlg32.dll") 16 | 17 | procGetSaveFileName = modcomdlg32.NewProc("GetSaveFileNameW") 18 | procGetOpenFileName = modcomdlg32.NewProc("GetOpenFileNameW") 19 | procCommDlgExtendedError = modcomdlg32.NewProc("CommDlgExtendedError") 20 | ) 21 | 22 | func GetOpenFileName(ofn *OPENFILENAME) bool { 23 | ret, _, _ := procGetOpenFileName.Call( 24 | uintptr(unsafe.Pointer(ofn))) 25 | 26 | return ret != 0 27 | } 28 | 29 | func GetSaveFileName(ofn *OPENFILENAME) bool { 30 | ret, _, _ := procGetSaveFileName.Call( 31 | uintptr(unsafe.Pointer(ofn))) 32 | 33 | return ret != 0 34 | } 35 | 36 | func CommDlgExtendedError() uint { 37 | ret, _, _ := procCommDlgExtendedError.Call() 38 | 39 | return uint(ret) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/idispatch.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 windows 6 | 7 | package w32 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | type pIDispatchVtbl struct { 14 | pQueryInterface uintptr 15 | pAddRef uintptr 16 | pRelease uintptr 17 | pGetTypeInfoCount uintptr 18 | pGetTypeInfo uintptr 19 | pGetIDsOfNames uintptr 20 | pInvoke uintptr 21 | } 22 | 23 | type IDispatch struct { 24 | lpVtbl *pIDispatchVtbl 25 | } 26 | 27 | func (this *IDispatch) QueryInterface(id *GUID) *IDispatch { 28 | return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id) 29 | } 30 | 31 | func (this *IDispatch) AddRef() int32 { 32 | return ComAddRef((*IUnknown)(unsafe.Pointer(this))) 33 | } 34 | 35 | func (this *IDispatch) Release() int32 { 36 | return ComRelease((*IUnknown)(unsafe.Pointer(this))) 37 | } 38 | 39 | func (this *IDispatch) GetIDsOfName(names []string) []int32 { 40 | return ComGetIDsOfName(this, names) 41 | } 42 | 43 | func (this *IDispatch) Invoke(dispid int32, dispatch int16, params ...interface{}) *VARIANT { 44 | return ComInvoke(this, dispid, dispatch, params...) 45 | } 46 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/istream.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 windows 6 | 7 | package w32 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | type pIStreamVtbl struct { 14 | pQueryInterface uintptr 15 | pAddRef uintptr 16 | pRelease uintptr 17 | } 18 | 19 | type IStream struct { 20 | lpVtbl *pIStreamVtbl 21 | } 22 | 23 | func (this *IStream) QueryInterface(id *GUID) *IDispatch { 24 | return ComQueryInterface((*IUnknown)(unsafe.Pointer(this)), id) 25 | } 26 | 27 | func (this *IStream) AddRef() int32 { 28 | return ComAddRef((*IUnknown)(unsafe.Pointer(this))) 29 | } 30 | 31 | func (this *IStream) Release() int32 { 32 | return ComRelease((*IUnknown)(unsafe.Pointer(this))) 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/iunknown.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 windows 6 | 7 | package w32 8 | 9 | type pIUnknownVtbl struct { 10 | pQueryInterface uintptr 11 | pAddRef uintptr 12 | pRelease uintptr 13 | } 14 | 15 | type IUnknown struct { 16 | lpVtbl *pIUnknownVtbl 17 | } 18 | 19 | func (this *IUnknown) QueryInterface(id *GUID) *IDispatch { 20 | return ComQueryInterface(this, id) 21 | } 22 | 23 | func (this *IUnknown) AddRef() int32 { 24 | return ComAddRef(this) 25 | } 26 | 27 | func (this *IUnknown) Release() int32 { 28 | return ComRelease(this) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/psapi.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 windows 6 | 7 | package w32 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | var ( 15 | modpsapi = syscall.NewLazyDLL("psapi.dll") 16 | 17 | procEnumProcesses = modpsapi.NewProc("EnumProcesses") 18 | ) 19 | 20 | func EnumProcesses(processIds []uint32, cb uint32, bytesReturned *uint32) bool { 21 | ret, _, _ := procEnumProcesses.Call( 22 | uintptr(unsafe.Pointer(&processIds[0])), 23 | uintptr(cb), 24 | uintptr(unsafe.Pointer(bytesReturned))) 25 | 26 | return ret != 0 27 | } 28 | -------------------------------------------------------------------------------- /vendor/github.com/shirou/w32/vars.go: -------------------------------------------------------------------------------- 1 | // Copyright 2010-2012 The W32 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 w32 6 | 7 | var ( 8 | IID_NULL = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}} 9 | IID_IUnknown = &GUID{0x00000000, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 10 | IID_IDispatch = &GUID{0x00020400, 0x0000, 0x0000, [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}} 11 | IID_IConnectionPointContainer = &GUID{0xB196B284, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 12 | IID_IConnectionPoint = &GUID{0xB196B286, 0xBAB4, 0x101A, [8]byte{0xB6, 0x9C, 0x00, 0xAA, 0x00, 0x34, 0x1D, 0x07}} 13 | ) 14 | -------------------------------------------------------------------------------- /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/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_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_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_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_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_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/dirent.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 nacl netbsd openbsd solaris 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | // ParseDirent parses up to max directory entries in buf, 12 | // appending the names to names. It returns the number of 13 | // bytes consumed from buf, the number of entries added 14 | // to names, and the new names slice. 15 | func ParseDirent(buf []byte, max int, names []string) (consumed int, count int, newnames []string) { 16 | return syscall.ParseDirent(buf, max, names) 17 | } 18 | -------------------------------------------------------------------------------- /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/openbsd_unveil.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 openbsd 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | // Unveil implements the unveil syscall. 15 | // For more information see unveil(2). 16 | // Note that the special case of blocking further 17 | // unveil calls is handled by UnveilBlock. 18 | func Unveil(path string, flags string) error { 19 | pathPtr, err := syscall.BytePtrFromString(path) 20 | if err != nil { 21 | return err 22 | } 23 | flagsPtr, err := syscall.BytePtrFromString(flags) 24 | if err != nil { 25 | return err 26 | } 27 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(unsafe.Pointer(pathPtr)), uintptr(unsafe.Pointer(flagsPtr)), 0) 28 | if e != 0 { 29 | return e 30 | } 31 | return nil 32 | } 33 | 34 | // UnveilBlock blocks future unveil calls. 35 | // For more information see unveil(2). 36 | func UnveilBlock() error { 37 | // Both pointers must be nil. 38 | var pathUnsafe, flagsUnsafe unsafe.Pointer 39 | _, _, e := syscall.Syscall(SYS_UNVEIL, uintptr(pathUnsafe), uintptr(flagsUnsafe), 0) 40 | if e != 0 { 41 | return e 42 | } 43 | return nil 44 | } 45 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_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 | package unix 9 | 10 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) 11 | //sysnb Setrlimit(resource int, rlim *Rlimit) (err error) 12 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek 13 | 14 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) = mmap64 15 | 16 | func setTimespec(sec, nsec int64) Timespec { 17 | return Timespec{Sec: sec, Nsec: nsec} 18 | } 19 | 20 | func setTimeval(sec, usec int64) Timeval { 21 | return Timeval{Sec: int64(sec), Usec: int32(usec)} 22 | } 23 | 24 | func (iov *Iovec) SetLen(length int) { 25 | iov.Len = uint64(length) 26 | } 27 | 28 | func (msghdr *Msghdr) SetControllen(length int) { 29 | msghdr.Controllen = uint32(length) 30 | } 31 | 32 | func (cmsg *Cmsghdr) SetLen(length int) { 33 | cmsg.Len = uint32(length) 34 | } 35 | -------------------------------------------------------------------------------- /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_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_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/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/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | // +build go1.9 7 | 8 | package windows 9 | 10 | import "syscall" 11 | 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for 386, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-16 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-12 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_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 | // 6 | // System calls for amd64, Windows are implemented in runtime/syscall_windows.goc 7 | // 8 | 9 | TEXT ·getprocaddress(SB), 7, $0-32 10 | JMP syscall·getprocaddress(SB) 11 | 12 | TEXT ·loadlibrary(SB), 7, $0-24 13 | JMP syscall·loadlibrary(SB) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/asm_windows_arm.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 | #include "textflag.h" 6 | 7 | TEXT ·getprocaddress(SB),NOSPLIT,$0 8 | B syscall·getprocaddress(SB) 9 | 10 | TEXT ·loadlibrary(SB),NOSPLIT,$0 11 | B syscall·loadlibrary(SB) 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/env_windows.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 | // Windows environment variables. 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | func Getenv(key string) (value string, found bool) { 12 | return syscall.Getenv(key) 13 | } 14 | 15 | func Setenv(key, value string) error { 16 | return syscall.Setenv(key, value) 17 | } 18 | 19 | func Clearenv() { 20 | syscall.Clearenv() 21 | } 22 | 23 | func Environ() []string { 24 | return syscall.Environ() 25 | } 26 | 27 | func Unsetenv(key string) error { 28 | return syscall.Unsetenv(key) 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | const ( 10 | EVENTLOG_SUCCESS = 0 11 | EVENTLOG_ERROR_TYPE = 1 12 | EVENTLOG_WARNING_TYPE = 2 13 | EVENTLOG_INFORMATION_TYPE = 4 14 | EVENTLOG_AUDIT_SUCCESS = 8 15 | EVENTLOG_AUDIT_FAILURE = 16 16 | ) 17 | 18 | //sys RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) [failretval==0] = advapi32.RegisterEventSourceW 19 | //sys DeregisterEventSource(handle Handle) (err error) = advapi32.DeregisterEventSource 20 | //sys ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) = advapi32.ReportEventW 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/memory_windows.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 | package windows 6 | 7 | const ( 8 | MEM_COMMIT = 0x00001000 9 | MEM_RESERVE = 0x00002000 10 | MEM_DECOMMIT = 0x00004000 11 | MEM_RELEASE = 0x00008000 12 | MEM_RESET = 0x00080000 13 | MEM_TOP_DOWN = 0x00100000 14 | MEM_WRITE_WATCH = 0x00200000 15 | MEM_PHYSICAL = 0x00400000 16 | MEM_RESET_UNDO = 0x01000000 17 | MEM_LARGE_PAGES = 0x20000000 18 | 19 | PAGE_NOACCESS = 0x01 20 | PAGE_READONLY = 0x02 21 | PAGE_READWRITE = 0x04 22 | PAGE_WRITECOPY = 0x08 23 | PAGE_EXECUTE_READ = 0x20 24 | PAGE_EXECUTE_READWRITE = 0x40 25 | PAGE_EXECUTE_WRITECOPY = 0x80 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | //go:generate go run $GOROOT/src/syscall/mksyscall_windows.go -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go 8 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,race 6 | 7 | package windows 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/windows/race0.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows,!race 6 | 7 | package windows 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/windows/str.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // +build windows 6 | 7 | package windows 8 | 9 | func itoa(val int) string { // do it here rather than with fmt to avoid dependency 10 | if val < 0 { 11 | return "-" + itoa(-val) 12 | } 13 | var buf [32]byte // big enough for int64 14 | i := len(buf) - 1 15 | for val >= 10 { 16 | buf[i] = byte(val%10 + '0') 17 | i-- 18 | val /= 10 19 | } 20 | buf[i] = byte(val + '0') 21 | return string(buf[i:]) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: golang:alpine 2 | stages: 3 | - test 4 | 5 | variables: 6 | GO_PACKAGE: "howett.net/plist" 7 | 8 | before_script: 9 | - "mkdir -p $(dirname $GOPATH/src/$GO_PACKAGE)" 10 | - "ln -s $(pwd) $GOPATH/src/$GO_PACKAGE" 11 | - "cd $GOPATH/src/$GO_PACKAGE" 12 | 13 | .template:go-test: &template-go-test 14 | stage: test 15 | script: 16 | - go test 17 | 18 | go-test-cover:latest: 19 | stage: test 20 | script: 21 | - go test -v -cover 22 | coverage: '/^coverage: \d+\.\d+/' 23 | 24 | go-test-appengine:latest: 25 | stage: test 26 | script: 27 | - go test -tags appengine 28 | 29 | go-test:1.6: 30 | <<: *template-go-test 31 | image: golang:1.6-alpine 32 | 33 | go-test:1.4: 34 | <<: *template-go-test 35 | image: golang:1.4-alpine 36 | 37 | go-test:1.2: 38 | <<: *template-go-test 39 | image: golang:1.2 40 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/README.md: -------------------------------------------------------------------------------- 1 | # plist - A pure Go property list transcoder [![coverage report](https://gitlab.howett.net/go/plist/badges/master/coverage.svg)](https://gitlab.howett.net/go/plist/commits/master) 2 | ## INSTALL 3 | ``` 4 | $ go get howett.net/plist 5 | ``` 6 | 7 | ## FEATURES 8 | * Supports encoding/decoding property lists (Apple XML, Apple Binary, OpenStep and GNUStep) from/to arbitrary Go types 9 | 10 | ## USE 11 | ```go 12 | package main 13 | import ( 14 | "howett.net/plist" 15 | "os" 16 | ) 17 | func main() { 18 | encoder := plist.NewEncoder(os.Stdout) 19 | encoder.Encode(map[string]string{"hello": "world"}) 20 | } 21 | ``` 22 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/bplist.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | type bplistTrailer struct { 4 | Unused [5]uint8 5 | SortVersion uint8 6 | OffsetIntSize uint8 7 | ObjectRefSize uint8 8 | NumObjects uint64 9 | TopObject uint64 10 | OffsetTableOffset uint64 11 | } 12 | 13 | const ( 14 | bpTagNull uint8 = 0x00 15 | bpTagBoolFalse = 0x08 16 | bpTagBoolTrue = 0x09 17 | bpTagInteger = 0x10 18 | bpTagReal = 0x20 19 | bpTagDate = 0x30 20 | bpTagData = 0x40 21 | bpTagASCIIString = 0x50 22 | bpTagUTF16String = 0x60 23 | bpTagUID = 0x80 24 | bpTagArray = 0xA0 25 | bpTagDictionary = 0xD0 26 | ) 27 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/doc.go: -------------------------------------------------------------------------------- 1 | // Package plist implements encoding and decoding of Apple's "property list" format. 2 | // Property lists come in three sorts: plain text (GNUStep and OpenStep), XML and binary. 3 | // plist supports all of them. 4 | // The mapping between property list and Go objects is described in the documentation for the Marshal and Unmarshal functions. 5 | package plist 6 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/fuzz.go: -------------------------------------------------------------------------------- 1 | // +build gofuzz 2 | 3 | package plist 4 | 5 | import ( 6 | "bytes" 7 | ) 8 | 9 | func Fuzz(data []byte) int { 10 | buf := bytes.NewReader(data) 11 | 12 | var obj interface{} 13 | if err := NewDecoder(buf).Decode(&obj); err != nil { 14 | return 0 15 | } 16 | return 1 17 | } 18 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/go.mod: -------------------------------------------------------------------------------- 1 | module howett.net/plist 2 | 3 | require ( 4 | // for cmd/ply 5 | github.com/jessevdk/go-flags v1.4.0 6 | github.com/kr/pretty v0.1.0 // indirect 7 | gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect 8 | gopkg.in/yaml.v2 v2.2.1 9 | ) 10 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/must.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | import ( 4 | "io" 5 | "strconv" 6 | ) 7 | 8 | type mustWriter struct { 9 | io.Writer 10 | } 11 | 12 | func (w mustWriter) Write(p []byte) (int, error) { 13 | n, err := w.Writer.Write(p) 14 | if err != nil { 15 | panic(err) 16 | } 17 | return n, nil 18 | } 19 | 20 | func mustParseInt(str string, base, bits int) int64 { 21 | i, err := strconv.ParseInt(str, base, bits) 22 | if err != nil { 23 | panic(err) 24 | } 25 | return i 26 | } 27 | 28 | func mustParseUint(str string, base, bits int) uint64 { 29 | i, err := strconv.ParseUint(str, base, bits) 30 | if err != nil { 31 | panic(err) 32 | } 33 | return i 34 | } 35 | 36 | func mustParseFloat(str string, bits int) float64 { 37 | i, err := strconv.ParseFloat(str, bits) 38 | if err != nil { 39 | panic(err) 40 | } 41 | return i 42 | } 43 | 44 | func mustParseBool(str string) bool { 45 | i, err := strconv.ParseBool(str) 46 | if err != nil { 47 | panic(err) 48 | } 49 | return i 50 | } 51 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/text_tables.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | type characterSet [4]uint64 4 | 5 | func (s *characterSet) Contains(ch rune) bool { 6 | return ch >= 0 && ch <= 255 && s.ContainsByte(byte(ch)) 7 | } 8 | 9 | func (s *characterSet) ContainsByte(ch byte) bool { 10 | return (s[ch/64]&(1<<(ch%64)) > 0) 11 | } 12 | 13 | // Bitmap of characters that must be inside a quoted string 14 | // when written to an old-style property list 15 | // Low bits represent lower characters, and each uint64 represents 64 characters. 16 | var gsQuotable = characterSet{ 17 | 0x78001385ffffffff, 18 | 0xa800000138000000, 19 | 0xffffffffffffffff, 20 | 0xffffffffffffffff, 21 | } 22 | 23 | // 7f instead of 3f in the top line: CFOldStylePlist.c says . is valid, but they quote it. 24 | var osQuotable = characterSet{ 25 | 0xf4007f6fffffffff, 26 | 0xf8000001f8000001, 27 | 0xffffffffffffffff, 28 | 0xffffffffffffffff, 29 | } 30 | 31 | var whitespace = characterSet{ 32 | 0x0000000100003f00, 33 | 0x0000000000000000, 34 | 0x0000000000000000, 35 | 0x0000000000000000, 36 | } 37 | 38 | var newlineCharacterSet = characterSet{ 39 | 0x0000000000002400, 40 | 0x0000000000000000, 41 | 0x0000000000000000, 42 | 0x0000000000000000, 43 | } 44 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/util.go: -------------------------------------------------------------------------------- 1 | package plist 2 | 3 | import "io" 4 | 5 | type countedWriter struct { 6 | io.Writer 7 | nbytes int 8 | } 9 | 10 | func (w *countedWriter) Write(p []byte) (int, error) { 11 | n, err := w.Writer.Write(p) 12 | w.nbytes += n 13 | return n, err 14 | } 15 | 16 | func (w *countedWriter) BytesWritten() int { 17 | return w.nbytes 18 | } 19 | 20 | func unsignedGetBase(s string) (string, int) { 21 | if len(s) > 1 && s[0] == '0' && (s[1] == 'x' || s[1] == 'X') { 22 | return s[2:], 16 23 | } 24 | return s, 10 25 | } 26 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/zerocopy.go: -------------------------------------------------------------------------------- 1 | // +build !appengine 2 | 3 | package plist 4 | 5 | import ( 6 | "reflect" 7 | "unsafe" 8 | ) 9 | 10 | func zeroCopy8BitString(buf []byte, off int, len int) string { 11 | if len == 0 { 12 | return "" 13 | } 14 | 15 | var s string 16 | hdr := (*reflect.StringHeader)(unsafe.Pointer(&s)) 17 | hdr.Data = uintptr(unsafe.Pointer(&buf[off])) 18 | hdr.Len = len 19 | return s 20 | } 21 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/zerocopy_appengine.go: -------------------------------------------------------------------------------- 1 | // +build appengine 2 | 3 | package plist 4 | 5 | func zeroCopy8BitString(buf []byte, off int, len int) string { 6 | return string(buf[off : off+len]) 7 | } 8 | -------------------------------------------------------------------------------- /vendor/modules.txt: -------------------------------------------------------------------------------- 1 | # github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 2 | github.com/StackExchange/wmi 3 | # github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd 4 | github.com/cjbassi/drawille-go 5 | # github.com/distatus/battery v0.9.0 6 | github.com/distatus/battery 7 | # github.com/docopt/docopt.go v0.0.0-20180111231733-ee0de3bc6815 8 | github.com/docopt/docopt.go 9 | # github.com/gizak/termui/v3 v3.0.0 10 | github.com/gizak/termui/v3 11 | # github.com/go-ole/go-ole v1.2.1 12 | github.com/go-ole/go-ole 13 | github.com/go-ole/go-ole/oleutil 14 | # github.com/mattn/go-runewidth v0.0.4 15 | github.com/mattn/go-runewidth 16 | # github.com/mitchellh/go-wordwrap v1.0.0 17 | github.com/mitchellh/go-wordwrap 18 | # github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d 19 | github.com/nsf/termbox-go 20 | # github.com/shirou/gopsutil v2.18.11+incompatible 21 | github.com/shirou/gopsutil/cpu 22 | github.com/shirou/gopsutil/disk 23 | github.com/shirou/gopsutil/host 24 | github.com/shirou/gopsutil/mem 25 | github.com/shirou/gopsutil/net 26 | github.com/shirou/gopsutil/process 27 | github.com/shirou/gopsutil/internal/common 28 | # github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4 29 | github.com/shirou/w32 30 | # golang.org/x/sys v0.0.0-20190116161447-11f53e031339 31 | golang.org/x/sys/unix 32 | golang.org/x/sys/windows 33 | # howett.net/plist v0.0.0-20181124034731-591f970eefbb 34 | howett.net/plist 35 | --------------------------------------------------------------------------------