├── .github └── workflows │ └── build.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── TODO.md ├── backend.go ├── backend_nocgo.go ├── cinnamon.go ├── closest.go ├── closest_nocgo.go ├── closest_test.go ├── cmd ├── getdpi │ ├── README.md │ ├── getdpi.1 │ └── main.go ├── heic2stw │ ├── .gitignore │ ├── README.md │ └── main.go ├── lscollection │ └── main.go ├── lsmon │ └── main.go ├── lstimed │ └── main.go ├── lswallpaper │ └── main.go ├── setcollection │ └── main.go ├── setrandom │ └── main.go ├── settimed │ └── main.go ├── setwallpaper │ ├── README.md │ └── main.go ├── timedinfo │ └── main.go ├── vram │ ├── README.md │ ├── main.go │ └── vram.1 ├── wayinfo │ └── main.go ├── xinfo │ └── main.go └── xml2stw │ ├── .gitignore │ └── main.go ├── collections.go ├── deepin.go ├── feh.go ├── gnome2.go ├── gnome3.go ├── go.mod ├── go.sum ├── gpu.go ├── gpus_test.go ├── gsettings.go ├── hyprpaper.go ├── include └── wayinfo.h ├── mate.go ├── monconf.go ├── monconf_test.go ├── monitor.go ├── overlap.go ├── pekwm.go ├── pkg ├── event │ ├── README.md │ ├── clock.go │ ├── cmd │ │ ├── clock │ │ │ └── main.go │ │ └── leetoclock │ │ │ └── main.go │ ├── event.go │ ├── eventsys.go │ ├── eventsys_test.go │ ├── simple.go │ ├── simple_test.go │ └── utils.go ├── gnometimed │ ├── README.md │ ├── convert.go │ ├── convert_test.go │ ├── eventloop.go │ ├── gnometimed.go │ ├── testdata │ │ ├── adwaita-timed.xml │ │ ├── example1.xml │ │ ├── example2.xml │ │ └── generated.xml │ ├── timedxml.go │ ├── timedxml_test.go │ └── utils.go └── simpletimed │ ├── README.md │ ├── eventloop.go │ ├── simpletimed.go │ ├── simpletimed_test.go │ ├── stw-1.0.0.md │ ├── stw-1.0.0.pdf │ ├── testdata │ ├── adwaita-timed2.stw │ └── comments.stw │ └── utils.go ├── plasma.go ├── res.go ├── res_test.go ├── scripts └── heic-install ├── sway.go ├── swaybg.go ├── utils.go ├── vendor ├── github.com │ ├── antchfx │ │ ├── xmlquery │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── cache.go │ │ │ ├── cached_reader.go │ │ │ ├── node.go │ │ │ ├── options.go │ │ │ ├── parse.go │ │ │ └── query.go │ │ └── xpath │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── build.go │ │ │ ├── cache.go │ │ │ ├── func.go │ │ │ ├── func_go110.go │ │ │ ├── func_pre_go110.go │ │ │ ├── operator.go │ │ │ ├── parse.go │ │ │ ├── query.go │ │ │ └── xpath.go │ ├── anthonynsimon │ │ └── bild │ │ │ ├── LICENSE │ │ │ ├── blend │ │ │ └── blend.go │ │ │ ├── clone │ │ │ └── clone.go │ │ │ ├── fcolor │ │ │ └── rgbaf64.go │ │ │ ├── imgio │ │ │ └── io.go │ │ │ ├── math │ │ │ └── f64 │ │ │ │ └── clamp.go │ │ │ └── parallel │ │ │ └── parallel.go │ ├── cpuguy83 │ │ └── go-md2man │ │ │ └── v2 │ │ │ ├── LICENSE.md │ │ │ └── md2man │ │ │ ├── debug.go │ │ │ ├── md2man.go │ │ │ └── roff.go │ ├── fatih │ │ └── color │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ ├── color.go │ │ │ ├── color_windows.go │ │ │ └── doc.go │ ├── golang │ │ └── groupcache │ │ │ └── lru │ │ │ └── lru.go │ ├── mattn │ │ ├── go-colorable │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── colorable_others.go │ │ │ ├── colorable_windows.go │ │ │ ├── go.test.sh │ │ │ └── noncolorable.go │ │ └── go-isatty │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ ├── go.test.sh │ │ │ ├── isatty_bsd.go │ │ │ ├── isatty_others.go │ │ │ ├── isatty_plan9.go │ │ │ ├── isatty_solaris.go │ │ │ ├── isatty_tcgets.go │ │ │ └── isatty_windows.go │ ├── russross │ │ └── blackfriday │ │ │ └── v2 │ │ │ ├── .gitignore │ │ │ ├── .travis.yml │ │ │ ├── LICENSE.txt │ │ │ ├── README.md │ │ │ ├── block.go │ │ │ ├── doc.go │ │ │ ├── entities.go │ │ │ ├── esc.go │ │ │ ├── html.go │ │ │ ├── inline.go │ │ │ ├── markdown.go │ │ │ ├── node.go │ │ │ └── smartypants.go │ ├── stretchr │ │ └── powerwalk │ │ │ ├── .gitignore │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── doc.go │ │ │ └── walker.go │ ├── urfave │ │ └── cli │ │ │ ├── .flake8 │ │ │ ├── .gitignore │ │ │ ├── CODE_OF_CONDUCT.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── app.go │ │ │ ├── category.go │ │ │ ├── cli.go │ │ │ ├── command.go │ │ │ ├── context.go │ │ │ ├── docs.go │ │ │ ├── errors.go │ │ │ ├── fish.go │ │ │ ├── flag.go │ │ │ ├── flag_bool.go │ │ │ ├── flag_bool_t.go │ │ │ ├── flag_duration.go │ │ │ ├── flag_float64.go │ │ │ ├── flag_generic.go │ │ │ ├── flag_int.go │ │ │ ├── flag_int64.go │ │ │ ├── flag_int64_slice.go │ │ │ ├── flag_int_slice.go │ │ │ ├── flag_string.go │ │ │ ├── flag_string_slice.go │ │ │ ├── flag_uint.go │ │ │ ├── flag_uint64.go │ │ │ ├── funcs.go │ │ │ ├── help.go │ │ │ ├── parse.go │ │ │ ├── sort.go │ │ │ └── template.go │ └── xyproto │ │ ├── env │ │ └── v2 │ │ │ ├── cache.go │ │ │ ├── env.go │ │ │ ├── etc.go │ │ │ ├── homedir.go │ │ │ ├── homedir_android.go │ │ │ ├── homedir_ios.go │ │ │ ├── homedir_plan9.go │ │ │ ├── homedir_windows.go │ │ │ └── session.go │ │ └── heic │ │ ├── .gitignore │ │ ├── README.md │ │ ├── TODO.md │ │ ├── heic.go │ │ ├── keepalive_16.go │ │ ├── keepalive_17.go │ │ └── metadata.go ├── golang.org │ └── x │ │ ├── image │ │ ├── LICENSE │ │ ├── PATENTS │ │ └── bmp │ │ │ ├── reader.go │ │ │ └── writer.go │ │ ├── net │ │ └── html │ │ │ ├── atom │ │ │ ├── atom.go │ │ │ └── table.go │ │ │ ├── charset │ │ │ └── charset.go │ │ │ ├── const.go │ │ │ ├── doc.go │ │ │ ├── doctype.go │ │ │ ├── entity.go │ │ │ ├── escape.go │ │ │ ├── foreign.go │ │ │ ├── iter.go │ │ │ ├── node.go │ │ │ ├── parse.go │ │ │ ├── render.go │ │ │ └── token.go │ │ ├── sys │ │ ├── LICENSE │ │ ├── PATENTS │ │ ├── unix │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── affinity_linux.go │ │ │ ├── aliases.go │ │ │ ├── asm_aix_ppc64.s │ │ │ ├── asm_bsd_386.s │ │ │ ├── asm_bsd_amd64.s │ │ │ ├── asm_bsd_arm.s │ │ │ ├── asm_bsd_arm64.s │ │ │ ├── asm_bsd_ppc64.s │ │ │ ├── asm_bsd_riscv64.s │ │ │ ├── asm_linux_386.s │ │ │ ├── asm_linux_amd64.s │ │ │ ├── asm_linux_arm.s │ │ │ ├── asm_linux_arm64.s │ │ │ ├── asm_linux_loong64.s │ │ │ ├── asm_linux_mips64x.s │ │ │ ├── asm_linux_mipsx.s │ │ │ ├── asm_linux_ppc64x.s │ │ │ ├── asm_linux_riscv64.s │ │ │ ├── asm_linux_s390x.s │ │ │ ├── asm_openbsd_mips64.s │ │ │ ├── asm_solaris_amd64.s │ │ │ ├── asm_zos_s390x.s │ │ │ ├── auxv.go │ │ │ ├── auxv_unsupported.go │ │ │ ├── bluetooth_linux.go │ │ │ ├── bpxsvc_zos.go │ │ │ ├── bpxsvc_zos.s │ │ │ ├── cap_freebsd.go │ │ │ ├── constants.go │ │ │ ├── dev_aix_ppc.go │ │ │ ├── dev_aix_ppc64.go │ │ │ ├── dev_darwin.go │ │ │ ├── dev_dragonfly.go │ │ │ ├── dev_freebsd.go │ │ │ ├── dev_linux.go │ │ │ ├── dev_netbsd.go │ │ │ ├── dev_openbsd.go │ │ │ ├── dev_zos.go │ │ │ ├── dirent.go │ │ │ ├── endian_big.go │ │ │ ├── endian_little.go │ │ │ ├── env_unix.go │ │ │ ├── fcntl.go │ │ │ ├── fcntl_darwin.go │ │ │ ├── fcntl_linux_32bit.go │ │ │ ├── fdset.go │ │ │ ├── gccgo.go │ │ │ ├── gccgo_c.c │ │ │ ├── gccgo_linux_amd64.go │ │ │ ├── ifreq_linux.go │ │ │ ├── ioctl_linux.go │ │ │ ├── ioctl_signed.go │ │ │ ├── ioctl_unsigned.go │ │ │ ├── ioctl_zos.go │ │ │ ├── mkall.sh │ │ │ ├── mkerrors.sh │ │ │ ├── mmap_nomremap.go │ │ │ ├── mremap.go │ │ │ ├── pagesize_unix.go │ │ │ ├── pledge_openbsd.go │ │ │ ├── ptrace_darwin.go │ │ │ ├── ptrace_ios.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── readdirent_getdents.go │ │ │ ├── readdirent_getdirentries.go │ │ │ ├── sockcmsg_dragonfly.go │ │ │ ├── sockcmsg_linux.go │ │ │ ├── sockcmsg_unix.go │ │ │ ├── sockcmsg_unix_other.go │ │ │ ├── sockcmsg_zos.go │ │ │ ├── symaddr_zos_s390x.s │ │ │ ├── syscall.go │ │ │ ├── syscall_aix.go │ │ │ ├── syscall_aix_ppc.go │ │ │ ├── syscall_aix_ppc64.go │ │ │ ├── syscall_bsd.go │ │ │ ├── syscall_darwin.go │ │ │ ├── syscall_darwin_amd64.go │ │ │ ├── syscall_darwin_arm64.go │ │ │ ├── syscall_darwin_libSystem.go │ │ │ ├── syscall_dragonfly.go │ │ │ ├── syscall_dragonfly_amd64.go │ │ │ ├── syscall_freebsd.go │ │ │ ├── syscall_freebsd_386.go │ │ │ ├── syscall_freebsd_amd64.go │ │ │ ├── syscall_freebsd_arm.go │ │ │ ├── syscall_freebsd_arm64.go │ │ │ ├── syscall_freebsd_riscv64.go │ │ │ ├── syscall_hurd.go │ │ │ ├── syscall_hurd_386.go │ │ │ ├── syscall_illumos.go │ │ │ ├── syscall_linux.go │ │ │ ├── syscall_linux_386.go │ │ │ ├── syscall_linux_alarm.go │ │ │ ├── syscall_linux_amd64.go │ │ │ ├── syscall_linux_amd64_gc.go │ │ │ ├── syscall_linux_arm.go │ │ │ ├── syscall_linux_arm64.go │ │ │ ├── syscall_linux_gc.go │ │ │ ├── syscall_linux_gc_386.go │ │ │ ├── syscall_linux_gc_arm.go │ │ │ ├── syscall_linux_gccgo_386.go │ │ │ ├── syscall_linux_gccgo_arm.go │ │ │ ├── syscall_linux_loong64.go │ │ │ ├── syscall_linux_mips64x.go │ │ │ ├── syscall_linux_mipsx.go │ │ │ ├── syscall_linux_ppc.go │ │ │ ├── syscall_linux_ppc64x.go │ │ │ ├── syscall_linux_riscv64.go │ │ │ ├── syscall_linux_s390x.go │ │ │ ├── syscall_linux_sparc64.go │ │ │ ├── syscall_netbsd.go │ │ │ ├── syscall_netbsd_386.go │ │ │ ├── syscall_netbsd_amd64.go │ │ │ ├── syscall_netbsd_arm.go │ │ │ ├── syscall_netbsd_arm64.go │ │ │ ├── syscall_openbsd.go │ │ │ ├── syscall_openbsd_386.go │ │ │ ├── syscall_openbsd_amd64.go │ │ │ ├── syscall_openbsd_arm.go │ │ │ ├── syscall_openbsd_arm64.go │ │ │ ├── syscall_openbsd_libc.go │ │ │ ├── syscall_openbsd_mips64.go │ │ │ ├── syscall_openbsd_ppc64.go │ │ │ ├── syscall_openbsd_riscv64.go │ │ │ ├── syscall_solaris.go │ │ │ ├── syscall_solaris_amd64.go │ │ │ ├── syscall_unix.go │ │ │ ├── syscall_unix_gc.go │ │ │ ├── syscall_unix_gc_ppc64x.go │ │ │ ├── syscall_zos_s390x.go │ │ │ ├── sysvshm_linux.go │ │ │ ├── sysvshm_unix.go │ │ │ ├── sysvshm_unix_other.go │ │ │ ├── timestruct.go │ │ │ ├── unveil_openbsd.go │ │ │ ├── vgetrandom_linux.go │ │ │ ├── vgetrandom_unsupported.go │ │ │ ├── xattr_bsd.go │ │ │ ├── zerrors_aix_ppc.go │ │ │ ├── zerrors_aix_ppc64.go │ │ │ ├── zerrors_darwin_amd64.go │ │ │ ├── zerrors_darwin_arm64.go │ │ │ ├── zerrors_dragonfly_amd64.go │ │ │ ├── zerrors_freebsd_386.go │ │ │ ├── zerrors_freebsd_amd64.go │ │ │ ├── zerrors_freebsd_arm.go │ │ │ ├── zerrors_freebsd_arm64.go │ │ │ ├── zerrors_freebsd_riscv64.go │ │ │ ├── zerrors_linux.go │ │ │ ├── zerrors_linux_386.go │ │ │ ├── zerrors_linux_amd64.go │ │ │ ├── zerrors_linux_arm.go │ │ │ ├── zerrors_linux_arm64.go │ │ │ ├── zerrors_linux_loong64.go │ │ │ ├── zerrors_linux_mips.go │ │ │ ├── zerrors_linux_mips64.go │ │ │ ├── zerrors_linux_mips64le.go │ │ │ ├── zerrors_linux_mipsle.go │ │ │ ├── zerrors_linux_ppc.go │ │ │ ├── zerrors_linux_ppc64.go │ │ │ ├── zerrors_linux_ppc64le.go │ │ │ ├── zerrors_linux_riscv64.go │ │ │ ├── zerrors_linux_s390x.go │ │ │ ├── zerrors_linux_sparc64.go │ │ │ ├── zerrors_netbsd_386.go │ │ │ ├── zerrors_netbsd_amd64.go │ │ │ ├── zerrors_netbsd_arm.go │ │ │ ├── zerrors_netbsd_arm64.go │ │ │ ├── zerrors_openbsd_386.go │ │ │ ├── zerrors_openbsd_amd64.go │ │ │ ├── zerrors_openbsd_arm.go │ │ │ ├── zerrors_openbsd_arm64.go │ │ │ ├── zerrors_openbsd_mips64.go │ │ │ ├── zerrors_openbsd_ppc64.go │ │ │ ├── zerrors_openbsd_riscv64.go │ │ │ ├── zerrors_solaris_amd64.go │ │ │ ├── zerrors_zos_s390x.go │ │ │ ├── zptrace_armnn_linux.go │ │ │ ├── zptrace_linux_arm64.go │ │ │ ├── zptrace_mipsnn_linux.go │ │ │ ├── zptrace_mipsnnle_linux.go │ │ │ ├── zptrace_x86_linux.go │ │ │ ├── zsymaddr_zos_s390x.s │ │ │ ├── zsyscall_aix_ppc.go │ │ │ ├── zsyscall_aix_ppc64.go │ │ │ ├── zsyscall_aix_ppc64_gc.go │ │ │ ├── zsyscall_aix_ppc64_gccgo.go │ │ │ ├── zsyscall_darwin_amd64.go │ │ │ ├── zsyscall_darwin_amd64.s │ │ │ ├── zsyscall_darwin_arm64.go │ │ │ ├── zsyscall_darwin_arm64.s │ │ │ ├── zsyscall_dragonfly_amd64.go │ │ │ ├── zsyscall_freebsd_386.go │ │ │ ├── zsyscall_freebsd_amd64.go │ │ │ ├── zsyscall_freebsd_arm.go │ │ │ ├── zsyscall_freebsd_arm64.go │ │ │ ├── zsyscall_freebsd_riscv64.go │ │ │ ├── zsyscall_illumos_amd64.go │ │ │ ├── zsyscall_linux.go │ │ │ ├── zsyscall_linux_386.go │ │ │ ├── zsyscall_linux_amd64.go │ │ │ ├── zsyscall_linux_arm.go │ │ │ ├── zsyscall_linux_arm64.go │ │ │ ├── zsyscall_linux_loong64.go │ │ │ ├── zsyscall_linux_mips.go │ │ │ ├── zsyscall_linux_mips64.go │ │ │ ├── zsyscall_linux_mips64le.go │ │ │ ├── zsyscall_linux_mipsle.go │ │ │ ├── zsyscall_linux_ppc.go │ │ │ ├── zsyscall_linux_ppc64.go │ │ │ ├── zsyscall_linux_ppc64le.go │ │ │ ├── zsyscall_linux_riscv64.go │ │ │ ├── zsyscall_linux_s390x.go │ │ │ ├── zsyscall_linux_sparc64.go │ │ │ ├── zsyscall_netbsd_386.go │ │ │ ├── zsyscall_netbsd_amd64.go │ │ │ ├── zsyscall_netbsd_arm.go │ │ │ ├── zsyscall_netbsd_arm64.go │ │ │ ├── zsyscall_openbsd_386.go │ │ │ ├── zsyscall_openbsd_386.s │ │ │ ├── zsyscall_openbsd_amd64.go │ │ │ ├── zsyscall_openbsd_amd64.s │ │ │ ├── zsyscall_openbsd_arm.go │ │ │ ├── zsyscall_openbsd_arm.s │ │ │ ├── zsyscall_openbsd_arm64.go │ │ │ ├── zsyscall_openbsd_arm64.s │ │ │ ├── zsyscall_openbsd_mips64.go │ │ │ ├── zsyscall_openbsd_mips64.s │ │ │ ├── zsyscall_openbsd_ppc64.go │ │ │ ├── zsyscall_openbsd_ppc64.s │ │ │ ├── zsyscall_openbsd_riscv64.go │ │ │ ├── zsyscall_openbsd_riscv64.s │ │ │ ├── zsyscall_solaris_amd64.go │ │ │ ├── zsyscall_zos_s390x.go │ │ │ ├── zsysctl_openbsd_386.go │ │ │ ├── zsysctl_openbsd_amd64.go │ │ │ ├── zsysctl_openbsd_arm.go │ │ │ ├── zsysctl_openbsd_arm64.go │ │ │ ├── zsysctl_openbsd_mips64.go │ │ │ ├── zsysctl_openbsd_ppc64.go │ │ │ ├── zsysctl_openbsd_riscv64.go │ │ │ ├── zsysnum_darwin_amd64.go │ │ │ ├── zsysnum_darwin_arm64.go │ │ │ ├── zsysnum_dragonfly_amd64.go │ │ │ ├── zsysnum_freebsd_386.go │ │ │ ├── zsysnum_freebsd_amd64.go │ │ │ ├── zsysnum_freebsd_arm.go │ │ │ ├── zsysnum_freebsd_arm64.go │ │ │ ├── zsysnum_freebsd_riscv64.go │ │ │ ├── zsysnum_linux_386.go │ │ │ ├── zsysnum_linux_amd64.go │ │ │ ├── zsysnum_linux_arm.go │ │ │ ├── zsysnum_linux_arm64.go │ │ │ ├── zsysnum_linux_loong64.go │ │ │ ├── zsysnum_linux_mips.go │ │ │ ├── zsysnum_linux_mips64.go │ │ │ ├── zsysnum_linux_mips64le.go │ │ │ ├── zsysnum_linux_mipsle.go │ │ │ ├── zsysnum_linux_ppc.go │ │ │ ├── zsysnum_linux_ppc64.go │ │ │ ├── zsysnum_linux_ppc64le.go │ │ │ ├── zsysnum_linux_riscv64.go │ │ │ ├── zsysnum_linux_s390x.go │ │ │ ├── zsysnum_linux_sparc64.go │ │ │ ├── zsysnum_netbsd_386.go │ │ │ ├── zsysnum_netbsd_amd64.go │ │ │ ├── zsysnum_netbsd_arm.go │ │ │ ├── zsysnum_netbsd_arm64.go │ │ │ ├── zsysnum_openbsd_386.go │ │ │ ├── zsysnum_openbsd_amd64.go │ │ │ ├── zsysnum_openbsd_arm.go │ │ │ ├── zsysnum_openbsd_arm64.go │ │ │ ├── zsysnum_openbsd_mips64.go │ │ │ ├── zsysnum_openbsd_ppc64.go │ │ │ ├── zsysnum_openbsd_riscv64.go │ │ │ ├── zsysnum_zos_s390x.go │ │ │ ├── ztypes_aix_ppc.go │ │ │ ├── ztypes_aix_ppc64.go │ │ │ ├── ztypes_darwin_amd64.go │ │ │ ├── ztypes_darwin_arm64.go │ │ │ ├── ztypes_dragonfly_amd64.go │ │ │ ├── ztypes_freebsd_386.go │ │ │ ├── ztypes_freebsd_amd64.go │ │ │ ├── ztypes_freebsd_arm.go │ │ │ ├── ztypes_freebsd_arm64.go │ │ │ ├── ztypes_freebsd_riscv64.go │ │ │ ├── ztypes_linux.go │ │ │ ├── ztypes_linux_386.go │ │ │ ├── ztypes_linux_amd64.go │ │ │ ├── ztypes_linux_arm.go │ │ │ ├── ztypes_linux_arm64.go │ │ │ ├── ztypes_linux_loong64.go │ │ │ ├── ztypes_linux_mips.go │ │ │ ├── ztypes_linux_mips64.go │ │ │ ├── ztypes_linux_mips64le.go │ │ │ ├── ztypes_linux_mipsle.go │ │ │ ├── ztypes_linux_ppc.go │ │ │ ├── ztypes_linux_ppc64.go │ │ │ ├── ztypes_linux_ppc64le.go │ │ │ ├── ztypes_linux_riscv64.go │ │ │ ├── ztypes_linux_s390x.go │ │ │ ├── ztypes_linux_sparc64.go │ │ │ ├── ztypes_netbsd_386.go │ │ │ ├── ztypes_netbsd_amd64.go │ │ │ ├── ztypes_netbsd_arm.go │ │ │ ├── ztypes_netbsd_arm64.go │ │ │ ├── ztypes_openbsd_386.go │ │ │ ├── ztypes_openbsd_amd64.go │ │ │ ├── ztypes_openbsd_arm.go │ │ │ ├── ztypes_openbsd_arm64.go │ │ │ ├── ztypes_openbsd_mips64.go │ │ │ ├── ztypes_openbsd_ppc64.go │ │ │ ├── ztypes_openbsd_riscv64.go │ │ │ ├── ztypes_solaris_amd64.go │ │ │ └── ztypes_zos_s390x.go │ │ └── windows │ │ │ ├── aliases.go │ │ │ ├── dll_windows.go │ │ │ ├── env_windows.go │ │ │ ├── eventlog.go │ │ │ ├── exec_windows.go │ │ │ ├── memory_windows.go │ │ │ ├── mkerrors.bash │ │ │ ├── mkknownfolderids.bash │ │ │ ├── mksyscall.go │ │ │ ├── race.go │ │ │ ├── race0.go │ │ │ ├── security_windows.go │ │ │ ├── service.go │ │ │ ├── setupapi_windows.go │ │ │ ├── str.go │ │ │ ├── syscall.go │ │ │ ├── syscall_windows.go │ │ │ ├── types_windows.go │ │ │ ├── types_windows_386.go │ │ │ ├── types_windows_amd64.go │ │ │ ├── types_windows_arm.go │ │ │ ├── types_windows_arm64.go │ │ │ ├── zerrors_windows.go │ │ │ ├── zknownfolderids_windows.go │ │ │ └── zsyscall_windows.go │ │ └── text │ │ ├── encoding │ │ ├── charmap │ │ │ ├── charmap.go │ │ │ └── tables.go │ │ ├── encoding.go │ │ ├── htmlindex │ │ │ ├── htmlindex.go │ │ │ ├── map.go │ │ │ └── tables.go │ │ ├── internal │ │ │ ├── identifier │ │ │ │ ├── identifier.go │ │ │ │ └── mib.go │ │ │ └── internal.go │ │ ├── japanese │ │ │ ├── all.go │ │ │ ├── eucjp.go │ │ │ ├── iso2022jp.go │ │ │ ├── shiftjis.go │ │ │ └── tables.go │ │ ├── korean │ │ │ ├── euckr.go │ │ │ └── tables.go │ │ ├── simplifiedchinese │ │ │ ├── all.go │ │ │ ├── gbk.go │ │ │ ├── hzgb2312.go │ │ │ └── tables.go │ │ ├── traditionalchinese │ │ │ ├── big5.go │ │ │ └── tables.go │ │ └── unicode │ │ │ ├── override.go │ │ │ └── unicode.go │ │ ├── internal │ │ ├── language │ │ │ ├── common.go │ │ │ ├── compact.go │ │ │ ├── compact │ │ │ │ ├── compact.go │ │ │ │ ├── language.go │ │ │ │ ├── parents.go │ │ │ │ ├── tables.go │ │ │ │ └── tags.go │ │ │ ├── compose.go │ │ │ ├── coverage.go │ │ │ ├── language.go │ │ │ ├── lookup.go │ │ │ ├── match.go │ │ │ ├── parse.go │ │ │ ├── tables.go │ │ │ └── tags.go │ │ ├── tag │ │ │ └── tag.go │ │ └── utf8internal │ │ │ └── utf8internal.go │ │ ├── language │ │ ├── coverage.go │ │ ├── doc.go │ │ ├── language.go │ │ ├── match.go │ │ ├── parse.go │ │ ├── tables.go │ │ └── tags.go │ │ ├── runes │ │ ├── cond.go │ │ └── runes.go │ │ └── transform │ │ └── transform.go ├── howett.net │ └── plist │ │ ├── .gitignore │ │ ├── .gitlab-ci.yml │ │ ├── README.md │ │ ├── bplist.go │ │ ├── bplist_generator.go │ │ ├── bplist_parser.go │ │ ├── decode.go │ │ ├── doc.go │ │ ├── encode.go │ │ ├── fuzz.go │ │ ├── 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 ├── wallpaper.go ├── wallutils.go ├── wayinfo.go ├── wayinfo_test.go ├── weston.go ├── xfce4.go ├── xinfo.go ├── xinfo.h ├── xinfo_test.go ├── xrandr.go └── xrandr_test.go /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | on: [push, pull_request] 2 | name: Build 3 | jobs: 4 | build: 5 | strategy: 6 | matrix: 7 | go-version: [1.22.x] 8 | os: [ubuntu-latest] 9 | runs-on: ${{ matrix.os }} 10 | steps: 11 | - name: Install Go 12 | uses: actions/setup-go@v5 13 | with: 14 | go-version: ${{ matrix.go-version }} 15 | - name: Checkout code 16 | uses: actions/checkout@v4 17 | - name: Build 18 | run: | 19 | sudo apt-mark hold grub-efi-amd64-signed 20 | sudo apt update --fix-missing 21 | sudo apt upgrade 22 | sudo apt-get install -y libx11-dev libxcursor-dev libxmu-dev libwayland-dev libxpm-dev xbitmaps libxmu-headers libheif-dev heif-thumbnailer 23 | make 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !*.* 3 | !*/ 4 | *.o 5 | *.swp 6 | *.tmp 7 | *.bak 8 | *.pro.user 9 | *CMakeFiles* 10 | *.dblite 11 | *.so 12 | .vscode 13 | *.svg 14 | !img/* 15 | pkg/event/cmd/clock/clock 16 | pkg/event/cmd/leetoclock/leetoclock 17 | include.txt 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2025 Alexander F. Rødseth 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | # TODO 2 | 3 | - [ ] Add a parameter to `settimed` for quickly visualizing 48 hours of wallpaper switching. Right now, debugging is too time-consuming. 4 | - [ ] Implement the equivalent of `xsetroot -bitmap` + image conversion. 5 | -------------------------------------------------------------------------------- /backend_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build !cgo 2 | // +build !cgo 3 | 4 | package wallutils 5 | 6 | // WMs contains all available backends for changing the wallpaper 7 | // Only backends that do not require cgo should be included here. 8 | var WMs = []WM{ 9 | &Hyprpaper{}, 10 | //&Sway{}, 11 | &Deepin{}, 12 | &Xfce4{}, 13 | &Mate{}, 14 | &Cinnamon{}, 15 | &Plasma{}, 16 | &Gnome3{}, 17 | &Gnome2{}, 18 | &Pekwm{}, 19 | &Weston{}, 20 | // xbg.New(), // X11 21 | &Feh{}, // use feh for X11 22 | } 23 | -------------------------------------------------------------------------------- /closest_nocgo.go: -------------------------------------------------------------------------------- 1 | //go:build !cgo 2 | // +build !cgo 3 | 4 | package wallutils 5 | 6 | import "errors" 7 | 8 | func ClosestByResolution(wallpapers []*Wallpaper) (*Wallpaper, error) { 9 | return nil, errors.New("the function ClosestByResolution is not available when compiling without cgo") 10 | } 11 | 12 | func ClosestByResolutionInFilename(filenames []string) (string, error) { 13 | return "", errors.New("the function ClosestByResolutionInFilename is not available when compiling without cgo") 14 | } 15 | 16 | func Closest(filenames []string) (string, error) { 17 | return "", errors.New("the function Closest is not available when compiling without cgo") 18 | } 19 | -------------------------------------------------------------------------------- /closest_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestClosest(t *testing.T) { 9 | filenames := []string{"hello_1024x768.jpg", "hello_1600x1200.jpg", "hello_320x200.jpg"} 10 | fmt.Println(filenames) 11 | 12 | resolutions, err := ExtractResolutions(filenames) 13 | if err != nil { 14 | t.Error(err) 15 | } 16 | fmt.Println("Resolutions extracted from slice of filenames:", resolutions) 17 | 18 | avgRes, err := AverageResolution() 19 | if err != nil { 20 | t.Error(err) 21 | } 22 | fmt.Println("Average resolution for all connected monitors:", avgRes) 23 | 24 | filename, err := Closest(filenames) 25 | if err != nil { 26 | t.Error(err) 27 | } 28 | fmt.Println("Filename closest to the average resolution:", filename) 29 | } 30 | -------------------------------------------------------------------------------- /cmd/getdpi/README.md: -------------------------------------------------------------------------------- 1 | # getdpi 2 | 3 | Tool for retrieving the average DPI across all monitors, regardless of if X or Wayland is in use. 4 | 5 | ## Building getdpi 6 | 7 | go build 8 | 9 | ## Usage 10 | 11 | Retrieve the average DPI as a pair of numbers (ie. `96x96`): 12 | 13 | getdpi -b 14 | 15 | Retrieve the average DPI as a single number (ie. `96`): 16 | 17 | getdpi 18 | 19 | Version information: 20 | 21 | getdpi --version 22 | 23 | ## Listing DPI per monitor 24 | 25 | The `lsmon` utility supports listing monitor resolutions and DPI with the `-dpi` flag. 26 | -------------------------------------------------------------------------------- /cmd/getdpi/getdpi.1: -------------------------------------------------------------------------------- 1 | .\" -*-Nroff-*- 2 | .\" 3 | .TH "getdpi" 1 "17 Jan 2025" "getdpi" "User Commands" 4 | .SH NAME 5 | getdpi \- get the DPI for the current monitor setup 6 | .SH SYNOPSIS 7 | .B getdpi 8 | Display the average DPI of all connected monitors. 9 | .sp 10 | .SH DESCRIPTION 11 | getdpi can fetch information about all connected monitors, for X or Wayland, and return the average DPI (dots per inch). 12 | .sp 13 | .SH OPTIONS 14 | .sp 15 | .TP 16 | .B \-a or \-\-all 17 | Output DPI information for all available monitors. 18 | .TP 19 | .B \-b or \-\-both 20 | Output both the horizontal and vertical average DPI. 21 | .TP 22 | .B \-h or \-\-help 23 | Show usage information. 24 | .TP 25 | .B \-V or \-\-version 26 | Show the current version. 27 | .PP 28 | .SH VERSION 29 | 5.12.10 30 | .SH AUTHOR 31 | .B getdpi 32 | was written by Alexander F. Rødseth 33 | -------------------------------------------------------------------------------- /cmd/heic2stw/.gitignore: -------------------------------------------------------------------------------- 1 | *.stw 2 | *.jpg 3 | *.heic 4 | -------------------------------------------------------------------------------- /cmd/heic2stw/README.md: -------------------------------------------------------------------------------- 1 | # heic2stw 2 | 3 | Extract timing metadata from .heic (macOS dynamic wallpaper / HEIF) files. 4 | 5 | Can be used in combination with an ImageMagick command like this: 6 | 7 | convert image.heic image_%02d.jpg 8 | 9 | And then extract a simple timed wallpaper file like this: 10 | 11 | heic2stw image.heic > image.stw 12 | 13 | Then copy `image.stw` and `image_*.jpg` to `/usr/share/backgrounds/image/`. 14 | 15 | The included `heic-install` script in the `scripts` directory in the project root does all of the above. 16 | -------------------------------------------------------------------------------- /cmd/lsmon/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/urfave/cli" 8 | "github.com/xyproto/wallutils" 9 | ) 10 | 11 | func listMonitorAction(c *cli.Context) error { 12 | // Retrieve a slice of Monitor structs, or exit with an error 13 | monitors, err := wallutils.Monitors() 14 | if err != nil { 15 | return err 16 | } 17 | // For every monitor, output the ID, width and height 18 | alsoDPI := c.IsSet("dpi") 19 | for _, mon := range monitors { 20 | if alsoDPI { 21 | fmt.Printf("%d: %dx%d (DPI: %dx%d)\n", mon.ID, mon.Width, mon.Height, mon.DPIw, mon.DPIh) 22 | } else { 23 | fmt.Printf("%d: %dx%d\n", mon.ID, mon.Width, mon.Height) 24 | } 25 | } 26 | return nil 27 | } 28 | 29 | func main() { 30 | app := cli.NewApp() 31 | 32 | app.Name = "lsmon" 33 | app.Usage = "output ID, width and height for all connected monitors" 34 | app.UsageText = "lsmon [options]" 35 | 36 | app.Version = wallutils.VersionString 37 | app.HideHelp = true 38 | 39 | cli.VersionFlag = cli.BoolFlag{ 40 | Name: "version, V", 41 | Usage: "output version information", 42 | } 43 | 44 | app.Flags = []cli.Flag{ 45 | cli.BoolFlag{ 46 | Name: "d, dpi", 47 | Usage: "also output the monitor DPI", 48 | }, 49 | } 50 | 51 | app.Action = listMonitorAction 52 | if err := app.Run(os.Args); err != nil { 53 | wallutils.Quit(err) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /cmd/setwallpaper/README.md: -------------------------------------------------------------------------------- 1 | `setwallpaper` aims to be able to change the desktop wallpaper, for any windowmanager. 2 | 3 | The first argument is the image to use. 4 | 5 | URLs are supported. 6 | 7 | # Wallpaper Modes 8 | 9 | ## Sway 10 | 11 | * `stretch` 12 | * `fill` 13 | * `fit` 14 | * `center` 15 | * `tile` 16 | 17 | ## Feh 18 | 19 | * `fill` 20 | * `center` 21 | * `max` 22 | * `scale` 23 | * `tile` 24 | 25 | ## Gnome3 / Cinnamon / MATE / Deepin 26 | 27 | * `none` 28 | * `wallpaper` 29 | * `centered` 30 | * `scaled` 31 | * `stretched` 32 | * `zoom` 33 | * `spanned` 34 | 35 | For compatibility: 36 | * `fill` is an alias for `stretched` 37 | * `center` is an alias for `centered` 38 | * `scale` is an alias for `scaled` 39 | * `tile` is an alias for `wallpaper` 40 | -------------------------------------------------------------------------------- /cmd/vram/README.md: -------------------------------------------------------------------------------- 1 | # vram 2 | 3 | Tool for retrieving the minimum amount of available VRAM for all non-integrated GPUs, or list all available GPUs. 4 | 5 | If only integrated GPUs are available, the minimum amount of VRAM for those will be outputted instead. 6 | 7 | ## Building vram 8 | 9 | go build 10 | 11 | ## Usage 12 | 13 | Retrieve the minimum amount of available VRAM as a number, followed by ` MiB`: 14 | 15 | vram 16 | 17 | Listing the bus ID, a description and the available VRAM for all GPUs: 18 | 19 | vram -l 20 | 21 | Version information: 22 | 23 | vram --version 24 | -------------------------------------------------------------------------------- /cmd/vram/vram.1: -------------------------------------------------------------------------------- 1 | .\" -*-Nroff-*- 2 | .\" 3 | .TH "vram" 1 "17 Jan 2025" "vram" "User Commands" 4 | .SH NAME 5 | vram \- get the minimum amount of VRAM for all non-integrated GPUs, or list all GPUs 6 | .SH SYNOPSIS 7 | .B vram 8 | Display the minimum amount of available VRAM of all available non-integrated GPUs. 9 | .sp 10 | If only non-integrated GPUs are found, the minimum amount of VRAM for those is used instead. 11 | .sp 12 | .SH DESCRIPTION 13 | vram can fetch information about all available GPUs. 14 | .sp 15 | .SH OPTIONS 16 | .sp 17 | .TP 18 | .B \-l or \-\-list 19 | List the bus ID, a description and available VRAM, for all GPUs. 20 | .TP 21 | .B \-h or \-\-help 22 | Show usage information. 23 | .TP 24 | .B \-V or \-\-version 25 | Show the current version. 26 | .PP 27 | .SH VERSION 28 | 5.12.10 29 | .SH AUTHOR 30 | .B vram 31 | was written by Alexander F. Rødseth 32 | -------------------------------------------------------------------------------- /cmd/wayinfo/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/urfave/cli" 8 | "github.com/xyproto/wallutils" 9 | ) 10 | 11 | func wayInfoAction(c *cli.Context) error { 12 | // Fetch the info string 13 | info, err := wallutils.WaylandInfo() 14 | if err != nil { 15 | return err 16 | } 17 | 18 | // Output the info 19 | fmt.Println(info) 20 | 21 | return nil 22 | } 23 | 24 | func main() { 25 | app := cli.NewApp() 26 | 27 | app.Name = "wayinfo" 28 | app.Usage = "output information about the current Wayland setup" 29 | app.UsageText = "wayinfo [options]" 30 | 31 | app.Version = wallutils.VersionString 32 | app.HideHelp = true 33 | 34 | cli.VersionFlag = cli.BoolFlag{ 35 | Name: "version, V", 36 | Usage: "output version information", 37 | } 38 | 39 | app.Action = wayInfoAction 40 | if err := app.Run(os.Args); err != nil { 41 | wallutils.Quit(err) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /cmd/xinfo/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | 7 | "github.com/urfave/cli" 8 | "github.com/xyproto/wallutils" 9 | ) 10 | 11 | func xInfoAction(c *cli.Context) error { 12 | // Fetch the info string 13 | info, err := wallutils.XInfo() 14 | if err != nil { 15 | return err 16 | } 17 | 18 | // Output the info 19 | fmt.Println(info) 20 | 21 | return nil 22 | } 23 | 24 | func main() { 25 | app := cli.NewApp() 26 | 27 | app.Name = "xinfo" 28 | app.Usage = "output information about the current X setup" 29 | app.UsageText = "xinfo [options]" 30 | 31 | app.Version = wallutils.VersionString 32 | app.HideHelp = true 33 | 34 | cli.VersionFlag = cli.BoolFlag{ 35 | Name: "version, V", 36 | Usage: "output version information", 37 | } 38 | 39 | app.Action = xInfoAction 40 | if err := app.Run(os.Args); err != nil { 41 | wallutils.Quit(err) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /cmd/xml2stw/.gitignore: -------------------------------------------------------------------------------- 1 | *.stw 2 | -------------------------------------------------------------------------------- /cmd/xml2stw/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | "os" 7 | 8 | "github.com/urfave/cli" 9 | "github.com/xyproto/wallutils" 10 | "github.com/xyproto/wallutils/pkg/gnometimed" 11 | ) 12 | 13 | func conversionAction(c *cli.Context) error { 14 | if c.NArg() == 0 { 15 | return errors.New("please use a GNOME timed wallpaper XML file as the first argument") 16 | } 17 | filename := c.Args().Get(0) 18 | 19 | simpleTimedWallpaperString, err := gnometimed.GnomeFileToSimpleString(filename) 20 | if err != nil { 21 | return err 22 | } 23 | 24 | // Output the result of the conversion 25 | fmt.Println(simpleTimedWallpaperString) 26 | 27 | return nil 28 | } 29 | 30 | func main() { 31 | app := cli.NewApp() 32 | 33 | app.Name = "xml2stw" 34 | app.Usage = "convert from GNOME Timed Wallpaper to the Simple Timed Wallpaper format" 35 | app.UsageText = "xml2stw [options] [XML file]" 36 | 37 | app.Version = wallutils.VersionString 38 | app.HideHelp = true 39 | 40 | cli.VersionFlag = cli.BoolFlag{ 41 | Name: "version, V", 42 | Usage: "output version information", 43 | } 44 | 45 | app.Flags = []cli.Flag{ 46 | cli.BoolFlag{ 47 | Name: "verbose, v", 48 | Usage: "verbose output", 49 | }, 50 | //cli.StringFlag{ 51 | // Name: "output, o", 52 | // Value: "output.stw", 53 | // Usage: "verbose output", 54 | //}, 55 | } 56 | 57 | app.Action = conversionAction 58 | if err := app.Run(os.Args); err != nil { 59 | wallutils.Quit(err) 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module github.com/xyproto/wallutils 2 | 3 | go 1.23.0 4 | 5 | toolchain go1.24.1 6 | 7 | require ( 8 | github.com/anthonynsimon/bild v0.14.0 9 | github.com/fatih/color v1.18.0 10 | github.com/stretchr/powerwalk v0.0.0-20151124150408-bceb9d014549 11 | github.com/urfave/cli v1.22.16 12 | github.com/xyproto/env/v2 v2.5.3 13 | github.com/xyproto/heic v1.0.0 14 | ) 15 | 16 | require ( 17 | github.com/antchfx/xmlquery v1.4.4 // indirect 18 | github.com/antchfx/xpath v1.3.4 // indirect 19 | github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect 20 | github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect 21 | github.com/mattn/go-colorable v0.1.14 // indirect 22 | github.com/mattn/go-isatty v0.0.20 // indirect 23 | github.com/russross/blackfriday/v2 v2.1.0 // indirect 24 | golang.org/x/image v0.26.0 // indirect 25 | golang.org/x/net v0.39.0 // indirect 26 | golang.org/x/sys v0.32.0 // indirect 27 | golang.org/x/text v0.24.0 // indirect 28 | howett.net/plist v1.0.1 // indirect 29 | ) 30 | -------------------------------------------------------------------------------- /gpus_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestGPUs(t *testing.T) { 9 | gpus, err := GPUs(true) 10 | if err != nil { 11 | t.Error(err) 12 | } 13 | for _, gpu := range gpus { 14 | fmt.Println(gpu) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /gsettings.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | // sq will single-quote a string 8 | func sq(s string) string { 9 | return "'" + s + "'" 10 | } 11 | 12 | // GSettings can be used for getting and setting configuration options with gsettings 13 | type GSettings struct { 14 | schema string 15 | verbose bool 16 | } 17 | 18 | // NewGSettings creates a new GSettings struct given a schema/category and a 19 | // bool for if the commands should be printed to stdout before running. 20 | func NewGSettings(schema string, verbose bool) *GSettings { 21 | return &GSettings{schema: schema, verbose: verbose} 22 | } 23 | 24 | // Set a key using gsettings. Will single-quote the given value. 25 | func (g *GSettings) Set(key, value string) error { 26 | return run("gsettings", []string{"set", g.schema, key, sq(value)}, g.verbose) 27 | } 28 | 29 | // Get a key using gsettings. Will return an empty string if there are errors. 30 | func (g *GSettings) Get(key string) string { 31 | retval := strings.TrimSpace(output("gsettings", []string{"get", g.schema, key}, g.verbose)) 32 | // Remove single quotes, if present 33 | if strings.HasPrefix(retval, "'") && strings.HasSuffix(retval, "'") { 34 | return retval[1 : len(retval)-1] 35 | } 36 | return retval 37 | } 38 | -------------------------------------------------------------------------------- /monconf_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestParseMonitorConfiguration(_ *testing.T) { 9 | mc, err := NewMonitorConfiguration() 10 | if err != nil { 11 | // Ignore this test if ~/.config/monitor.xml does not exist 12 | return 13 | } 14 | if !mc.Overlapping() { 15 | fmt.Println("No overlapping monitor configurations in ~/.config/monitors.xml") 16 | } else { 17 | fmt.Println("There are overlapping monitor configurations in ~/.config/monitors.xml") 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /monitor.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | ) 7 | 8 | // Monitor contains an ID, the width in pixels and the height in pixels 9 | type Monitor struct { 10 | ID uint // monitor number, from 0 and up 11 | Width uint // width, in pixels 12 | Height uint // height, in pixels 13 | DPIw uint // DPI, if available (width) 14 | DPIh uint // DPI, if available (height) 15 | } 16 | 17 | var errNoWaylandNoX = errors.New("could not detect neither Wayland nor X") 18 | 19 | // String returns a string with monitor ID and resolution 20 | func (m Monitor) String() string { 21 | return fmt.Sprintf("[%d] %dx%d", m.ID, m.Width, m.Height) 22 | } 23 | -------------------------------------------------------------------------------- /overlap.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | // Functions and structs for detecting overlap between monitors / display configurations 4 | 5 | import ( 6 | "image" 7 | ) 8 | 9 | // NewRect is a convenience function for creating an image.Rectangle, given 10 | // the upper left corner (x and y), a width and a height. 11 | func NewRect(x, y, w, h uint) image.Rectangle { 12 | return image.Rect(int(x), int(y), int(x+w), int(y+h)) 13 | } 14 | 15 | // Overlaps checks if any rectangles in a slice of rectangles overlaps. 16 | func Overlaps(rects []image.Rectangle) bool { 17 | for _, ar := range rects { 18 | for _, br := range rects { 19 | if ar == br { 20 | continue 21 | } 22 | if ar.Overlaps(br) { 23 | return true 24 | } 25 | } 26 | } 27 | return false 28 | } 29 | -------------------------------------------------------------------------------- /pkg/event/README.md: -------------------------------------------------------------------------------- 1 | # Event 2 | 3 | A simple event system, for triggering events at certain times. 4 | 5 | ## Example use 6 | 7 | **Leet o'clock** 8 | 9 | ```go 10 | package main 11 | 12 | import ( 13 | "fmt" 14 | "time" 15 | 16 | "github.com/xyproto/wallutils/pkg/event" 17 | ) 18 | 19 | func main() { 20 | // Create a new event system, with a loop iteration delay of 1 second 21 | eventSys := event.NewSystem(1 * time.Second) 22 | // Add an event that will trigger every day at 13:37 23 | eventSys.ClockEvent(13, 37, func() error { 24 | fmt.Println("It's leet o'clock") 25 | return nil 26 | }) 27 | // Run the event system (not verbose) 28 | eventSys.Run(false) 29 | } 30 | ``` 31 | 32 | **Clock** 33 | 34 | ```go 35 | package main 36 | 37 | import ( 38 | "fmt" 39 | "time" 40 | 41 | "github.com/xyproto/wallutils/pkg/event" 42 | ) 43 | 44 | func clockSystem() *event.EventSys { 45 | sys := event.NewSystem(1 * time.Second) 46 | for hour := 0; hour < 24; hour++ { 47 | for minute := 0; minute < 60; minute++ { 48 | // Create new variables that can be closed over by the new function below 49 | hour := hour 50 | minute := minute 51 | // Create a new event that will trigger at the specified hour and minute 52 | sys.ClockEvent(hour, minute, func() error { 53 | fmt.Printf("The clock is %02d:%02d\n", hour, minute) 54 | return nil 55 | }) 56 | } 57 | } 58 | return sys 59 | } 60 | 61 | func main() { 62 | // Start the event system that will trigger an event at every minute 63 | clockSystem().RunBackground(false) 64 | // Wait endlessly while saying "tick" and "tock" every second 65 | for { 66 | fmt.Println("tick") 67 | time.Sleep(1 * time.Second) 68 | fmt.Println("tock") 69 | time.Sleep(1 * time.Second) 70 | } 71 | } 72 | ``` 73 | -------------------------------------------------------------------------------- /pkg/event/clock.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | // NewClockEvent will create a simple event that can be triggered 4 | // The event will trigger every time the hour and minute matches the one from time.Now() 5 | func NewClockEvent(h, m int, f func() error) *SimpleEvent { 6 | return &SimpleEvent{h, m, false, f} 7 | } 8 | -------------------------------------------------------------------------------- /pkg/event/cmd/clock/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/xyproto/wallutils/pkg/event" 8 | ) 9 | 10 | func clockSystem() *event.EventSys { 11 | sys := event.NewSystem(1 * time.Second) 12 | for hour := 0; hour < 24; hour++ { 13 | for minute := 0; minute < 60; minute++ { 14 | // Create new variables that can be closed over by the new function below 15 | hour := hour 16 | minute := minute 17 | // Create a new event that will trigger at the specified hour and minute 18 | sys.ClockEvent(hour, minute, func() error { 19 | fmt.Printf("The clock is %02d:%02d\n", hour, minute) 20 | return nil 21 | }) 22 | } 23 | } 24 | return sys 25 | } 26 | 27 | func main() { 28 | // Start the event system that will trigger an event at every minute 29 | clockSystem().RunBackground(false) 30 | // Wait endlessly while saying "tick" and "tock" every second 31 | for { 32 | fmt.Println("tick") 33 | time.Sleep(1 * time.Second) 34 | fmt.Println("tock") 35 | time.Sleep(1 * time.Second) 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pkg/event/cmd/leetoclock/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | 7 | "github.com/xyproto/wallutils/pkg/event" 8 | ) 9 | 10 | func main() { 11 | // Create a new event system, with a loop iteration delay of 1 second 12 | eventSys := event.NewSystem(1 * time.Second) 13 | // Add an event that will trigger every day at 13:37 14 | eventSys.ClockEvent(13, 37, func() error { 15 | fmt.Println("It's leet o'clock") 16 | return nil 17 | }) 18 | // Run the event system (not verbose) 19 | eventSys.Run(false) 20 | } 21 | -------------------------------------------------------------------------------- /pkg/event/event.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | // Event is an interface that will trigger at a specific hour and minute. 4 | // Trigger() is the function that will be triggered. 5 | // JustOnce() is if it should only be triggered once, or each day. 6 | type Event interface { 7 | Trigger() error 8 | Hour() int 9 | Minute() int 10 | JustOnce() bool 11 | } 12 | -------------------------------------------------------------------------------- /pkg/event/eventsys_test.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | "time" 7 | ) 8 | 9 | func TestEveryMinute(t *testing.T) { 10 | sys := NewSystem(1 * time.Second) 11 | now := time.Now() 12 | i := 0 13 | n := 1 // Could be any number of events to trigger, with a minute between 14 | sys.EveryMinute(now.Hour(), now.Minute(), n, func() error { 15 | fmt.Printf("WAIT A MINUTE #%d\n", i+1) 16 | i++ 17 | return nil 18 | }) 19 | verbose := true 20 | sys.Run(verbose) 21 | time.Sleep(1 * time.Second) 22 | } 23 | -------------------------------------------------------------------------------- /pkg/event/simple.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import ( 4 | "log" 5 | "time" 6 | ) 7 | 8 | // SimpleEvent is a simple event that will trigger a function at HH:MM 9 | type SimpleEvent struct { 10 | hour int 11 | minute int 12 | once bool 13 | f func() error 14 | } 15 | 16 | // NewTestEvent will create a new event that will trigger in 5 seconds along with a log message 17 | func NewTestEvent() *SimpleEvent { 18 | return NewSimpleEvent(time.Second*5, true, func() error { 19 | log.Println("TEST FUNCTION WAS TRIGGERED") 20 | return nil 21 | }) 22 | } 23 | 24 | // NewSimpleEvent will create a simple event that can be triggered 25 | func NewSimpleEvent(in time.Duration, once bool, f func() error) *SimpleEvent { 26 | now := time.Now() 27 | when := now.Add(in) 28 | return &SimpleEvent{when.Hour(), when.Minute(), once, f} 29 | } 30 | 31 | // SetTriggerFunction can be used for replacing the trigger function for a single event 32 | func (se *SimpleEvent) SetTriggerFunction(f func() error) { 33 | se.f = f 34 | } 35 | 36 | // Trigger will call the trigger function stored in the SimpleEvent struct 37 | func (se *SimpleEvent) Trigger() error { 38 | // Call the function in f 39 | return se.f() 40 | } 41 | 42 | // Hour will return the hour number for when the event should trigger 43 | func (se *SimpleEvent) Hour() int { 44 | return se.hour 45 | } 46 | 47 | // Minute will return the minute number for when the event should trigger 48 | func (se *SimpleEvent) Minute() int { 49 | return se.minute 50 | } 51 | 52 | // JustOnce returns true if the event should only ever trigger once 53 | func (se *SimpleEvent) JustOnce() bool { 54 | return se.once 55 | } 56 | -------------------------------------------------------------------------------- /pkg/event/simple_test.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import ( 4 | "testing" 5 | "time" 6 | ) 7 | 8 | func TestNewSimpleEvent(t *testing.T) { 9 | sys := NewSystem(1 * time.Second) 10 | e := NewTestEvent() 11 | sys.Register(e) 12 | verbose := true 13 | sys.Run(verbose) 14 | } 15 | -------------------------------------------------------------------------------- /pkg/event/utils.go: -------------------------------------------------------------------------------- 1 | package event 2 | 3 | import "time" 4 | 5 | // ToToday moves the date of a given time.Time to today's date. 6 | // The hour/minute/second is kept as it is. 7 | func ToToday(d time.Time) time.Time { 8 | // Get hour, minute and second from the event 9 | hour, min, sec := d.Clock() 10 | 11 | // Get the current time and date 12 | now := time.Now() 13 | 14 | // Return a new time.Time 15 | return time.Date(now.Year(), now.Month(), now.Day(), hour, min, sec, now.Nanosecond(), now.Location()) 16 | } 17 | -------------------------------------------------------------------------------- /pkg/gnometimed/README.md: -------------------------------------------------------------------------------- 1 | # gnometimed 2 | 3 | Package for dealing with GNOME Timed Wallpaper XML files 4 | 5 | Version: 2.0.1 6 | -------------------------------------------------------------------------------- /pkg/gnometimed/convert_test.go: -------------------------------------------------------------------------------- 1 | package gnometimed 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func TestConvert(t *testing.T) { 9 | gtw, err := ParseXML("testdata/generated.xml") 10 | if err != nil { 11 | panic(err) 12 | } 13 | fmt.Println(gtw.Config.StartTime.Year) 14 | stw, err := GnomeToSimple(gtw) 15 | if err != nil { 16 | panic(err) 17 | } 18 | fmt.Println(stw) 19 | } 20 | -------------------------------------------------------------------------------- /pkg/gnometimed/testdata/generated.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 2018 6 | 1 7 | 1 8 | 7 9 | 0 10 | 0 11 | 12 | 13 | 14 | /usr/share/wallpapers/Spring/contents/images/1440x900.jpg 15 | 10.0 16 | 17 | 18 | 19 | /usr/share/wallpapers/Autumn/contents/images/1440x900.jpg 20 | 10.0 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /pkg/gnometimed/timedxml_test.go: -------------------------------------------------------------------------------- 1 | package gnometimed 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func ExampleParseXML() { 8 | gtw, err := ParseXML("testdata/example1.xml") 9 | if err != nil { 10 | panic(err) 11 | } 12 | fmt.Println(gtw.Config.StartTime.Year) 13 | fmt.Println(gtw.Config.Transitions[0].ToFilename) 14 | 15 | gtw, err = ParseXML("testdata/example2.xml") 16 | if err != nil { 17 | panic(err) 18 | } 19 | fmt.Println(gtw.Config.StartTime.Year) 20 | 21 | gtw, err = ParseXML("testdata/adwaita-timed.xml") 22 | if err != nil { 23 | panic(err) 24 | } 25 | fmt.Println(gtw.Config.StartTime.Year) 26 | 27 | gtw, err = ParseXML("testdata/generated.xml") 28 | if err != nil { 29 | panic(err) 30 | } 31 | fmt.Println(gtw.Config.StartTime.Year) 32 | 33 | // Output: 34 | // 2009 35 | // /usr/share/backgrounds/cosmos/comet.jpg 36 | // 0 37 | // 2011 38 | // 2018 39 | } 40 | -------------------------------------------------------------------------------- /pkg/simpletimed/README.md: -------------------------------------------------------------------------------- 1 | # Simpletimed 2 | 3 | `simpletimed` can be used for parsing the STW file format and for running an event loop for setting the wallpaper, given a function with this signature: 4 | 5 | ```go 6 | func(string) error 7 | ``` 8 | 9 | Where the given string is the image filename to be set. 10 | 11 | ## The Simple Timed Wallpaper Format 12 | 13 | STW is a format for a configuration file that specifies in which time ranges wallpapers should change from one to another, and with which transition. 14 | 15 | It's a similar to the GNOME timed wallpaper XML format, but much simpler and less verbose. 16 | -------------------------------------------------------------------------------- /pkg/simpletimed/simpletimed_test.go: -------------------------------------------------------------------------------- 1 | package simpletimed 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func ExampleParseSTW() { 8 | stw, err := ParseSTW("testdata/adwaita-timed2.stw") 9 | if err != nil { 10 | panic(err) 11 | } 12 | fmt.Println(stw.Name) 13 | 14 | stw, err = ParseSTW("testdata/comments.stw") 15 | if err != nil { 16 | panic(err) 17 | } 18 | fmt.Println(stw.Name) 19 | 20 | // Output: 21 | // adwaita-timed 22 | // comments 23 | } 24 | -------------------------------------------------------------------------------- /pkg/simpletimed/stw-1.0.0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xyproto/wallutils/b591edb5e461626f8131a71c296150fde2669419/pkg/simpletimed/stw-1.0.0.pdf -------------------------------------------------------------------------------- /pkg/simpletimed/testdata/adwaita-timed2.stw: -------------------------------------------------------------------------------- 1 | stw: 1.0 2 | name: adwaita-timed 3 | format: /usr/share/backgrounds/gnome/adwaita-%s.jpg 4 | @07:00: morning 5 | @08:00-13:00: morning .. day 6 | @13:00: day 7 | @18:00-00:00: day .. night | overlay 8 | @00:00: night 9 | @05:00-07:00: night .. morning 10 | -------------------------------------------------------------------------------- /pkg/simpletimed/testdata/comments.stw: -------------------------------------------------------------------------------- 1 | # 2 | # Simple Timed Wallpaper 3 | # 2019-03-18 4 | # Alexander F. Rødseth 5 | # 6 | # Activate with `settimed` from the `wallutils` package. 7 | # 8 | // Another comment 9 | # 10 | stw: 1.0 11 | name: comments 12 | format: /usr/share/backgrounds/comments/comments-%s 13 | @05:00: early.jpg 14 | @23:00: late.png 15 | -------------------------------------------------------------------------------- /pkg/simpletimed/utils.go: -------------------------------------------------------------------------------- 1 | package simpletimed 2 | 3 | import ( 4 | "fmt" 5 | "os" 6 | "strings" 7 | "time" 8 | ) 9 | 10 | var h24 = time.Hour * 24 11 | 12 | // cFmt formats a timestamp as HH:MM 13 | func cFmt(t time.Time) string { 14 | return fmt.Sprintf("%.2d:%.2d", t.Hour(), t.Minute()) 15 | } 16 | 17 | // dFmt formats a duration nicely 18 | func dFmt(d time.Duration) string { 19 | s := fmt.Sprintf("%6s", d) 20 | if strings.Contains(s, ".") { 21 | pos := strings.Index(s, ".") 22 | if strings.Contains(s[pos:], "s") { 23 | s = s[:pos] + "s" 24 | } 25 | } 26 | if strings.HasSuffix(s, "m0s") { 27 | s = s[:len(s)-2] 28 | } 29 | if strings.HasSuffix(s, "h0m") { 30 | s = s[:len(s)-2] 31 | } 32 | return strings.TrimSpace(s) 33 | } 34 | 35 | // exists checks if the given path exists 36 | func exists(path string) bool { 37 | _, err := os.Stat(path) 38 | return err == nil 39 | } 40 | 41 | // mod24 returns the duration, but in the interval from 0 to 24, regardless 42 | // if the given duration is negative, less than 24h or larger than 24h. 43 | // The modulo operator is used to "wrap" the given duration in a 24h interval. 44 | // Unlike in Python, modulo in Go can return a negative result. 45 | func mod24(d time.Duration) time.Duration { 46 | hourDiff := d % h24 47 | if hourDiff < 0 { 48 | return -hourDiff 49 | } 50 | return hourDiff 51 | } 52 | -------------------------------------------------------------------------------- /res_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | ) 6 | 7 | func ExampleFilenameToRes() { 8 | fn := "hello_there_320x200.png" 9 | res, err := FilenameToRes(fn) 10 | if err != nil { 11 | panic(err) 12 | } 13 | fmt.Println(res) 14 | // Output: 15 | // 320x200 16 | } 17 | -------------------------------------------------------------------------------- /scripts/heic-install: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | filename="$1" 3 | 4 | if [[ "$1" == "" ]]; then 5 | echo 'Usage: heic-install image.heic' 6 | exit 1 7 | fi 8 | 9 | # pkgdir is optional 10 | pkgdir="$2" 11 | 12 | # use colors, if $NO_COLOR != 1 13 | if [[ "$NO_COLOR" != "1" ]]; then 14 | RED="\033[1;31m" 15 | BLUE="\033[1;34m" 16 | BOLD="\033[;1m" 17 | OFF="\033[0m" 18 | else 19 | RED="" 20 | BLUE="" 21 | BOLD="" 22 | OFF="" 23 | fi 24 | 25 | baseName=$(basename "$filename") 26 | name=${baseName%.*} 27 | 28 | if [[ "$name" == "" ]]; then 29 | echo 'The image name is empty' 30 | exit 1 31 | fi 32 | 33 | # check if we have access to /usr/share/backgrounds (since -e is used) 34 | install -d "$pkgdir/usr/share/backgrounds/$name" 2>/dev/null || \ 35 | (printf "${RED}error: heic-install needs permissions to write to /usr/share/backgrounds${OFF}\n${BLUE}try: ${BOLD}sudo %s %q${OFF}\n" "$(basename $0)" "$*"; exit 1) 36 | 37 | # extract the metadata 38 | echo -e -n " ${BLUE}-> ${BOLD}Extracting metadata from $baseName... $OFF" 39 | heic2stw -- "$filename" > "$pkgdir/usr/share/backgrounds/$name/$name.stw" && echo -e "${BOLD}DONE${OFF}" || exit 1 40 | 41 | # convert the images 42 | echo -e " ${BLUE}-> ${BOLD}Converting images from HEIC to JPEG...$OFF" 43 | convert -verbose -- "$filename" "$pkgdir/usr/share/backgrounds/$name/%02d.jpg" && echo -e " ${BLUE}-> ${BOLD}DONE$OFF" || exit 1 44 | 45 | # set permissions 46 | chmod 0755 "$pkgdir/usr/share/backgrounds/$name" 47 | chmod 0644 "$pkgdir/usr/share/backgrounds/$name/"* 48 | 49 | # check if it shows up with lstimed 50 | lstimed | grep -q "$name" && echo -e " ${BLUE}-> ${BOLD}Success, ${BLUE}$name ${BOLD}was installed${OFF}" || (echo -e "${RED}Error, ${BLUE}$name ${RED}was not installed correctly${OFF}"; exit 1) 51 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xmlquery/.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | debug 4 | *.test 5 | 6 | ./build 7 | 8 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 9 | *.o 10 | *.a 11 | *.so 12 | 13 | 14 | # Folders 15 | _obj 16 | _test 17 | 18 | # Architecture specific extensions/prefixes 19 | *.[568vq] 20 | [568vq].out 21 | 22 | *.cgo1.go 23 | *.cgo2.c 24 | _cgo_defun.c 25 | _cgo_gotypes.go 26 | _cgo_export.* 27 | 28 | _testmain.go 29 | 30 | *.exe 31 | *.test 32 | *.prof -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xmlquery/cache.go: -------------------------------------------------------------------------------- 1 | package xmlquery 2 | 3 | import ( 4 | "sync" 5 | 6 | "github.com/golang/groupcache/lru" 7 | 8 | "github.com/antchfx/xpath" 9 | ) 10 | 11 | // DisableSelectorCache will disable caching for the query selector if value is true. 12 | var DisableSelectorCache = false 13 | 14 | // SelectorCacheMaxEntries allows how many selector object can be caching. Default is 50. 15 | // Will disable caching if SelectorCacheMaxEntries <= 0. 16 | var SelectorCacheMaxEntries = 50 17 | 18 | var ( 19 | cacheOnce sync.Once 20 | cache *lru.Cache 21 | cacheMutex sync.Mutex 22 | ) 23 | 24 | func getQuery(expr string) (*xpath.Expr, error) { 25 | if DisableSelectorCache || SelectorCacheMaxEntries <= 0 { 26 | return xpath.Compile(expr) 27 | } 28 | cacheOnce.Do(func() { 29 | cache = lru.New(SelectorCacheMaxEntries) 30 | }) 31 | cacheMutex.Lock() 32 | defer cacheMutex.Unlock() 33 | if v, ok := cache.Get(expr); ok { 34 | return v.(*xpath.Expr), nil 35 | } 36 | v, err := xpath.Compile(expr) 37 | if err != nil { 38 | return nil, err 39 | } 40 | cache.Add(expr, v) 41 | return v, nil 42 | 43 | } 44 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xmlquery/cached_reader.go: -------------------------------------------------------------------------------- 1 | package xmlquery 2 | 3 | import ( 4 | "bufio" 5 | ) 6 | 7 | type cachedReader struct { 8 | buffer *bufio.Reader 9 | cache []byte 10 | caching bool 11 | } 12 | 13 | func newCachedReader(r *bufio.Reader) *cachedReader { 14 | return &cachedReader{ 15 | buffer: r, 16 | cache: make([]byte, 0, 4096), 17 | caching: false, 18 | } 19 | } 20 | 21 | func (c *cachedReader) StartCaching() { 22 | c.cache = c.cache[:0] 23 | c.caching = true 24 | } 25 | 26 | func (c *cachedReader) ReadByte() (b byte, err error) { 27 | b, err = c.buffer.ReadByte() 28 | if err != nil { 29 | return 30 | } 31 | if c.caching { 32 | c.cacheByte(b) 33 | } 34 | return 35 | } 36 | 37 | func (c *cachedReader) Cache() []byte { 38 | return c.cache 39 | } 40 | 41 | func (c *cachedReader) CacheWithLimit(n int) []byte { 42 | if n < 1 { 43 | return nil 44 | } 45 | l := len(c.cache) 46 | if n > l { 47 | n = l 48 | } 49 | return c.cache[:n] 50 | } 51 | 52 | func (c *cachedReader) StopCaching() { 53 | c.caching = false 54 | } 55 | 56 | func (c *cachedReader) Read(p []byte) (int, error) { 57 | n, err := c.buffer.Read(p) 58 | if err != nil { 59 | return n, err 60 | } 61 | if c.caching { 62 | for i := 0; i < n; i++ { 63 | if !c.cacheByte(p[i]) { 64 | break 65 | } 66 | } 67 | } 68 | return n, err 69 | } 70 | 71 | func (c *cachedReader) cacheByte(b byte) bool { 72 | n := len(c.cache) 73 | if n == cap(c.cache) { 74 | return false 75 | } 76 | c.cache = c.cache[:n+1] 77 | c.cache[n] = b 78 | return true 79 | } 80 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xmlquery/options.go: -------------------------------------------------------------------------------- 1 | package xmlquery 2 | 3 | import ( 4 | "encoding/xml" 5 | "io" 6 | ) 7 | 8 | type ParserOptions struct { 9 | Decoder *DecoderOptions 10 | } 11 | 12 | func (options ParserOptions) apply(parser *parser) { 13 | if options.Decoder != nil { 14 | (*options.Decoder).apply(parser.decoder) 15 | } 16 | } 17 | 18 | // DecoderOptions implement the very same options than the standard 19 | // encoding/xml package. Please refer to this documentation: 20 | // https://golang.org/pkg/encoding/xml/#Decoder 21 | type DecoderOptions struct { 22 | Strict bool 23 | AutoClose []string 24 | Entity map[string]string 25 | CharsetReader func(charset string, input io.Reader) (io.Reader, error) 26 | } 27 | 28 | func (options DecoderOptions) apply(decoder *xml.Decoder) { 29 | decoder.Strict = options.Strict 30 | decoder.AutoClose = options.AutoClose 31 | decoder.Entity = options.Entity 32 | decoder.CharsetReader = options.CharsetReader 33 | } 34 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/.gitignore: -------------------------------------------------------------------------------- 1 | # vscode 2 | .vscode 3 | debug 4 | *.test 5 | 6 | ./build 7 | 8 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 9 | *.o 10 | *.a 11 | *.so 12 | 13 | 14 | # Folders 15 | _obj 16 | _test 17 | 18 | # Architecture specific extensions/prefixes 19 | *.[568vq] 20 | [568vq].out 21 | 22 | *.cgo1.go 23 | *.cgo2.c 24 | _cgo_defun.c 25 | _cgo_gotypes.go 26 | _cgo_export.* 27 | 28 | _testmain.go 29 | 30 | *.exe 31 | *.test 32 | *.prof -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_go110.go: -------------------------------------------------------------------------------- 1 | // +build go1.10 2 | 3 | package xpath 4 | 5 | import ( 6 | "math" 7 | "strings" 8 | ) 9 | 10 | func round(f float64) int { 11 | return int(math.Round(f)) 12 | } 13 | 14 | func newStringBuilder() stringBuilder { 15 | return &strings.Builder{} 16 | } 17 | -------------------------------------------------------------------------------- /vendor/github.com/antchfx/xpath/func_pre_go110.go: -------------------------------------------------------------------------------- 1 | // +build !go1.10 2 | 3 | package xpath 4 | 5 | import ( 6 | "bytes" 7 | "math" 8 | ) 9 | 10 | // math.Round() is supported by Go 1.10+, 11 | // This method just compatible for version <1.10. 12 | // https://github.com/golang/go/issues/20100 13 | func round(f float64) int { 14 | if math.Abs(f) < 0.5 { 15 | return 0 16 | } 17 | return int(f + math.Copysign(0.5, f)) 18 | } 19 | 20 | func newStringBuilder() stringBuilder { 21 | return &bytes.Buffer{} 22 | } 23 | -------------------------------------------------------------------------------- /vendor/github.com/anthonynsimon/bild/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Anthony Najjar Simon 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/anthonynsimon/bild/fcolor/rgbaf64.go: -------------------------------------------------------------------------------- 1 | /*Package fcolor provides a basic RGBAF64 color type.*/ 2 | package fcolor 3 | 4 | import "github.com/anthonynsimon/bild/math/f64" 5 | 6 | // RGBAF64 represents an RGBA color using the range 0.0 to 1.0 with a float64 for each channel. 7 | type RGBAF64 struct { 8 | R, G, B, A float64 9 | } 10 | 11 | // NewRGBAF64 returns a new RGBAF64 color based on the provided uint8 values. 12 | // uint8 value 0 maps to 0, 128 to 0.5 and 255 to 1.0. 13 | func NewRGBAF64(r, g, b, a uint8) RGBAF64 { 14 | return RGBAF64{float64(r) / 255, float64(g) / 255, float64(b) / 255, float64(a) / 255} 15 | } 16 | 17 | // Clamp limits the channel values of the RGBAF64 color to the range 0.0 to 1.0. 18 | func (c *RGBAF64) Clamp() { 19 | c.R = f64.Clamp(c.R, 0, 1) 20 | c.G = f64.Clamp(c.G, 0, 1) 21 | c.B = f64.Clamp(c.B, 0, 1) 22 | c.A = f64.Clamp(c.A, 0, 1) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/anthonynsimon/bild/math/f64/clamp.go: -------------------------------------------------------------------------------- 1 | /*Package f64 provides helper functions for the float64 type.*/ 2 | package f64 3 | 4 | // Clamp returns the value if it fits within the parameters min and max. 5 | // Otherwise returns the closest boundary parameter value. 6 | func Clamp(value, min, max float64) float64 { 7 | if value > max { 8 | return max 9 | } 10 | if value < min { 11 | return min 12 | } 13 | return value 14 | } 15 | -------------------------------------------------------------------------------- /vendor/github.com/anthonynsimon/bild/parallel/parallel.go: -------------------------------------------------------------------------------- 1 | /*Package parallel provides helper functions for the dispatching of parallel jobs.*/ 2 | package parallel 3 | 4 | import ( 5 | "runtime" 6 | "sync" 7 | ) 8 | 9 | func init() { 10 | runtime.GOMAXPROCS(runtime.NumCPU()) 11 | } 12 | 13 | // Line dispatches a parameter fn into multiple goroutines by splitting the parameter length 14 | // by the number of available CPUs and assigning the length parts into each fn. 15 | func Line(length int, fn func(start, end int)) { 16 | procs := runtime.GOMAXPROCS(0) 17 | counter := length 18 | partSize := length / procs 19 | if procs <= 1 || partSize <= procs { 20 | fn(0, length) 21 | } else { 22 | var wg sync.WaitGroup 23 | for counter > 0 { 24 | start := counter - partSize 25 | end := counter 26 | if start < 0 { 27 | start = 0 28 | } 29 | counter -= partSize 30 | wg.Add(1) 31 | go func() { 32 | defer wg.Done() 33 | fn(start, end) 34 | }() 35 | } 36 | 37 | wg.Wait() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/v2/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Brian Goff 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/cpuguy83/go-md2man/v2/md2man/debug.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "os" 7 | "strings" 8 | 9 | "github.com/russross/blackfriday/v2" 10 | ) 11 | 12 | func fmtListFlags(flags blackfriday.ListType) string { 13 | knownFlags := []struct { 14 | name string 15 | flag blackfriday.ListType 16 | }{ 17 | {"ListTypeOrdered", blackfriday.ListTypeOrdered}, 18 | {"ListTypeDefinition", blackfriday.ListTypeDefinition}, 19 | {"ListTypeTerm", blackfriday.ListTypeTerm}, 20 | {"ListItemContainsBlock", blackfriday.ListItemContainsBlock}, 21 | {"ListItemBeginningOfList", blackfriday.ListItemBeginningOfList}, 22 | {"ListItemEndOfList", blackfriday.ListItemEndOfList}, 23 | } 24 | 25 | var f []string 26 | for _, kf := range knownFlags { 27 | if flags&kf.flag != 0 { 28 | f = append(f, kf.name) 29 | flags &^= kf.flag 30 | } 31 | } 32 | if flags != 0 { 33 | f = append(f, fmt.Sprintf("Unknown(%#x)", flags)) 34 | } 35 | return strings.Join(f, "|") 36 | } 37 | 38 | type debugDecorator struct { 39 | blackfriday.Renderer 40 | } 41 | 42 | func depth(node *blackfriday.Node) int { 43 | d := 0 44 | for n := node.Parent; n != nil; n = n.Parent { 45 | d++ 46 | } 47 | return d 48 | } 49 | 50 | func (d *debugDecorator) RenderNode(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus { 51 | fmt.Fprintf(os.Stderr, "%s%s %v %v\n", 52 | strings.Repeat(" ", depth(node)), 53 | map[bool]string{true: "+", false: "-"}[entering], 54 | node, 55 | fmtListFlags(node.ListFlags)) 56 | var b strings.Builder 57 | status := d.Renderer.RenderNode(io.MultiWriter(&b, w), node, entering) 58 | if b.Len() > 0 { 59 | fmt.Fprintf(os.Stderr, ">> %q\n", b.String()) 60 | } 61 | return status 62 | } 63 | -------------------------------------------------------------------------------- /vendor/github.com/cpuguy83/go-md2man/v2/md2man/md2man.go: -------------------------------------------------------------------------------- 1 | package md2man 2 | 3 | import ( 4 | "os" 5 | "strconv" 6 | 7 | "github.com/russross/blackfriday/v2" 8 | ) 9 | 10 | // Render converts a markdown document into a roff formatted document. 11 | func Render(doc []byte) []byte { 12 | renderer := NewRoffRenderer() 13 | var r blackfriday.Renderer = renderer 14 | if v, _ := strconv.ParseBool(os.Getenv("MD2MAN_DEBUG")); v { 15 | r = &debugDecorator{Renderer: r} 16 | } 17 | 18 | return blackfriday.Run(doc, 19 | []blackfriday.Option{ 20 | blackfriday.WithRenderer(r), 21 | blackfriday.WithExtensions(renderer.GetExtensions()), 22 | }...) 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/fatih/color/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2013 Fatih Arslan 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/fatih/color/color_windows.go: -------------------------------------------------------------------------------- 1 | package color 2 | 3 | import ( 4 | "os" 5 | 6 | "golang.org/x/sys/windows" 7 | ) 8 | 9 | func init() { 10 | // Opt-in for ansi color support for current process. 11 | // https://learn.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences#output-sequences 12 | var outMode uint32 13 | out := windows.Handle(os.Stdout.Fd()) 14 | if err := windows.GetConsoleMode(out, &outMode); err != nil { 15 | return 16 | } 17 | outMode |= windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_VIRTUAL_TERMINAL_PROCESSING 18 | _ = windows.SetConsoleMode(out, outMode) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/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-colorable/README.md: -------------------------------------------------------------------------------- 1 | # go-colorable 2 | 3 | [![Build Status](https://github.com/mattn/go-colorable/workflows/test/badge.svg)](https://github.com/mattn/go-colorable/actions?query=workflow%3Atest) 4 | [![Codecov](https://codecov.io/gh/mattn/go-colorable/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-colorable) 5 | [![GoDoc](https://godoc.org/github.com/mattn/go-colorable?status.svg)](http://godoc.org/github.com/mattn/go-colorable) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-colorable)](https://goreportcard.com/report/mattn/go-colorable) 7 | 8 | Colorable writer for windows. 9 | 10 | For example, most of logger packages doesn't show colors on windows. (I know we can do it with ansicon. But I don't want.) 11 | This package is possible to handle escape sequence for ansi color on windows. 12 | 13 | ## Too Bad! 14 | 15 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/bad.png) 16 | 17 | 18 | ## So Good! 19 | 20 | ![](https://raw.githubusercontent.com/mattn/go-colorable/gh-pages/good.png) 21 | 22 | ## Usage 23 | 24 | ```go 25 | logrus.SetFormatter(&logrus.TextFormatter{ForceColors: true}) 26 | logrus.SetOutput(colorable.NewColorableStdout()) 27 | 28 | logrus.Info("succeeded") 29 | logrus.Warn("not correct") 30 | logrus.Error("something error") 31 | logrus.Fatal("panic") 32 | ``` 33 | 34 | You can compile above code on non-windows OSs. 35 | 36 | ## Installation 37 | 38 | ``` 39 | $ go get github.com/mattn/go-colorable 40 | ``` 41 | 42 | # License 43 | 44 | MIT 45 | 46 | # Author 47 | 48 | Yasuhiro Matsumoto (a.k.a mattn) 49 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/colorable_others.go: -------------------------------------------------------------------------------- 1 | //go:build !windows || appengine 2 | // +build !windows appengine 3 | 4 | package colorable 5 | 6 | import ( 7 | "io" 8 | "os" 9 | 10 | _ "github.com/mattn/go-isatty" 11 | ) 12 | 13 | // NewColorable returns new instance of Writer which handles escape sequence. 14 | func NewColorable(file *os.File) io.Writer { 15 | if file == nil { 16 | panic("nil passed instead of *os.File to NewColorable()") 17 | } 18 | 19 | return file 20 | } 21 | 22 | // NewColorableStdout returns new instance of Writer which handles escape sequence for stdout. 23 | func NewColorableStdout() io.Writer { 24 | return os.Stdout 25 | } 26 | 27 | // NewColorableStderr returns new instance of Writer which handles escape sequence for stderr. 28 | func NewColorableStderr() io.Writer { 29 | return os.Stderr 30 | } 31 | 32 | // EnableColorsStdout enable colors if possible. 33 | func EnableColorsStdout(enabled *bool) func() { 34 | if enabled != nil { 35 | *enabled = true 36 | } 37 | return func() {} 38 | } 39 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-colorable/noncolorable.go: -------------------------------------------------------------------------------- 1 | package colorable 2 | 3 | import ( 4 | "bytes" 5 | "io" 6 | ) 7 | 8 | // NonColorable holds writer but removes escape sequence. 9 | type NonColorable struct { 10 | out io.Writer 11 | } 12 | 13 | // NewNonColorable returns new instance of Writer which removes escape sequence from Writer. 14 | func NewNonColorable(w io.Writer) io.Writer { 15 | return &NonColorable{out: w} 16 | } 17 | 18 | // Write writes data on console 19 | func (w *NonColorable) Write(data []byte) (n int, err error) { 20 | er := bytes.NewReader(data) 21 | var plaintext bytes.Buffer 22 | loop: 23 | for { 24 | c1, err := er.ReadByte() 25 | if err != nil { 26 | plaintext.WriteTo(w.out) 27 | break loop 28 | } 29 | if c1 != 0x1b { 30 | plaintext.WriteByte(c1) 31 | continue 32 | } 33 | _, err = plaintext.WriteTo(w.out) 34 | if err != nil { 35 | break loop 36 | } 37 | c2, err := er.ReadByte() 38 | if err != nil { 39 | break loop 40 | } 41 | if c2 != 0x5b { 42 | continue 43 | } 44 | 45 | for { 46 | c, err := er.ReadByte() 47 | if err != nil { 48 | break loop 49 | } 50 | if ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || c == '@' { 51 | break 52 | } 53 | } 54 | } 55 | 56 | return len(data), nil 57 | } 58 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Yasuhiro MATSUMOTO 2 | 3 | MIT License (Expat) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/README.md: -------------------------------------------------------------------------------- 1 | # go-isatty 2 | 3 | [![Godoc Reference](https://godoc.org/github.com/mattn/go-isatty?status.svg)](http://godoc.org/github.com/mattn/go-isatty) 4 | [![Codecov](https://codecov.io/gh/mattn/go-isatty/branch/master/graph/badge.svg)](https://codecov.io/gh/mattn/go-isatty) 5 | [![Coverage Status](https://coveralls.io/repos/github/mattn/go-isatty/badge.svg?branch=master)](https://coveralls.io/github/mattn/go-isatty?branch=master) 6 | [![Go Report Card](https://goreportcard.com/badge/mattn/go-isatty)](https://goreportcard.com/report/mattn/go-isatty) 7 | 8 | isatty for golang 9 | 10 | ## Usage 11 | 12 | ```go 13 | package main 14 | 15 | import ( 16 | "fmt" 17 | "github.com/mattn/go-isatty" 18 | "os" 19 | ) 20 | 21 | func main() { 22 | if isatty.IsTerminal(os.Stdout.Fd()) { 23 | fmt.Println("Is Terminal") 24 | } else if isatty.IsCygwinTerminal(os.Stdout.Fd()) { 25 | fmt.Println("Is Cygwin/MSYS2 Terminal") 26 | } else { 27 | fmt.Println("Is Not Terminal") 28 | } 29 | } 30 | ``` 31 | 32 | ## Installation 33 | 34 | ``` 35 | $ go get github.com/mattn/go-isatty 36 | ``` 37 | 38 | ## License 39 | 40 | MIT 41 | 42 | ## Author 43 | 44 | Yasuhiro Matsumoto (a.k.a mattn) 45 | 46 | ## Thanks 47 | 48 | * k-takata: base idea for IsCygwinTerminal 49 | 50 | https://github.com/k-takata/go-iscygpty 51 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/doc.go: -------------------------------------------------------------------------------- 1 | // Package isatty implements interface to isatty 2 | package isatty 3 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/go.test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | echo "" > coverage.txt 5 | 6 | for d in $(go list ./... | grep -v vendor); do 7 | go test -race -coverprofile=profile.out -covermode=atomic "$d" 8 | if [ -f profile.out ]; then 9 | cat profile.out >> coverage.txt 10 | rm profile.out 11 | fi 12 | done 13 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_bsd.go: -------------------------------------------------------------------------------- 1 | //go:build (darwin || freebsd || openbsd || netbsd || dragonfly || hurd) && !appengine && !tinygo 2 | // +build darwin freebsd openbsd netbsd dragonfly hurd 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TIOCGETA) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_others.go: -------------------------------------------------------------------------------- 1 | //go:build (appengine || js || nacl || tinygo || wasm) && !windows 2 | // +build appengine js nacl tinygo wasm 3 | // +build !windows 4 | 5 | package isatty 6 | 7 | // IsTerminal returns true if the file descriptor is terminal which 8 | // is always false on js and appengine classic which is a sandboxed PaaS. 9 | func IsTerminal(fd uintptr) bool { 10 | return false 11 | } 12 | 13 | // IsCygwinTerminal() return true if the file descriptor is a cygwin or msys2 14 | // terminal. This is also always false on this environment. 15 | func IsCygwinTerminal(fd uintptr) bool { 16 | return false 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | // +build plan9 3 | 4 | package isatty 5 | 6 | import ( 7 | "syscall" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | path, err := syscall.Fd2path(int(fd)) 13 | if err != nil { 14 | return false 15 | } 16 | return path == "/dev/cons" || path == "/mnt/term/dev/cons" 17 | } 18 | 19 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 20 | // terminal. This is also always false on this environment. 21 | func IsCygwinTerminal(fd uintptr) bool { 22 | return false 23 | } 24 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_solaris.go: -------------------------------------------------------------------------------- 1 | //go:build solaris && !appengine 2 | // +build solaris,!appengine 3 | 4 | package isatty 5 | 6 | import ( 7 | "golang.org/x/sys/unix" 8 | ) 9 | 10 | // IsTerminal returns true if the given file descriptor is a terminal. 11 | // see: https://src.illumos.org/source/xref/illumos-gate/usr/src/lib/libc/port/gen/isatty.c 12 | func IsTerminal(fd uintptr) bool { 13 | _, err := unix.IoctlGetTermio(int(fd), unix.TCGETA) 14 | return err == nil 15 | } 16 | 17 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 18 | // terminal. This is also always false on this environment. 19 | func IsCygwinTerminal(fd uintptr) bool { 20 | return false 21 | } 22 | -------------------------------------------------------------------------------- /vendor/github.com/mattn/go-isatty/isatty_tcgets.go: -------------------------------------------------------------------------------- 1 | //go:build (linux || aix || zos) && !appengine && !tinygo 2 | // +build linux aix zos 3 | // +build !appengine 4 | // +build !tinygo 5 | 6 | package isatty 7 | 8 | import "golang.org/x/sys/unix" 9 | 10 | // IsTerminal return true if the file descriptor is terminal. 11 | func IsTerminal(fd uintptr) bool { 12 | _, err := unix.IoctlGetTermios(int(fd), unix.TCGETS) 13 | return err == nil 14 | } 15 | 16 | // IsCygwinTerminal return true if the file descriptor is a cygwin or msys2 17 | // terminal. This is also always false on this environment. 18 | func IsCygwinTerminal(fd uintptr) bool { 19 | return false 20 | } 21 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.gitignore: -------------------------------------------------------------------------------- 1 | *.out 2 | *.swp 3 | *.8 4 | *.6 5 | _obj 6 | _test* 7 | markdown 8 | tags 9 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: go 3 | go: 4 | - "1.10.x" 5 | - "1.11.x" 6 | - tip 7 | matrix: 8 | fast_finish: true 9 | allow_failures: 10 | - go: tip 11 | install: 12 | - # Do nothing. This is needed to prevent default install action "go get -t -v ./..." from happening here (we want it to happen inside script step). 13 | script: 14 | - go get -t -v ./... 15 | - diff -u <(echo -n) <(gofmt -d -s .) 16 | - go tool vet . 17 | - go test -v ./... 18 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Blackfriday is distributed under the Simplified BSD License: 2 | 3 | > Copyright © 2011 Russ Ross 4 | > All rights reserved. 5 | > 6 | > Redistribution and use in source and binary forms, with or without 7 | > modification, are permitted provided that the following conditions 8 | > are met: 9 | > 10 | > 1. Redistributions of source code must retain the above copyright 11 | > notice, this list of conditions and the following disclaimer. 12 | > 13 | > 2. Redistributions in binary form must reproduce the above 14 | > copyright notice, this list of conditions and the following 15 | > disclaimer in the documentation and/or other materials provided with 16 | > the distribution. 17 | > 18 | > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | > "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | > LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21 | > FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22 | > COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 23 | > INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 24 | > BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | > LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 26 | > CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | > LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 | > ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | > POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /vendor/github.com/russross/blackfriday/v2/esc.go: -------------------------------------------------------------------------------- 1 | package blackfriday 2 | 3 | import ( 4 | "html" 5 | "io" 6 | ) 7 | 8 | var htmlEscaper = [256][]byte{ 9 | '&': []byte("&"), 10 | '<': []byte("<"), 11 | '>': []byte(">"), 12 | '"': []byte("""), 13 | } 14 | 15 | func escapeHTML(w io.Writer, s []byte) { 16 | escapeEntities(w, s, false) 17 | } 18 | 19 | func escapeAllHTML(w io.Writer, s []byte) { 20 | escapeEntities(w, s, true) 21 | } 22 | 23 | func escapeEntities(w io.Writer, s []byte, escapeValidEntities bool) { 24 | var start, end int 25 | for end < len(s) { 26 | escSeq := htmlEscaper[s[end]] 27 | if escSeq != nil { 28 | isEntity, entityEnd := nodeIsEntity(s, end) 29 | if isEntity && !escapeValidEntities { 30 | w.Write(s[start : entityEnd+1]) 31 | start = entityEnd + 1 32 | } else { 33 | w.Write(s[start:end]) 34 | w.Write(escSeq) 35 | start = end + 1 36 | } 37 | } 38 | end++ 39 | } 40 | if start < len(s) && end <= len(s) { 41 | w.Write(s[start:end]) 42 | } 43 | } 44 | 45 | func nodeIsEntity(s []byte, end int) (isEntity bool, endEntityPos int) { 46 | isEntity = false 47 | endEntityPos = end + 1 48 | 49 | if s[end] == '&' { 50 | for endEntityPos < len(s) { 51 | if s[endEntityPos] == ';' { 52 | if entities[string(s[end:endEntityPos+1])] { 53 | isEntity = true 54 | break 55 | } 56 | } 57 | if !isalnum(s[endEntityPos]) && s[endEntityPos] != '&' && s[endEntityPos] != '#' { 58 | break 59 | } 60 | endEntityPos++ 61 | } 62 | } 63 | 64 | return isEntity, endEntityPos 65 | } 66 | 67 | func escLink(w io.Writer, text []byte) { 68 | unesc := html.UnescapeString(string(text)) 69 | escapeHTML(w, []byte(unesc)) 70 | } 71 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/powerwalk/.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | 25 | test_files/ 26 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/powerwalk/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Stretchr, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /vendor/github.com/stretchr/powerwalk/README.md: -------------------------------------------------------------------------------- 1 | # Powerwalk 2 | 3 | Go package for walking files and concurrently calling user code to handle each file. This package walks the file system in the same way `filepath.Walk` does, except instead of calling the `walkFn` inline, it uses goroutines to allow the files to be handled concurrently. 4 | 5 | Powerwalk functions by walking concurrently over many files. In order to realize any benefits from this approach, you must tell the runtime to use multiple CPUs. For example: 6 | 7 | ``` 8 | runtime.GOMAXPROCS(runtime.NumCPU()) 9 | ``` 10 | 11 | ## Usage 12 | 13 | Powerwalk is a drop-in replacement for the `filepath.Walk` method ([read about that for more details](http://golang.org/pkg/path/filepath/#Walk)), and so has the same signature, even using the `filepath.WalkFunc` too. 14 | 15 | ``` 16 | powerwalk.Walk(root string, walkFn filepath.WalkFunc) error 17 | ``` 18 | 19 | By default, Powerwalk will call the `walkFn` for `powerwalk.DefaultConcurrentWalks` (currently `100`) files at a time. To be specific about the number of concurrent files to walk, use the `WalkLimit` alternative. 20 | 21 | ``` 22 | powerwalk.WalkLimit(root string, walkFn filepath.WalkFunc, limit int) error 23 | ``` 24 | 25 | The `WalkLimit` function does the same as `Walk`, except allows you to specify the number of files to concurrently walk using the `limit` argument. The `limit` argument must be one or higher (i.e. `>0`). Specificying a limit that's too high, causes unnecessary overhead so sensible numbers are encouraged but not enforced. 26 | 27 | See the [godoc documentation](http://godoc.org/github.com/stretchr/powerwalk) for more information. 28 | 29 | -------------------------------------------------------------------------------- /vendor/github.com/stretchr/powerwalk/doc.go: -------------------------------------------------------------------------------- 1 | // Package powerwalk concurrently walks file trees. 2 | // Aside from SkipDir functionality not working and the fact that the 3 | // WalkFunc gets run concurrently, this is a drop-in replacement 4 | // for filepath.Walk. 5 | package powerwalk 6 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 120 3 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/.gitignore: -------------------------------------------------------------------------------- 1 | *.coverprofile 2 | coverage.txt 3 | node_modules/ 4 | vendor 5 | .idea 6 | /.local/ 7 | /internal/ 8 | /site/ 9 | package.json 10 | package-lock.json 11 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Jeremy Saenz & Contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/category.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | // CommandCategories is a slice of *CommandCategory. 4 | type CommandCategories []*CommandCategory 5 | 6 | // CommandCategory is a category containing commands. 7 | type CommandCategory struct { 8 | Name string 9 | Commands Commands 10 | } 11 | 12 | func (c CommandCategories) Less(i, j int) bool { 13 | return lexicographicLess(c[i].Name, c[j].Name) 14 | } 15 | 16 | func (c CommandCategories) Len() int { 17 | return len(c) 18 | } 19 | 20 | func (c CommandCategories) Swap(i, j int) { 21 | c[i], c[j] = c[j], c[i] 22 | } 23 | 24 | // AddCommand adds a command to a category. 25 | func (c CommandCategories) AddCommand(category string, command Command) CommandCategories { 26 | for _, commandCategory := range c { 27 | if commandCategory.Name == category { 28 | commandCategory.Commands = append(commandCategory.Commands, command) 29 | return c 30 | } 31 | } 32 | return append(c, &CommandCategory{Name: category, Commands: []Command{command}}) 33 | } 34 | 35 | // VisibleCommands returns a slice of the Commands with Hidden=false 36 | func (c *CommandCategory) VisibleCommands() []Command { 37 | ret := []Command{} 38 | for _, command := range c.Commands { 39 | if !command.Hidden { 40 | ret = append(ret, command) 41 | } 42 | } 43 | return ret 44 | } 45 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/cli.go: -------------------------------------------------------------------------------- 1 | // Package cli provides a minimal framework for creating and organizing command line 2 | // Go applications. cli is designed to be easy to understand and write, the most simple 3 | // cli application can be written as follows: 4 | // func main() { 5 | // cli.NewApp().Run(os.Args) 6 | // } 7 | // 8 | // Of course this application does not do much, so let's make this an actual application: 9 | // func main() { 10 | // app := cli.NewApp() 11 | // app.Name = "greet" 12 | // app.Usage = "say a greeting" 13 | // app.Action = func(c *cli.Context) error { 14 | // println("Greetings") 15 | // return nil 16 | // } 17 | // 18 | // app.Run(os.Args) 19 | // } 20 | package cli 21 | 22 | //go:generate go run flag-gen/main.go flag-gen/assets_vfsdata.go 23 | -------------------------------------------------------------------------------- /vendor/github.com/urfave/cli/sort.go: -------------------------------------------------------------------------------- 1 | package cli 2 | 3 | import "unicode" 4 | 5 | // lexicographicLess compares strings alphabetically considering case. 6 | func lexicographicLess(i, j string) bool { 7 | iRunes := []rune(i) 8 | jRunes := []rune(j) 9 | 10 | lenShared := len(iRunes) 11 | if lenShared > len(jRunes) { 12 | lenShared = len(jRunes) 13 | } 14 | 15 | for index := 0; index < lenShared; index++ { 16 | ir := iRunes[index] 17 | jr := jRunes[index] 18 | 19 | if lir, ljr := unicode.ToLower(ir), unicode.ToLower(jr); lir != ljr { 20 | return lir < ljr 21 | } 22 | 23 | if ir != jr { 24 | return ir < jr 25 | } 26 | } 27 | 28 | return i < j 29 | } 30 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/etc.go: -------------------------------------------------------------------------------- 1 | package env 2 | 3 | import ( 4 | "bytes" 5 | "fmt" 6 | "os" 7 | "strings" 8 | ) 9 | 10 | // isDir checks if the given path is a directory (could also be a symlink) 11 | func isDir(path string) bool { 12 | fi, err := os.Stat(path) 13 | return err == nil && fi.IsDir() 14 | } 15 | 16 | // EtcEnvironment tries to find the value of the given variable name in /etc/environment. 17 | // The variable name could be ie. "JAVA_HOME". 18 | func EtcEnvironment(envVarName string) (string, error) { 19 | // Find the definition of ie. JAVA_HOME within /etc/environment 20 | data, err := os.ReadFile("/etc/environment") 21 | if err != nil { 22 | return "", err 23 | } 24 | lines := bytes.Split(data, []byte{'\n'}) 25 | for _, line := range lines { 26 | if bytes.Contains(line, []byte(envVarName)) && bytes.Count(line, []byte("=")) == 1 { 27 | fields := bytes.SplitN(line, []byte("="), 2) 28 | javaPath := strings.TrimSpace(string(fields[1])) 29 | if !isDir(javaPath) { 30 | continue 31 | } 32 | return javaPath, nil 33 | } 34 | } 35 | return "", fmt.Errorf("could not find the value of %s in /etc/environment", envVarName) 36 | } 37 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir.go: -------------------------------------------------------------------------------- 1 | //go:build !android && !ios && !plan9 && !windows 2 | 3 | package env 4 | 5 | import "fmt" 6 | 7 | const home = "HOME" 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv(home) 13 | if value == "" { 14 | return "", fmt.Errorf("$%s is not defined", home) 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_android.go: -------------------------------------------------------------------------------- 1 | //go:build android 2 | 3 | package env 4 | 5 | // userHomeDir returns the same value as os.UserHomeDir for Android 6 | func userHomeDir() (string, error) { 7 | return "/sdcard", nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_ios.go: -------------------------------------------------------------------------------- 1 | //go:build ios 2 | 3 | package env 4 | 5 | // userHomeDir returns the same value as os.UserHomeDir for iOS 6 | func userHomeDir() (string, error) { 7 | return "/", nil 8 | } 9 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_plan9.go: -------------------------------------------------------------------------------- 1 | //go:build plan9 2 | 3 | package env 4 | 5 | import "fmt" 6 | 7 | const home = "home" 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv(home) 13 | if value == "" { 14 | return "", fmt.Errorf("$%s is not defined", home) 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/homedir_windows.go: -------------------------------------------------------------------------------- 1 | //go:build windows 2 | 3 | package env 4 | 5 | import ( 6 | "errors" 7 | ) 8 | 9 | // userHomeDir is the same as os.UserHomeDir, except that "getenv" is called instead of "os.Getenv" 10 | // (for caching). Also, the two switch statements are combined into just one. 11 | func userHomeDir() (string, error) { 12 | value := getenv("USERPROFILE") 13 | if value == "" { 14 | return "", errors.New("%userprofile% is not defined") 15 | } 16 | return value, nil 17 | } 18 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/env/v2/session.go: -------------------------------------------------------------------------------- 1 | package env 2 | 3 | import "strings" 4 | 5 | // WaylandSession returns true of XDG_SESSION_TYPE is "wayland" or if 6 | // DESKTOP_SESSION contains "wayland". 7 | func WaylandSession() bool { 8 | return Str("XDG_SESSION_TYPE") == "wayland" || Has("WAYLAND_DISPLAY") || strings.Contains(Str("DESKTOP_SESSION"), "wayland") 9 | } 10 | 11 | // XSession returns true if DISPLAY is set. 12 | // X being available is not neccessarily in opposition to Wayland running. 13 | func XSession() bool { 14 | return Has("DISPLAY") 15 | } 16 | 17 | // OnlyXSession returns true if DISPLAY is set and WaylandSession() is false. 18 | func OnlyXSession() bool { 19 | return Has("DISPLAY") && !WaylandSession() 20 | } 21 | 22 | // XOrWaylandSession returns true if DISPLAY is set or WaylandSession() returns true. 23 | func XOrWaylandSession() bool { 24 | return Has("DISPLAY") || WaylandSession() 25 | } 26 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/heic/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.tmp 3 | *.o 4 | *~ 5 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/heic/README.md: -------------------------------------------------------------------------------- 1 | # HEIC 2 | 3 | This is a fork of the Go code in [github.com/strukturag/libheif/go](https://github.com/strukturag/libheif/tree/master/go), with the intention of being able to load dynamic wallpapers in the `heic` format. 4 | 5 | Code has been added that makes it possible to read the timing information from dynamic wallpapers in the `.heic` and/or HEIF format. 6 | 7 | ```go 8 | ... 9 | metadataIDs := handle.MetadataIDs() 10 | if len(metadataIDs) > 0 { 11 | metadataID := metadataIDs[0] 12 | timeTable, err := handle.ImageTimes(metadataID) 13 | // the mapping from image index to timestamp that contains the correct hour and minute are now in "timeTable" 14 | ... 15 | } 16 | ``` 17 | 18 | Take a look at 19 | 20 | ## General info 21 | 22 | * Version: 1.0.0 23 | * License: LGPL3 24 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/heic/TODO.md: -------------------------------------------------------------------------------- 1 | # Plans 2 | 3 | - [ ] Don't fork. Create a new BSD-3 licensed package that just uses the `libheif/go` package. 4 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/heic/keepalive_16.go: -------------------------------------------------------------------------------- 1 | //go:build !go1.7 2 | // +build !go1.7 3 | 4 | /* 5 | * GO interface to libheif 6 | * Copyright (c) 2019 struktur AG, Dirk Farin 7 | * 8 | * This file is part of heif, an example application using libheif. 9 | * 10 | * heif is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * heif is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with heif. If not, see . 22 | */ 23 | 24 | package heic 25 | 26 | //go:noinline 27 | func keepAlive(x interface{}) { 28 | if _Cgo_always_false { 29 | _Cgo_use(x) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /vendor/github.com/xyproto/heic/keepalive_17.go: -------------------------------------------------------------------------------- 1 | //go:build go1.7 2 | // +build go1.7 3 | 4 | /* 5 | * GO interface to libheif 6 | * Copyright (c) 2019 struktur AG, Dirk Farin 7 | * 8 | * This file is part of heif, an example application using libheif. 9 | * 10 | * heif is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | * 15 | * heif is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | * 20 | * You should have received a copy of the GNU General Public License 21 | * along with heif. If not, see . 22 | */ 23 | 24 | package heic 25 | 26 | import ( 27 | "runtime" 28 | ) 29 | 30 | func keepAlive(x interface{}) { 31 | runtime.KeepAlive(x) 32 | } 33 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/image/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/net/html/iter.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.23 6 | 7 | package html 8 | 9 | import "iter" 10 | 11 | // Ancestors returns an iterator over the ancestors of n, starting with n.Parent. 12 | // 13 | // Mutating a Node or its parents while iterating may have unexpected results. 14 | func (n *Node) Ancestors() iter.Seq[*Node] { 15 | _ = n.Parent // eager nil check 16 | 17 | return func(yield func(*Node) bool) { 18 | for p := n.Parent; p != nil && yield(p); p = p.Parent { 19 | } 20 | } 21 | } 22 | 23 | // ChildNodes returns an iterator over the immediate children of n, 24 | // starting with n.FirstChild. 25 | // 26 | // Mutating a Node or its children while iterating may have unexpected results. 27 | func (n *Node) ChildNodes() iter.Seq[*Node] { 28 | _ = n.FirstChild // eager nil check 29 | 30 | return func(yield func(*Node) bool) { 31 | for c := n.FirstChild; c != nil && yield(c); c = c.NextSibling { 32 | } 33 | } 34 | 35 | } 36 | 37 | // Descendants returns an iterator over all nodes recursively beneath 38 | // n, excluding n itself. Nodes are visited in depth-first preorder. 39 | // 40 | // Mutating a Node or its descendants while iterating may have unexpected results. 41 | func (n *Node) Descendants() iter.Seq[*Node] { 42 | _ = n.FirstChild // eager nil check 43 | 44 | return func(yield func(*Node) bool) { 45 | n.descendants(yield) 46 | } 47 | } 48 | 49 | func (n *Node) descendants(yield func(*Node) bool) bool { 50 | for c := range n.ChildNodes() { 51 | if !yield(c) || !c.descendants(yield) { 52 | return false 53 | } 54 | } 55 | return true 56 | } 57 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2009 The Go Authors. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google LLC nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the Go project. 5 | 6 | Google hereby grants to You a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer and otherwise run, modify and propagate the contents of this 10 | implementation of Go, where such license applies only to those patent 11 | claims, both currently owned or controlled by Google and acquired in 12 | the future, licensable by Google that are necessarily infringed by this 13 | implementation of Go. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of Go or any code incorporated within this 19 | implementation of Go constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of Go 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/.gitignore: -------------------------------------------------------------------------------- 1 | _obj/ 2 | unix.test 3 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | type Signal = syscall.Signal 12 | type Errno = syscall.Errno 13 | type SysProcAttr = syscall.SysProcAttr 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_aix_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 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_bsd_386.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for 386 BSD 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-28 15 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for AMD64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM BSD 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-28 15 | B syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-40 18 | B syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-52 21 | B syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 24 | B syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 27 | B syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_arm64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for ARM64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_bsd_ppc64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for ppc64, BSD 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_bsd_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || freebsd || netbsd || openbsd) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // System call support for RISCV64 BSD 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 | JMP syscall·Syscall(SB) 16 | 17 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 18 | JMP syscall·Syscall6(SB) 19 | 20 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 21 | JMP syscall·Syscall9(SB) 22 | 23 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 24 | JMP syscall·RawSyscall(SB) 25 | 26 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 27 | JMP syscall·RawSyscall6(SB) 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 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 | //go:build gc 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 | //go:build linux && arm64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // Just jump to package syscall's implementation for all these functions. 10 | // The runtime may know about them. 11 | 12 | TEXT ·Syscall(SB),NOSPLIT,$0-56 13 | B syscall·Syscall(SB) 14 | 15 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 16 | B syscall·Syscall6(SB) 17 | 18 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 19 | BL runtime·entersyscall(SB) 20 | MOVD a1+8(FP), R0 21 | MOVD a2+16(FP), R1 22 | MOVD a3+24(FP), R2 23 | MOVD $0, R3 24 | MOVD $0, R4 25 | MOVD $0, R5 26 | MOVD trap+0(FP), R8 // syscall entry 27 | SVC 28 | MOVD R0, r1+32(FP) // r1 29 | MOVD R1, r2+40(FP) // r2 30 | BL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | B syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | B syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOVD a1+8(FP), R0 41 | MOVD a2+16(FP), R1 42 | MOVD a3+24(FP), R2 43 | MOVD $0, R3 44 | MOVD $0, R4 45 | MOVD $0, R5 46 | MOVD trap+0(FP), R8 // syscall entry 47 | SVC 48 | MOVD R0, r1+32(FP) 49 | MOVD R1, r2+40(FP) 50 | RET 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_loong64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && loong64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | 10 | // Just jump to package syscall's implementation for all these functions. 11 | // The runtime may know about them. 12 | 13 | TEXT ·Syscall(SB),NOSPLIT,$0-56 14 | JMP syscall·Syscall(SB) 15 | 16 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 17 | JMP syscall·Syscall6(SB) 18 | 19 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 20 | JAL runtime·entersyscall(SB) 21 | MOVV a1+8(FP), R4 22 | MOVV a2+16(FP), R5 23 | MOVV a3+24(FP), R6 24 | MOVV R0, R7 25 | MOVV R0, R8 26 | MOVV R0, R9 27 | MOVV trap+0(FP), R11 // syscall entry 28 | SYSCALL 29 | MOVV R4, r1+32(FP) 30 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 31 | JAL runtime·exitsyscall(SB) 32 | RET 33 | 34 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 35 | JMP syscall·RawSyscall(SB) 36 | 37 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 38 | JMP syscall·RawSyscall6(SB) 39 | 40 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 41 | MOVV a1+8(FP), R4 42 | MOVV a2+16(FP), R5 43 | MOVV a3+24(FP), R6 44 | MOVV R0, R7 45 | MOVV R0, R8 46 | MOVV R0, R9 47 | MOVV trap+0(FP), R11 // syscall entry 48 | SYSCALL 49 | MOVV R4, r1+32(FP) 50 | MOVV R0, r2+40(FP) // r2 is not used. Always set to 0 51 | RET 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mips64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips64 || mips64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips64, 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 | JAL runtime·entersyscall(SB) 24 | MOVV a1+8(FP), R4 25 | MOVV a2+16(FP), R5 26 | MOVV a3+24(FP), R6 27 | MOVV R0, R7 28 | MOVV R0, R8 29 | MOVV R0, R9 30 | MOVV trap+0(FP), R2 // syscall entry 31 | SYSCALL 32 | MOVV R2, r1+32(FP) 33 | MOVV R3, r2+40(FP) 34 | JAL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | JMP syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | JMP syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVV a1+8(FP), R4 45 | MOVV a2+16(FP), R5 46 | MOVV a3+24(FP), R6 47 | MOVV R0, R7 48 | MOVV R0, R8 49 | MOVV R0, R9 50 | MOVV trap+0(FP), R2 // syscall entry 51 | SYSCALL 52 | MOVV R2, r1+32(FP) 53 | MOVV R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_mipsx.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (mips || mipsle) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for mips, 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 | 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 ·SyscallNoError(SB),NOSPLIT,$0-24 26 | JAL runtime·entersyscall(SB) 27 | MOVW a1+4(FP), R4 28 | MOVW a2+8(FP), R5 29 | MOVW a3+12(FP), R6 30 | MOVW R0, R7 31 | MOVW trap+0(FP), R2 // syscall entry 32 | SYSCALL 33 | MOVW R2, r1+16(FP) // r1 34 | MOVW R3, r2+20(FP) // r2 35 | JAL runtime·exitsyscall(SB) 36 | RET 37 | 38 | TEXT ·RawSyscall(SB),NOSPLIT,$0-28 39 | JMP syscall·RawSyscall(SB) 40 | 41 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-40 42 | JMP syscall·RawSyscall6(SB) 43 | 44 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-24 45 | MOVW a1+4(FP), R4 46 | MOVW a2+8(FP), R5 47 | MOVW a3+12(FP), R6 48 | MOVW trap+0(FP), R2 // syscall entry 49 | SYSCALL 50 | MOVW R2, r1+16(FP) 51 | MOVW R3, r2+20(FP) 52 | RET 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_ppc64x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64 || ppc64le) && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for ppc64, 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 ·SyscallNoError(SB),NOSPLIT,$0-48 17 | BL runtime·entersyscall(SB) 18 | MOVD a1+8(FP), R3 19 | MOVD a2+16(FP), R4 20 | MOVD a3+24(FP), R5 21 | MOVD R0, R6 22 | MOVD R0, R7 23 | MOVD R0, R8 24 | MOVD trap+0(FP), R9 // syscall entry 25 | SYSCALL R9 26 | MOVD R3, r1+32(FP) 27 | MOVD R4, r2+40(FP) 28 | BL runtime·exitsyscall(SB) 29 | RET 30 | 31 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 32 | MOVD a1+8(FP), R3 33 | MOVD a2+16(FP), R4 34 | MOVD a3+24(FP), R5 35 | MOVD R0, R6 36 | MOVD R0, R7 37 | MOVD R0, R8 38 | MOVD trap+0(FP), R9 // syscall entry 39 | SYSCALL R9 40 | MOVD R3, r1+32(FP) 41 | MOVD R4, r2+40(FP) 42 | RET 43 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_riscv64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for linux/riscv64. 11 | // 12 | // Where available, just jump to package syscall's implementation of 13 | // these functions. 14 | 15 | TEXT ·Syscall(SB),NOSPLIT,$0-56 16 | JMP syscall·Syscall(SB) 17 | 18 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 19 | JMP syscall·Syscall6(SB) 20 | 21 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 22 | CALL runtime·entersyscall(SB) 23 | MOV a1+8(FP), A0 24 | MOV a2+16(FP), A1 25 | MOV a3+24(FP), A2 26 | MOV trap+0(FP), A7 // syscall entry 27 | ECALL 28 | MOV A0, r1+32(FP) // r1 29 | MOV A1, r2+40(FP) // r2 30 | CALL runtime·exitsyscall(SB) 31 | RET 32 | 33 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 34 | JMP syscall·RawSyscall(SB) 35 | 36 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 37 | JMP syscall·RawSyscall6(SB) 38 | 39 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 40 | MOV a1+8(FP), A0 41 | MOV a2+16(FP), A1 42 | MOV a3+24(FP), A2 43 | MOV trap+0(FP), A7 // syscall entry 44 | ECALL 45 | MOV A0, r1+32(FP) 46 | MOV A1, r2+40(FP) 47 | RET 48 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_linux_s390x.s: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && s390x && gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System calls for s390x, 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 | BR syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | BR syscall·Syscall6(SB) 21 | 22 | TEXT ·SyscallNoError(SB),NOSPLIT,$0-48 23 | BL runtime·entersyscall(SB) 24 | MOVD a1+8(FP), R2 25 | MOVD a2+16(FP), R3 26 | MOVD a3+24(FP), R4 27 | MOVD $0, R5 28 | MOVD $0, R6 29 | MOVD $0, R7 30 | MOVD trap+0(FP), R1 // syscall entry 31 | SYSCALL 32 | MOVD R2, r1+32(FP) 33 | MOVD R3, r2+40(FP) 34 | BL runtime·exitsyscall(SB) 35 | RET 36 | 37 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 38 | BR syscall·RawSyscall(SB) 39 | 40 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 41 | BR syscall·RawSyscall6(SB) 42 | 43 | TEXT ·RawSyscallNoError(SB),NOSPLIT,$0-48 44 | MOVD a1+8(FP), R2 45 | MOVD a2+16(FP), R3 46 | MOVD a3+24(FP), R4 47 | MOVD $0, R5 48 | MOVD $0, R6 49 | MOVD $0, R7 50 | MOVD trap+0(FP), R1 // syscall entry 51 | SYSCALL 52 | MOVD R2, r1+32(FP) 53 | MOVD R3, r2+40(FP) 54 | RET 55 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_openbsd_mips64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 6 | 7 | #include "textflag.h" 8 | 9 | // 10 | // System call support for mips64, OpenBSD 11 | // 12 | 13 | // Just jump to package syscall's implementation for all these functions. 14 | // The runtime may know about them. 15 | 16 | TEXT ·Syscall(SB),NOSPLIT,$0-56 17 | JMP syscall·Syscall(SB) 18 | 19 | TEXT ·Syscall6(SB),NOSPLIT,$0-80 20 | JMP syscall·Syscall6(SB) 21 | 22 | TEXT ·Syscall9(SB),NOSPLIT,$0-104 23 | JMP syscall·Syscall9(SB) 24 | 25 | TEXT ·RawSyscall(SB),NOSPLIT,$0-56 26 | JMP syscall·RawSyscall(SB) 27 | 28 | TEXT ·RawSyscall6(SB),NOSPLIT,$0-80 29 | JMP syscall·RawSyscall6(SB) 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/asm_solaris_amd64.s: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gc 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/auxv.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | //go:linkname runtime_getAuxv runtime.getAuxv 15 | func runtime_getAuxv() []uintptr 16 | 17 | // Auxv returns the ELF auxiliary vector as a sequence of key/value pairs. 18 | // The returned slice is always a fresh copy, owned by the caller. 19 | // It returns an error on non-ELF platforms, or if the auxiliary vector cannot be accessed, 20 | // which happens in some locked-down environments and build modes. 21 | func Auxv() ([][2]uintptr, error) { 22 | vec := runtime_getAuxv() 23 | vecLen := len(vec) 24 | 25 | if vecLen == 0 { 26 | return nil, syscall.ENOENT 27 | } 28 | 29 | if vecLen%2 != 0 { 30 | return nil, syscall.EINVAL 31 | } 32 | 33 | result := make([]uintptr, vecLen) 34 | copy(result, vec) 35 | return unsafe.Slice((*[2]uintptr)(unsafe.Pointer(&result[0])), vecLen/2), nil 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/auxv_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2025 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !go1.21 && (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Auxv() ([][2]uintptr, error) { 12 | return nil, syscall.ENOTSUP 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/bluetooth_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Bluetooth sockets and messages 6 | 7 | package unix 8 | 9 | // Bluetooth Protocols 10 | const ( 11 | BTPROTO_L2CAP = 0 12 | BTPROTO_HCI = 1 13 | BTPROTO_SCO = 2 14 | BTPROTO_RFCOMM = 3 15 | BTPROTO_BNEP = 4 16 | BTPROTO_CMTP = 5 17 | BTPROTO_HIDP = 6 18 | BTPROTO_AVDTP = 7 19 | ) 20 | 21 | const ( 22 | HCI_CHANNEL_RAW = 0 23 | HCI_CHANNEL_USER = 1 24 | HCI_CHANNEL_MONITOR = 2 25 | HCI_CHANNEL_CONTROL = 3 26 | HCI_CHANNEL_LOGGING = 4 27 | ) 28 | 29 | // Socketoption Level 30 | const ( 31 | SOL_BLUETOOTH = 0x112 32 | SOL_HCI = 0x0 33 | SOL_L2CAP = 0x6 34 | SOL_RFCOMM = 0x12 35 | SOL_SCO = 0x11 36 | ) 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/constants.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 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 | //go:build aix && ppc 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev >> 16) & 0xffff) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32(dev & 0xffff) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | return uint64(((major) << 16) | (minor)) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_aix_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix && ppc64 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used AIX. 9 | 10 | package unix 11 | 12 | // Major returns the major component of a Linux device number. 13 | func Major(dev uint64) uint32 { 14 | return uint32((dev & 0x3fffffff00000000) >> 32) 15 | } 16 | 17 | // Minor returns the minor component of a Linux device number. 18 | func Minor(dev uint64) uint32 { 19 | return uint32((dev & 0x00000000ffffffff) >> 0) 20 | } 21 | 22 | // Mkdev returns a Linux device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | var DEVNO64 uint64 26 | DEVNO64 = 0x8000000000000000 27 | return ((uint64(major) << 32) | (uint64(minor) & 0x00000000FFFFFFFF) | DEVNO64) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Darwin's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a Darwin device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev >> 24) & 0xff) 13 | } 14 | 15 | // Minor returns the minor component of a Darwin device number. 16 | func Minor(dev uint64) uint32 { 17 | return uint32(dev & 0xffffff) 18 | } 19 | 20 | // Mkdev returns a Darwin device number generated from the given major and minor 21 | // components. 22 | func Mkdev(major, minor uint32) uint64 { 23 | return (uint64(major) << 24) | uint64(minor) 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in Dragonfly's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a DragonFlyBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a DragonFlyBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a DragonFlyBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_freebsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in FreeBSD's sys/types.h header. 7 | // 8 | // The information below is extracted and adapted from sys/types.h: 9 | // 10 | // Minor gives a cookie instead of an index since in order to avoid changing the 11 | // meanings of bits 0-15 or wasting time and space shifting bits 16-31 for 12 | // devices that don't use them. 13 | 14 | package unix 15 | 16 | // Major returns the major component of a FreeBSD device number. 17 | func Major(dev uint64) uint32 { 18 | return uint32((dev >> 8) & 0xff) 19 | } 20 | 21 | // Minor returns the minor component of a FreeBSD device number. 22 | func Minor(dev uint64) uint32 { 23 | return uint32(dev & 0xffff00ff) 24 | } 25 | 26 | // Mkdev returns a FreeBSD device number generated from the given major and 27 | // minor components. 28 | func Mkdev(major, minor uint32) uint64 { 29 | return (uint64(major) << 8) | uint64(minor) 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_netbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in NetBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of a NetBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x000fff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of a NetBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xfff00000) >> 12) 19 | return minor 20 | } 21 | 22 | // Mkdev returns a NetBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x000fff00 26 | dev |= (uint64(minor) << 12) & 0xfff00000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | // Functions to access/create device major and minor numbers matching the 6 | // encoding used in OpenBSD's sys/types.h header. 7 | 8 | package unix 9 | 10 | // Major returns the major component of an OpenBSD device number. 11 | func Major(dev uint64) uint32 { 12 | return uint32((dev & 0x0000ff00) >> 8) 13 | } 14 | 15 | // Minor returns the minor component of an OpenBSD device number. 16 | func Minor(dev uint64) uint32 { 17 | minor := uint32((dev & 0x000000ff) >> 0) 18 | minor |= uint32((dev & 0xffff0000) >> 8) 19 | return minor 20 | } 21 | 22 | // Mkdev returns an OpenBSD device number generated from the given major and minor 23 | // components. 24 | func Mkdev(major, minor uint32) uint64 { 25 | dev := (uint64(major) << 8) & 0x0000ff00 26 | dev |= (uint64(minor) << 8) & 0xffff0000 27 | dev |= (uint64(minor) << 0) & 0x000000ff 28 | return dev 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/dev_zos.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build zos && s390x 6 | 7 | // Functions to access/create device major and minor numbers matching the 8 | // encoding used by z/OS. 9 | // 10 | // The information below is extracted and adapted from macros. 11 | 12 | package unix 13 | 14 | // Major returns the major component of a z/OS device number. 15 | func Major(dev uint64) uint32 { 16 | return uint32((dev >> 16) & 0x0000FFFF) 17 | } 18 | 19 | // Minor returns the minor component of a z/OS device number. 20 | func Minor(dev uint64) uint32 { 21 | return uint32(dev & 0x0000FFFF) 22 | } 23 | 24 | // Mkdev returns a z/OS device number generated from the given major and minor 25 | // components. 26 | func Mkdev(major, minor uint32) uint64 { 27 | return (uint64(major) << 16) | uint64(minor) 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/endian_big.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | // 5 | //go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64 6 | 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 | //go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh 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 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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 | //go:build dragonfly || freebsd || linux || netbsd 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 fcntl_linux_32bit.go to be SYS_FCNTL64. 13 | var fcntl64Syscall uintptr = SYS_FCNTL 14 | 15 | func fcntl(fd int, cmd, arg int) (int, error) { 16 | valptr, _, errno := Syscall(fcntl64Syscall, uintptr(fd), uintptr(cmd), uintptr(arg)) 17 | var err error 18 | if errno != 0 { 19 | err = errno 20 | } 21 | return int(valptr), err 22 | } 23 | 24 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 25 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 26 | return fcntl(int(fd), cmd, arg) 27 | } 28 | 29 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 30 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 31 | _, _, errno := Syscall(fcntl64Syscall, fd, uintptr(cmd), uintptr(unsafe.Pointer(lk))) 32 | if errno == 0 { 33 | return nil 34 | } 35 | return errno 36 | } 37 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // FcntlInt performs a fcntl syscall on fd with the provided command and argument. 10 | func FcntlInt(fd uintptr, cmd, arg int) (int, error) { 11 | return fcntl(int(fd), cmd, arg) 12 | } 13 | 14 | // FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. 15 | func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { 16 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(lk)))) 17 | return err 18 | } 19 | 20 | // FcntlFstore performs a fcntl syscall for the F_PREALLOCATE command. 21 | func FcntlFstore(fd uintptr, cmd int, fstore *Fstore_t) error { 22 | _, err := fcntl(int(fd), cmd, int(uintptr(unsafe.Pointer(fstore)))) 23 | return err 24 | } 25 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/fcntl_linux_32bit.go: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc) 6 | 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/fdset.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | // Set adds fd to the set fds. 10 | func (fds *FdSet) Set(fd int) { 11 | fds.Bits[fd/NFDBITS] |= (1 << (uintptr(fd) % NFDBITS)) 12 | } 13 | 14 | // Clear removes fd from the set fds. 15 | func (fds *FdSet) Clear(fd int) { 16 | fds.Bits[fd/NFDBITS] &^= (1 << (uintptr(fd) % NFDBITS)) 17 | } 18 | 19 | // IsSet returns whether fd is in the set fds. 20 | func (fds *FdSet) IsSet(fd int) bool { 21 | return fds.Bits[fd/NFDBITS]&(1<<(uintptr(fd)%NFDBITS)) != 0 22 | } 23 | 24 | // Zero clears the set fds. 25 | func (fds *FdSet) Zero() { 26 | for i := range fds.Bits { 27 | fds.Bits[i] = 0 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /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 | //go:build gccgo && !aix && !hurd 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define _STRINGIFY2_(x) #x 12 | #define _STRINGIFY_(x) _STRINGIFY2_(x) 13 | #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__) 14 | 15 | // Call syscall from C code because the gccgo support for calling from 16 | // Go to C does not support varargs functions. 17 | 18 | struct ret { 19 | uintptr_t r; 20 | uintptr_t err; 21 | }; 22 | 23 | struct ret 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) 24 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscall"); 25 | 26 | struct ret 27 | 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) 28 | { 29 | struct ret r; 30 | 31 | errno = 0; 32 | r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 33 | r.err = errno; 34 | return r; 35 | } 36 | 37 | uintptr_t 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) 38 | __asm__(GOSYM_PREFIX GOPKGPATH ".realSyscallNoError"); 39 | 40 | uintptr_t 41 | 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) 42 | { 43 | return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9); 44 | } 45 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/gccgo_linux_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build gccgo && linux && amd64 6 | 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/mmap_nomremap.go: -------------------------------------------------------------------------------- 1 | // Copyright 2023 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | var mapper = &mmapper{ 10 | active: make(map[*byte][]byte), 11 | mmap: mmap, 12 | munmap: munmap, 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/pagesize_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos 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/ptrace_darwin.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin && !ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) error { 10 | return ptrace1(request, pid, addr, data) 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/ptrace_ios.go: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ios 6 | 7 | package unix 8 | 9 | func ptrace(request int, pid int, addr uintptr, data uintptr) (err error) { 10 | return ENOTSUP 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && race) || (linux && race) || (freebsd && race) 6 | 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 | //go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "unsafe" 11 | ) 12 | 13 | const raceenabled = false 14 | 15 | func raceAcquire(addr unsafe.Pointer) { 16 | } 17 | 18 | func raceReleaseMerge(addr unsafe.Pointer) { 19 | } 20 | 21 | func raceReadRange(addr unsafe.Pointer, len int) { 22 | } 23 | 24 | func raceWriteRange(addr unsafe.Pointer, len int) { 25 | } 26 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdents.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || dragonfly || freebsd || linux || netbsd || openbsd 6 | 7 | package unix 8 | 9 | // ReadDirent reads directory entries from fd and writes them into buf. 10 | func ReadDirent(fd int, buf []byte) (n int, err error) { 11 | return Getdents(fd, buf) 12 | } 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/readdirent_getdirentries.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // ReadDirent reads directory entries from fd and writes them into buf. 12 | func ReadDirent(fd int, buf []byte) (n int, err error) { 13 | // Final argument is (basep *uintptr) and the syscall doesn't take nil. 14 | // 64 bits should be enough. (32 bits isn't even on 386). Since the 15 | // actual system call is getdirentries64, 64 is a good guess. 16 | // TODO(rsc): Can we use a single global basep for all calls? 17 | var base = (*uintptr)(unsafe.Pointer(new(uint64))) 18 | return Getdirentries(fd, buf, base) 19 | } 20 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_dragonfly.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | // Round the length of a raw sockaddr up to align it properly. 8 | func cmsgAlignOf(salen int) int { 9 | salign := SizeofPtr 10 | if SizeofPtr == 8 && !supportsABI(_dragonflyABIChangeVersion) { 11 | // 64-bit Dragonfly before the September 2019 ABI changes still requires 12 | // 32-bit aligned access to network subsystem. 13 | salign = 4 14 | } 15 | return (salen + salign - 1) & ^(salign - 1) 16 | } 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos 6 | 7 | package unix 8 | 9 | import ( 10 | "runtime" 11 | ) 12 | 13 | // Round the length of a raw sockaddr up to align it properly. 14 | func cmsgAlignOf(salen int) int { 15 | salign := SizeofPtr 16 | 17 | // dragonfly needs to check ABI version at runtime, see cmsgAlignOf in 18 | // sockcmsg_dragonfly.go 19 | switch runtime.GOOS { 20 | case "aix": 21 | // There is no alignment on AIX. 22 | salign = 1 23 | case "darwin", "ios", "illumos", "solaris": 24 | // NOTE: It seems like 64-bit Darwin, Illumos and Solaris 25 | // kernels still require 32-bit aligned access to network 26 | // subsystem. 27 | if SizeofPtr == 8 { 28 | salign = 4 29 | } 30 | case "netbsd", "openbsd": 31 | // NetBSD and OpenBSD armv7 require 64-bit alignment. 32 | if runtime.GOARCH == "arm" { 33 | salign = 8 34 | } 35 | // NetBSD aarch64 requires 128-bit alignment. 36 | if runtime.GOOS == "netbsd" && runtime.GOARCH == "arm64" { 37 | salign = 16 38 | } 39 | case "zos": 40 | // z/OS socket macros use [32-bit] sizeof(int) alignment, 41 | // not pointer width. 42 | salign = SizeofInt 43 | } 44 | 45 | return (salen + salign - 1) & ^(salign - 1) 46 | } 47 | -------------------------------------------------------------------------------- /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 | //go:build aix && ppc 6 | 7 | package unix 8 | 9 | //sysnb Getrlimit(resource int, rlim *Rlimit) (err error) = getrlimit64 10 | //sys Seek(fd int, offset int64, whence int) (off int64, err error) = lseek64 11 | 12 | //sys mmap(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) 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 (iov *Iovec) SetLen(length int) { 23 | iov.Len = uint32(length) 24 | } 25 | 26 | func (msghdr *Msghdr) SetControllen(length int) { 27 | msghdr.Controllen = uint32(length) 28 | } 29 | 30 | func (msghdr *Msghdr) SetIovlen(length int) { 31 | msghdr.Iovlen = int32(length) 32 | } 33 | 34 | func (cmsg *Cmsghdr) SetLen(length int) { 35 | cmsg.Len = uint32(length) 36 | } 37 | 38 | func Fstat(fd int, stat *Stat_t) error { 39 | return fstat(fd, stat) 40 | } 41 | 42 | func Fstatat(dirfd int, path string, stat *Stat_t, flags int) error { 43 | return fstatat(dirfd, path, stat, flags) 44 | } 45 | 46 | func Lstat(path string, stat *Stat_t) error { 47 | return lstat(path, stat) 48 | } 49 | 50 | func Stat(path string, statptr *Stat_t) error { 51 | return stat(path, statptr) 52 | } 53 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && darwin 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func setTimespec(sec, nsec int64) Timespec { 12 | return Timespec{Sec: sec, Nsec: nsec} 13 | } 14 | 15 | func setTimeval(sec, usec int64) Timeval { 16 | return Timeval{Sec: sec, Usec: int32(usec)} 17 | } 18 | 19 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 20 | k.Ident = uint64(fd) 21 | k.Filter = int16(mode) 22 | k.Flags = uint16(flags) 23 | } 24 | 25 | func (iov *Iovec) SetLen(length int) { 26 | iov.Len = uint64(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetControllen(length int) { 30 | msghdr.Controllen = uint32(length) 31 | } 32 | 33 | func (msghdr *Msghdr) SetIovlen(length int) { 34 | msghdr.Iovlen = int32(length) 35 | } 36 | 37 | func (cmsg *Cmsghdr) SetLen(length int) { 38 | cmsg.Len = uint32(length) 39 | } 40 | 41 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) // sic 42 | 43 | //sys Fstat(fd int, stat *Stat_t) (err error) 44 | //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) 45 | //sys Fstatfs(fd int, stat *Statfs_t) (err error) 46 | //sys getfsstat(buf unsafe.Pointer, size uintptr, flags int) (n int, err error) = SYS_GETFSSTAT 47 | //sys Lstat(path string, stat *Stat_t) (err error) 48 | //sys ptrace1(request int, pid int, addr uintptr, data uintptr) (err error) = SYS_ptrace 49 | //sys Stat(path string, stat *Stat_t) (err error) 50 | //sys Statfs(path string, stat *Statfs_t) (err error) 51 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_darwin_libSystem.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build darwin 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 | func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 19 | 20 | //go:linkname syscall_syscall syscall.syscall 21 | //go:linkname syscall_syscall6 syscall.syscall6 22 | //go:linkname syscall_syscall6X syscall.syscall6X 23 | //go:linkname syscall_syscall9 syscall.syscall9 24 | //go:linkname syscall_rawSyscall syscall.rawSyscall 25 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 26 | //go:linkname syscall_syscallPtr syscall.syscallPtr 27 | -------------------------------------------------------------------------------- /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 | //go: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 (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 45 | var writtenOut uint64 = 0 46 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 47 | 48 | written = int(writtenOut) 49 | 50 | if e1 != 0 { 51 | err = e1 52 | } 53 | return 54 | } 55 | 56 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 57 | -------------------------------------------------------------------------------- /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 | //go: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 (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint32(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr((*offset)>>32), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /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 | //go: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 (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && 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 (msghdr *Msghdr) SetIovlen(length int) { 37 | msghdr.Iovlen = int32(length) 38 | } 39 | 40 | func (cmsg *Cmsghdr) SetLen(length int) { 41 | cmsg.Len = uint32(length) 42 | } 43 | 44 | func (d *PtraceIoDesc) SetLen(length int) { 45 | d.Len = uint64(length) 46 | } 47 | 48 | func sendfile(outfd int, infd int, offset *int64, count int) (written int, err error) { 49 | var writtenOut uint64 = 0 50 | _, _, e1 := Syscall9(SYS_SENDFILE, uintptr(infd), uintptr(outfd), uintptr(*offset), uintptr(count), 0, uintptr(unsafe.Pointer(&writtenOut)), 0, 0, 0) 51 | 52 | written = int(writtenOut) 53 | 54 | if e1 != 0 { 55 | err = e1 56 | } 57 | return 58 | } 59 | 60 | func Syscall9(num, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err syscall.Errno) 61 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build hurd 6 | 7 | package unix 8 | 9 | /* 10 | #include 11 | int ioctl(int, unsigned long int, uintptr_t); 12 | */ 13 | import "C" 14 | import "unsafe" 15 | 16 | func ioctl(fd int, req uint, arg uintptr) (err error) { 17 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(arg)) 18 | if r0 == -1 && er != nil { 19 | err = er 20 | } 21 | return 22 | } 23 | 24 | func ioctlPtr(fd int, req uint, arg unsafe.Pointer) (err error) { 25 | r0, er := C.ioctl(C.int(fd), C.ulong(req), C.uintptr_t(uintptr(arg))) 26 | if r0 == -1 && er != nil { 27 | err = er 28 | } 29 | return 30 | } 31 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_hurd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && hurd 6 | 7 | package unix 8 | 9 | const ( 10 | TIOCGETA = 0x62251713 11 | ) 12 | 13 | type Winsize struct { 14 | Row uint16 15 | Col uint16 16 | Xpixel uint16 17 | Ypixel uint16 18 | } 19 | 20 | type Termios struct { 21 | Iflag uint32 22 | Oflag uint32 23 | Cflag uint32 24 | Lflag uint32 25 | Cc [20]uint8 26 | Ispeed int32 27 | Ospeed int32 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_alarm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64) 6 | 7 | package unix 8 | 9 | // SYS_ALARM is not defined on arm or riscv, but is available for other GOARCH 10 | // values. 11 | 12 | //sys Alarm(seconds uint) (remaining uint, err error) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && linux && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | //go:noescape 12 | func gettimeofday(tv *Timeval) (err syscall.Errno) 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gc 6 | 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 | //go:build linux && gc && 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_gc_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && gc && linux 6 | 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 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_linux_gccgo_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && gccgo && 386 6 | 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 | //go: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 | //go: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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && netbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2013 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && netbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_netbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && netbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = int32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_386.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build 386 && openbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/386 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && openbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2017 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm && openbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/arm the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build arm64 && openbsd 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/amd64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2022 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build openbsd 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | // Implemented in the runtime package (runtime/sys_openbsd3.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_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10 uintptr) (r1, r2 uintptr, err Errno) 15 | func syscall_rawSyscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err Errno) 16 | func syscall_rawSyscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) 17 | 18 | //go:linkname syscall_syscall syscall.syscall 19 | //go:linkname syscall_syscall6 syscall.syscall6 20 | //go:linkname syscall_syscall10 syscall.syscall10 21 | //go:linkname syscall_rawSyscall syscall.rawSyscall 22 | //go:linkname syscall_rawSyscall6 syscall.rawSyscall6 23 | 24 | func syscall_syscall9(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9 uintptr) (r1, r2 uintptr, err Errno) { 25 | return syscall_syscall10(fn, a1, a2, a3, a4, a5, a6, a7, a8, a9, 0) 26 | } 27 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_mips64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | func setTimespec(sec, nsec int64) Timespec { 8 | return Timespec{Sec: sec, Nsec: nsec} 9 | } 10 | 11 | func setTimeval(sec, usec int64) Timeval { 12 | return Timeval{Sec: sec, Usec: usec} 13 | } 14 | 15 | func SetKevent(k *Kevent_t, fd, mode, flags int) { 16 | k.Ident = uint64(fd) 17 | k.Filter = int16(mode) 18 | k.Flags = uint16(flags) 19 | } 20 | 21 | func (iov *Iovec) SetLen(length int) { 22 | iov.Len = uint64(length) 23 | } 24 | 25 | func (msghdr *Msghdr) SetControllen(length int) { 26 | msghdr.Controllen = uint32(length) 27 | } 28 | 29 | func (msghdr *Msghdr) SetIovlen(length int) { 30 | msghdr.Iovlen = uint32(length) 31 | } 32 | 33 | func (cmsg *Cmsghdr) SetLen(length int) { 34 | cmsg.Len = uint32(length) 35 | } 36 | 37 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 38 | // of OpenBSD the syscall is called sysctl instead of __sysctl. 39 | const SYS___SYSCTL = SYS_SYSCTL 40 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_ppc64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build ppc64 && 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/ppc64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_openbsd_riscv64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build riscv64 && 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 (msghdr *Msghdr) SetIovlen(length int) { 32 | msghdr.Iovlen = uint32(length) 33 | } 34 | 35 | func (cmsg *Cmsghdr) SetLen(length int) { 36 | cmsg.Len = uint32(length) 37 | } 38 | 39 | // SYS___SYSCTL is used by syscall_bsd.go for all BSDs, but in modern versions 40 | // of openbsd/riscv64 the syscall is called sysctl instead of __sysctl. 41 | const SYS___SYSCTL = SYS_SYSCTL 42 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_solaris_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build amd64 && solaris 6 | 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 (msghdr *Msghdr) SetIovlen(length int) { 22 | msghdr.Iovlen = int32(length) 23 | } 24 | 25 | func (cmsg *Cmsghdr) SetLen(length int) { 26 | cmsg.Len = uint32(length) 27 | } 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc.go: -------------------------------------------------------------------------------- 1 | // Copyright 2016 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 12 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 13 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) 14 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) 15 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/syscall_unix_gc_ppc64x.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && (ppc64le || ppc64) && gc 6 | 7 | package unix 8 | 9 | import "syscall" 10 | 11 | func Syscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 12 | return syscall.Syscall(trap, a1, a2, a3) 13 | } 14 | func Syscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 15 | return syscall.Syscall6(trap, a1, a2, a3, a4, a5, a6) 16 | } 17 | func RawSyscall(trap, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) { 18 | return syscall.RawSyscall(trap, a1, a2, a3) 19 | } 20 | func RawSyscall6(trap, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) { 21 | return syscall.RawSyscall6(trap, a1, a2, a3, a4, a5, a6) 22 | } 23 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux 6 | 7 | package unix 8 | 9 | import "runtime" 10 | 11 | // SysvShmCtl performs control operations on the shared memory segment 12 | // specified by id. 13 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 14 | if runtime.GOARCH == "arm" || 15 | runtime.GOARCH == "mips64" || runtime.GOARCH == "mips64le" { 16 | cmd |= ipc_64 17 | } 18 | 19 | return shmctl(id, cmd, desc) 20 | } 21 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || linux || zos 6 | 7 | package unix 8 | 9 | import "unsafe" 10 | 11 | // SysvShmAttach attaches the Sysv shared memory segment associated with the 12 | // shared memory identifier id. 13 | func SysvShmAttach(id int, addr uintptr, flag int) ([]byte, error) { 14 | addr, errno := shmat(id, addr, flag) 15 | if errno != nil { 16 | return nil, errno 17 | } 18 | 19 | // Retrieve the size of the shared memory to enable slice creation 20 | var info SysvShmDesc 21 | 22 | _, err := SysvShmCtl(id, IPC_STAT, &info) 23 | if err != nil { 24 | // release the shared memory if we can't find the size 25 | 26 | // ignoring error from shmdt as there's nothing sensible to return here 27 | shmdt(addr) 28 | return nil, err 29 | } 30 | 31 | // Use unsafe to convert addr into a []byte. 32 | b := unsafe.Slice((*byte)(unsafe.Pointer(addr)), int(info.Segsz)) 33 | return b, nil 34 | } 35 | 36 | // SysvShmDetach unmaps the shared memory slice returned from SysvShmAttach. 37 | // 38 | // It is not safe to use the slice after calling this function. 39 | func SysvShmDetach(data []byte) error { 40 | if len(data) == 0 { 41 | return EINVAL 42 | } 43 | 44 | return shmdt(uintptr(unsafe.Pointer(&data[0]))) 45 | } 46 | 47 | // SysvShmGet returns the Sysv shared memory identifier associated with key. 48 | // If the IPC_CREAT flag is specified a new segment is created. 49 | func SysvShmGet(key, size, flag int) (id int, err error) { 50 | return shmget(key, size, flag) 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/sysvshm_unix_other.go: -------------------------------------------------------------------------------- 1 | // Copyright 2021 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build (darwin && !ios) || zos 6 | 7 | package unix 8 | 9 | // SysvShmCtl performs control operations on the shared memory segment 10 | // specified by id. 11 | func SysvShmCtl(id, cmd int, desc *SysvShmDesc) (result int, err error) { 12 | return shmctl(id, cmd, desc) 13 | } 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/unveil_openbsd.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package unix 6 | 7 | import "fmt" 8 | 9 | // Unveil implements the unveil syscall. 10 | // For more information see unveil(2). 11 | // Note that the special case of blocking further 12 | // unveil calls is handled by UnveilBlock. 13 | func Unveil(path string, flags string) error { 14 | if err := supportsUnveil(); err != nil { 15 | return err 16 | } 17 | pathPtr, err := BytePtrFromString(path) 18 | if err != nil { 19 | return err 20 | } 21 | flagsPtr, err := BytePtrFromString(flags) 22 | if err != nil { 23 | return err 24 | } 25 | return unveil(pathPtr, flagsPtr) 26 | } 27 | 28 | // UnveilBlock blocks future unveil calls. 29 | // For more information see unveil(2). 30 | func UnveilBlock() error { 31 | if err := supportsUnveil(); err != nil { 32 | return err 33 | } 34 | return unveil(nil, nil) 35 | } 36 | 37 | // supportsUnveil checks for availability of the unveil(2) system call based 38 | // on the running OpenBSD version. 39 | func supportsUnveil() error { 40 | maj, min, err := majmin() 41 | if err != nil { 42 | return err 43 | } 44 | 45 | // unveil is not available before 6.4 46 | if maj < 6 || (maj == 6 && min <= 3) { 47 | return fmt.Errorf("cannot call Unveil on OpenBSD %d.%d", maj, min) 48 | } 49 | 50 | return nil 51 | } 52 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_linux.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build linux && go1.24 6 | 7 | package unix 8 | 9 | import _ "unsafe" 10 | 11 | //go:linkname vgetrandom runtime.vgetrandom 12 | //go:noescape 13 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) 14 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/vgetrandom_unsupported.go: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build !linux || !go1.24 6 | 7 | package unix 8 | 9 | func vgetrandom(p []byte, flags uint32) (ret int, supported bool) { 10 | return -1, false 11 | } 12 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_armnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT. 2 | 3 | //go:build linux && (arm || arm64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsArm is the registers used by arm binaries. 10 | type PtraceRegsArm struct { 11 | Uregs [18]uint32 12 | } 13 | 14 | // PtraceGetRegsArm fetches the registers used by arm binaries. 15 | func PtraceGetRegsArm(pid int, regsout *PtraceRegsArm) error { 16 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 17 | } 18 | 19 | // PtraceSetRegsArm sets the registers used by arm binaries. 20 | func PtraceSetRegsArm(pid int, regs *PtraceRegsArm) error { 21 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 22 | } 23 | 24 | // PtraceRegsArm64 is the registers used by arm64 binaries. 25 | type PtraceRegsArm64 struct { 26 | Regs [31]uint64 27 | Sp uint64 28 | Pc uint64 29 | Pstate uint64 30 | } 31 | 32 | // PtraceGetRegsArm64 fetches the registers used by arm64 binaries. 33 | func PtraceGetRegsArm64(pid int, regsout *PtraceRegsArm64) error { 34 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 35 | } 36 | 37 | // PtraceSetRegsArm64 sets the registers used by arm64 binaries. 38 | func PtraceSetRegsArm64(pid int, regs *PtraceRegsArm64) error { 39 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 40 | } 41 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_linux_arm64.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtraceRegSet("arm64"). DO NOT EDIT. 2 | 3 | package unix 4 | 5 | import "unsafe" 6 | 7 | // PtraceGetRegSetArm64 fetches the registers used by arm64 binaries. 8 | func PtraceGetRegSetArm64(pid, addr int, regsout *PtraceRegsArm64) error { 9 | iovec := Iovec{(*byte)(unsafe.Pointer(regsout)), uint64(unsafe.Sizeof(*regsout))} 10 | return ptracePtr(PTRACE_GETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 11 | } 12 | 13 | // PtraceSetRegSetArm64 sets the registers used by arm64 binaries. 14 | func PtraceSetRegSetArm64(pid, addr int, regs *PtraceRegsArm64) error { 15 | iovec := Iovec{(*byte)(unsafe.Pointer(regs)), uint64(unsafe.Sizeof(*regs))} 16 | return ptracePtr(PTRACE_SETREGSET, pid, uintptr(addr), unsafe.Pointer(&iovec)) 17 | } 18 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnn_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT. 2 | 3 | //go:build linux && (mips || mips64) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMips is the registers used by mips binaries. 10 | type PtraceRegsMips struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMips fetches the registers used by mips binaries. 21 | func PtraceGetRegsMips(pid int, regsout *PtraceRegsMips) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMips sets the registers used by mips binaries. 26 | func PtraceSetRegsMips(pid int, regs *PtraceRegsMips) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64 is the registers used by mips64 binaries. 31 | type PtraceRegsMips64 struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64 fetches the registers used by mips64 binaries. 42 | func PtraceGetRegsMips64(pid int, regsout *PtraceRegsMips64) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64 sets the registers used by mips64 binaries. 47 | func PtraceSetRegsMips64(pid int, regs *PtraceRegsMips64) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/unix/zptrace_mipsnnle_linux.go: -------------------------------------------------------------------------------- 1 | // Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT. 2 | 3 | //go:build linux && (mipsle || mips64le) 4 | 5 | package unix 6 | 7 | import "unsafe" 8 | 9 | // PtraceRegsMipsle is the registers used by mipsle binaries. 10 | type PtraceRegsMipsle struct { 11 | Regs [32]uint64 12 | Lo uint64 13 | Hi uint64 14 | Epc uint64 15 | Badvaddr uint64 16 | Status uint64 17 | Cause uint64 18 | } 19 | 20 | // PtraceGetRegsMipsle fetches the registers used by mipsle binaries. 21 | func PtraceGetRegsMipsle(pid int, regsout *PtraceRegsMipsle) error { 22 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 23 | } 24 | 25 | // PtraceSetRegsMipsle sets the registers used by mipsle binaries. 26 | func PtraceSetRegsMipsle(pid int, regs *PtraceRegsMipsle) error { 27 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 28 | } 29 | 30 | // PtraceRegsMips64le is the registers used by mips64le binaries. 31 | type PtraceRegsMips64le struct { 32 | Regs [32]uint64 33 | Lo uint64 34 | Hi uint64 35 | Epc uint64 36 | Badvaddr uint64 37 | Status uint64 38 | Cause uint64 39 | } 40 | 41 | // PtraceGetRegsMips64le fetches the registers used by mips64le binaries. 42 | func PtraceGetRegsMips64le(pid int, regsout *PtraceRegsMips64le) error { 43 | return ptracePtr(PTRACE_GETREGS, pid, 0, unsafe.Pointer(regsout)) 44 | } 45 | 46 | // PtraceSetRegsMips64le sets the registers used by mips64le binaries. 47 | func PtraceSetRegsMips64le(pid int, regs *PtraceRegsMips64le) error { 48 | return ptracePtr(PTRACE_SETREGS, pid, 0, unsafe.Pointer(regs)) 49 | } 50 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/aliases.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 7 | package windows 8 | 9 | import "syscall" 10 | 11 | type Errno = syscall.Errno 12 | type SysProcAttr = syscall.SysProcAttr 13 | -------------------------------------------------------------------------------- /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 ( 10 | "syscall" 11 | "unsafe" 12 | ) 13 | 14 | func Getenv(key string) (value string, found bool) { 15 | return syscall.Getenv(key) 16 | } 17 | 18 | func Setenv(key, value string) error { 19 | return syscall.Setenv(key, value) 20 | } 21 | 22 | func Clearenv() { 23 | syscall.Clearenv() 24 | } 25 | 26 | func Environ() []string { 27 | return syscall.Environ() 28 | } 29 | 30 | // Returns a default environment associated with the token, rather than the current 31 | // process. If inheritExisting is true, then this environment also inherits the 32 | // environment of the current process. 33 | func (token Token) Environ(inheritExisting bool) (env []string, err error) { 34 | var block *uint16 35 | err = CreateEnvironmentBlock(&block, token, inheritExisting) 36 | if err != nil { 37 | return nil, err 38 | } 39 | defer DestroyEnvironmentBlock(block) 40 | size := unsafe.Sizeof(*block) 41 | for *block != 0 { 42 | // find NUL terminator 43 | end := unsafe.Pointer(block) 44 | for *(*uint16)(end) != 0 { 45 | end = unsafe.Add(end, size) 46 | } 47 | 48 | entry := unsafe.Slice(block, (uintptr(end)-uintptr(unsafe.Pointer(block)))/size) 49 | env = append(env, UTF16ToString(entry)) 50 | block = (*uint16)(unsafe.Add(end, size)) 51 | } 52 | return env, nil 53 | } 54 | 55 | func Unsetenv(key string) error { 56 | return syscall.Unsetenv(key) 57 | } 58 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/eventlog.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows 6 | 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 = 0x00000001 20 | PAGE_READONLY = 0x00000002 21 | PAGE_READWRITE = 0x00000004 22 | PAGE_WRITECOPY = 0x00000008 23 | PAGE_EXECUTE = 0x00000010 24 | PAGE_EXECUTE_READ = 0x00000020 25 | PAGE_EXECUTE_READWRITE = 0x00000040 26 | PAGE_EXECUTE_WRITECOPY = 0x00000080 27 | PAGE_GUARD = 0x00000100 28 | PAGE_NOCACHE = 0x00000200 29 | PAGE_WRITECOMBINE = 0x00000400 30 | PAGE_TARGETS_INVALID = 0x40000000 31 | PAGE_TARGETS_NO_UPDATE = 0x40000000 32 | 33 | QUOTA_LIMITS_HARDWS_MIN_DISABLE = 0x00000002 34 | QUOTA_LIMITS_HARDWS_MIN_ENABLE = 0x00000001 35 | QUOTA_LIMITS_HARDWS_MAX_DISABLE = 0x00000008 36 | QUOTA_LIMITS_HARDWS_MAX_ENABLE = 0x00000004 37 | ) 38 | 39 | type MemoryBasicInformation struct { 40 | BaseAddress uintptr 41 | AllocationBase uintptr 42 | AllocationProtect uint32 43 | PartitionId uint16 44 | RegionSize uintptr 45 | State uint32 46 | Protect uint32 47 | Type uint32 48 | } 49 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mkknownfolderids.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright 2019 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 | set -e 8 | shopt -s nullglob 9 | 10 | knownfolders="$(printf '%s\n' "/mnt/c/Program Files (x86)/Windows Kits/"/*/Include/*/um/KnownFolders.h | sort -Vr | head -n 1)" 11 | [[ -n $knownfolders ]] || { echo "Unable to find KnownFolders.h" >&2; exit 1; } 12 | 13 | { 14 | echo "// Code generated by 'mkknownfolderids.bash'; DO NOT EDIT." 15 | echo 16 | echo "package windows" 17 | echo "type KNOWNFOLDERID GUID" 18 | echo "var (" 19 | while read -r line; do 20 | [[ $line =~ DEFINE_KNOWN_FOLDER\((FOLDERID_[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+),[\t\ ]*(0x[^,]+)\) ]] || continue 21 | printf "%s = &KNOWNFOLDERID{0x%08x, 0x%04x, 0x%04x, [8]byte{0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x}}\n" \ 22 | "${BASH_REMATCH[1]}" $(( "${BASH_REMATCH[2]}" )) $(( "${BASH_REMATCH[3]}" )) $(( "${BASH_REMATCH[4]}" )) \ 23 | $(( "${BASH_REMATCH[5]}" )) $(( "${BASH_REMATCH[6]}" )) $(( "${BASH_REMATCH[7]}" )) $(( "${BASH_REMATCH[8]}" )) \ 24 | $(( "${BASH_REMATCH[9]}" )) $(( "${BASH_REMATCH[10]}" )) $(( "${BASH_REMATCH[11]}" )) $(( "${BASH_REMATCH[12]}" )) 25 | done < "$knownfolders" 26 | echo ")" 27 | } | gofmt > "zknownfolderids_windows.go" 28 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/mksyscall.go: -------------------------------------------------------------------------------- 1 | // Copyright 2009 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build generate 6 | 7 | package windows 8 | 9 | //go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go eventlog.go service.go syscall_windows.go security_windows.go setupapi_windows.go 10 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/race.go: -------------------------------------------------------------------------------- 1 | // Copyright 2012 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | //go:build windows && race 6 | 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 | //go: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 | //go: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 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_amd64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm.go: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | Description [WSADESCRIPTION_LEN + 1]byte 11 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 12 | MaxSockets uint16 13 | MaxUdpDg uint16 14 | VendorInfo *byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Port uint16 21 | Proto *byte 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | _ uint32 // pad to 8 byte boundary 35 | } 36 | -------------------------------------------------------------------------------- /vendor/golang.org/x/sys/windows/types_windows_arm64.go: -------------------------------------------------------------------------------- 1 | // Copyright 2011 The Go Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style 3 | // license that can be found in the LICENSE file. 4 | 5 | package windows 6 | 7 | type WSAData struct { 8 | Version uint16 9 | HighVersion uint16 10 | MaxSockets uint16 11 | MaxUdpDg uint16 12 | VendorInfo *byte 13 | Description [WSADESCRIPTION_LEN + 1]byte 14 | SystemStatus [WSASYS_STATUS_LEN + 1]byte 15 | } 16 | 17 | type Servent struct { 18 | Name *byte 19 | Aliases **byte 20 | Proto *byte 21 | Port uint16 22 | } 23 | 24 | type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { 25 | PerProcessUserTimeLimit int64 26 | PerJobUserTimeLimit int64 27 | LimitFlags uint32 28 | MinimumWorkingSetSize uintptr 29 | MaximumWorkingSetSize uintptr 30 | ActiveProcessLimit uint32 31 | Affinity uintptr 32 | PriorityClass uint32 33 | SchedulingClass uint32 34 | } 35 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/japanese/all.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 | package japanese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{EUCJP, ISO2022JP, ShiftJIS} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/encoding/simplifiedchinese/all.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 | package simplifiedchinese 6 | 7 | import ( 8 | "golang.org/x/text/encoding" 9 | ) 10 | 11 | // All is a list of all defined encodings in this package. 12 | var All = []encoding.Encoding{GB18030, GBK, HZGB2312} 13 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/common.go: -------------------------------------------------------------------------------- 1 | // Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. 2 | 3 | package language 4 | 5 | // This file contains code common to the maketables.go and the package code. 6 | 7 | // AliasType is the type of an alias in AliasMap. 8 | type AliasType int8 9 | 10 | const ( 11 | Deprecated AliasType = iota 12 | Macro 13 | Legacy 14 | 15 | AliasTypeUnknown AliasType = -1 16 | ) 17 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/compact.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 language 6 | 7 | // CompactCoreInfo is a compact integer with the three core tags encoded. 8 | type CompactCoreInfo uint32 9 | 10 | // GetCompactCore generates a uint32 value that is guaranteed to be unique for 11 | // different language, region, and script values. 12 | func GetCompactCore(t Tag) (cci CompactCoreInfo, ok bool) { 13 | if t.LangID > langNoIndexOffset { 14 | return 0, false 15 | } 16 | cci |= CompactCoreInfo(t.LangID) << (8 + 12) 17 | cci |= CompactCoreInfo(t.ScriptID) << 12 18 | cci |= CompactCoreInfo(t.RegionID) 19 | return cci, true 20 | } 21 | 22 | // Tag generates a tag from c. 23 | func (c CompactCoreInfo) Tag() Tag { 24 | return Tag{ 25 | LangID: Language(c >> 20), 26 | RegionID: Region(c & 0x3ff), 27 | ScriptID: Script(c>>12) & 0xff, 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/coverage.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 | package language 6 | 7 | // BaseLanguages returns the list of all supported base languages. It generates 8 | // the list by traversing the internal structures. 9 | func BaseLanguages() []Language { 10 | base := make([]Language, 0, NumLanguages) 11 | for i := 0; i < langNoIndexOffset; i++ { 12 | // We included "und" already for the value 0. 13 | if i != nonCanonicalUnd { 14 | base = append(base, Language(i)) 15 | } 16 | } 17 | i := langNoIndexOffset 18 | for _, v := range langNoIndex { 19 | for k := 0; k < 8; k++ { 20 | if v&1 == 1 { 21 | base = append(base, Language(i)) 22 | } 23 | v >>= 1 24 | i++ 25 | } 26 | } 27 | return base 28 | } 29 | -------------------------------------------------------------------------------- /vendor/golang.org/x/text/internal/language/tags.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 | package language 6 | 7 | // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. 8 | // It simplifies safe initialization of Tag values. 9 | func MustParse(s string) Tag { 10 | t, err := Parse(s) 11 | if err != nil { 12 | panic(err) 13 | } 14 | return t 15 | } 16 | 17 | // MustParseBase is like ParseBase, but panics if the given base cannot be parsed. 18 | // It simplifies safe initialization of Base values. 19 | func MustParseBase(s string) Language { 20 | b, err := ParseBase(s) 21 | if err != nil { 22 | panic(err) 23 | } 24 | return b 25 | } 26 | 27 | // MustParseScript is like ParseScript, but panics if the given script cannot be 28 | // parsed. It simplifies safe initialization of Script values. 29 | func MustParseScript(s string) Script { 30 | scr, err := ParseScript(s) 31 | if err != nil { 32 | panic(err) 33 | } 34 | return scr 35 | } 36 | 37 | // MustParseRegion is like ParseRegion, but panics if the given region cannot be 38 | // parsed. It simplifies safe initialization of Region values. 39 | func MustParseRegion(s string) Region { 40 | r, err := ParseRegion(s) 41 | if err != nil { 42 | panic(err) 43 | } 44 | return r 45 | } 46 | 47 | // Und is the root language. 48 | var Und Tag 49 | -------------------------------------------------------------------------------- /vendor/howett.net/plist/.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | *.wasm 8 | 9 | # Test binary, built with `go test -c` 10 | *.test 11 | 12 | # Output of the go coverage tool, specifically when used with LiteIDE 13 | *.out 14 | 15 | # Dependency directories (remove the comment below to include it) 16 | # vendor/ 17 | -------------------------------------------------------------------------------- /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/main/coverage.svg)](https://gitlab.howett.net/go/plist/commits/main) 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/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) Map(ch rune) rune { 6 | if s.Contains(ch) { 7 | return ch 8 | } else { 9 | return -1 10 | } 11 | } 12 | 13 | func (s *characterSet) Contains(ch rune) bool { 14 | return ch >= 0 && ch <= 255 && s.ContainsByte(byte(ch)) 15 | } 16 | 17 | func (s *characterSet) ContainsByte(ch byte) bool { 18 | return (s[ch/64]&(1<<(ch%64)) > 0) 19 | } 20 | 21 | // Bitmap of characters that must be inside a quoted string 22 | // when written to an old-style property list 23 | // Low bits represent lower characters, and each uint64 represents 64 characters. 24 | var gsQuotable = characterSet{ 25 | 0x78001385ffffffff, 26 | 0xa800000138000000, 27 | 0xffffffffffffffff, 28 | 0xffffffffffffffff, 29 | } 30 | 31 | // 7f instead of 3f in the top line: CFOldStylePlist.c says . is valid, but they quote it. 32 | // ef instead og 6f in the top line: ' will be quoted 33 | var osQuotable = characterSet{ 34 | 0xf4007fefffffffff, 35 | 0xf8000001f8000001, 36 | 0xffffffffffffffff, 37 | 0xffffffffffffffff, 38 | } 39 | 40 | var whitespace = characterSet{ 41 | 0x0000000100003f00, 42 | 0x0000000000000000, 43 | 0x0000000000000000, 44 | 0x0000000000000000, 45 | } 46 | 47 | var newlineCharacterSet = characterSet{ 48 | 0x0000000000002400, 49 | 0x0000000000000000, 50 | 0x0000000000000000, 51 | 0x0000000000000000, 52 | } 53 | 54 | // Bitmap of characters that are valid in base64-encoded strings. 55 | // Used to filter out non-b64 characters to emulate NSDataBase64DecodingIgnoreUnknownCharacters 56 | var base64ValidChars = characterSet{ 57 | 0x23ff880000000000, 58 | 0x07fffffe07fffffe, 59 | 0x0000000000000000, 60 | 0x0000000000000000, 61 | } 62 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /wallutils.go: -------------------------------------------------------------------------------- 1 | // Package wallutils can deal with monitors, resolution, dpi, wallpapers, wallpaper collections, timed wallpapers and converting GNOME timed wallpapers to the Simple Timed Wallpaper format. 2 | package wallutils 3 | 4 | // VersionString is the current version of wallutils and all included utilities 5 | const VersionString = "5.12.7" 6 | -------------------------------------------------------------------------------- /wayinfo_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "testing" 7 | ) 8 | 9 | func TestWaylandMonitors(t *testing.T) { 10 | if !WaylandCanConnect() { 11 | log.Println("Could not connect over Wayland, skipping test") 12 | return 13 | } 14 | 15 | info, err := WaylandInfo() 16 | if err != nil { 17 | t.Error(err) 18 | } 19 | fmt.Println(info) 20 | IDs, widths, heights, wDPIs, hDPIs := []uint{}, []uint{}, []uint{}, []uint{}, []uint{} 21 | err = WaylandMonitors(&IDs, &widths, &heights, &wDPIs, &hDPIs) 22 | if err != nil { 23 | t.Error(err) 24 | } 25 | if len(IDs) == 0 { 26 | t.Fatal("No monitors?") 27 | } 28 | for i, ID := range IDs { 29 | fmt.Printf("monitor %d: %dx%d (DPI: %dx%d)\n", ID, widths[i], heights[i], wDPIs[i], hDPIs[i]) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /xinfo_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "fmt" 5 | "log" 6 | "testing" 7 | ) 8 | 9 | func TestXMonitors(t *testing.T) { 10 | if !XCanConnect() { 11 | log.Println("Could not connect over X, skipping test") 12 | return 13 | } 14 | info, err := XInfo() 15 | if err != nil { 16 | t.Error(err) 17 | } 18 | fmt.Println(info) 19 | IDs, widths, heights, wDPIs, hDPIs := []uint{}, []uint{}, []uint{}, []uint{}, []uint{} 20 | err = XMonitors(&IDs, &widths, &heights, &wDPIs, &hDPIs) 21 | if err != nil { 22 | t.Error(err) 23 | } 24 | for i, ID := range IDs { 25 | fmt.Printf("monitor %d: %dx%d (DPI: %dx%d)\n", ID, widths[i], heights[i], wDPIs[i], hDPIs[i]) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /xrandr_test.go: -------------------------------------------------------------------------------- 1 | package wallutils 2 | 3 | import ( 4 | "testing" 5 | ) 6 | 7 | func TestXrandrOverlap(_ *testing.T) { 8 | NoXRandrOverlapOrExit(true) 9 | } 10 | --------------------------------------------------------------------------------