├── .cvsignore ├── .github └── workflows │ └── build.yml ├── .gitignore ├── COPYING ├── ChangeLog.txt ├── INSTALL.txt ├── LICENSE ├── Makefile.in ├── README.md ├── buildinfo.pl ├── docs ├── .gitignore ├── default.keysyms ├── libssh2_license.txt ├── libstm_license.txt ├── rsh_colors256.png ├── rsh_login.png ├── rsh_mc.png ├── rsh_version.png ├── rxvt.keysyms ├── sgrtab.sh ├── ssh_colors256.png ├── ssh_mc.png ├── ssh_version.png ├── winrsh_license.txt ├── winssh_license.txt ├── winssh_usage.txt ├── xterm-colortest.pl └── xterm_color_chart.py ├── libNTService ├── .cvsignore ├── .gitignore ├── MSG00001.bin ├── Makefile.in ├── NTServMsg.h ├── NTServMsg.mc ├── NTServMsg.rc ├── NTService.cpp ├── NTService.h ├── NTServiceConfig.cpp ├── NTServiceConfig.h ├── NTServiceControl.cpp ├── NTServiceControl.h ├── NTServiceGetopt.h ├── NTServiceIIO.h ├── NTServiceIO.h ├── NTServiceReg.cpp ├── NTServiceReg.h ├── NTString.h └── build_NTServMsg.bat ├── libmbedtls ├── .cvsignore ├── .gitignore ├── Makefile.in ├── Makefile.in.2.27.0 ├── mbedtls-2.27.0.gr.tgz ├── mbedtls-2.27.0.tgz ├── mbedtls-3.6.2.gr.tgz ├── owc │ ├── IntSafe.h │ ├── WSPiApi.h │ ├── aesni_3.6.2.obj │ └── aesni_3_6_2.asm ├── readme_2_27_0.txt ├── readme_3_6_2.txt └── win32 │ ├── alignment_linkage.c │ ├── crypto_globals.c │ ├── crypto_globals.h │ ├── libmbedcrypto.def │ ├── libmbedcrypto.def.3.6.2 │ ├── libmbedtls.def │ ├── libmbedtls.def.3.6.2 │ ├── libmbedtls.rc │ ├── libmbedx509.def │ ├── libmbedx509.def.3.6.2 │ ├── x509_globals.c │ └── x509_globals.h ├── librcmd ├── getport.c ├── getport.h ├── pathnames.h ├── rcmd.3 ├── rcmd.c ├── rcmd.h └── rcmd.txt ├── libssh ├── .cvsignore ├── .gitignore ├── Makefile.in ├── compat_strnlen.c ├── config.h ├── libssh-0.9.4.gr.tgz ├── libssh-0.9.4.tar.xz ├── libssh.def ├── libssh.rc ├── readme_0_9_4.txt └── version.h ├── libssh2 ├── .cvsignore ├── .gitignore ├── Makefile.in ├── libssh2-1.10.0.gr.tgz ├── libssh2-1.11.0.gr.tgz ├── libssh2-1.11.1.gr.tgz ├── libssh2-1.9.0.gr.tgz ├── libssh2-1.9.0.tgz ├── libssh2_helper.c ├── libssh2_helper.h ├── readme_1_10_0.txt ├── readme_1_11_1.txt ├── readme_1_9_0.txt └── sdk │ ├── Crypt32.Lib │ ├── bcrypt.h │ └── bcrypt.lib ├── libtermemu ├── .cvsignore ├── .gitignore ├── Makefile.in ├── compat.h ├── compat_inet_ntop.c ├── compat_inet_pton.c ├── compat_stdbool.h ├── compat_stdint.h ├── compat_strtonum.c ├── config.h ├── keysymdb.h ├── libtsm │ ├── external │ │ ├── wcwidth.c │ │ ├── wcwidth.h │ │ ├── xkbcommon-keysyms.h │ │ └── xkbcommon-keysyms.h.2017 │ ├── libtsm-3.tgz │ ├── libtsm.h │ ├── libtsm_int.h │ ├── readme.txt │ ├── shl_array.h │ ├── shl_htable.c │ ├── shl_htable.h │ ├── shl_llog.h │ ├── tsm_screen.c │ ├── tsm_unicode.c │ ├── tsm_vte.c │ └── tsm_vte_charsets.c ├── shl_ring.c ├── shl_ring.h ├── tailqueue.h ├── termemu_cio.c ├── termemu_cio.h ├── termemu_keyexec.c ├── termemu_keymap.c ├── termemu_keymap.h ├── termemu_keysym.c ├── termemu_keysym.h ├── termemu_tsm.c ├── termemu_tsm.h ├── termemu_vio.c ├── termemu_vio.h ├── termemukbtest.c ├── termemumkkeys.c ├── termios.h ├── translation_table.h ├── vk_table.h └── xkb_table.h.notused ├── libtool_win32.pl ├── libw32 ├── .cvsignore ├── .gitignore ├── LICENSE.txt ├── Makefile.in ├── alloca.h ├── dirent.h ├── dlfcn.h ├── edidentifier.h ├── err.h ├── getopt.h ├── grp.h ├── langinfo.h ├── libgen.h ├── libw32.def ├── libw32.h ├── libw32.rc ├── libw32_version.h ├── msvc │ ├── inttypes.h │ ├── readme.txt │ ├── stdbool.h │ ├── stdint.h │ └── utime.h ├── msvc_2019 │ └── utime.h ├── msvc_errno.h ├── msvc_system_error.hpp ├── msvcversions.h ├── netdb.h ├── netinet │ ├── in.h │ └── tcp.h ├── notice.txt ├── package.h.in ├── poll.h ├── pwd.h ├── semaphore.h ├── sys │ ├── cdefs.h │ ├── endian.h │ ├── fd_set.h │ ├── file.h │ ├── ioctl.h │ ├── mman.h │ ├── mount.h │ ├── pack0.h │ ├── pack1.h │ ├── param.h │ ├── poll.h │ ├── queue.h │ ├── resource.h │ ├── rwlock.h │ ├── select.h │ ├── socket.h │ ├── statfs.h │ ├── statvfs.h │ ├── time.h │ ├── uio.h │ ├── utsname.h │ ├── utypes.h │ ├── vfs.h │ └── wait.h ├── sysexits.h ├── tailqueue.h ├── tzfile.h ├── unistd.h ├── updateyear.pl ├── w32_access.c ├── w32_check.c ├── w32_child.c ├── w32_chmod.c ├── w32_chown.c ├── w32_close.c ├── w32_colors256.h ├── w32_dir.c ├── w32_dirent.c ├── w32_direntunc.c ├── w32_dlfcn.c ├── w32_domainname.c ├── w32_err.c ├── w32_errno.c ├── w32_fallocate.c ├── w32_fcntl.c ├── w32_flock.c ├── w32_fsync.c ├── w32_getcwd.c ├── w32_getcwdd.c ├── w32_gethostname.c ├── w32_getlocale.c ├── w32_getopt.c ├── w32_getopt_long.c ├── w32_getopt_vars.c ├── w32_getrlimit.c ├── w32_getrusage.c ├── w32_getsubopt.c ├── w32_gistrerror.c ├── w32_grp.c ├── w32_iconv.c ├── w32_iconv_native.c ├── w32_ino.c ├── w32_io.c ├── w32_itimer.c ├── w32_langinfo.c ├── w32_link.c ├── w32_mknod.c ├── w32_mkstemp.c ├── w32_mmap.c ├── w32_neterr.c ├── w32_pipe.c ├── w32_poll.c ├── w32_popen.c ├── w32_proctitle.c ├── w32_progname.c ├── w32_pwd.c ├── w32_read.c ├── w32_readv.c ├── w32_realpath.c ├── w32_rename.c ├── w32_reparse.c ├── w32_rwlock.c ├── w32_select.c ├── w32_setrlimit.c ├── w32_shell.c ├── w32_signal.c ├── w32_sockbase.c ├── w32_socket.c ├── w32_socket2.c ├── w32_sockfd.c ├── w32_sockpair.c ├── w32_statfs.c ├── w32_strftime.c ├── w32_string.c ├── w32_strlcat.c ├── w32_strlcpy.c ├── w32_strsep.c ├── w32_strtoll.c ├── w32_strtoull.c ├── w32_sysdir.c ├── w32_time.c ├── w32_timegm.c ├── w32_truncate.c ├── w32_uname.c ├── w32_unlink.c ├── w32_user.c ├── w32_util.c ├── w32_wdirent.c ├── w32_write.c ├── w32_writev.c ├── w32config.hin ├── win32_cdef.h ├── win32_child.h ├── win32_direct.h ├── win32_errno.h ├── win32_iconv.h ├── win32_include.h ├── win32_internal.h ├── win32_io.h ├── win32_ioctl.h ├── win32_misc.h └── win32_time.h ├── libz ├── .cvsignore ├── .gitignore ├── Makefile.in ├── README.txt ├── makelib.def ├── zlib-1.2.11.tgz ├── zlib-1.2.13.tgz └── zlib-1.3.tgz ├── makeconfig.in ├── makeconfig.pm ├── makelib.in ├── makelib.pl ├── msvc2015 ├── .cvsignore ├── .gitignore ├── kbtest │ ├── .cvsignore │ ├── kbtest.keymap │ ├── kbtest.vcxproj │ └── kbtest.vcxproj.filters ├── libw32 │ ├── .cvsignore │ ├── libw32.vcxproj │ └── libw32.vcxproj.filters ├── mkkeys │ ├── .cvsignore │ ├── mkkeys.vcxproj │ └── mkkeys.vcxproj.filters ├── rcmd │ ├── rcmd.vcxproj │ └── rcmd.vcxproj.filters ├── rlogin │ ├── .cvsignore │ ├── rlogin.vcxproj │ └── rlogin.vcxproj.filters ├── rlogind │ ├── .cvsignore │ ├── .gitignore │ ├── rlogind.vcxproj │ └── rlogind.vcxproj.filters ├── slogin │ ├── .cvsignore │ ├── slogin.vcxproj │ └── slogin.vcxproj.filters └── slogind │ ├── .cvsignore │ ├── slogind.vcxproj │ └── slogind.vcxproj.filters ├── rcmd ├── .cvsignore ├── .gitignore ├── Makefile.in ├── rcmd.1 ├── rcmd.rc └── rcmd_man.txt ├── releases ├── .gitignore ├── modpath.iss └── xsh-inno-setup.iss ├── rlogin ├── .cvsignore ├── .gitignore ├── Makefile.in ├── config.h ├── rlogin.1 ├── rlogin.c ├── rlogin.rc └── rlogin_man.txt ├── rlogind ├── .cvsignore ├── .gitignore ├── .rhosts ├── ConPty.cpp ├── ConPty.h ├── Logger.cpp ├── Logger.h ├── Makefile.in ├── Service.cpp ├── Service.h ├── Service.rc ├── Session.cpp ├── Session.h ├── SimpleIni │ ├── LICENCE.txt │ ├── SOURCE.txt │ └── SimpleIni.h ├── SyslogDiagnosticsIO.h ├── W32Poll.cpp ├── W32Poll.h ├── config.h ├── heapcheck.c ├── heapcheck.h ├── rlogind.8 ├── rlogind.cpp ├── rlogind.h ├── rlogind.ini ├── syslog.c ├── syslog.h ├── test │ └── logger_arguments.cpp ├── vis.c ├── vis.h ├── w32support.h └── winsize.h ├── rsh ├── .cvsignore ├── .gitignore ├── Makefile.in ├── rsh.1 ├── rsh.c ├── rsh.rc └── rsh_man.txt ├── rshd ├── rshd.8 └── rshd.c ├── slogin ├── .cvsignore ├── .gitignore ├── Makefile.in ├── config.h ├── console.c ├── console.h ├── options.c ├── options.h ├── options_test.c ├── slogin.c ├── slogin.rc ├── ssh_man.txt └── sshconfig_man.txt ├── slogind └── slogind.cpp └── support ├── .gitignore ├── busybox.exe ├── config_windows.pl ├── gmake-42.exe ├── mkdir_p.pl ├── owc20config.bat ├── owcconfig.bat ├── updateyear.pl ├── vc2013config.bat ├── vc2015config.bat ├── vc2019config.bat ├── vc2019x64config.bat └── vc2022x64config.bat /.cvsignore: -------------------------------------------------------------------------------- 1 | .makelib 2 | include 3 | patch 4 | ref 5 | bin 6 | bin.* 7 | lib.* 8 | obj.* 9 | Makefile 10 | buildinfo.h 11 | BUILDNUMBER 12 | owcsetup.dbg 13 | .created 14 | mc.aps 15 | .git 16 | .#* 17 | *.00* 18 | *.o 19 | *.obj 20 | *.a 21 | *.lo 22 | *.la 23 | *~ 24 | *.err 25 | *.mbr 26 | *.log 27 | *.old 28 | *.sav 29 | *.bak 30 | *.orig 31 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | on: [push] 3 | jobs: 4 | build: 5 | name: ${{ matrix.config.name }} 6 | runs-on: ${{ matrix.config.os }} 7 | strategy: 8 | fail-fast: false 9 | matrix: 10 | config: 11 | - { 12 | name: "Windows Latest MSVC", 13 | os: windows-latest, 14 | toolchain: vc2022, 15 | toolversion: vs170 16 | } 17 | 18 | steps: 19 | 20 | - name: Checkout repository 21 | uses: actions/checkout@v4 22 | 23 | - name: Checkout submodules 24 | run: | 25 | git submodule update --init --recursive 26 | 27 | - name: MSVC setup 28 | uses: ilammy/msvc-dev-cmd@v1 29 | if: startsWith(matrix.config.name, 'Windows Latest MSVC') 30 | with: 31 | arch: x86 32 | 33 | - name: Generate 34 | shell: cmd 35 | run: | 36 | @set BUSYBOX=./support/busybox 37 | @set PERL=c:/Strawberry/perl/bin/perl 38 | c:/Strawberry/perl/bin/perl makelib.pl --perlpath=c:/Strawberry/perl/bin --busybox=%BUSYBOX% --verbose "${{ matrix.config.toolchain }}" 39 | 40 | - name: Compile 41 | if: startsWith(matrix.config.name, 'Windows Latest') 42 | shell: cmd 43 | run: | 44 | @set PERL=c:/Strawberry/perl/bin/perl 45 | .\support\gmake-42 release build 46 | 47 | - name: Installer 48 | if: startsWith(matrix.config.name, 'Windows Latest MSVC') || startsWith(matrix.config.name, 'Windows Latest OWC') 49 | shell: cmd 50 | run: | 51 | @set PERL=c:/Strawberry/perl/bin/perl 52 | choco install innosetup --version=5.6.1 --force 53 | @rem .\support\gmake-42 release package 54 | "%programfiles(x86)%\Inno Setup 5\ISCC" -DBUILD_INFO=1 -DBUILD_TYPE=release ".\releases\xsh-inno-setup.iss" 55 | 56 | - name: Upload artifacts 57 | uses: actions/upload-artifact@v4 58 | with: 59 | name: xsh-package 60 | path: ./releases/xsh-build*-setup.exe 61 | 62 | - name: Release artifacts 63 | if: startsWith(matrix.config.name, 'Windows Latest MSVC') || startsWith(matrix.config.name, 'Windows Latest OWC') 64 | uses: softprops/action-gh-release@v1 65 | with: 66 | files: ./releases/xsh-build*-setup.exe 67 | draft: true 68 | 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .makelib/ 2 | libtelnet/ 3 | include/ 4 | patch/ 5 | ref/ 6 | old/ 7 | bin 8 | bin.*/ 9 | lib.*/ 10 | obj.*/ 11 | msvc*/ 12 | crash/ 13 | CVS/ 14 | .vscode/ 15 | Makefile 16 | buildinfo.h 17 | BUILDNUMBER 18 | owcsetup.dbg 19 | testaccounts.txt 20 | .created 21 | .#* 22 | wd*.bat 23 | *.00* 24 | *.o 25 | *.obj 26 | *.a 27 | *.lo 28 | *.la 29 | *~ 30 | *.err 31 | *.mbr 32 | *.log 33 | *.old 34 | *.sav 35 | *.bak 36 | *.orig 37 | *.org 38 | *.bat 39 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | WinRSH/WinSSH project. 2 | 3 | Copyright (c) 2015 - 2025, Adam Young. 4 | All rights reserved. 5 | 6 | The applications are free software: you can redistribute it 7 | and/or modify it under the terms of the GNU General Public License as 8 | published by the Free Software Foundation, version 3. 9 | 10 | Redistributions of source code must retain the above copyright 11 | notice, and must be distributed with the license document above. 12 | 13 | Redistributions in binary form must reproduce the above copyright 14 | notice, and must include the license document above in 15 | the documentation and/or other materials provided with the 16 | distribution. 17 | 18 | This project is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | license for more details. 22 | -------------------------------------------------------------------------------- /ChangeLog.txt: -------------------------------------------------------------------------------- 1 | Sun Feb 2 12:43:33 2025 adamy 2 | 3 | * version 0.3.1/build-61 4 | 5 | * submodule updates 6 | 7 | o mbedtls - 3.6.2 8 | o libssh2 - 1.11.1 9 | 10 | Sun Mar 20 18:59:48 2022 adamy 11 | 12 | * version 0.3.0 13 | 14 | * slogin 15 | 16 | o command exec option. 17 | o raw terminal mode. 18 | o aligned pseudo-tty rules. 19 | 20 | * ci: github 21 | 22 | o rcmd/rsh published 23 | o inno package 24 | 25 | Mon Nov 8 20:34:27 2021 adamy 26 | 27 | * submodule updates 28 | 29 | o libssh2 - 1.10.0 30 | o mbedtls - 2.27.0 31 | 32 | Mon Jun 8 20:59:04 2020 adamy 33 | 34 | * ci builds 35 | 36 | Tue May 19 21:12:16 2020 adamy 37 | 38 | * rlogind - beta ConPTY based service. 39 | 40 | WARNING: Limited login validation, pty's shall be created under the service identity. 41 | Hence if running under the default Service account, shall have system rights. 42 | 43 | * rlogin - ctrl-break extension; WinRlogind only. 44 | 45 | Thu Apr 30 23:08:57 2020 adamy 46 | 47 | * BUILD 56; release 48 | 49 | * -E and -v command options; note only effective within local builds. 50 | 51 | * libssh2 1.9.0; + Blowfish. 52 | 53 | Wed Apr 29 14:31:33 2020 adamy 54 | 55 | * BUILD 54; beta 56 | 57 | * initial source release; github 58 | 59 | * mebedtls 2.16.6 60 | 61 | * mcwin32 merge; libw32 / vio upgrades 62 | 63 | * 2020 64 | 65 | Tue Nov 6 20:18:45 2018 adamy 66 | 67 | * BUILD 53 68 | 69 | * mebedtls 1.8.0 libssh2 engine enabled 70 | 71 | Sun Oct 28 22:52:38 2018 adamy 72 | 73 | * version 0.2.2 74 | 75 | * added agent supported; untested. 76 | 77 | * removed non-ascii characters within diagnostics. 78 | 79 | * command line options 80 | 81 | -Q , Query the supported alorgthms. 82 | -c , Ciper specification list, comma seperated. 83 | corrected -l; value was previously ignored. 84 | 85 | * windows 10 console support. 86 | 87 | Mon Mar 20 13:24:23 2017 adamy 88 | 89 | * key-translation support enabled. 90 | 91 | Sun Mar 19 01:05:04 2017 adamy 92 | 93 | * additional command line argument usage errors. 94 | 95 | * save/restore image of start and exit. 96 | 97 | Sat Mar 18 00:10:31 2017 adamy 98 | 99 | * CSI-s/r DECSET partional implementation. 100 | 101 | * additional ctrl/alt key mapped (CTRL-@ etc) 102 | 103 | Fri Mar 17 18:45:02 2017 adamy 104 | 105 | * overstrike, faint and inverse modes enabled. 106 | 107 | * console2 and Windows 10 console detection. 108 | in both cases extended color support is disabled. 109 | In future Windows10 releases, console support should have native true-color support, 110 | at which time functionality cab be reviewed. 111 | 112 | Fri Feb 17 20:02:17 2017 adamy 113 | 114 | * rlogin '-i' logic enforce, 115 | previously stated remote and local user names where always the same. 116 | 117 | * released build 52 118 | 119 | /* 120 | * Local Variables: *** 121 | * mode: changelog *** 122 | * End: *** 123 | */ 124 | 125 | -------------------------------------------------------------------------------- /INSTALL.txt: -------------------------------------------------------------------------------- 1 | 2 | For installation notes relating to specific systems, please skip to the next 3 | section of this document. 4 | 5 | ------- 6 | 7 | On WIN32 using either Visual C/C++ or WATCOM, build by the following these steps: 8 | 9 | a. Install the gnuwin32 tool set or similar. (optional) set the PATH environment 10 | variable to include the win32 sub-directory which contains console versions 11 | of several GNU tools, including gmake. 12 | 13 | Source, http://unxutils.sourceforge.net/ 14 | 15 | Notes: 16 | 17 | o gmake bundled with gnuwin32 is 3.81 wont function correctly as 18 | GNU make 4.0 or greater shall be required to build several packages. 19 | 20 | 21 | b. If you dont have perl available, download and install. 22 | ActivePerl is one of the better options. 23 | 24 | 25 | c. Run the `makelib.pl' perl script by typing: 26 | 27 | o MSVC, 2015+ or greater 28 | 29 | perl makelib.pl [--gnuwin32=] vc[2015|2017|2019] 30 | 31 | 32 | o OpenWatcom 1.9 or 2.0 (beta at your caution). 33 | 34 | perl makelib.pl owc 35 | 36 | 37 | d. Build the entire tree with: 38 | 39 | gmake release|debug 40 | 41 | ------- 42 | 43 | $Id: INSTALL.txt,v 1.4 2020/06/14 00:49:50 cvsuser Exp $ 44 | 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | [![Website](https://img.shields.io/badge/View-Website-blue)](https://sourceforge.net/projects/winssh/) [![Build status](https://ci.appveyor.com/api/projects/status/6fq5on94pp3i87kj?svg=true&passingText=MSVC%20Passing&failingText=MSVC%20Failing&pendingText=MSVC%20Pending)](https://ci.appveyor.com/project/adamyg/winxsh-msvc/) 3 | 4 | # WinRSH/WinSSH project 5 | 6 | Lean Win32 native console clients with a built-in VT220/xterm-color256 terminal emulator. 7 | 8 | * slogin is a Windows console based SSH2 client, using LIBSSH2; with a builtin terminal emulator. 9 | 10 | * rlogin is a RLOGIN(1) client; with a builtin terminal emulator. 11 | 12 | * rsh is a RSH(1) client. 13 | 14 | 15 | Plus a native win32 'rlogind' service. 16 | 17 | * rlogind is a RSH/RLOGIN service utilising ConPTY's 18 | 19 | This service is an investigation into the recently released Window's 10 Pseudo Console (ConPTY) 20 | infrustructure and API, in addition to enhanced console UTF-8 and VT functionality. 21 | 22 | Note: Limited login validation occurs, pty's shall be created under the service identity. 23 | Hence if running under the default Service account, shall have system rights. 24 | 25 | See for [Introducing the windows pseudo console ConPTY](https://devblogs.microsoft.com/commandline/windows-command-line-introducing-the-windows-pseudo-console-conpty) 26 | series of articles detailing recent developments. 27 | 28 | 29 | ### Project Samples 30 | 31 | ![256 color](https://github.com/adamyg/winxsh/blob/master/docs/ssh_colors256.png?raw=true) 32 | 33 | ![Midnight Commander](https://github.com/adamyg/winxsh/blob/master/docs/ssh_mc.png?raw=true) 34 | 35 | 36 | ### Distributions 37 | 38 | Latest builds: 39 | 40 | * https://sourceforge.net/projects/winssh 41 | 42 | * https://sourceforge.net/projects/winrsh 43 | 44 | Source: 45 | 46 | * https://github.com/adamyg/winxsh 47 | 48 | Last Updated: 21/05/2020 49 | 50 | -end- 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | *.pdf 2 | 3 | -------------------------------------------------------------------------------- /docs/default.keysyms: -------------------------------------------------------------------------------- 1 | ! $Id: default.keysyms,v 1.1 2020/04/29 11:54:23 cvsuser Exp $ 2 | ! -*- mode: mk; tabs: 8; indent-width: 8; -*- 3 | ! rlogin/slogin default key translation table, as at 20/03/17 4 | ! 5 | 6 | xterm*VT100.Translations: #override \n\ 7 | ~ShiftosfPageUp: scroll-back(1,lines) \n\ 8 | ~ShiftosfPageDown: scroll-forw(1,lines) \n\ 9 | ~ShiftosfUp: scroll-back(1,page) \n\ 10 | ~ShiftosfDown: scroll-forw(1,page) 11 | 12 | ! ** Translation Table Syntax 13 | ! 14 | ! The Table Syntax follows XLib style translation resource, as utilised by Xterm, 15 | ! allowing existing definitions to shared. 16 | ! 17 | ! The basic syntax for specifying a translation table as a resource is as follows: 18 | ! 19 | ! [object*[subobject...]]*translations: #override \ 20 | ! [modifier]...][detail]: action([arguments]) 21 | ! : 22 | ! 23 | ! A translation table must be a continuous string. In order to link multiple 24 | ! mappings as a continuous string, each event-action line should be terminated by 25 | ! a newline character (\n), which is in turn followed by a backslash (\) to 26 | ! escape the actual newline. 27 | ! 28 | ! Events: 29 | ! 30 | ! The follow set of events are supported. 31 | ! 32 | ! ButtonPress Any pointer button pressed. 33 | ! ButtonRelease Any pointer button released. 34 | ! KeyPress Key pressed. 35 | ! Key Key pressed (aliases). 36 | ! KeyDown Key pressed (aliases). 37 | ! Ctrl KeyPress with Ctrl modifier. 38 | ! Meta KeyPress with Meta modifier. 39 | ! Shift KeyPress with Shift modifier. 40 | ! 41 | ! Modifiers: 42 | ! 43 | ! The follow set of modifiers are supported. 44 | ! 45 | ! Ctrl Control key is held down. 46 | ! Shift Shift key is held down. 47 | ! Lock Caps Lock is in effect. 48 | ! Meta Meta key is held down. 49 | ! Alt Alt key is held down. 50 | ! Button1 Pointer Button 1 is held down. 51 | ! Button2 Pointer Button 2 is held down. 52 | ! Button3 Pointer Button 3 is held down. 53 | ! 54 | ! Modifiers can be decorated to extend their characteristics, as follows. 55 | ! 56 | ! None No modifiers may be present. 57 | ! ! No modifiers except those explicitly specified may be present. 58 | ! : Apply shift (and lock) modifier to key event before comparing. 59 | ! ~ The modifier immediately following cannot be present. 60 | ! 61 | ! Support actions: 62 | ! 63 | ! scroll-forw(count, object) 64 | ! scroll-back(count, object) 65 | ! string( ... ) 66 | ! insert_char() 67 | ! newline() 68 | ! quit() 69 | ! ignore() or noop() 70 | ! 71 | !end 72 | -------------------------------------------------------------------------------- /docs/libssh2_license.txt: -------------------------------------------------------------------------------- 1 | 2 | LIBSSH2 - the ssh library. 3 | 4 | https://www.libssh2.org/license.html 5 | 6 | /* Copyright (c) 2004-2007 Sara Golemon 7 | * Copyright (c) 2005,2006 Mikhail Gusarov 8 | * Copyright (c) 2006-2007 The Written Word, Inc. 9 | * Copyright (c) 2007 Eli Fant 10 | * Copyright (c) 2009-2014 Daniel Stenberg 11 | * Copyright (C) 2008, 2009 Simon Josefsson 12 | * All rights reserved. 13 | * 14 | * Redistribution and use in source and binary forms, 15 | * with or without modification, are permitted provided 16 | * that the following conditions are met: 17 | * 18 | * Redistributions of source code must retain the above 19 | * copyright notice, this list of conditions and the 20 | * following disclaimer. 21 | * 22 | * Redistributions in binary form must reproduce the above 23 | * copyright notice, this list of conditions and the following 24 | * disclaimer in the documentation and/or other materials 25 | * provided with the distribution. 26 | * 27 | * Neither the name of the copyright holder nor the names 28 | * of any other contributors may be used to endorse or 29 | * promote products derived from this software without 30 | * specific prior written permission. 31 | * 32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 33 | * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 34 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 35 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 36 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 37 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 38 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 39 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 40 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 41 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 42 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 43 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 44 | * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 45 | * OF SUCH DAMAGE. 46 | */ -------------------------------------------------------------------------------- /docs/libstm_license.txt: -------------------------------------------------------------------------------- 1 | 2 | https://www.freedesktop.org/wiki/Software/kmscon/libtsm/ 3 | 4 | libtsm - Terminal-emulator State Machine 5 | 6 | TSM is a state machine for DEC VT100-VT520 compatible terminal emulators. It tries to 7 | support all common standards while keeping compatibility to existing emulators like xterm, 8 | gnome-terminal, konsole, .. 9 | 10 | TSM itself does not provide any rendering nor window management. It is a simple plain 11 | state machine without any external dependencies. It can be used to implement terminal 12 | emulators, but also to implement other applications that need to interpret terminal 13 | escape sequences. 14 | 15 | This library is very similar to libvte of the gnome project. However, libvte is highly 16 | bound to GTK+, which makes it unsuitable for non-graphics projects that need to parse 17 | escape sequences. Instead, TSM tries to restrict its API to terminal emulation only. 18 | Furthermore, TSM does not try to establish a new terminal emulation standard, but instead 19 | keeps compatibility as close to xterm as possible. This is why the TERM variable can be 20 | set to xterm-color256 with any TSM based terminal emulator. 21 | 22 | License: 23 | 24 | Copyright (c) 2011-2013 David Herrmann 25 | 26 | Permission is hereby granted, free of charge, to any person obtaining 27 | a copy of this software and associated documentation files 28 | (the "Software"), to deal in the Software without restriction, including 29 | without limitation the rights to use, copy, modify, merge, publish, 30 | distribute, sublicense, and/or sell copies of the Software, and to 31 | permit persons to whom the Software is furnished to do so, subject to 32 | the following conditions: 33 | 34 | The above copyright notice and this permission notice shall be included 35 | in all copies or substantial portions of the Software. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 38 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 39 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 40 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 41 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 42 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 43 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 44 | -------------------------------------------------------------------------------- /docs/rsh_colors256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/rsh_colors256.png -------------------------------------------------------------------------------- /docs/rsh_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/rsh_login.png -------------------------------------------------------------------------------- /docs/rsh_mc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/rsh_mc.png -------------------------------------------------------------------------------- /docs/rsh_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/rsh_version.png -------------------------------------------------------------------------------- /docs/ssh_colors256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/ssh_colors256.png -------------------------------------------------------------------------------- /docs/ssh_mc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/ssh_mc.png -------------------------------------------------------------------------------- /docs/ssh_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/docs/ssh_version.png -------------------------------------------------------------------------------- /libNTService/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | *.aps 4 | *.mbr 5 | 6 | -------------------------------------------------------------------------------- /libNTService/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | Simple*.doc 3 | NTString_test.* 4 | *.bat 5 | *.err 6 | 7 | -------------------------------------------------------------------------------- /libNTService/MSG00001.bin: -------------------------------------------------------------------------------- 1 | dpDThe %1 service was installed. 2 | @The %1 service was removed. 3 | TThe %1 service could not be removed. 4 | `The control handler could not be installed. 5 | PThe initialization process failed. 6 | <The service was started. 7 | dThe service received an unsupported request. 8 | Debug: %1 9 | <The service was stopped. 10 | 4Failed to stop "%1". 11 | %1. 12 | DService encounter error <%1>. 13 | xEvent viewer support for "%1" successfully registered. 14 | -------------------------------------------------------------------------------- /libNTService/NTServMsg.mc: -------------------------------------------------------------------------------- 1 | MessageId=100 2 | SymbolicName=EVMSG_INSTALLED 3 | Language=English 4 | The %1 service was installed. 5 | . 6 | 7 | MessageId= 8 | SymbolicName=EVMSG_REMOVED 9 | Language=English 10 | The %1 service was removed. 11 | . 12 | 13 | MessageId= 14 | SymbolicName=EVMSG_NOTREMOVED 15 | Language=English 16 | The %1 service could not be removed. 17 | . 18 | 19 | MessageId= 20 | SymbolicName=EVMSG_CTRLHANDLERNOTINSTALLED 21 | Language=English 22 | The control handler could not be installed. 23 | . 24 | 25 | MessageId= 26 | SymbolicName=EVMSG_FAILEDINIT 27 | Language=English 28 | The initialization process failed. 29 | . 30 | 31 | MessageId= 32 | SymbolicName=EVMSG_STARTED 33 | Language=English 34 | The service was started. 35 | . 36 | 37 | MessageId= 38 | SymbolicName=EVMSG_BADREQUEST 39 | Language=English 40 | The service received an unsupported request. 41 | . 42 | 43 | MessageId= 44 | SymbolicName=EVMSG_DEBUG 45 | Language=English 46 | Debug: %1 47 | . 48 | 49 | MessageId= 50 | SymbolicName=EVMSG_STOPPED 51 | Language=English 52 | The service was stopped. 53 | . 54 | 55 | MessageId= 56 | SymbolicName=EVMSG_FAILED_STOP 57 | Language=English 58 | Failed to stop "%1". 59 | . 60 | 61 | MessageId= 62 | SymbolicName=EVMSG_GENERIC_MESSAGE 63 | Language=English 64 | %1. 65 | . 66 | 67 | MessageId= 68 | SymbolicName=EVMSG_GENERIC_ERROR 69 | Language=English 70 | Service encounter error <%1>. 71 | . 72 | 73 | MessageId= 74 | SymbolicName=EVMSG_EVENTVIEWER_SUPPORT_INSTALLED 75 | Language=English 76 | Event viewer support for "%1" successfully registered. 77 | . 78 | 79 | -------------------------------------------------------------------------------- /libNTService/NTServMsg.rc: -------------------------------------------------------------------------------- 1 | LANGUAGE 0x9,0x1 2 | 1 11 "MSG00001.bin" 3 | -------------------------------------------------------------------------------- /libNTService/NTServiceConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CNTService - Classic window services framework (tweaked). 3 | * Service config. 4 | * 5 | * Copyright (c) 2020 - 2025, Adam Young. 6 | * All rights reserved. 7 | * 8 | * This file is part of the WinRSH/WinSSH project. 9 | * 10 | * The applications are free software: you can redistribute it 11 | * and/or modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation, version 3. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * This project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * license for more details. 26 | * ==end== 27 | */ 28 | 29 | #include "NTServiceIO.h" 30 | #include "NTString.h" 31 | 32 | class CNTServiceReg; 33 | 34 | class CNTServiceConfig { 35 | CNTServiceConfig(const class CNTServiceConfig &) /*=delete*/; 36 | CNTServiceConfig& operator=(const CNTServiceConfig &) /*=delete*/; 37 | 38 | public: 39 | CNTServiceConfig(const char *svcname, const char *coname, 40 | NTService::IDiagnostics &diags = NTService::StdioDiagnosticsIO::Get()); 41 | ~CNTServiceConfig(); 42 | 43 | NTService::IDiagnostics &diags() const; 44 | int ExecuteCommand(int argc, const char * const *argv, unsigned filter = 0); 45 | void Query(); 46 | void Disable(); 47 | void Enable(); 48 | void UpdateDescription(const char *desc); 49 | void Delete(); 50 | int SetAttribute(int argc, const char * const *argv); 51 | 52 | private: 53 | NTService::IDiagnostics &diags_; 54 | NTService::CString svcName_; 55 | NTService::CString coName_; 56 | }; 57 | 58 | //end 59 | -------------------------------------------------------------------------------- /libNTService/NTServiceControl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * CNTService - Classic window services framework (tweaked). 3 | * Service Control 4 | * 5 | * Copyright (c) 2020 - 2025, Adam Young. 6 | * All rights reserved. 7 | * 8 | * This file is part of the WinRSH/WinSSH project. 9 | * 10 | * The applications are free software: you can redistribute it 11 | * and/or modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation, version 3. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * This project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * license for more details. 26 | * ==end== 27 | */ 28 | 29 | #include "NTServiceIO.h" 30 | #include "NTString.h" 31 | 32 | class CNTServiceControl { 33 | CNTServiceControl(const class CNTServiceControl &) /*=delete*/; 34 | CNTServiceControl& operator=(const CNTServiceControl &) /*=delete*/; 35 | 36 | public: 37 | CNTServiceControl(const char *svcname, NTService::IDiagnostics &diags = NTService::StdioDiagnosticsIO::Get()); 38 | ~ CNTServiceControl(); 39 | 40 | int ExecuteCommand(int argc, const char * const *argv, unsigned filter = 0); 41 | void Start(); 42 | void UpdateDacl(); 43 | void Stop(); 44 | 45 | private: 46 | NTService::IDiagnostics &diags_; 47 | NTService::CString svcName_; 48 | }; 49 | 50 | //end 51 | -------------------------------------------------------------------------------- /libNTService/NTServiceIIO.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef NTSERVICEIIO_H_INCLUDED 3 | #define NTSERVICEIIO_H_INCLUDED 4 | /* 5 | * CNTService - Classic window services framework (tweaked). 6 | * 7 | * Copyright (c) 2020 - 2025, Adam Young. 8 | * All rights reserved. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * license for more details. 28 | * ==end== 29 | */ 30 | 31 | #include 32 | 33 | namespace NTService { 34 | 35 | // Diagnostics interface. 36 | struct IDiagnostics { 37 | virtual void ferror(const char *fmt, ...) = 0; 38 | virtual void fwarning(const char *fmt, ...) = 0; 39 | virtual void finfo(const char *fmt, ...) = 0; 40 | virtual void fdebug(const char *fmt, ...) = 0; 41 | 42 | virtual void verror(const char *fmt, va_list) = 0; 43 | virtual void vwarning(const char *fmt, va_list) = 0; 44 | virtual void vinfo(const char *fmt, va_list) = 0; 45 | virtual void vdebug(const char *fmt, va_list) = 0; 46 | 47 | virtual void error(const char *msg) = 0; 48 | virtual void warning(const char *msg) = 0; 49 | virtual void info(const char *msg) = 0; 50 | virtual void debug(const char *msg) = 0; 51 | }; 52 | 53 | }; //namespace NTService 54 | 55 | #endif //NTSERVICEIIO_H_INCLUDED 56 | -------------------------------------------------------------------------------- /libNTService/build_NTServMsg.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | "C:/Program Files (x86)/Windows Kits/10/bin/10.0.17763.0/x86/mc.exe" NTServMsg.mc 3 | -------------------------------------------------------------------------------- /libmbedtls/.cvsignore: -------------------------------------------------------------------------------- 1 | mbedtls-2.13.0 2 | mbedtls-2.16.6 3 | mbedtls-2.27.0 4 | mbedtls-3.6.2 5 | .unpacked.* 6 | Makefile 7 | *.err 8 | -------------------------------------------------------------------------------- /libmbedtls/.gitignore: -------------------------------------------------------------------------------- 1 | mbedtls-2.13.* 2 | readme_2_13_* 3 | mbedtls-2.16.* 4 | readme_2_16_* 5 | mbedtls-2.27.0/ 6 | mbedtls-3.6.2/ 7 | Makefile.in.* 8 | .unpacked.* 9 | Makefile 10 | *.err 11 | 12 | -------------------------------------------------------------------------------- /libmbedtls/mbedtls-2.27.0.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libmbedtls/mbedtls-2.27.0.gr.tgz -------------------------------------------------------------------------------- /libmbedtls/mbedtls-2.27.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libmbedtls/mbedtls-2.27.0.tgz -------------------------------------------------------------------------------- /libmbedtls/mbedtls-3.6.2.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libmbedtls/mbedtls-3.6.2.gr.tgz -------------------------------------------------------------------------------- /libmbedtls/owc/WSPiApi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | /* 3 | * 4 | */ 5 | 6 | /*end*/ 7 | -------------------------------------------------------------------------------- /libmbedtls/owc/aesni_3.6.2.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libmbedtls/owc/aesni_3.6.2.obj -------------------------------------------------------------------------------- /libmbedtls/win32/alignment_linkage.c: -------------------------------------------------------------------------------- 1 | //$Id: alignment_linkage.c,v 1.1 2025/02/02 10:22:40 cvsuser Exp $ 2 | // 3 | // alignment support 4 | // 5 | // 3.4.1 6 | // Provide external definitions of some inline functions so that the compiler has the option to not inline them 7 | // 8 | // Source: library/platform_util.c 9 | // 10 | 11 | #if defined(__MINGW32__) 12 | 13 | #include "mbedtls/build_info.h" 14 | 15 | #if (MBEDTLS_VERSION_NUMBER >= 0x03040100) 16 | 17 | #include "../library/common.h" 18 | 19 | #include "mbedtls/platform_util.h" 20 | 21 | extern inline void mbedtls_xor(unsigned char *r, 22 | const unsigned char *a, 23 | const unsigned char *b, 24 | size_t n); 25 | 26 | extern inline uint16_t mbedtls_get_unaligned_uint16(const void *p); 27 | 28 | extern inline void mbedtls_put_unaligned_uint16(void *p, uint16_t x); 29 | 30 | extern inline uint32_t mbedtls_get_unaligned_uint32(const void *p); 31 | 32 | extern inline void mbedtls_put_unaligned_uint32(void *p, uint32_t x); 33 | 34 | extern inline uint64_t mbedtls_get_unaligned_uint64(const void *p); 35 | 36 | extern inline void mbedtls_put_unaligned_uint64(void *p, uint64_t x); 37 | 38 | #endif //MBEDTLS_VERSION_NUMBER 39 | 40 | #endif //__MINGW32__ 41 | 42 | //end 43 | 44 | -------------------------------------------------------------------------------- /libmbedtls/win32/crypto_globals.h: -------------------------------------------------------------------------------- 1 | #ifndef CRYPTO_GLOBALS_H_INCLUDED 2 | #define CRYPTO_GLOBALS_H_INCLUDED 3 | #pragma once 4 | //$Id: crypto_globals.h,v 1.3 2025/02/01 19:25:39 cvsuser Exp $ 5 | // 6 | // libmbedcrypto support 7 | // 8 | 9 | #if defined(_WIN32) 10 | # if defined(LIBMBED_DYNAMIC) 11 | # if defined(LIBMBED_STATIC) 12 | # error LIBMBED_DYNAMIC and LIBMBED_STATIC defined 13 | # endif 14 | # if defined(LIBMBEDCRYPTO_SOURCE) 15 | # define CRYPTO_MBEDAPI __declspec(dllexport) 16 | # else 17 | # define CRYPTO_MBEDAPI __declspec(dllimport) 18 | # endif 19 | # else 20 | # if !defined(LIBMBED_STATIC) 21 | # define LIBMBED_STATIC 22 | # endif 23 | # define CRYPTO_MBEDAPI extern 24 | # endif 25 | #else 26 | # define CRYPTO_MBEDAPI extern 27 | #endif 28 | 29 | #include "mbedtls/platform.h" 30 | #include 31 | 32 | typedef int (*mbedtls_fprintf_t)(FILE *stream, const char *format, ...); 33 | typedef int (*mbedtls_printf_t)(const char *format, ...); 34 | typedef int (*mbedtls_snprintf_t)(char * s, size_t n, const char * format, ...); 35 | typedef int (*mbedtls_vsnprintf_t)(char * s, size_t n, const char * format, va_list arg); 36 | 37 | #if defined(MBEDTLS_PLATFORM_FPRINTF_ALT) 38 | CRYPTO_MBEDAPI mbedtls_fprintf_t get_mbedtls_fprintf(void); 39 | #endif 40 | #if defined(MBEDTLS_PLATFORM_PRINTF_ALT) 41 | CRYPTO_MBEDAPI mbedtls_printf_t get_mbedtls_printf(void); 42 | #endif 43 | #if defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) 44 | CRYPTO_MBEDAPI mbedtls_snprintf_t get_mbedtls_snprintf(void); 45 | #endif 46 | #if defined(MBEDTLS_PLATFORM_VSNPRINTF_ALT) 47 | CRYPTO_MBEDAPI mbedtls_vsnprintf_t get_mbedtls_vsnprintf(void); 48 | #endif 49 | 50 | #endif //CRYPTO_GLOBALS_H_INCLUDED 51 | 52 | -------------------------------------------------------------------------------- /libmbedtls/win32/libmbedtls.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libmbedtls/win32/libmbedtls.rc -------------------------------------------------------------------------------- /libmbedtls/win32/libmbedx509.def: -------------------------------------------------------------------------------- 1 | ;$Id: libmbedx509.def,v 1.3 2022/03/20 10:12:38 cvsuser Exp $ 2 | ; 3 | ; libmbedx509 library definition (2.27) 4 | ; 5 | DESCRIPTION "libmbedx509" 6 | EXPORTS 7 | 8 | ; library\x509.c 9 | mbedtls_x509_dn_gets 10 | mbedtls_x509_get_alg 11 | mbedtls_x509_get_alg_null 12 | mbedtls_x509_get_ext 13 | mbedtls_x509_get_name 14 | mbedtls_x509_get_rsassa_pss_params 15 | mbedtls_x509_get_serial 16 | mbedtls_x509_get_sig 17 | mbedtls_x509_get_sig_alg 18 | mbedtls_x509_get_time 19 | mbedtls_x509_key_size_helper 20 | mbedtls_x509_self_test 21 | mbedtls_x509_serial_gets 22 | mbedtls_x509_sig_alg_gets 23 | mbedtls_x509_time_is_future 24 | mbedtls_x509_time_is_past 25 | 26 | ; library\x509_create.c 27 | mbedtls_x509_set_extension 28 | mbedtls_x509_string_to_names 29 | mbedtls_x509_write_extensions 30 | mbedtls_x509_write_names 31 | mbedtls_x509_write_sig 32 | 33 | ; library\x509_crl.c 34 | mbedtls_x509_crl_free 35 | mbedtls_x509_crl_info 36 | mbedtls_x509_crl_init 37 | mbedtls_x509_crl_parse 38 | mbedtls_x509_crl_parse_der 39 | mbedtls_x509_crl_parse_file 40 | 41 | ; library\x509_crt.c 42 | mbedtls_x509_crt_check_extended_key_usage 43 | mbedtls_x509_crt_check_key_usage 44 | mbedtls_x509_crt_free 45 | mbedtls_x509_crt_info 46 | mbedtls_x509_crt_init 47 | mbedtls_x509_crt_is_revoked 48 | mbedtls_x509_crt_parse 49 | mbedtls_x509_crt_parse_der 50 | mbedtls_x509_crt_parse_file 51 | mbedtls_x509_crt_parse_path 52 | mbedtls_x509_crt_verify 53 | mbedtls_x509_crt_verify_info 54 | mbedtls_x509_crt_verify_with_profile 55 | mbedtls_x509_crt_verify_restartable 56 | 57 | ; library\x509_csr.c 58 | mbedtls_x509_csr_free 59 | mbedtls_x509_csr_info 60 | mbedtls_x509_csr_init 61 | mbedtls_x509_csr_parse 62 | mbedtls_x509_csr_parse_der 63 | mbedtls_x509_csr_parse_file 64 | 65 | ; library\x509write_crt.c 66 | mbedtls_x509write_crt_der 67 | mbedtls_x509write_crt_free 68 | mbedtls_x509write_crt_init 69 | mbedtls_x509write_crt_pem 70 | mbedtls_x509write_crt_set_authority_key_identifier 71 | mbedtls_x509write_crt_set_basic_constraints 72 | mbedtls_x509write_crt_set_extension 73 | mbedtls_x509write_crt_set_issuer_key 74 | mbedtls_x509write_crt_set_issuer_name 75 | mbedtls_x509write_crt_set_key_usage 76 | mbedtls_x509write_crt_set_md_alg 77 | mbedtls_x509write_crt_set_ns_cert_type 78 | mbedtls_x509write_crt_set_serial 79 | mbedtls_x509write_crt_set_subject_key 80 | mbedtls_x509write_crt_set_subject_key_identifier 81 | mbedtls_x509write_crt_set_subject_name 82 | mbedtls_x509write_crt_set_validity 83 | mbedtls_x509write_crt_set_version 84 | 85 | ; library\x509write_csr.c 86 | mbedtls_x509write_csr_der 87 | mbedtls_x509write_csr_free 88 | mbedtls_x509write_csr_init 89 | mbedtls_x509write_csr_pem 90 | mbedtls_x509write_csr_set_extension 91 | mbedtls_x509write_csr_set_key 92 | mbedtls_x509write_csr_set_key_usage 93 | mbedtls_x509write_csr_set_md_alg 94 | mbedtls_x509write_csr_set_ns_cert_type 95 | mbedtls_x509write_csr_set_subject_name 96 | 97 | -------------------------------------------------------------------------------- /libmbedtls/win32/x509_globals.c: -------------------------------------------------------------------------------- 1 | //$Id: x509_globals.c,v 1.3 2025/02/01 19:25:39 cvsuser Exp $ 2 | // 3 | // libmetlx509 support 4 | // 5 | 6 | #if defined(_MSC_VER) 7 | #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x600) 8 | #undef WINVER 9 | #undef _WIN32_WINNT 10 | #define WINVER 0x600 11 | #define _WIN32_WINNT 0x600 12 | #define NEED_INET_XTOX 13 | #endif 14 | #endif 15 | 16 | #include "x509_globals.h" 17 | 18 | 19 | MBEDAPI const mbedtls_x509_crt_profile * 20 | get_mbedtls_x509_crt_profile_default(void) { 21 | return &mbedtls_x509_crt_profile_default; 22 | } 23 | 24 | 25 | MBEDAPI const mbedtls_x509_crt_profile * 26 | get_mbedtls_x509_crt_profile_next(void) { 27 | return &mbedtls_x509_crt_profile_next; 28 | } 29 | 30 | 31 | MBEDAPI const mbedtls_x509_crt_profile * 32 | get_mbedtls_x509_crt_profile_suiteb(void) { 33 | return &mbedtls_x509_crt_profile_suiteb; 34 | } 35 | 36 | 37 | /** 38 | * inet_pton - convert IPv4 and IPv6 addresses from text to binary form. 39 | * inet_ntop - convert IPv4 and IPv6 addresses from binary to text. 40 | */ 41 | 42 | #if defined(NEED_INET_XTOX) 43 | 44 | #if !defined(_WINSOCK_DEPRECATED_NO_WARNINGS) 45 | #define _WINSOCK_DEPRECATED_NO_WARNINGS 1 46 | #endif 47 | 48 | #include 49 | #include 50 | 51 | int 52 | /*mbedtls_*/ inet_pton(int af, const char *src, void *dst) 53 | { 54 | int rc = -1, srclen = (src ? strlen(src) : 0); 55 | 56 | if (af == AF_INET6) { 57 | struct sockaddr_in6 sockaddr = {0}; 58 | 59 | rc = WSAStringToAddressA((char *)src, AF_INET6, NULL, (struct sockaddr *)&sockaddr, &srclen); 60 | memcpy(dst, &sockaddr.sin6_addr.s6_addr, sizeof(sockaddr.sin6_addr.s6_addr)); 61 | 62 | } else { 63 | struct sockaddr_in sockaddr = {0}; 64 | 65 | rc = WSAStringToAddressA((char *)src, AF_INET, NULL, (struct sockaddr *)&sockaddr, &srclen); 66 | memcpy(dst, &sockaddr.sin_addr.s_addr, sizeof(sockaddr.sin_addr.s_addr)); 67 | } 68 | return rc; 69 | } 70 | 71 | 72 | const char * 73 | /*mbedtls_*/ inet_ntop(int af, const void *src, char *dst, size_t /*socklen_t*/ size) 74 | { 75 | struct sockaddr_storage ss = {0}; 76 | unsigned long s = (unsigned long)size; 77 | 78 | ss.ss_family = af; 79 | switch (af) { 80 | case AF_INET: 81 | ((struct sockaddr_in *)&ss)->sin_addr = *(struct in_addr *)src; 82 | break; 83 | case AF_INET6: 84 | ((struct sockaddr_in6 *)&ss)->sin6_addr = *(struct in6_addr *)src; 85 | break; 86 | default: 87 | return NULL; 88 | } 89 | return (WSAAddressToStringA((struct sockaddr *)&ss, sizeof(ss), NULL, dst, &s) == 0) ? dst : NULL; 90 | } 91 | 92 | #endif //INET_NTOP 93 | 94 | //end 95 | 96 | -------------------------------------------------------------------------------- /libmbedtls/win32/x509_globals.h: -------------------------------------------------------------------------------- 1 | //$Id: x509_globals.h,v 1.1 2018/11/07 01:11:54 cvsuser Exp $ 2 | // 3 | // libmetlx509 support 4 | // 5 | 6 | #if defined(_WIN32) 7 | # if defined(LIBMBED_DYNAMIC) 8 | # if defined(LIBMBED_STATIC) 9 | # error LIBMBED_DYNAMIC and LIBMBED_STATIC defined 10 | # endif 11 | # if defined(LIBMBEDX509_SOURCE) 12 | # define MBEDAPI __declspec(dllexport) 13 | # else 14 | # define MBEDAPI __declspec(dllimport) 15 | # endif 16 | # else 17 | # if !defined(LIBMBED_STATIC) 18 | # define LIBMBED_STATIC 19 | # endif 20 | # define MBEDAPI extern 21 | # endif 22 | #else 23 | # define MBEDAPI extern 24 | #endif 25 | 26 | #include "mbedtls/x509_crt.h" 27 | 28 | MBEDAPI const mbedtls_x509_crt_profile * get_mbedtls_x509_crt_profile_default(void); 29 | MBEDAPI const mbedtls_x509_crt_profile * get_mbedtls_x509_crt_profile_next(void); 30 | MBEDAPI const mbedtls_x509_crt_profile * get_mbedtls_x509_crt_profile_suiteb(void); 31 | -------------------------------------------------------------------------------- /librcmd/getport.c: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 The NetBSD Foundation, Inc. 3 | * All rights reserved. 4 | * 5 | * This code is derived from software contributed to The NetBSD Foundation 6 | * by Christos Zoulas. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | * 29 | * __RCSID("$NetBSD: getport.c,v 1.2 2008/04/28 20:24:14 martin Exp $"); 30 | */ 31 | 32 | #include 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | #include "getport.h" 43 | 44 | struct servent * 45 | getport(const char *service, const char *protocol) 46 | { 47 | long port; 48 | char *ep; 49 | struct servent *sp = getservbyname(service, protocol); 50 | if (sp != NULL) 51 | return sp; 52 | 53 | #ifndef IPPORT_ANONMAX 54 | #define IPPORT_ANONMAX 0xffff 55 | #endif 56 | 57 | if ((sp = calloc(1, sizeof(*sp))) == NULL) 58 | err(1, "malloc"); 59 | sp->s_name = __UNCONST(service); 60 | sp->s_proto = __UNCONST(protocol); 61 | port = strtol(service, &ep, 0); 62 | if ((service[0] != '\0' && *ep != '\0') || 63 | (errno == ERANGE && 64 | (port == LONG_MAX || port == LONG_MIN)) || 65 | (port <= 0 || port >= IPPORT_ANONMAX)) 66 | errx(1,"port must be between 1 and %d", 67 | IPPORT_ANONMAX); 68 | sp->s_port = htons((uint16_t)port); 69 | return sp; 70 | } 71 | -------------------------------------------------------------------------------- /librcmd/getport.h: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2004 The NetBSD Foundation, Inc. 3 | * All rights reserved. 4 | * 5 | * This code is derived from software contributed to The NetBSD Foundation 6 | * by Christos Zoulas. 7 | * 8 | * Redistribution and use in source and binary forms, with or without 9 | * modification, are permitted provided that the following conditions 10 | * are met: 11 | * 1. Redistributions of source code must retain the above copyright 12 | * notice, this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright 14 | * notice, this list of conditions and the following disclaimer in the 15 | * documentation and/or other materials provided with the distribution. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | extern struct servent *getport(const char *, const char *); 31 | -------------------------------------------------------------------------------- /librcmd/pathnames.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Default paths 3 | */ 4 | 5 | #define _PATH_HEQUIV "/etc/rhosts.equiv" 6 | #define _PATH_LOGIN "/usr/bin/login" 7 | #define _PATH_RLOGIN "/usr/bin/rlogin" 8 | #define _PATH_BIN_RCMD "/bin/rcmd" 9 | #define _PATH_BSHELL "/bin/sh" 10 | 11 | /*end*/ 12 | -------------------------------------------------------------------------------- /librcmd/rcmd.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBRCMD_H_INCLUDED 2 | #define LIBRCMD_H_INCLUDED 3 | /* 4 | * Windows interface 5 | */ 6 | 7 | #include 8 | 9 | __BEGIN_DECLS 10 | 11 | extern int __check_rhosts_file; 12 | extern const char * __rcmd_errstr; 13 | 14 | extern int rcmd(const char **ahost, int rport, const char *locuser, const char *remuser, const char *cmd, int *fd2p); 15 | extern int rcmd_af(const char **ahost, int rport, const char *locuser, const char *remuser, const char *cmd, int *fd2p, int af); 16 | 17 | extern int orcmd(const char **ahost, u_int rport, const char *locuser, const char *remuser, const char *cmd, int *fd2p); 18 | extern int orcmd_af(const char **ahost, u_int rport, const char *locuser, const char *remuser, const char *cmd, int *fd2p, int af); 19 | 20 | extern int rresvport(int *alport); 21 | extern int rresvport_af(int *alport, int family); 22 | 23 | extern int iruserok(unsigned raddr, int superuser, const char *ruser, const char *luser); 24 | extern int iruserok_sa(const void *raddr, int rlen, int superuser, const char *ruser, const char *luser); 25 | 26 | __END_DECLS 27 | 28 | #endif /*LIBRCMD_H_INCLUDED*/ 29 | 30 | -------------------------------------------------------------------------------- /libssh/.cvsignore: -------------------------------------------------------------------------------- 1 | libssh-0.9.4 2 | .unpacked.* 3 | Makefile 4 | *.err 5 | -------------------------------------------------------------------------------- /libssh/.gitignore: -------------------------------------------------------------------------------- 1 | libssh-0.9.4/ 2 | ref/ 3 | .unpacked.* 4 | Makefile 5 | *.err 6 | 7 | -------------------------------------------------------------------------------- /libssh/compat_strnlen.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(compat_strnlen_c,"$Id: compat_strnlen.c,v 1.2 2020/05/21 00:40:36 cvsuser Exp $") 3 | 4 | // 5 | // strnlen -- library compat 6 | // 7 | 8 | #include "config.h" 9 | 10 | #if defined(__WATCOMC__) 11 | 12 | #include 13 | #include 14 | 15 | size_t 16 | strnlen(const char *str, size_t maxlen) 17 | { 18 | const char *cp; 19 | 20 | for (cp = str; maxlen != 0 && *cp != '\0'; cp++, maxlen--) 21 | ; 22 | 23 | return (size_t)(cp - str); 24 | } 25 | 26 | 27 | #else 28 | extern void __stdlibrary_has_strnlen(void); 29 | 30 | void 31 | __stdlibrary_has_strnlen(void) 32 | { 33 | } 34 | 35 | #endif 36 | 37 | //end 38 | -------------------------------------------------------------------------------- /libssh/libssh-0.9.4.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh/libssh-0.9.4.gr.tgz -------------------------------------------------------------------------------- /libssh/libssh-0.9.4.tar.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh/libssh-0.9.4.tar.xz -------------------------------------------------------------------------------- /libssh/libssh.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh/libssh.rc -------------------------------------------------------------------------------- /libssh/readme_0_9_4.txt: -------------------------------------------------------------------------------- 1 | 2 | Source: libssh 0.9.4, changes 3 | 4 | src\packet.c 5 | 6 | + #if defined(__WATCOMC__) 7 | + memset(&session->in_packet, 0, sizeof(session->in_packet)); 8 | + #else 9 | session->in_packet = (struct packet_struct) { 10 | .type = 0, 11 | }; 12 | + #endif 13 | 14 | --------- 15 | -------------------------------------------------------------------------------- /libssh/version.h: -------------------------------------------------------------------------------- 1 | // 2 | // libssh version 3 | // 4 | 5 | #define LIBSSH_VERSION_MAJOR 4 6 | #define LIBSSH_VERSION_MINOR 8 7 | #define LIBSSH_VERSION_PATCH 5 8 | 9 | #define LIBSSH_VERSION "4.8.5" 10 | #define LIBSSH_COPYRIGHT "Copyright (c) 2008-2013 by Andreas Schneider " 11 | 12 | //end 13 | -------------------------------------------------------------------------------- /libssh2/.cvsignore: -------------------------------------------------------------------------------- 1 | libssh2-1.8.0 2 | libssh2-1.9.0 3 | libssh2-1.10.0 4 | libssh2-1.11.0 5 | libssh2-1.11.1 6 | *.tgz 7 | .unpacked.* 8 | Makefile 9 | *.err 10 | -------------------------------------------------------------------------------- /libssh2/.gitignore: -------------------------------------------------------------------------------- 1 | *-1.8.0* 2 | *_1_8_0* 3 | *-1.9.0* 4 | *_1_9_0* 5 | libssh2-1.10.0/ 6 | libssh2-1.10.0.tgz 7 | Makefile.in.1.10 8 | libssh2-1.11.0/ 9 | libssh2-1.11.0.tgz 10 | libssh2-1.11.1/ 11 | libssh2-1.11.1.tgz 12 | Makefile.in.1.11 13 | .unpacked.* 14 | Makefile 15 | *.err 16 | 17 | -------------------------------------------------------------------------------- /libssh2/libssh2-1.10.0.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/libssh2-1.10.0.gr.tgz -------------------------------------------------------------------------------- /libssh2/libssh2-1.11.0.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/libssh2-1.11.0.gr.tgz -------------------------------------------------------------------------------- /libssh2/libssh2-1.11.1.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/libssh2-1.11.1.gr.tgz -------------------------------------------------------------------------------- /libssh2/libssh2-1.9.0.gr.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/libssh2-1.9.0.gr.tgz -------------------------------------------------------------------------------- /libssh2/libssh2-1.9.0.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/libssh2-1.9.0.tgz -------------------------------------------------------------------------------- /libssh2/libssh2_helper.c: -------------------------------------------------------------------------------- 1 | //$Id: libssh2_helper.c,v 1.2 2025/02/01 19:26:07 cvsuser Exp $ 2 | // 3 | // libssh2 support 4 | // 5 | 6 | #define LIBSSH2_LIBRARY 7 | #include 8 | 9 | 10 | #if defined(_MSC_VER) || defined(__WATCOMC__) 11 | #pragma comment(lib, "BCrypt.lib") // BCryptGenRandom(), +3.5.0 12 | #endif 13 | 14 | 15 | LIBSSH2_API int 16 | libssh2_helper_trace(void) 17 | { 18 | #if defined(LIBSSH2DEBUG) 19 | return 1; 20 | #else 21 | return 0; 22 | #endif 23 | } 24 | 25 | 26 | LIBSSH2_API const char * 27 | libssh2_helper_engine(void) 28 | { 29 | #if defined(LIBSSH2_OPENSSL) 30 | return "openssl"; 31 | 32 | #elif defined(LIBSSH2_MBEDTLS) 33 | return "mbedtls"; 34 | 35 | #elif defined(LIBSSH2_WINCNG) 36 | return "wincng"; 37 | 38 | #else 39 | #error Unknown engine configuration 40 | #endif 41 | } 42 | 43 | //end 44 | 45 | -------------------------------------------------------------------------------- /libssh2/libssh2_helper.h: -------------------------------------------------------------------------------- 1 | //$Id: libssh2_helper.h,v 1.2 2025/02/01 19:26:07 cvsuser Exp $ 2 | // 3 | // libssh2 support 4 | // 5 | 6 | #include 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | LIBSSH2_API int libssh2_helper_trace(void); 13 | LIBSSH2_API const char *libssh2_helper_engine(void); 14 | 15 | #ifdef __cplusplus 16 | } /* extern "C" */ 17 | #endif 18 | 19 | //end 20 | 21 | -------------------------------------------------------------------------------- /libssh2/readme_1_10_0.txt: -------------------------------------------------------------------------------- 1 | 2 | Source: libssh2 1.10.0, code changes 3 | 4 | Makefile.in: 5 | 6 | + agent_win$(O) 7 | 8 | 9 | src\libssh2_priv.h: 10 | 11 | #include 12 | + #include //UINT_MAX 13 | 14 | 15 | src\misc.c: 16 | 17 | #ifdef WIN32 18 | + #if defined(__WATCOMC__) 19 | + static void *safememset(void *a, int b, size_t c) { 20 | + return memset(a, b, c); 21 | + } 22 | + static void * (__watcall * const volatile memset_libssh)(void *, int, size_t) = 23 | + safememset; 24 | + #else 25 | static void * (__cdecl * const volatile memset_libssh)(void *, int, size_t) = 26 | memset; 27 | + #endif 28 | #else 29 | static void * (* const volatile memset_libssh)(void *, int, size_t) = memset; 30 | #endif 31 | 32 | --------- 33 | -------------------------------------------------------------------------------- /libssh2/readme_1_11_1.txt: -------------------------------------------------------------------------------- 1 | 2 | Source: libssh2 1.11.1, code changes 3 | 4 | makefile.in 5 | 6 | #1.11.1+ 7 | CSOURCES+=\ 8 | cipher-chachapoly.c 9 | 10 | win32\ 11 | 12 | + libssh2_config.h 13 | 14 | src\misc.h: 15 | 16 | 47: 17 | - #elif defined(_WIN32) 18 | + #elif defined(_WIN32) && !defined(__WATCOMC__) 19 | 20 | src\misc.c: 21 | 22 | 805: 23 | #ifdef LIBSSH2_MEMZERO 24 | + #if defined(__WATCOMC__) 25 | + static void *safememset(void *a, int b, size_t c) 26 | + { 27 | + return memset(a, b, c); 28 | + } 29 | + static void * (__watcall * const volatile memset_libssh)(void *, int, size_t) = safememset; 30 | + #else 31 | static void * (* const volatile memset_libssh)(void *, int, size_t) = memset; 32 | + #endif 33 | 34 | --------- 35 | -------------------------------------------------------------------------------- /libssh2/readme_1_9_0.txt: -------------------------------------------------------------------------------- 1 | 2 | Source: libssh2 1.9.0, code changes 3 | 4 | src\libssh2_priv.h 5 | 6 | #include 7 | + #include //UINT_MAX 8 | 9 | 10 | src\misc.c 11 | 12 | #ifdef WIN32 13 | + #if defined(__WATCOMC__) 14 | + static void *safememset(void *a, int b, size_t c) { 15 | + return memset(a, b, c); 16 | + } 17 | + static void * (__watcall * const volatile memset_libssh)(void *, int, size_t) = 18 | + safememset; 19 | + #else 20 | static void * (__cdecl * const volatile memset_libssh)(void *, int, size_t) = 21 | memset; 22 | + #endif 23 | #else 24 | static void * (* const volatile memset_libssh)(void *, int, size_t) = memset; 25 | #endif 26 | 27 | --------- 28 | -------------------------------------------------------------------------------- /libssh2/sdk/Crypt32.Lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/sdk/Crypt32.Lib -------------------------------------------------------------------------------- /libssh2/sdk/bcrypt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libssh2/sdk/bcrypt.lib -------------------------------------------------------------------------------- /libtermemu/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | ref.* 4 | *.old 5 | 6 | -------------------------------------------------------------------------------- /libtermemu/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | ref.*/ 4 | *.old 5 | 6 | -------------------------------------------------------------------------------- /libtermemu/compat.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_H_INCLUDED 2 | #define COMPAT_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(compat_h,"$Id: compat.h,v 1.2 2017/03/23 16:16:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* 8 | * compat interfaces 9 | */ 10 | 11 | #ifndef HAVE_CONFIG_H 12 | #error HAVE_CONFIG_H assumed ... 13 | #endif 14 | #include "config.h" 15 | #include 16 | 17 | __BEGIN_DECLS 18 | 19 | #ifndef HAVE_STRTONUM 20 | extern long long strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp); 21 | #endif 22 | #if !defined(HAVE_INET_NTOP) && \ 23 | (!defined(_MSC_VER) || (_MSC_VER < 1500)) /*FIXME: makelib.pl*/ 24 | extern const char *inet_ntop(int af, const void *src, char *dst, size_t /*socklen_t*/ size); 25 | extern int inet_pton(int af, const char *src, void *dst); 26 | #endif 27 | 28 | __END_DECLS 29 | 30 | #endif //COMPAT_H_INCLUDED 31 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /libtermemu/compat_stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_STDBOOL_H_INCLUDED 2 | #define COMPAT_STDBOOL_H_INCLUDED 3 | /* 4 | * compat stdbool.h 5 | * 6 | * Copyright (c) 2015 - 2025, Adam Young. 7 | * All rights reserved. 8 | * 9 | * This file is part of the WinRSH/WinSSH project. 10 | * 11 | * The WinRSH/WinSSH project is free software: you can redistribute it 12 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * License for more details. 26 | * ==end== 27 | */ 28 | 29 | #if defined(HAVE_CONFIG_H) 30 | #include "config.h" 31 | #endif 32 | 33 | #if defined(HAVE_STDBOOL_H) 34 | #include 35 | 36 | #elif defined(HAVE_SYS_BOOL_H) 37 | #include 38 | 39 | #else 40 | #if defined(_MSC_VER) 41 | #if defined(__cpluplus) 42 | #if defined(__BOOL_DEFINED) //Visual C++ 5.0 and later 43 | typedef _Bool bool; 44 | #else 45 | #error unsupported MSVC C++ version ... 46 | #endif 47 | #elif !defined(bool) 48 | typedef char bool; 49 | #define true 1 50 | #define false 0 51 | #endif 52 | 53 | #else 54 | #eror bool not supported .... 55 | #endif 56 | #endif 57 | 58 | #endif //COMPAT_STDBOOL_H_INCLUDED 59 | -------------------------------------------------------------------------------- /libtermemu/compat_stdint.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPAT_STDINT_H_INCLUDED 2 | #define COMPAT_STDINT_H_INCLUDED 3 | /* 4 | * compat stdint.h 5 | * 6 | * Copyright (c) 2015 - 2025, Adam Young. 7 | * All rights reserved. 8 | * 9 | * This file is part of the WinRSH/WinSSH project. 10 | * 11 | * The WinRSH/WinSSH project is free software: you can redistribute it 12 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * License for more details. 26 | * ==end== 27 | */ 28 | 29 | #if defined(HAVE_CONFIG_H) 30 | #include "config.h" 31 | #endif 32 | 33 | #if defined(HAVE_STDBOOL_H) 34 | #include 35 | 36 | #else 37 | #include 38 | #endif 39 | 40 | #endif //COMPAT_STDINT_H_INCLUDED 41 | -------------------------------------------------------------------------------- /libtermemu/compat_strtonum.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(compat_strtonum_c,"$Id: compat_strtonum.c,v 1.4 2020/05/15 00:21:39 cvsuser Exp $") 3 | /* 4 | * strtonum --- compat interface 5 | */ 6 | 7 | #include "config.h" 8 | 9 | #if !defined(HAVE_STRTONUM) 10 | 11 | #include 12 | #include 13 | #include 14 | #if defined(HAVE_UNISTD_H) 15 | #include 16 | #endif 17 | #include "compat.h" 18 | 19 | #define INVALID 1 20 | #define TOOSMALL 2 21 | #define TOOLARGE 3 22 | 23 | long long 24 | strtonum(const char *numstr, long long minval, long long maxval, const char **errstrp) 25 | { 26 | static const struct errval { 27 | const char *errstr; 28 | int err; 29 | } ev[4] = { 30 | { NULL, 0 }, 31 | { "invalid", EINVAL }, 32 | { "too small", ERANGE }, 33 | { "too large", ERANGE }, 34 | }; 35 | long long ll = 0; 36 | int oerrno = errno, error = 0; 37 | char *ep; 38 | 39 | if (minval > maxval) { 40 | error = INVALID; 41 | } else { 42 | #if defined(_MSC_VER) 43 | #define strtoll _strtoi64 44 | #endif 45 | errno = 0; 46 | ll = strtoll(numstr, &ep, 10); 47 | if (numstr == ep || *ep != '\0') 48 | error = INVALID; 49 | else if ((ll == LLONG_MIN && errno == ERANGE) || ll < minval) 50 | error = TOOSMALL; 51 | else if ((ll == LLONG_MAX && errno == ERANGE) || ll > maxval) 52 | error = TOOLARGE; 53 | } 54 | if (errstrp != NULL) 55 | *errstrp = ev[error].errstr; 56 | errno = (error ? ev[error].err : oerrno /*restore*/); 57 | if (error) 58 | ll = 0; 59 | return ll; 60 | } 61 | 62 | #else /*!HAVE_STRTONUM*/ 63 | 64 | extern void __native_strtonum_available(void); 65 | void __native_strtonum_available(void) 66 | { 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /libtermemu/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * local 3 | */ 4 | 5 | #include // common configuration 6 | 7 | #if defined(_MSC_VER) 8 | #pragma warning (disable : 4127) // conditional expression is constant 9 | #pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union 10 | #pragma warning (disable : 4204) // nonstandard extension used : non-constant aggregate initializer 11 | #pragma warning (disable : 4702) // unreachable code 12 | #pragma warning (disable : 4706) // assignment within conditional expression 13 | #pragma warning (disable : 4996) // 'xxx' was declared deprecated 14 | 15 | #elif defined(__WATCOMC__) 16 | #pragma disable_message(136) // Comparison equivalent to 'unsigned == 0' 17 | #pragma disable_message(201) // Unreachable code 18 | #pragma disable_message(202) // Unreferenced 19 | #pragma disable_message(124) // Comparison result always 0 20 | #endif 21 | 22 | /*end*/ 23 | 24 | -------------------------------------------------------------------------------- /libtermemu/libtsm/external/wcwidth.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This is an implementation of wcwidth() and wcswidth() (defined in 3 | * IEEE Std 1002.1-2001) for Unicode. 4 | * 5 | * Markus Kuhn -- 2007-05-26 (Unicode 5.0) 6 | * 7 | * Permission to use, copy, modify, and distribute this software 8 | * for any purpose and without fee is hereby granted. The author 9 | * disclaims all warranties with regard to this software. 10 | */ 11 | 12 | #include 13 | #include 14 | 15 | int mk_wcwidth(wchar_t ucs); 16 | int mk_wcswidth(const wchar_t *pwcs, size_t n); 17 | int mk_wcwidth_cjk(wchar_t ucs); 18 | int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n); 19 | -------------------------------------------------------------------------------- /libtermemu/libtsm/libtsm-3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libtermemu/libtsm/libtsm-3.tgz -------------------------------------------------------------------------------- /libtermemu/shl_ring.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SHL - Ring buffer 3 | * 4 | * Copyright (c) 2011-2014 David Herrmann 5 | * Dedicated to the Public Domain 6 | */ 7 | 8 | /* 9 | * Ring buffer 10 | */ 11 | 12 | #ifndef SHL_RING_H 13 | #define SHL_RING_H 14 | 15 | #if defined(HAVE_CONFIG_H) 16 | #include "config.h" 17 | #endif 18 | 19 | #include 20 | #if defined(HAVE_INTTYPES_H) 21 | #include 22 | #endif 23 | #include 24 | #include 25 | #include 26 | 27 | struct shl_ring { 28 | uint8_t *buf; /* buffer or NULL */ 29 | size_t size; /* actual size of @buf */ 30 | size_t start; /* start position of ring */ 31 | size_t used; /* number of actually used bytes */ 32 | }; 33 | 34 | /* flush buffer so it is empty again */ 35 | void shl_ring_flush(struct shl_ring *r); 36 | 37 | /* flush buffer, free allocated data and reset to initial state */ 38 | void shl_ring_clear(struct shl_ring *r); 39 | 40 | /* get pointers to buffer data and their length */ 41 | size_t shl_ring_peek(struct shl_ring *r, struct iovec *vec); 42 | 43 | /* copy data into external linear buffer */ 44 | size_t shl_ring_copy(struct shl_ring *r, void *buf, size_t size); 45 | 46 | /* push data to the end of the buffer */ 47 | int shl_ring_push(struct shl_ring *r, const void *u8, size_t size); 48 | 49 | /* pull data from the front of the buffer */ 50 | void shl_ring_pull(struct shl_ring *r, size_t size); 51 | 52 | /* return size of occupied buffer in bytes */ 53 | size_t shl_ring_get_size(struct shl_ring *r); 54 | 55 | #endif /* SHL_RING_H */ 56 | 57 | -------------------------------------------------------------------------------- /libtermemu/termemu_cio.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMEMU_CIO_H_INCLUDED 2 | #define TERMEMU_CIO_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(termemu_cio_h,"$Id: termemu_cio.h,v 1.6 2025/02/02 13:58:14 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * libtermemu console driver 10 | * 11 | * Copyright (c) 2015 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * License for more details. 31 | * ==end== 32 | */ 33 | 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | extern int termemu_cio_keyevent(const KEY_EVENT_RECORD *key, termemu_event_t *evt); 39 | extern unsigned termemu_cio_modifiers(const DWORD dwControlKeyState, bool apps); 40 | extern int termemu_cio_keyauto(int sequence, INPUT_RECORD *ir, termemu_event_t *evt); 41 | 42 | __END_DECLS 43 | 44 | #endif //TERMEMU_CIO_H_INCLUDED 45 | 46 | -------------------------------------------------------------------------------- /libtermemu/termemu_keymap.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMEMU_KEYMAP_H_INCLUDED 2 | #define TERMEMU_KEYMAP_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(termemu_keymap_h,"$Id: termemu_keymap.h,v 1.9 2025/02/02 13:58:14 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * termemu keyboard mapping 10 | * 11 | * Copyright (c) 2015 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * License for more details. 31 | * ==end== 32 | */ 33 | 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | typedef void * termemu_keymap_t; 39 | 40 | typedef void (*termemu_method_t)(void *cxt, int argc, const char *argv); 41 | 42 | typedef struct action { 43 | const char *name; 44 | termemu_method_t method; 45 | } termemu_action_t; 46 | 47 | typedef struct event { 48 | unsigned modifiers; // TSM_XXX_MASK(s) 49 | unsigned vkkey; // VK_xxxx key code; otherwise 0. 50 | unsigned vkkeyalt; // Alternative VK_xxxx key code; otherwise 0. 51 | const char *vkname; // VK symbol name; otherwise NULL. 52 | int vkenhanced; // Whether an enhanced VK, 1 otherwise 0. 53 | int xkbkey; // XKB_XXX key symbol; otherwise -1. 54 | const char *xkbname; // XKB symbol name; otherwise NULL. 55 | int ascii; // ASCII character value; otherwise -1 56 | int unicode; // Unicode character value; otherwise -1 57 | } termemu_event_t; 58 | 59 | struct tsm_vte; 60 | 61 | extern termemu_keymap_t* termemu_keymap_new(const char *name); 62 | extern void termemu_keymap_delete(termemu_keymap_t *keymap); 63 | extern int termemu_keymap_context(termemu_keymap_t *keymap, const char *cxt); 64 | extern int termemu_keymap_parse(termemu_keymap_t *keymap, const char *source, size_t buflen, const char *label); 65 | extern void termemu_keymap_print(const termemu_keymap_t *keymap); 66 | extern int termemu_keymap_execute(termemu_keymap_t *keymap, const termemu_event_t *event, struct tsm_vte *vte); 67 | 68 | __END_DECLS 69 | 70 | #endif //TERMEMU_KEYMAP_H_INCLUDED 71 | -------------------------------------------------------------------------------- /libtermemu/termemu_keysym.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMEMU_KEYSYM_H_INCLUDED 2 | #define TERMEMU_KEYSYM_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(termemu_keysym_h,"$Id: termemu_keysym.h,v 1.7 2025/02/02 13:58:14 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * termemu keyboard symbol lookup. 10 | * 11 | * Copyright (c) 2015 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * License for more details. 31 | * ==end== 32 | */ 33 | 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | extern const char * termemu_keysym_tostr(unsigned ks); 39 | extern const char * termemu_keysym_tostruc(unsigned ks, unsigned *uc); 40 | extern int termemu_keysym_tostrs(unsigned ks, const char **strs, unsigned count); 41 | extern char * termemu_keysym_ucstr(unsigned ks, char *buf, size_t buflen); 42 | extern const char * termemu_keysym_asstr(unsigned ks, unsigned *unicode, char *buf, size_t buflen); 43 | 44 | extern unsigned termemu_keysym_tonum(const char *name); 45 | extern unsigned termemu_keysym_tonumuc(const char *name, unsigned *uc); 46 | 47 | extern unsigned termemu_keysym_fromuc(unsigned uc); 48 | 49 | __END_DECLS 50 | 51 | #endif //TERMEMU_KEYSYM_H_INCLUDED 52 | -------------------------------------------------------------------------------- /libtermemu/termemu_tsm.h: -------------------------------------------------------------------------------- 1 | #ifndef TERMEMU_TSM_H_INCLUDED 2 | #define TERMEMU_TSM_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(termemu_tsm_h,"$Id: termemu_tsm.h,v 1.11 2025/02/02 13:58:14 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * libtermemu terminal driver 10 | * 11 | * Copyright (c) 2015 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * License for more details. 31 | * ==end== 32 | */ 33 | 34 | __BEGIN_DECLS 35 | 36 | #define LIBTSM_VERSION "1.3.0c" 37 | 38 | extern int termemu_init(void); 39 | extern int termemu_active(void); 40 | extern int termemu_palette(const char *name); 41 | extern int termemu_appname(const char *appname); 42 | extern int termemu_keysyms(const char *keysyms); 43 | extern void termemu_exit(void); 44 | extern int termemu_size(int *rows, int *cols); 45 | extern int termemu_winch(int *rows, int *cols); 46 | extern int termemu_read(void *buf, int buflen, void (*sigwinch)(void)); 47 | extern void termemu_write(void *buf, int len); 48 | extern void termemu_flush(void); 49 | extern void termemu_signal_break(void); 50 | 51 | __END_DECLS 52 | 53 | #endif /*TERMEMU_TSM_H_INCLUDED*/ 54 | -------------------------------------------------------------------------------- /libtermemu/termemukbtest.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libtermemu/termemukbtest.c -------------------------------------------------------------------------------- /libw32/.cvsignore: -------------------------------------------------------------------------------- 1 | util 2 | ref* 3 | Makefile 4 | w32config.h 5 | package.h 6 | update*.pl 7 | *.err 8 | -------------------------------------------------------------------------------- /libw32/.gitignore: -------------------------------------------------------------------------------- 1 | util/ 2 | ref*/ 3 | Makefile 4 | w32config.h 5 | package.h 6 | update*.pl 7 | *.err 8 | -------------------------------------------------------------------------------- /libw32/LICENSE.txt: -------------------------------------------------------------------------------- 1 | 2 | Windows minimal POSIX implementation. 3 | 4 | This library fills a few holes which are not generally provided by 5 | run-time libraries of native WIN32 compiler chains. 6 | 7 | Copyright (c) 2007, 2012-2022, Adam Young. 8 | All rights reserved. 9 | 10 | ------------------------------------------------------------ 11 | 12 | Redistributions of source code must retain the above copyright 13 | notice, and must be distributed with the project license document. 14 | 15 | Redistributions in binary form must reproduce the above copyright 16 | notice, and must include the license document above in 17 | the documentation and/or other materials provided with the 18 | distribution. 19 | 20 | The applications are distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | License for more details. 24 | 25 | ------------------------------------------------------------ 26 | 27 | Portions Copyright (c) 1990, 1993 28 | The Regents of the University of California. All rights reserved. 29 | 30 | Redistribution and use in source and binary forms, with or without 31 | modification, are permitted provided that the following conditions 32 | are met: 33 | 1. Redistributions of source code must retain the above copyright 34 | notice, this list of conditions and the following disclaimer. 35 | 2. Redistributions in binary form must reproduce the above copyright 36 | notice, this list of conditions and the following disclaimer in the 37 | documentation and/or other materials provided with the distribution. 38 | 4. Neither the name of the University nor the names of its contributors 39 | may be used to endorse or promote products derived from this software 40 | without specific prior written permission. 41 | 42 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 43 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 44 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 45 | ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 46 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 47 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 48 | OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 49 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 50 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 51 | OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 52 | SUCH DAMAGE. 53 | 54 | ------------------------------------------------------------ 55 | 56 | -------------------------------------------------------------------------------- /libw32/alloca.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_ALLOCA_H_INCLUDED 2 | #define LIBW32_ALLOCA_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_alloca_h,"$Id: alloca.h,v 1.3 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 12 | * 13 | * This file is part of the WinRSH/WinSSH project. 14 | * 15 | * The applications are free software: you can redistribute it 16 | * and/or modify it under the terms of the GNU General Public License as 17 | * published by the Free Software Foundation, version 3. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * This project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * license for more details. 31 | * ==end== 32 | */ 33 | 34 | #include 35 | 36 | #endif /*LIBW32_ALLOCA_H_INCLUDED*/ 37 | 38 | -------------------------------------------------------------------------------- /libw32/dlfcn.h: -------------------------------------------------------------------------------- 1 | #ifndef GR_DLFCN_H_INCLUDED 2 | #define GR_DLFCN_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_dlfcn_h,"$Id: dlfcn.h,v 1.3 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * for windows 10 | * 11 | * Copyright (c) 1998 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * license for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | #include 37 | 38 | __BEGIN_DECLS 39 | 40 | #define RTLD_LAZY 0x01 /* relocations are performed at an implementation-defined time. */ 41 | #define RTLD_NOW 0x02 /* relocations are performed when the object is loaded. */ 42 | 43 | #define RTLD_GLOBAL 0x04 /* all symbols are available for relocation processing of other modules. */ 44 | #define RTLD_LOCAL 0x08 /* all symbols are not made available for relocation processing by other modules. */ 45 | 46 | LIBW32_API void * dlopen(const char *file, int mode); 47 | LIBW32_API void * dlopenA(const char *file, int mode); 48 | LIBW32_API void * dlopenW(const wchar_t *file, int mode); 49 | LIBW32_API void * dlsym(void *__restrict handle, const char *__restrict name); 50 | LIBW32_API int dlclose(void *handle); 51 | LIBW32_API char * dlerror(void); 52 | 53 | __END_DECLS 54 | 55 | #endif /*GR_DLFCN_H_INCLUDED*/ 56 | -------------------------------------------------------------------------------- /libw32/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_GETOPT_H_INCLUDED 2 | #define LIBW32_GETOPT_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_getopt_h,"$Id: getopt.h,v 1.11 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | /* -*- mode: c; indent-width: 4; -*- */ 7 | /* 8 | * win 9 | * 10 | * Copyright (c) 1998 - 2025, Adam Young. 11 | * All rights reserved. 12 | * 13 | * This file is part of the WinRSH/WinSSH project. 14 | * 15 | * The applications are free software: you can redistribute it 16 | * and/or modify it under the terms of the GNU General Public License as 17 | * published by the Free Software Foundation, version 3. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * This project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * license for more details. 31 | * ==end== 32 | */ 33 | 34 | #if defined(__MINGW32__) 35 | 36 | #include_next /* native getopt.h */ 37 | 38 | #else 39 | 40 | #include 41 | 42 | __BEGIN_DECLS 43 | 44 | LIBW32_VAR int opterr; /* if error message should be printed */ 45 | LIBW32_VAR int optind; /* index into parent argv vector */ 46 | LIBW32_VAR int optopt; /* character checked for validity */ 47 | LIBW32_VAR int optreset; /* reset getopt */ 48 | LIBW32_VAR char *optarg; 49 | 50 | /* 51 | * GNU like getopt_long() and BSD4.4 getsubopt()/optreset extensions. 52 | */ 53 | #define no_argument 0 54 | #define required_argument 1 55 | #define optional_argument 2 56 | 57 | struct option { 58 | const char *name; /* name of long option */ 59 | /* 60 | * one of no_argument, required_argument, and optional_argument: 61 | * whether option takes an argument 62 | */ 63 | int has_arg; 64 | int *flag; /* if not NULL, set *flag to val when option found */ 65 | int val; /* if flag not NULL, value to set *flag to; else return value */ 66 | }; 67 | 68 | LIBW32_API int getopt(int nargc, char * const *nargv, const char *options); 69 | LIBW32_API int getopt_long(int argvc, char * const *argv, const char *options, const struct option *long_options, int *idx); 70 | LIBW32_API int getopt_long2(int argvc, char * const *argv, const char *options, const struct option *long_options, int *idx, char *buf, int buflen); 71 | 72 | #if defined(LIBW32_LIBRARY) 73 | extern void __w32_getopt_globals(void); 74 | #endif 75 | 76 | __END_DECLS 77 | 78 | #endif /*!__MINGW32__*/ 79 | 80 | #endif /*LIBW32_GETOPT_H_INCLUDED*/ 81 | -------------------------------------------------------------------------------- /libw32/grp.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_GRP_H_INCLUDED 2 | #define LIBW32_GRP_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_grp_h,"$Id: grp.h,v 1.3 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * license for more details. 32 | * ==end== 33 | */ 34 | 35 | #include /* __BEGIN_DECLS, __PDECL */ 36 | #include /* uid_t */ 37 | #include /* size_t */ 38 | 39 | __BEGIN_DECLS 40 | 41 | #if !defined(NGROUPS_MAX) 42 | #define NGROUPS_MAX 32 43 | #endif 44 | 45 | struct group { 46 | const char * gr_name; 47 | const char * gr_passwd; 48 | int gr_gid; 49 | const char ** gr_mem; 50 | }; 51 | 52 | LIBW32_API struct group *getgrgid(int); 53 | LIBW32_API struct group *getgrnam(const char *); 54 | 55 | LIBW32_API void setgrent(void); 56 | LIBW32_API struct group *getgrent(void); 57 | LIBW32_API void endgrent(void); 58 | LIBW32_API int getgrent_r(struct group *grp, char *buf, size_t buflen, struct group **result); 59 | 60 | LIBW32_API int getgrgid_r(gid_t, struct group *, char *, size_t, struct group **); 61 | LIBW32_API int getgrnam_r(const char *name, struct group *grp, char *buf, size_t buflen, struct group **result); 62 | 63 | LIBW32_API int getgroups(int gidsetsize, gid_t grouplist[]); 64 | LIBW32_API int setgroups(size_t size, const gid_t *gidset); 65 | 66 | __END_DECLS 67 | 68 | #endif /*LIBW32_GRP_H_INCLUDED*/ 69 | -------------------------------------------------------------------------------- /libw32/libgen.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_LIBGEN_H_INCLUDED 2 | #define LIBW32_LIBGEN_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libgen_h,"$Id: libgen.h,v 1.3 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 12 | * 13 | * This file is part of the WinRSH/WinSSH project. 14 | * 15 | * The applications are free software: you can redistribute it 16 | * and/or modify it under the terms of the GNU General Public License as 17 | * published by the Free Software Foundation, version 3. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * This project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * license for more details. 31 | * ==end== 32 | */ 33 | 34 | #include 35 | 36 | __BEGIN_DECLS 37 | 38 | LIBW32_API char * w32_basename (char *path); 39 | LIBW32_API char * w32_dirname (char *path); 40 | 41 | __END_DECLS 42 | 43 | #endif /*LIBW32_LIBGEN_H_INCLUDED*/ 44 | -------------------------------------------------------------------------------- /libw32/libw32.def: -------------------------------------------------------------------------------- 1 | ; libw32 library 2 | EXPORTS 3 | ; global variables, see: w32_slang.c 4 | ; variables need to be explicitly exported unlike functions. 5 | ; socket interface 6 | w32_h_errno DATA 7 | ; end 8 | -------------------------------------------------------------------------------- /libw32/libw32.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_LIBW32_H_INCLUDED 2 | #define LIBW32_LIBW32_H_INCLUDED 3 | /* -*- mode: c; indent-width: 4; -*- */ 4 | /* 5 | * win32 public interface 6 | * 7 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 8 | * 9 | * This file is part of the WinRSH/WinSSH project. 10 | * 11 | * The applications are free software: you can redistribute it 12 | * and/or modify it under the terms of the GNU General Public License as 13 | * published by the Free Software Foundation, version 3. 14 | * 15 | * Redistributions of source code must retain the above copyright 16 | * notice, and must be distributed with the license document above. 17 | * 18 | * Redistributions in binary form must reproduce the above copyright 19 | * notice, and must include the license document above in 20 | * the documentation and/or other materials provided with the 21 | * distribution. 22 | * 23 | * This project is distributed in the hope that it will be useful, 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | * license for more details. 27 | * ==end== 28 | */ 29 | 30 | #include "w32config.h" 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #endif /*LIBW32_LIBW32_H_INCLUDED*/ 40 | -------------------------------------------------------------------------------- /libw32/libw32.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016 - 2025 Adam Young. 3 | * 4 | * This file is part of the WinRSH/WinSSH project. 5 | * 6 | * The WinRSH/WinSSH project is free software: you can redistribute it 7 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 8 | * 9 | * Redistributions of source code must retain the above copyright 10 | * notice, and must be distributed with the license document above. 11 | * 12 | * Redistributions in binary form must reproduce the above copyright 13 | * notice, and must include the license document above in 14 | * the documentation and/or other materials provided with the 15 | * distribution. 16 | * 17 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * License for more details. 21 | * ==end== 22 | */ 23 | 24 | #include 25 | #include "libw32_version.h" 26 | 27 | #ifdef GCC_WINDRES 28 | VS_VERSION_INFO VERSIONINFO 29 | #else 30 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 31 | #endif 32 | FILEVERSION LIBW32_VER_MAJOR,LIBW32_VER_MINOR,LIBW32_VER_REVISION,0 33 | PRODUCTVERSION LIBW32_VER_MAJOR,LIBW32_VER_MINOR,LIBW32_VER_REVISION,0 34 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 35 | #ifdef _DEBUG 36 | FILEFLAGS 1 37 | #else 38 | FILEFLAGS 0 39 | #endif 40 | FILEOS VOS__WINDOWS32 41 | FILETYPE VFT_DLL 42 | FILESUBTYPE 0 // not used 43 | BEGIN 44 | BLOCK "StringFileInfo" 45 | BEGIN 46 | BLOCK "040904E4" 47 | //language ID = U.S. English, char set = Windows, Multilingual 48 | BEGIN 49 | VALUE "FileDescription", 50 | "Windows unix/posix emulation/compat library\0" 51 | 52 | VALUE "FileVersion", LIBW32_VERSION "\0" 53 | 54 | VALUE "InternalName", "libwin32.dll\0" 55 | 56 | VALUE "LegalCopyright", 57 | "Copyright (c) 2007 - 2025 Adam Young\0" 58 | 59 | VALUE "OriginalFilename", 60 | "libwin32." LIBW32_VERSION ".dll\0" 61 | 62 | VALUE "ProductName", 63 | "libwin32\0" 64 | 65 | VALUE "ProductVersion", 66 | LIBW32_VERSION "\0" 67 | 68 | VALUE "Comments", 69 | "For more information visit https://github.com/adamyg/winxsh\0" 70 | END 71 | END 72 | BLOCK "VarFileInfo" 73 | BEGIN 74 | VALUE "Translation", 0x0409, 1252 75 | END 76 | END 77 | -------------------------------------------------------------------------------- /libw32/libw32_version.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_VERSION_H_INCLUDED 2 | #define LIBW32_VERSION_H_INCLUDED 3 | /* 4 | * Copyright (c) 2016 - 2025 Adam Young. 5 | * 6 | * This file is part of the WinRSH/WinSSH project. 7 | * 8 | * The applications are free software: you can redistribute it 9 | * and/or modify it under the terms of the GNU General Public License as 10 | * published by the Free Software Foundation, version 3. 11 | * 12 | * Redistributions of source code must retain the above copyright 13 | * notice, and must be distributed with the license document above. 14 | * 15 | * Redistributions in binary form must reproduce the above copyright 16 | * notice, and must include the license document above in 17 | * the documentation and/or other materials provided with the 18 | * distribution. 19 | * 20 | * This project is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * license for more details. 24 | * ==end== 25 | */ 26 | 27 | #define LIBW32_VERSION "1.2.0" 28 | #define LIBW32_VER_MAJOR 1 29 | #define LIBW32_VER_MINOR 2 30 | #define LIBW32_VER_REVISION 0 31 | 32 | #endif /*LIBW32_VERSION_H_INCLUDED*/ 33 | -------------------------------------------------------------------------------- /libw32/msvc/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | source: msinttypes - http://code.google.com/p/msinttypes/ 3 | 4 | This project fills the absence of stdint.h and inttypes.h in Microsoft 5 | Visual Studio. This files were standartized by ISO/IEC as a part of C99 6 | standard library. If you want to compile or use C99 compliant project 7 | with Microsoft Visual Studio, you will likely find that you're missing 8 | these headers. Note though, that just adding these header does not make 9 | Visual Studio compiler fully C99 compliant. 10 | -------------------------------------------------------------------------------- /libw32/msvc/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_MSVC_STDBOOL_H_INCLUDED 2 | #define LIBW32_MSVC_STDBOOL_H_INCLUDED 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | // ISO C9x compliant inttypes.h for Microsoft Visual Studio 6 | // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 7 | // 8 | // Public domain 9 | // 10 | 11 | #ifndef _MSC_VER 12 | #error "Use this header only with Microsoft Visual C++ compilers!" 13 | #endif 14 | #if _MSC_VER > 1000 15 | #pragma once 16 | #endif 17 | 18 | /** 19 | * Microsoft C/C++ 20 | * version 14.00.50727.762, which comes with Visual C++ 2005, 21 | * and version 15.00.30729.01, which comes with Visual C++ 2008, 22 | * and version 16.00.30319.01, which comes with Visual C++ 2010, 23 | * do not define _Bool. 24 | */ 25 | #if defined(_MSC_VER) && _MSC_VER <= 1600 26 | typedef int _Bool; 27 | #endif 28 | 29 | #ifndef __cplusplus 30 | #define bool _Bool 31 | #define true 1 32 | #define false 0 33 | #endif 34 | 35 | #endif /*LIBW32_MSVC_STDBOOL_H_INCLUDED*/ 36 | -------------------------------------------------------------------------------- /libw32/msvc/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_MSVC_UTIME_H_INCLUDED 2 | #define LIBW32_MSVC_UTIME_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_msvc_utime_h,"$Id: utime.h,v 1.1 2020/04/29 11:54:26 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | 9 | #if (_MSC_VER >= 1800) 10 | #include 11 | #endif 12 | 13 | #endif /*LIBW32_MSVC_UTIME_H_INCLUDED*/ 14 | -------------------------------------------------------------------------------- /libw32/msvc_2019/utime.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_MSVC_UTIME_H_INCLUDED 2 | #define LIBW32_MSVC_UTIME_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_msvc_utime_h,"$Id: utime.h,v 1.1 2025/02/02 14:15:31 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | 9 | #if (_MSC_VER >= 1800) 10 | #include 11 | #endif 12 | 13 | #endif /*LIBW32_MSVC_UTIME_H_INCLUDED*/ 14 | -------------------------------------------------------------------------------- /libw32/msvc_errno.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: msvc_errno.h,v 1.4 2023/12/26 17:01:01 cvsuser Exp $ 3 | * MSVC errno filter 4 | * 5 | * This file is part of the WinRSH/WinSSH project. 6 | * 7 | * The applications are free software: you can redistribute it 8 | * and/or modify it under the terms of the GNU General Public License as 9 | * published by the Free Software Foundation, version 3. 10 | * 11 | * Redistributions of source code must retain the above copyright 12 | * notice, and must be distributed with the license document above. 13 | * 14 | * Redistributions in binary form must reproduce the above copyright 15 | * notice, and must include the license document above in 16 | * the documentation and/or other materials provided with the 17 | * distribution. 18 | * 19 | * This project is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * License for more details. 23 | * ==end== 24 | */ 25 | 26 | #undef EADDRINUSE //100 27 | #undef EADDRNOTAVAIL //101 28 | #undef EAFNOSUPPORT //102 29 | #undef EALREADY //103 30 | //#define EBADMSG 104 31 | //#define ECANCELED 105 32 | #undef ECONNABORTED //106 33 | #undef ECONNREFUSED //107 34 | #undef ECONNRESET //108 35 | #undef EDESTADDRREQ //109 36 | #undef EHOSTUNREACH //110 37 | //#define EIDRM 111 38 | #undef EINPROGRESS //112 39 | #undef EISCONN //113 40 | #undef ELOOP //114 41 | #undef EMSGSIZE //115g 42 | #undef ENETDOWN //116 43 | #undef ENETRESET //117 44 | #undef ENETUNREACH //118 45 | #undef ENOBUFS //119 46 | //#define ENODATA 120 47 | //#define ENOLINK 121 48 | //#define ENOMSG 122 49 | #undef ENOPROTOOPT //123 50 | //#define ENOSR 124 51 | //#define ENOSTR 125 52 | //#define ENOTCONN 126 53 | #undef ENOTCONN //126 54 | #undef ENOTRECOVERABLE //127 55 | #undef ENOTSOCK //128 56 | //#define ENOTSUP 129 57 | #undef EOPNOTSUPP //130 58 | //#define EOTHER 131 59 | //#define EOVERFLOW 132 60 | //#define EOWNERDEAD 133 61 | //#define EPROTO 134 62 | #undef EPROTONOSUPPORT //135 63 | #undef EPROTOTYPE //136 64 | //#define ETIME 137 65 | #undef ETIMEDOUT //138 66 | //#define ETXTBSY 139 67 | #undef EWOULDBLOCK //140 68 | 69 | //end 70 | -------------------------------------------------------------------------------- /libw32/msvc_system_error.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // MSVC +2010/ 3 | // 4 | // Work around for the following condition, 5 | // 6 | // is incompatible with _CRT_NO_POSIX_ERROR_CODES. 7 | // 8 | 9 | #include 10 | 11 | #if defined(__cplusplus) 12 | #if defined(_MSC_VER) && (_MSC_VER > _MSC_VER_2010) && \ 13 | defined(_CRT_NO_POSIX_ERROR_CODES) 14 | // 15 | // Problem: 16 | // fails to compile with _CRT_NO_POSIX_ERROR_CODES defined as they are referenced 17 | // within the 'enum class errc' definitions. yet the associations are irrelevant in many ways. 18 | // 19 | // Description: 20 | // _CRT_NO_POSIX_ERROR_CODES and the values defined within do not reflect either 21 | // WinSock's nor WinSystem error codes, for example: 22 | // 23 | // EINVAL is assigned to 22, which neither maps to 24 | // 25 | // o ERROR_INVALID_PARAMETER (87), or 26 | // o WSAEINVAL (10004) 27 | // 28 | // In addition, the available error codes do not reflect the full scope of reported either 29 | // WinSock's or OS API's. 30 | // 31 | // Hence we disable globally and define our own set against WinSock2 returns allowing them 32 | // to be functionality compatiable with API calls; see . 33 | // 34 | // Notes: 35 | // Only become an issue from MSVC 2010+ and recently addressed in MSVC 2019+. 36 | // 37 | // Ref: https://github.com/microsoft/STL/blob/master/stl/src/syserror.cpp 38 | // 39 | #undef _CRT_NO_POSIX_ERROR_CODES 40 | #include 41 | #define _CRT_NO_POSIX_ERROR_CODES 42 | 43 | #else 44 | #include 45 | #endif 46 | 47 | #endif //__cplusplus 48 | 49 | //end 50 | -------------------------------------------------------------------------------- /libw32/netdb.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_NETDB_H_INCLUDED 2 | #define LIBW32_NETDB_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_netdb_h,"$Id: netdb.h,v 1.9 2025/02/02 08:46:57 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * Copyright (c) 1998 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * license for more details. 32 | * ==end== 33 | */ 34 | 35 | #include /* winsock etc */ 36 | #include 37 | 38 | __BEGIN_DECLS 39 | 40 | #if (defined(_MSC_VER) && (_MSC_VER < 1400)) || \ 41 | defined(__WATCOMC__) 42 | LIBW32_API const char * gai_strerror(int ecode); 43 | #endif 44 | LIBW32_API const char * w32_gai_strerror(int ecode); 45 | 46 | __END_DECLS 47 | 48 | #endif /*LIBW32_NETDB_H_INCLUDED*/ 49 | -------------------------------------------------------------------------------- /libw32/netinet/in.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_NETINET_IN_H_INCLUDED 2 | #define LIBW32_NETINET_IN_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_netinet_in_h,"$Id: in.h,v 1.5 2023/12/26 17:01:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * netinet/in.h 10 | * 11 | * Copyright (c) 1998 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * This project is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * License for more details. 23 | * ==end== 24 | */ 25 | 26 | #include 27 | #include /* winsock and windows.h guard */ 28 | 29 | #endif /*LIBW32_NETINET_IN_H_INCLUDED*/ 30 | -------------------------------------------------------------------------------- /libw32/netinet/tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_NETINET_TCP_H_INCLUDED 2 | #define LIBW32_NETINET_TCP_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_netinet_tcp_h,"$Id: tcp.h,v 1.5 2023/12/26 17:01:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * netinet/tcp.h 10 | * 11 | * Copyright (c) 1998 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The WinRSH/WinSSH project is free software: you can redistribute it 17 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 18 | * 19 | * This project is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * License for more details. 23 | * ==end== 24 | */ 25 | 26 | #include 27 | #include /* winsock and windows.h guard */ 28 | 29 | #endif /*LIBW32_NETINET_TCP_H_INCLUDED*/ 30 | -------------------------------------------------------------------------------- /libw32/notice.txt: -------------------------------------------------------------------------------- 1 | * 2 | * This file is part of the WinRSH/WinSSH project. 3 | * 4 | * The applications are free software: you can redistribute it 5 | * and/or modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation, version 3. 7 | * 8 | * Redistributions of source code must retain the above copyright 9 | * notice, and must be distributed with the license document above. 10 | * 11 | * Redistributions in binary form must reproduce the above copyright 12 | * notice, and must include the license document above in 13 | * the documentation and/or other materials provided with the 14 | * distribution. 15 | * 16 | * This project is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * License for more details. 20 | * ==end== 21 | -------------------------------------------------------------------------------- /libw32/pwd.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_PWD_H_INCLUDED 2 | #define LIBW32_PWD_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_pwd_h,"$Id: pwd.h,v 1.7 2023/12/26 17:01:01 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * pwd.h - password structure 12 | * 13 | * This file is part of the WinRSH/WinSSH project. 14 | * 15 | * The applications are free software: you can redistribute it 16 | * and/or modify it under the terms of the GNU General Public License as 17 | * published by the Free Software Foundation, version 3. 18 | * 19 | * Redistributions of source code must retain the above copyright 20 | * notice, and must be distributed with the license document above. 21 | * 22 | * Redistributions in binary form must reproduce the above copyright 23 | * notice, and must include the license document above in 24 | * the documentation and/or other materials provided with the 25 | * distribution. 26 | * 27 | * This project is distributed in the hope that it will be useful, 28 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | * license for more details. 31 | * ==end== 32 | */ 33 | 34 | #include /* __BEGIN_DECLS, __PDECL */ 35 | #include /* uid_t */ 36 | #include /* size_t */ 37 | 38 | __BEGIN_DECLS 39 | 40 | /* 41 | * The header shall provide a definition for struct passwd, 42 | * which shall include at least the following members: 43 | * 44 | * char *pw_name User's login name. 45 | * uid_t pw_uid Numerical user ID. 46 | * gid_t pw_gid Numerical group ID. 47 | * char *pw_dir Initial working directory. 48 | * char *pw_shell Program to use as shell. 49 | */ 50 | 51 | struct passwd { 52 | const char * pw_name; 53 | const char * pw_passwd; 54 | int pw_uid; 55 | int pw_gid; 56 | const char * pw_age; 57 | const char * pw_comment; 58 | const char * pw_gecos; 59 | const char * pw_dir; 60 | const char * pw_shell; 61 | long pw_audid; 62 | int pw_audflg; 63 | }; 64 | 65 | LIBW32_API struct passwd *getpwuid(int); 66 | LIBW32_API struct passwd *getpwnam(const char *); 67 | 68 | LIBW32_API void setpwent(void); 69 | LIBW32_API struct passwd *getpwent(void); 70 | LIBW32_API void endpwent(void); 71 | LIBW32_API int getpwent_r(struct passwd *, char *, size_t, struct passwd **); 72 | 73 | LIBW32_API int getpwnam_r(const char *, struct passwd *, char *, size_t, struct passwd **); 74 | LIBW32_API int getpwuid_r(uid_t, struct passwd *, char *, size_t, struct passwd **); 75 | 76 | __END_DECLS 77 | 78 | #endif /*LIBW32_PWD_H_INCLUDED*/ 79 | -------------------------------------------------------------------------------- /libw32/semaphore.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SEMAPHORE_H_INCLUDED 2 | #define LIBW32_SEMAPHORE_H_INCLUDED 3 | 4 | #include 5 | #include 6 | 7 | __BEGIN_DECLS 8 | 9 | #ifndef _TIMESPEC_DEFINED 10 | #define _TIMESPEC_DEFINED 11 | struct timespec { 12 | long tv_sec; 13 | long tv_nsec; 14 | }; 15 | #endif 16 | 17 | #ifndef _SEM_T_DEFINED 18 | #define _SEM_T_DEFINED 19 | typedef HANDLE sem_t; 20 | #endif 21 | 22 | #define _POSIX_SEMAPHORES 23 | #define SEM_FAILED (-1) 24 | 25 | LIBW32_API int sem_init(sem_t *sem, int pshared, unsigned int value); 26 | LIBW32_API int sem_destroy(sem_t *sem); 27 | LIBW32_API int sem_trywait(sem_t *sem); 28 | LIBW32_API int sem_wait(sem_t * sem); 29 | LIBW32_API int sem_timedwait(sem_t *sem, const struct timespec *abstime); 30 | LIBW32_API int sem_post(sem_t *sem); 31 | LIBW32_API int sem_post_multiple(sem_t *sem, int count); 32 | LIBW32_API int sem_open(const char *name, int oflag, int mode, unsigned int value); 33 | LIBW32_API int sem_close(sem_t *sem); 34 | LIBW32_API int sem_unlink(const char *name); 35 | LIBW32_API int sem_getvalue(sem_t *sem, int *sval); 36 | 37 | __END_DECLS 38 | 39 | #endif /*LIBW32_SEMAPHORE_H_INCLUDED*/ 40 | -------------------------------------------------------------------------------- /libw32/sys/fd_set.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* 4 | * 5 | * 6 | * Copyright (c) 2022 - 2023, Adam Young. 7 | * All rights reserved. 8 | * 9 | * 10 | * The applications are free software: you can redistribute it 11 | * and/or modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation, version 3. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * This project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * license for more details. 26 | * ==end== 27 | */ 28 | 29 | #include 30 | 31 | /*end*/ 32 | -------------------------------------------------------------------------------- /libw32/sys/file.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_FILE_H_INCLUDED 2 | #define LIBW32_SYS_FILE_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_file_h,"$Id: file.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 sys/file.h 10 | * 11 | * Copyright (c) 2020 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * License for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | 37 | #define LOCK_SH 0x01 38 | #define LOCK_EX 0x02 39 | #define LOCK_NB 0x04 40 | #define LOCK_UN 0x08 41 | 42 | __BEGIN_DECLS 43 | 44 | LIBW32_API int w32_flock(int fd, int operation); 45 | 46 | __END_DECLS 47 | 48 | #endif /*LIBW32_SYS_FILE_H_INCLUDED*/ 49 | -------------------------------------------------------------------------------- /libw32/sys/ioctl.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_IOCTL_H_INCLUDED 2 | #define LIBW32_SYS_IOCTL_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_ioctl_h,"$Id: ioctl.h,v 1.5 2022/03/15 12:15:39 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 1998 - 2022, Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * License for more details. 30 | * ==end== 31 | */ 32 | 33 | #endif /*LIBW32_SYS_IOCTL_H_INCLUDED*/ 34 | -------------------------------------------------------------------------------- /libw32/sys/mount.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_MOUNT_H_INCLUDED 2 | #define LIBW32_SYS_MOUNT_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_mount_h,"$Id: mount.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 mount() implementation 10 | * 11 | * Copyright (c) 2012 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * License for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | 37 | #define MOUNT_NONE 0 38 | #define MOUNT_UFS 1 39 | #define MOUNT_NFS 2 40 | #define MOUNT_MFS 3 41 | #define MOUNT_PC 4 42 | #define MOUNT_LFS 5 43 | #define MOUNT_LO 6 44 | #define MOUNT_FDESC 7 45 | #define MOUNT_PORTAL 8 46 | #define MOUNT_NULL 9 47 | #define MOUNT_UMAP 10 48 | #define MOUNT_KERNFS 11 49 | 50 | #define MOUNT_TFS 12 51 | #define MOUNT_TMP 13 52 | #define MOUNT_MSDOS 14 53 | #define MOUNT_ISO9660 15 54 | #define MOUNT_MAXTYPE 15 55 | 56 | #define INITMOUNTNAMES { \ 57 | "none", /* 0 MOUNT_NONE */ \ 58 | "ufs", /* 1 MOUNT_UFS */ \ 59 | "nfs", /* 2 MOUNT_NFS */ \ 60 | "mfs", /* 3 MOUNT_MFS */ \ 61 | "pc", /* 4 MOUNT_PC */ \ 62 | "lfs", /* 5 MOUNT_LFS */ \ 63 | "lo", /* 6 MOUNT_LO */ \ 64 | "fdesc", /* 7 MOUNT_FDESC */ \ 65 | "portal", /* 8 MOUNT_PORTAL */ \ 66 | "null", /* 9 MOUNT_NULL */ \ 67 | "umap", /* 10 MOUNT_UMAP */ \ 68 | "kernfs", /* 11 MOUNT_KERNFS */ \ 69 | "tfs", /* 12 MOUNT_TFS */ \ 70 | "tmp", /* 13 MOUNT_TMP */ \ 71 | "msdos", /* 14 MOUNT_MSDOS */ \ 72 | "iso9660", /* 15 MOUNT_ISO9660 */ \ 73 | 0, \ 74 | } 75 | 76 | #define MNT_WAIT 0 77 | #define MNT_NOWAIT 1 78 | 79 | __BEGIN_DECLS 80 | 81 | struct statfs; 82 | 83 | LIBW32_API int getfsstat(struct statfs *buf, long bufsize, int mode); 84 | LIBW32_API int getmntinfo(struct statfs **mntbufp, int flags); 85 | 86 | __END_DECLS 87 | 88 | #endif /*LIBW32_SYS_MOUNT_H_INCLUDED*/ 89 | -------------------------------------------------------------------------------- /libw32/sys/pack0.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; indent-width: 4; -*- 2 | * $Id: pack0.h,v 1.4 2020/07/02 21:31:44 cvsuser Exp $ 3 | * ==noguard== 4 | * 5 | * win32 declaration helpers 6 | * 7 | * Copyright (c) 1998 - 2020, Adam Young. 8 | * All rights reserved. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * License for more details. 28 | * ==end== 29 | * 30 | * Usage: 31 | * 32 | * #include 33 | * 34 | * #include 35 | * struct __packed_pre__ mypackedstruct { 36 | * : 37 | * } __packed_post__; 38 | * #include 39 | * 40 | */ 41 | 42 | 43 | #if !defined(__SYS_PACK1_H_INCLUDED__) 44 | #error bad usage required 45 | #endif 46 | 47 | #if !(defined(lint) || defined(_lint)) 48 | # if defined(_MSC_VER) && (_MSC_VER >= 800) 49 | # pragma pack() 50 | # elif defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__PARADIGM__) 51 | # pragma pack() 52 | # endif 53 | #endif 54 | -------------------------------------------------------------------------------- /libw32/sys/pack1.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; indent-width: 4; -*- 2 | * $Id: pack1.h,v 1.6 2023/12/26 17:01:06 cvsuser Exp $ 3 | * ==noguard== 4 | * 5 | * win32 declaration helpers 6 | * 7 | * Copyright (c) 1998 - 2023, Adam Young. 8 | * All rights reserved. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * License for more details. 28 | * ==end== 29 | * 30 | * Usage: 31 | * 32 | * #include 33 | * 34 | * #include 35 | * struct __packed_pre__ mypackedstruct { 36 | * : 37 | * } __packed_post__; 38 | * #include 39 | * 40 | */ 41 | 42 | #include /* __packed_pre__ and __packed_post__ */ 43 | 44 | #if !(defined(lint) || defined(_lint)) 45 | # if defined(_MSC_VER) && (_MSC_VER >= 800) 46 | # ifndef __SYS_PACK1_H_INCLUDED__ 47 | # pragma warning(disable:4103) 48 | # endif 49 | # pragma pack(1) 50 | # elif defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__PARADIGM__) 51 | # pragma pack(1) 52 | # endif 53 | #endif 54 | #define __SYS_PACK1_H_INCLUDED__ 55 | -------------------------------------------------------------------------------- /libw32/sys/param.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_PARAM_H_INCLUDED 2 | #define LIBW32_SYS_PARAM_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_param_h,"$Id: param.h,v 1.6 2023/12/26 17:01:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 10 | * 11 | * Copyright (c) 1998 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * License for more details. 32 | * ==end== 33 | */ 34 | 35 | #include /*PATH_MAX*/ 36 | #include /*PATH_MAX*/ 37 | #include /*_MAX_PATH*/ 38 | 39 | #define ALIGNBYTES 3 /*FIXME , 32/64 bit machines*/ 40 | #define ALIGN(p) (((unsigned int)(p) + ALIGNBYTES) &~ ALIGNBYTES) 41 | 42 | #if !defined(PATH_MAX) 43 | #define PATH_MAX _MAX_PATH 44 | #define NAME_MAX _MAX_PATH 45 | #endif 46 | 47 | /*limits.h*/ 48 | #define _POSIX2_LINE_MAX 2048 49 | #define LINE_MAX 2048 50 | 51 | #endif /*LIBW32_SYS_PARAM_H_INCLUDED*/ 52 | -------------------------------------------------------------------------------- /libw32/sys/poll.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_POLL_H_INCLUDED 2 | #define LIBW32_SYS_POLL_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_poll_h,"$Id: poll.h,v 1.6 2023/12/26 17:01:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 1998 - 2023, Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * License for more details. 30 | * ==end== 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | #endif /*LIBW32_SYS_POLL_H_INCLUDED*/ 38 | -------------------------------------------------------------------------------- /libw32/sys/rwlock.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_RWLOCK_H_INCLUDED 2 | #define LIBW32_SYS_RWLOCK_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_rwlock_h,"$Id: rwlock.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 implementation 10 | * 11 | * Copyright (c) 1998 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * License for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | 37 | typedef struct rwlock { 38 | #if defined(_WIN64) 39 | unsigned char opaque[128]; 40 | #else 41 | unsigned char opaque[64]; 42 | #endif 43 | } rwlock_t; 44 | 45 | #define RWLOCK_INITIALIZER {0xffff} 46 | 47 | __BEGIN_DECLS 48 | 49 | LIBW32_API void rwlock_init(struct rwlock *rw); 50 | LIBW32_API void rwlock_destroy(struct rwlock *rw); 51 | LIBW32_API void rwlock_rdlock(struct rwlock *rw); 52 | LIBW32_API void rwlock_wrlock(struct rwlock *rw); 53 | LIBW32_API void rwlock_rdunlock(struct rwlock *rw); 54 | LIBW32_API void rwlock_wrunlock(struct rwlock *rw); 55 | LIBW32_API void rwlock_unlock(struct rwlock *rw); 56 | LIBW32_API int rwlock_status(struct rwlock *rw); 57 | 58 | __END_DECLS 59 | 60 | #endif /*WIN32_SYS_RWLOCK_H_INCLUDED*/ 61 | -------------------------------------------------------------------------------- /libw32/sys/select.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_SELECT_H_INCLUDED 2 | #define LIBW32_SYS_SELECT_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_select_h,"$Id: select.h,v 1.5 2023/12/26 17:01:06 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 2012 - 2023 Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * License for more details. 30 | * ==end== 31 | */ 32 | 33 | #if !defined(_WINSOCK2_H) /* MINGW32 guard */ 34 | #include /* winsock and windows.h guard */ 35 | #endif 36 | 37 | #endif /*LIBW32_SYS_SELECT_H_INCLUDED*/ 38 | -------------------------------------------------------------------------------- /libw32/sys/uio.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_UIO_H_INCLUDED 2 | #define LIBW32_SYS_UIO_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_uio_h,"$Id: uio.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 sys/uio.h 10 | * 11 | * Copyright (c) 1998 - 2023, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * license for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | 37 | #include /* size_t */ 38 | #include /* INT_MAX */ 39 | 40 | #define IOV_MAX 64 41 | #if !defined(__MINGW32__) 42 | #if !defined(SSIZE_MAX) 43 | #define SSIZE_MAX INT_MAX 44 | #endif 45 | #endif 46 | 47 | __BEGIN_DECLS 48 | 49 | struct iovec { 50 | void * iov_base; 51 | int iov_len; 52 | }; 53 | 54 | LIBW32_API int /*ssize_t*/ readv(int, const struct iovec *, int); 55 | LIBW32_API int /*ssize_t*/ writev(int, const struct iovec *, int); 56 | 57 | // LIBW32_API ssize_t preadv(int fd, const struct iovec *iov, int iovcnt, off_t offset); 58 | // LIBW32_API ssize_t pwritev(int fd, const struct iovec *iov, int iovcnt, off_t offset); 59 | // LIBW32_API ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); 60 | // LIBW32_API ssize_t pwritev2(int fd, const struct iovec *iov, int iovcnt, off_t offset, int flags); 61 | 62 | __END_DECLS 63 | 64 | #endif /*LIBW32_SYS_UIO_H_INCLUDED*/ 65 | -------------------------------------------------------------------------------- /libw32/sys/utsname.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_UTSNAME_H_INCLUDED 2 | #define LIBW32_SYS_UTSNAME_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_utsname_h,"$Id: utsname.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 2012 - 2023, Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * License for more details. 30 | * ==end== 31 | */ 32 | 33 | #define _UTSNAME_LENGTH 64 34 | 35 | struct utsname { 36 | char sysname[_UTSNAME_LENGTH]; 37 | char nodename[_UTSNAME_LENGTH]; 38 | char release[_UTSNAME_LENGTH]; 39 | char version[_UTSNAME_LENGTH]; 40 | char machine[_UTSNAME_LENGTH]; 41 | }; 42 | 43 | #include /* __BEGIN_DECLS, __PDECL */ 44 | 45 | __BEGIN_DECLS 46 | LIBW32_API int uname(struct utsname *buf); 47 | __END_DECLS 48 | 49 | #endif /*LIBW32_SYS_UTSNAME_H_INCLUDED*/ 50 | -------------------------------------------------------------------------------- /libw32/sys/vfs.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_VFS_H 2 | #define LIBW32_SYS_VFS_H 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_vfs_h,"$Id: vfs.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 2012 - 2023, Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * License for more details. 30 | * ==end== 31 | */ 32 | 33 | #include 34 | 35 | #endif /*LIBW32_SYS_VFS_H*/ 36 | -------------------------------------------------------------------------------- /libw32/sys/wait.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_SYS_WAIT_H 2 | #define LIBW32_SYS_WAIT_H 3 | #include 4 | __CIDENT_RCSID(gr_libw32_sys_wait_h,"$Id: wait.h,v 1.1 2025/02/02 10:23:25 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 2012 - 2023Adam Young. 10 | * All rights reserved. 11 | * 12 | * This file is part of the WinRSH/WinSSH project. 13 | * 14 | * The applications are free software: you can redistribute it 15 | * and/or modify it under the terms of the GNU General Public License as 16 | * published by the Free Software Foundation, version 3. 17 | * 18 | * Redistributions of source code must retain the above copyright 19 | * notice, and must be distributed with the license document above. 20 | * 21 | * Redistributions in binary form must reproduce the above copyright 22 | * notice, and must include the license document above in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * 26 | * This project is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * license for more details. 30 | * ==end== 31 | */ 32 | 33 | #endif /*LIBW32_SYS_WAIT_H*/ 34 | -------------------------------------------------------------------------------- /libw32/tzfile.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_TZFILE_H_INCLUDED 2 | #define LIBW32_TZFILE_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_tzfile_h,"$Id: tzfile.h,v 1.1 2023/12/26 17:01:01 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * Copyright (c) 1988 Regents of the University of California. 10 | * All rights reserved. 11 | * 12 | * This code is derived from software contributed to Berkeley by 13 | * Arthur David Olson of the National Cancer Institute. 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * 1. Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | */ 21 | 22 | #define TZ_MAX_TIMES 2000 23 | 24 | #define TZ_MAX_TYPES 256 /* This must be at least 17 for Europe/Samara and Europe/Vilnius. */ 25 | /* Limited by what (unsigned char)'s can hold */ 26 | 27 | #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ 28 | /* (limited by what unsigned chars can hold) */ 29 | 30 | #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ 31 | 32 | #define SECSPERMIN 60 33 | #define MINSPERHOUR 60 34 | #define HOURSPERDAY 24 35 | #define DAYSPERWEEK 7 36 | #define DAYSPERNYEAR 365 37 | #define DAYSPERLYEAR 366 38 | #define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) 39 | #define SECSPERDAY ((int32_t) SECSPERHOUR * HOURSPERDAY) 40 | #define MONSPERYEAR 12 41 | 42 | #define TM_SUNDAY 0 43 | #define TM_MONDAY 1 44 | #define TM_TUESDAY 2 45 | #define TM_WEDNESDAY 3 46 | #define TM_THURSDAY 4 47 | #define TM_FRIDAY 5 48 | #define TM_SATURDAY 6 49 | 50 | #define TM_JANUARY 0 51 | #define TM_FEBRUARY 1 52 | #define TM_MARCH 2 53 | #define TM_APRIL 3 54 | #define TM_MAY 4 55 | #define TM_JUNE 5 56 | #define TM_JULY 6 57 | #define TM_AUGUST 7 58 | #define TM_SEPTEMBER 8 59 | #define TM_OCTOBER 9 60 | #define TM_NOVEMBER 10 61 | #define TM_DECEMBER 11 62 | 63 | #define TM_YEAR_BASE 1900 64 | 65 | #define EPOCH_YEAR 1970 66 | #define EPOCH_WDAY TM_THURSDAY 67 | 68 | #define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) 69 | 70 | #endif /*LIBW32_TZFILE_H_INCLUDED*/ 71 | 72 | 73 | -------------------------------------------------------------------------------- /libw32/w32_getopt_vars.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_getopt_vars_c,"$Id: w32_getopt_vars.c,v 1.2 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * common getopt and getopt_long globals 7 | */ 8 | 9 | #if !defined(__MINGW32__) 10 | 11 | #include 12 | 13 | #include 14 | #include "getopt.h" 15 | 16 | /*LIBW32_VAR*/ int opterr = 1; /* if error message should be printed */ 17 | /*LIBW32_VAR*/ int optind = 1; /* index into parent argv vector */ 18 | /*LIBW32_VAR*/ int optopt = '?'; /* character checked for validity */ 19 | /*LIBW32_VAR*/ int optreset = 0; /* reset getopt */ 20 | /*LIBW32_VAR*/ char *optarg = NULL; /* argument associated with option */ 21 | 22 | #endif /*!__MINGW32__*/ 23 | 24 | extern void __w32_getopt_globals(void); 25 | 26 | void 27 | __w32_getopt_globals(void) 28 | { 29 | } 30 | 31 | /*end*/ 32 | -------------------------------------------------------------------------------- /libw32/w32_langinfo.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_langinfo_c,"$Id: w32_langinfo.c,v 1.3 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 langinfo() implementation 7 | * 8 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * license for more details. 28 | * ==end== 29 | */ 30 | 31 | #include "win32_internal.h" 32 | #include 33 | 34 | /* 35 | // NAME 36 | // nl_langinfo - language information 37 | // 38 | // SYNOPSIS 39 | // #include 40 | // 41 | // char *nl_langinfo(nl_item item); 42 | // 43 | // DESCRIPTION 44 | // The nl_langinfo() function shall return a pointer to a string containing 45 | // information relevant to the particular language or cultural area defined in the 46 | // program's locale (see ). The manifest constant names and values of item 47 | // are defined in . For example: 48 | // 49 | // nl_langinfo(ABDAY_1) 50 | // 51 | // would return a pointer to the string "Dom" if the identified language was 52 | // Portuguese, and "Sun" if the identified language was English. 53 | // 54 | // Calls to setlocale() with a category corresponding to the category of item (see 55 | // ), or to the category LC_ALL , may overwrite the array pointed to by 56 | // the return value. 57 | // 58 | // The nl_langinfo() function need not be reentrant. A function that is not required 59 | // to be reentrant is not required to be thread-safe. 60 | // 61 | // RETURN VALUE 62 | // In a locale where langinfo data is not defined, nl_langinfo() shall return a 63 | // pointer to the corresponding string in the POSIX locale. In all locales, 64 | // nl_langinfo() shall return a pointer to an empty string if item contains an invalid 65 | // setting. 66 | // 67 | // This pointer may point to static data that may be overwritten on the next call. 68 | // 69 | // ERRORS 70 | // No errors are defined. 71 | */ 72 | LIBW32_API const char * 73 | nl_langinfo(nl_item item) 74 | { 75 | switch (item) { 76 | case CODESET: /* assume terminal is UTF-8 */ 77 | return "UTF-8"; /* TODO: Hook vio driver*/ 78 | } 79 | return "n/a"; 80 | } 81 | 82 | /*end*/ 83 | -------------------------------------------------------------------------------- /libw32/w32_pipe.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_pipe_c,"$Id: w32_pipe.c,v 1.2 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 pipe() system calls, 7 | * 8 | * Copyright (c) 2018 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * license for more details. 29 | * ==end== 30 | * 31 | * Notice: Portions of this text are reprinted and reproduced in electronic form. from 32 | * IEEE Portable Operating System Interface (POSIX), for reference only. Copyright (C) 33 | * 2001-2003 by the Institute of. Electrical and Electronics Engineers, Inc and The Open 34 | * Group. Copyright remains with the authors and the original Standard can be obtained 35 | * online at http://www.opengroup.org/unix/online.html. 36 | * ==extra== 37 | */ 38 | 39 | #ifndef _WIN32_WINNT 40 | #define _WIN32_WINNT 0x0501 /* enable xp+ features */ 41 | #endif 42 | 43 | #include "win32_internal.h" 44 | #include "win32_misc.h" 45 | #include 46 | 47 | LIBW32_API int 48 | w32_pipe(int fildes[2]) 49 | { 50 | HANDLE hReadPipe = 0, hWritePipe = 0; 51 | const BOOL ret = CreatePipe(&hReadPipe, &hWritePipe, NULL, 0); 52 | 53 | if (ret) { 54 | fildes[0] = _open_osfhandle((OSFHANDLE)hReadPipe, O_NOINHERIT); 55 | if (fildes[0] < 0) { 56 | CloseHandle(hReadPipe), CloseHandle(hWritePipe); 57 | return -1; 58 | } 59 | fildes[1] = _open_osfhandle((OSFHANDLE)hWritePipe, O_NOINHERIT); 60 | if (fildes[1] < 0) { 61 | _close(fildes[0]), CloseHandle(hWritePipe); 62 | return -1; 63 | } 64 | return 0; 65 | } 66 | w32_errno_set(); 67 | return -1; 68 | } 69 | 70 | /*end*/ 71 | -------------------------------------------------------------------------------- /libw32/w32_setrlimit.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_setrlimit_c,"$Id: w32_setrlimit.c,v 1.2 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 setrlimit() system calls 7 | * 8 | * Copyright (c) 2020 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * license for more details. 29 | * ==end== 30 | * 31 | * Notice: Portions of this text are reprinted and reproduced in electronic form. from 32 | * IEEE Portable Operating System Interface (POSIX), for reference only. Copyright (C) 33 | * 2001-2003 by the Institute of. Electrical and Electronics Engineers, Inc and The Open 34 | * Group. Copyright remains with the authors and the original Standard can be obtained 35 | * online at http://www.opengroup.org/unix/online.html. 36 | * ==extra== 37 | */ 38 | 39 | #include "win32_internal.h" 40 | 41 | #include 42 | #include 43 | #include 44 | 45 | int 46 | setrlimit(int resource, const struct rlimit *rlp) 47 | { 48 | if (NULL == rlp) { 49 | errno = EINVAL; 50 | } else if (rlp->rlim_cur > rlp->rlim_max) { 51 | errno = EINVAL; 52 | } else { 53 | switch (resource) { 54 | case RLIMIT_NOFILE: { 55 | int newmax, ret = 0; 56 | if (rlp->rlim_max > WIN32_FILDES_DEF) { 57 | #if defined(__WATCOMC__) 58 | if (_grow_handles(rlp->rlim_max) < rlp->rlim_max) { 59 | #else 60 | if (-1 == (newmax = _setmaxstdio((int)rlp->rlim_max))) { 61 | #endif 62 | errno = EINVAL; 63 | ret = -1; 64 | } 65 | w32_sockfd_limit((int)rlp->rlim_max); 66 | } 67 | return ret; 68 | } 69 | } 70 | errno = ENOSYS; 71 | } 72 | return -1; 73 | } 74 | 75 | /*end*/ 76 | -------------------------------------------------------------------------------- /libw32/w32_signal.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_signal_c,"$Id: w32_signal.c,v 1.3 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 signal support 7 | * 8 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * license for more details. 28 | * ==end== 29 | */ 30 | 31 | #include "win32_internal.h" 32 | #include 33 | #include 34 | 35 | #if !defined(__MINGW32__) || defined(__MINGW64_VERSION_MAJOR) 36 | /* 37 | // NAME 38 | // sigemptyset - initialize and empty a signal set 39 | // 40 | // SYNOPSIS 41 | // #include 42 | // 43 | // int sigemptyset(sigset_t *set); [Option End] 44 | // 45 | // DESCRIPTION 46 | // The sigemptyset() function initializes the signal set pointed to by set, such that all signals defined in POSIX.1-2017 are excluded. 47 | // 48 | // RETURN VALUE 49 | // Upon successful completion, sigemptyset() shall return 0; otherwise, it shall return -1 and set errno to indicate the error. 50 | // 51 | // ERRORS 52 | // No errors are defined. 53 | // 54 | */ 55 | LIBW32_API int 56 | sigemptyset(sigset_t *ss) 57 | { 58 | if (ss) { 59 | memset(ss, 0, sizeof(*ss)); 60 | return 0; 61 | } 62 | errno = EINVAL; 63 | return -1; 64 | } 65 | 66 | 67 | LIBW32_API int 68 | sigaction(int sig, struct sigaction *sa, struct sigaction *osa) 69 | { 70 | switch (sig) { 71 | case SIGPIPE: 72 | return 0; 73 | } 74 | 75 | // if (sa) { 76 | // if (osa) { 77 | // osa->sa_handler = signal(sig, (void (__cdecl *)(int))sa->sa_handler); 78 | // 79 | // } else { 80 | // signal(sig, (void (__cdecl *)(int))sa->sa_handler); 81 | // } 82 | // } 83 | errno = EINVAL; 84 | return -1; 85 | } 86 | 87 | #endif /*__MINGW32__*/ 88 | 89 | /*end*/ 90 | -------------------------------------------------------------------------------- /libw32/w32_string.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_string_c,"$Id: w32_string.c,v 1.3 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 string functionality 7 | * 8 | * Copyright (c) 2007, 2012 - 2025 Adam Young. 9 | * 10 | * This file is part of the WinRSH/WinSSH project. 11 | * 12 | * The applications are free software: you can redistribute it 13 | * and/or modify it under the terms of the GNU General Public License as 14 | * published by the Free Software Foundation, version 3. 15 | * 16 | * Redistributions of source code must retain the above copyright 17 | * notice, and must be distributed with the license document above. 18 | * 19 | * Redistributions in binary form must reproduce the above copyright 20 | * notice, and must include the license document above in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * 24 | * This project is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * license for more details. 28 | * ==end== 29 | * 30 | * Notice: Portions of this text are reprinted and reproduced in electronic form. from 31 | * IEEE Portable Operating System Interface (POSIX), for reference only. Copyright (C) 32 | * 2001-2003 by the Institute of. Electrical and Electronics Engineers, Inc and The Open 33 | * Group. Copyright remains with the authors and the original Standard can be obtained 34 | * online at http://www.opengroup.org/unix/online.html. 35 | * ==extra== 36 | */ 37 | 38 | #include "win32_internal.h" 39 | 40 | #include 41 | #include 42 | #include 43 | 44 | 45 | #if defined(NEED_STRCASECMP) 46 | LIBW32_API int 47 | strcasecmp(const char *s1, const char *s2) 48 | { 49 | #if defined(_MSC_VER) && (_MSC_VER >= 1400) 50 | return _stricmp(s1, s2); 51 | #else 52 | return stricmp(s1, s2); 53 | #endif 54 | } 55 | #endif 56 | 57 | 58 | #if defined(NEED_STRCASECMP) 59 | LIBW32_API int 60 | strncasecmp(const char *s1, const char *s2, size_t len) 61 | { 62 | #if defined(_MSC_VER) && (_MSC_VER >= 1400) 63 | return _strnicmp(s1, s2, len); 64 | #else 65 | return strnicmp(s1, s2, len); 66 | #endif 67 | } 68 | #endif 69 | 70 | 71 | #if defined(NEED_STRNLEN) 72 | LIBW32_API size_t 73 | strnlen(const char *s, size_t maxlen) 74 | { 75 | register const char *e; 76 | size_t n; 77 | 78 | for (e = s, n = 0; *e && n < maxlen; e++, n++) 79 | /**/; 80 | return n; 81 | } 82 | #endif 83 | 84 | /*end*/ 85 | -------------------------------------------------------------------------------- /libw32/w32_strsep.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_strsep_c,"$Id: w32_strsep.c,v 1.1 2023/12/26 17:01:05 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /*- 6 | * Copyright (c) 1990, 1993 7 | * The Regents of the University of California. All rights reserved. 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 4. Neither the name of the University nor the names of its contributors 18 | * may be used to endorse or promote products derived from this software 19 | * without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 | * SUCH DAMAGE. 32 | */ 33 | 34 | #include 35 | #include 36 | 37 | /* 38 | * Get next token from string *stringp, where tokens are possibly-empty 39 | * strings separated by characters from delim. 40 | * 41 | * Writes NULs into the string at *stringp to end tokens. 42 | * delim need not remain constant from call to call. 43 | * On return, *stringp points past the last NUL written (if there might 44 | * be further tokens), or is NULL (if there are definitely no more tokens). 45 | * 46 | * If *stringp is NULL, strsep returns NULL. 47 | */ 48 | LIBW32_API char * 49 | strsep(char **stringp, const char *delim) 50 | { 51 | char *s; 52 | const char *spanp; 53 | int c, sc; 54 | char *tok; 55 | 56 | if ((s = *stringp) == NULL) 57 | return (NULL); 58 | for (tok = s;;) { 59 | c = *s++; 60 | spanp = delim; 61 | do { 62 | if ((sc = *spanp++) == c) { 63 | if (c == 0) 64 | s = NULL; 65 | else 66 | s[-1] = 0; 67 | *stringp = s; 68 | return (tok); 69 | } 70 | } while (sc != 0); 71 | } 72 | /* NOTREACHED */ 73 | } 74 | 75 | /*end*/ 76 | -------------------------------------------------------------------------------- /libw32/w32_writev.c: -------------------------------------------------------------------------------- 1 | #include 2 | __CIDENT_RCSID(gr_w32_writev_c,"$Id: w32_writev.c,v 1.4 2025/02/02 08:46:58 cvsuser Exp $") 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * win32 writev() system calls, 7 | * 8 | * Copyright (c) 2018 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * license for more details. 29 | * ==end== 30 | */ 31 | 32 | #ifndef _WIN32_WINNT 33 | #define _WIN32_WINNT 0x0501 /* enable xp+ features */ 34 | #endif 35 | 36 | #include "win32_internal.h" 37 | #include "win32_misc.h" 38 | 39 | #include 40 | #include 41 | 42 | #pragma comment(lib, "Ws2_32.lib") 43 | 44 | 45 | LIBW32_API int /*ssize_t*/ 46 | writev(int fildes, const struct iovec *iov, int iovcnt) 47 | { 48 | SOCKET s = (SOCKET)-1; 49 | int i, ret = -1; 50 | 51 | if (fildes < 0) { 52 | errno = EBADF; 53 | 54 | } else if (NULL == iov || iovcnt <= 0){ 55 | errno = EINVAL; 56 | 57 | } else if (w32_issockfd(fildes, &s)) { 58 | ret = 0; 59 | for (i = 0; i < iovcnt; ++i) { 60 | #undef sendto 61 | const int cnt = sendto(s, iov[i].iov_base, iov[i].iov_len, 0, NULL, 0); 62 | if (cnt > 0) { 63 | ret += cnt; 64 | } else if (0 == cnt) { 65 | break; 66 | } else { /*SOCKET_ERROR*/ 67 | if (0 == ret) { 68 | w32_neterrno_set(); 69 | ret = -1; 70 | } 71 | break; 72 | } 73 | ++i; 74 | } 75 | 76 | } else { 77 | ret = 0; 78 | for (i = 0; i < iovcnt; ++i) { 79 | const int cnt = _write(fildes, iov[i].iov_base, iov[i].iov_len); 80 | if (cnt > 0) { 81 | ret += cnt; 82 | } else if (0 == cnt) { 83 | break; 84 | } else if (errno == EINTR) { 85 | continue; 86 | } else { 87 | if (ret == 0) ret = -1; 88 | break; 89 | } 90 | } 91 | } 92 | return ret; 93 | } 94 | 95 | /*end*/ 96 | -------------------------------------------------------------------------------- /libw32/win32_cdef.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_WIN32_CDEF_H_INCLUDED 2 | #define LIBW32_WIN32_CDEF_H_INCLUDED 3 | /* -*- mode: c; indent-width: 4; -*- */ 4 | /* 5 | * internal definitions 6 | * 7 | * Copyright (c) 2016 - 2025 Adam Young. 8 | * 9 | * The applications are free software: you can redistribute it 10 | * and/or modify it under the terms of the GNU General Public License as 11 | * published by the Free Software Foundation, version 3. 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, and must be distributed with the license document above. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, and must include the license document above in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * This project is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * license for more details. 25 | * ==end== 26 | */ 27 | 28 | #include 29 | 30 | /*end*/ 31 | #endif /*LIBW32_WIN32_CDEF_H_INCLUDED*/ 32 | -------------------------------------------------------------------------------- /libw32/win32_direct.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_DIRECT_H_INCLUDED 2 | #define LIBW32_DIRECT_H_INCLUDED 3 | 4 | /* -*- mode: c; indent-width: 4; -*- */ 5 | /* 6 | * Copyright (c) 2021 - 2025, Adam Young. 7 | * 8 | * This file is part of the WinRSH/WinSSH project. 9 | * 10 | * The applications are free software: you can redistribute it 11 | * and/or modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation, version 3. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * This project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * license for more details. 26 | * ==end== 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | __BEGIN_DECLS 33 | 34 | #define DIR_MAGIC 0x57333264 // W32d 35 | #define DIR_WMAGIC 0x57333244 // W32D 36 | #define DIR_UMAGIC 0x57333255 // W32U 37 | 38 | #define DIR_FISHPF 0x0001 39 | #define DIR_FISUTF8 0x0002 40 | #define DIR_FHAVESTATS 0x0040 41 | //#define DIR_FDYNAMICREAD 0x1000 // TODO 42 | 43 | #define PATH_SEP '/' 44 | #define PATH_SEP_STR "/" 45 | #define PATH_SEP2 '\\' 46 | #define PATH_SEP_STR2 "\\" 47 | #define IS_PATH_SEP(c) ((c) == PATH_SEP || (c) == PATH_SEP2) 48 | 49 | DIR * w32_dir_alloc(void); 50 | void w32_dir_free(DIR *dp); 51 | int w32_dir_identifier(void); 52 | 53 | typedef int (*unc_push_t)(void *data, const wchar_t *); 54 | 55 | int w32_unc_iterateA(const char *servername, unc_push_t push, void *data); 56 | int w32_unc_iterateW(const wchar_t *servername, unc_push_t push, void *data); 57 | 58 | DIR * w32_unc_opendirA(const char *dirname); 59 | DIR * w32_unc_opendirW(const wchar_t *dirname); 60 | struct dirent * w32_unc_readdirA(DIR *dp); 61 | struct dirent * w32_unc_readdirW(DIR *dp); 62 | int w32_unc_closedir(DIR *dp); 63 | 64 | int w32_unc_validA(const char *path); 65 | int w32_unc_validW(const wchar_t *path); 66 | 67 | int w32_unc_rootA(const char *path, int *length); 68 | int w32_unc_rootW(const wchar_t *path, int *length); 69 | 70 | __END_DECLS 71 | 72 | #endif /*LIBW32_DIRECT_H_INCLUDED*/ 73 | -------------------------------------------------------------------------------- /libw32/win32_iconv.h: -------------------------------------------------------------------------------- 1 | #ifndef LIBW32_WIN32_ICONV_H_INCLUDED 2 | #define LIBW32_WIN32_ICONV_H_INCLUDED 3 | #include 4 | __CIDENT_RCSID(gr_libw32_win32_iconv_h,"$Id: win32_iconv.h,v 1.3 2025/02/02 08:46:58 cvsuser Exp $") 5 | __CPRAGMA_ONCE 6 | 7 | /* -*- mode: c; indent-width: 4; -*- */ 8 | /* 9 | * win32 iconv dynamic loader. 10 | * 11 | * Copyright (c) 2007, 2012 - 2025, Adam Young. 12 | * All rights reserved. 13 | * 14 | * This file is part of the WinRSH/WinSSH project. 15 | * 16 | * The applications are free software: you can redistribute it 17 | * and/or modify it under the terms of the GNU General Public License as 18 | * published by the Free Software Foundation, version 3. 19 | * 20 | * Redistributions of source code must retain the above copyright 21 | * notice, and must be distributed with the license document above. 22 | * 23 | * Redistributions in binary form must reproduce the above copyright 24 | * notice, and must include the license document above in 25 | * the documentation and/or other materials provided with the 26 | * distribution. 27 | * 28 | * This project is distributed in the hope that it will be useful, 29 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 30 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 31 | * license for more details. 32 | * ==end== 33 | */ 34 | 35 | #include 36 | #include 37 | 38 | __BEGIN_DECLS 39 | 40 | LIBW32_API void w32_iconv_dllname(const char *dllname); 41 | 42 | LIBW32_API int w32_iconv_connect(int verbose); 43 | LIBW32_API void w32_iconv_shutdown(void); 44 | 45 | LIBW32_API void * w32_iconv_open(const char *to, const char *from); 46 | LIBW32_API int w32_iconv(void *fd, const char **from, size_t *fromlen, char **to, size_t *tolen); 47 | LIBW32_API void w32_iconv_close(void *fd); 48 | 49 | LIBW32_API void * w32native_iconv_open(const char *tocode, const char *fromcode); 50 | LIBW32_API int w32native_iconv_close(void *fd); 51 | LIBW32_API size_t w32native_iconv(void *fd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft); 52 | 53 | #if defined(WIN32_ICONV_MAP) 54 | typedef void *iconv_t; 55 | 56 | #define iconv_open(__to, __from) w32_iconv_open(__to, __from) 57 | #define iconv(__fd, __from, __fromlen, __to, __tolen) w32_iconv(__fd, __from, __fromlen, __to, __tolen) 58 | #define iconv_close(__fd) w32_iconv_close(__fd) 59 | #endif /*WIN32_ICONV_MAP*/ 60 | 61 | __END_DECLS 62 | 63 | #endif /*LIBW32_WIN32_ICONV_H_INCLUDED*/ 64 | -------------------------------------------------------------------------------- /libz/.cvsignore: -------------------------------------------------------------------------------- 1 | zlib-1.2.* 2 | zlib-1.3* 3 | .unpacked* 4 | Makefile 5 | *.err 6 | -------------------------------------------------------------------------------- /libz/.gitignore: -------------------------------------------------------------------------------- 1 | zlib-1.2.*/ 2 | zlib-1.3*/ 3 | .unpacked* 4 | Makefile 5 | *.err 6 | 7 | -------------------------------------------------------------------------------- /libz/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Version: 1.3 3 | Source: http://www.zlib.net/ 4 | 5 | Copyright notice: 6 | 7 | (C) 1995-2023 Jean-loup Gailly and Mark Adler 8 | 9 | This software is provided 'as-is', without any express or implied 10 | warranty. In no event will the authors be held liable for any damages 11 | arising from the use of this software. 12 | 13 | Permission is granted to anyone to use this software for any purpose, 14 | including commercial applications, and to alter it and redistribute it 15 | freely, subject to the following restrictions: 16 | 17 | 1. The origin of this software must not be misrepresented; you must not 18 | claim that you wrote the original software. If you use this software 19 | in a product, an acknowledgment in the product documentation would be 20 | appreciated but is not required. 21 | 2. Altered source versions must be plainly marked as such, and must not be 22 | misrepresented as being the original software. 23 | 3. This notice may not be removed or altered from any source distribution. 24 | 25 | Jean-loup Gailly Mark Adler 26 | jloup@gzip.org madler@alumni.caltech.edu 27 | 28 | -------------------------------------------------------------------------------- /libz/makelib.def: -------------------------------------------------------------------------------- 1 | # $Id: makelib.def,v 1.2 2017/03/10 03:47:43 cvsuser Exp $ 2 | # win32 makelib configuration 3 | # 4 | inc=../include 5 | lbl=LIBZ 6 | lib=libz.lib 7 | def=HAVE_LIBZ 8 | def=HAVE_ZLIB_H 9 | -------------------------------------------------------------------------------- /libz/zlib-1.2.11.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libz/zlib-1.2.11.tgz -------------------------------------------------------------------------------- /libz/zlib-1.2.13.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libz/zlib-1.2.13.tgz -------------------------------------------------------------------------------- /libz/zlib-1.3.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/libz/zlib-1.3.tgz -------------------------------------------------------------------------------- /msvc2015/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | ipch 5 | *.opendb 6 | *.db 7 | *.ncb 8 | *.suo 9 | 10 | 11 | -------------------------------------------------------------------------------- /msvc2015/.gitignore: -------------------------------------------------------------------------------- 1 | .vs*/ 2 | Debug*/ 3 | Release*/ 4 | ipch/ 5 | *.user 6 | *.opendb 7 | *.db 8 | *.ncb 9 | *.suo 10 | 11 | -------------------------------------------------------------------------------- /msvc2015/kbtest/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/kbtest/kbtest.keymap: -------------------------------------------------------------------------------- 1 | ! exported keymap 2 | xterm.VT100.translations: #override \n\ 3 | Escape : string("\033") \n\ 4 | Left : string("\033[D") \n\ 5 | Up : string("\033[A") \n\ 6 | Right : string("\033[C") \n\ 7 | Down : string("\033[B") \n\ 8 | 2 : string("2") \n\ 9 | 3 : string("3") \n\ 10 | 4 : string("4") \n\ 11 | 5 : string("5") \n\ 12 | 6 : string("6") 13 | -------------------------------------------------------------------------------- /msvc2015/kbtest/kbtest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {b3f23340-e238-4c6a-bfec-ba960169cbda} 14 | 15 | 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files\libtsm 31 | 32 | 33 | Source Files\libtsm 34 | 35 | 36 | Source Files\libtsm 37 | 38 | 39 | Source Files\libtsm 40 | 41 | 42 | Source Files\libtsm 43 | 44 | 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | Header Files 54 | 55 | 56 | Header Files 57 | 58 | 59 | -------------------------------------------------------------------------------- /msvc2015/libw32/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/mkkeys/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/mkkeys/mkkeys.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /msvc2015/rcmd/rcmd.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | Resource Files 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /msvc2015/rlogin/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/rlogind/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/rlogind/.gitignore: -------------------------------------------------------------------------------- 1 | log/ 2 | 3 | -------------------------------------------------------------------------------- /msvc2015/slogin/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/slogind/.cvsignore: -------------------------------------------------------------------------------- 1 | .vs* 2 | Debug* 3 | Release* 4 | 5 | -------------------------------------------------------------------------------- /msvc2015/slogind/slogind.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /rcmd/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | -------------------------------------------------------------------------------- /rcmd/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | -------------------------------------------------------------------------------- /rcmd/rcmd_man.txt: -------------------------------------------------------------------------------- 1 | RCMD(1) General Commands Manual RCMD(1) 2 | 3 | NAME 4 | rcmd - backend driver for rcmd(3) 5 | 6 | SYNOPSIS 7 | rcmd [-46dn] [-l username] [-p port] [-u localusername] host command 8 | 9 | DESCRIPTION 10 | rcmd executes command on host. 11 | 12 | rcmd copies its standard input to the remote command, the standard output 13 | of the remote command to its standard output, and the standard error of 14 | the remote command to its standard error. Interrupt, quit and terminate 15 | signals are propagated to the remote command; rcmd normally terminates 16 | when the remote command does. The options are as follows: 17 | 18 | -4 Use IPv4 addresses only. 19 | 20 | -6 Use IPv6 addresses only. 21 | 22 | -d The -d option turns on socket debugging (using setsockopt(2)) on 23 | the TCP sockets used for communication with the remote host. 24 | 25 | -l By default, the remote username is the same as the local username. 26 | The -l option allows the remote name to be specified. Another 27 | possible way to specify the remote username is the notation 28 | user@host. 29 | 30 | -n The -n option redirects input from the special device /dev/null 31 | (see the BUGS section of this manual page). 32 | 33 | -p port 34 | Uses the given port instead of the one assigned to the service 35 | "shell". May be given either as symbolic name or as number. 36 | 37 | -u The -u option allows the local username to be specified. Only the 38 | superuser is allowed to use this option. 39 | 40 | Shell metacharacters which are not quoted are interpreted on local 41 | machine, while quoted metacharacters are interpreted on the remote 42 | machine. For example, the command 43 | 44 | rcmd otherhost cat remotefile >> localfile 45 | 46 | appends the remote file remotefile to the local file localfile, while 47 | 48 | rcmd otherhost cat remotefile ">>" other_remotefile 49 | 50 | appends remotefile to other_remotefile. 51 | 52 | FILES 53 | /etc/hosts 54 | 55 | SEE ALSO 56 | rsh(1), rcmd(3), environ(7) 57 | 58 | HISTORY 59 | The rcmd command appeared in NetBSD 1.3 and is primarily derived from 60 | rsh(1). Its purpose was to create a backend driver for rcmd(3) that 61 | would allow the users of rcmd(3) to no longer require super-user 62 | privileges. 63 | 64 | BUGS 65 | If you are using csh(1) and put a rcmd in the background without 66 | redirecting its input away from the terminal, it will block even if no 67 | reads are posted by the remote command. If no input is desired you 68 | should redirect the input of rcmd to /dev/null using the -n option. 69 | 70 | You cannot use rcmd to run an interactive command (like rogue(6) or 71 | vi(1)). Use rlogin(1) instead. 72 | 73 | The stop signal, SIGSTOP, will stop the local rcmd process only. This is 74 | arguably wrong, but currently hard to fix for reasons too complicated to 75 | explain here. 76 | -------------------------------------------------------------------------------- /releases/.gitignore: -------------------------------------------------------------------------------- 1 | *manifest* 2 | *.exe 3 | 4 | -------------------------------------------------------------------------------- /rlogin/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | *.old 4 | -------------------------------------------------------------------------------- /rlogin/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | *.old/ 4 | 5 | 6 | -------------------------------------------------------------------------------- /rlogin/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // rlogin - configuration. 3 | // 4 | // Note: required by imported librcmd components. 5 | // 6 | 7 | //end 8 | 9 | -------------------------------------------------------------------------------- /rlogin/rlogin_man.txt: -------------------------------------------------------------------------------- 1 | RLOGIN(1) General Commands Manual RLOGIN(1) 2 | 3 | NAME 4 | rlogin -- remote login 5 | 6 | SYNOPSIS 7 | rlogin [-468DEdn] [-e char] [-i localname] [-l username] 8 | [-t terminalname] [user@]host 9 | 10 | DESCRIPTION 11 | The rlogin utility starts a terminal session on a remote host host. 12 | 13 | The standard Berkeley rhosts authorization mechanism is used. 14 | 15 | The following options are available: 16 | 17 | -4 Use IPv4 addresses only. 18 | 19 | -6 Use IPv6 addresses only. 20 | 21 | -8 Allow an eight-bit input data path at all times; otherwise parity 22 | bits are stripped except when the remote side's stop and start 23 | characters are other than ^S/^Q. 24 | 25 | -E Stop any character from being recognized as an escape character. 26 | When used with the -8 option, this provides a completely transpar- 27 | ent connection. 28 | 29 | -d Turn on socket debugging (see setsockopt(2)) on the TCP sockets 30 | used for communication with the remote host. 31 | 32 | -n Set the TCP_NODELAY socket option which can improve interactive 33 | response at the expense of increased network load. 34 | 35 | -e Allow user specification of the escape character, which is ``~'' by 36 | default. This specification may be as a literal character, or as 37 | an octal value in the form \nnn. 38 | 39 | -i Allow the caller to specify a different local name to be used for 40 | authentication. 41 | 42 | -l Specify a different username for the remote login. If this option 43 | is not specified, your local username will be used. 44 | 45 | -t Specify the terminal-name, otherwise 'xterm-color'. 46 | 47 | A line of the form ``.'' disconnects from the remote host. 48 | Similarly, the line ``^Z'' will suspend the rlogin session, 49 | and ``'' suspends the send portion of 50 | the rlogin session, but allows output from the remote system. By 51 | default, the tilde (``~'') character is the escape character, and nor- 52 | mally control-Y (``^Y'') is the delayed-suspend character. 53 | 54 | All echoing takes place at the remote site, so that (except for delays) 55 | the rlogin is transparent. Flow control via ^S/^Q and flushing of input 56 | and output on interrupts are handled properly. 57 | 58 | FILES 59 | /etc/hosts 60 | /etc/hosts.equiv 61 | $HOME/.rhosts 62 | 63 | SEE ALSO 64 | login(1), rsh(1), telnet(1), setsockopt(2), ruserok(3), tty(4), hosts(5), 65 | hosts.equiv(5), rlogind(8), rshd(8) 66 | 67 | 68 | -------------------------------------------------------------------------------- /rlogind/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | -------------------------------------------------------------------------------- /rlogind/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | ref/ 4 | 5 | -------------------------------------------------------------------------------- /rlogind/.rhosts: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | 4 | 127.0.0.1 5 | -------------------------------------------------------------------------------- /rlogind/ConPty.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; indent-width: 8; -*- */ 2 | /* 3 | * Windows 10 ConPTY interface 4 | * 5 | * Copyright (c) 2020 - 2025, Adam Young. 6 | * All rights reserved. 7 | * 8 | * This file is part of the WinRSH/WinSSH project. 9 | * 10 | * The applications are free software: you can redistribute it 11 | * and/or modify it under the terms of the GNU General Public License as 12 | * published by the Free Software Foundation, version 3. 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, and must be distributed with the license document above. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, and must include the license document above in 19 | * the documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * This project is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * License for more details. 26 | * ==end== 27 | */ 28 | 29 | #if !defined(PSEUDOCONSOLE_INHERIT_CURSOR) /* Windows SDK 10.0.18346.0 (ConsoleApi.h) */ 30 | #define PSEUDOCONSOLE_INHERIT_CURSOR (0x1) 31 | typedef VOID *HPCON; 32 | #endif 33 | 34 | #include "w32support.h" 35 | 36 | struct winsize; 37 | 38 | class ConPTY { 39 | BOOST_DELETED_FUNCTION(ConPTY(const ConPTY &)) 40 | BOOST_DELETED_FUNCTION(ConPTY& operator=(const ConPTY &)) 41 | 42 | public: 43 | ConPTY(); 44 | virtual ~ConPTY(); 45 | 46 | static bool initialise_conpty(); 47 | static bool get_default_size(COORD &size); 48 | // static bool get_default_shell(char *name, size_t namelen); 49 | 50 | bool set_pipe_mode(DWORD dwMode); 51 | bool set_pipe_size(DWORD dwSize); 52 | bool set_read_mode(DWORD dwMode); 53 | bool set_write_mode(DWORD dwMode); 54 | bool create_pty(COORD size); 55 | bool create_pty(const struct winsize *win = 0); 56 | bool attach_shell( /*const char *shell = 0, bool suspended = false*/ ); 57 | bool attach_shell_as( /*user*/ /*shell*/ /*suspended*/ ); 58 | bool start_shell(); 59 | bool get_process_exit(DWORD &dwExit, DWORD dwTimeoutMs = 0); 60 | bool winch(COORD size); 61 | bool winch(const struct winsize *win); 62 | bool ctrlbreak(); 63 | HANDLE stdout_pipe() const; 64 | HANDLE stdin_pipe() const; 65 | HANDLE process_handle() const; 66 | DWORD process_identifier() const; 67 | bool is_open() const; 68 | bool is_attached() const; 69 | bool terminate(int exit_code, bool wait = false); 70 | void close(); 71 | void disconnect(); 72 | 73 | private: 74 | void cleanup_attributes(); 75 | 76 | private: 77 | DWORD dwPipeMode_; 78 | DWORD dwPipeSize_; 79 | DWORD dwReadMode_; 80 | DWORD dwWriteMode_; 81 | 82 | HPCON hPC_; 83 | HANDLE hPipeIn_; 84 | HANDLE hPipeOut_; 85 | 86 | void * pThreadhreadAttributeList_; 87 | DWORD dwProcessId_; 88 | HANDLE hProcess_; 89 | HANDLE hThread_; 90 | bool attached_; 91 | }; 92 | 93 | //end 94 | -------------------------------------------------------------------------------- /rlogind/Service.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef SERVICE_H_INCLUDED 3 | #define SERVICE_H_INCLUDED 4 | /* -*- mode: c; indent-width: 8; -*- */ 5 | /* 6 | * rlogind serice adapter 7 | * 8 | * Copyright (c) 2020 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * License for more details. 29 | * ==end== 30 | */ 31 | 32 | #if defined(_MSC_VER) 33 | #include 34 | #endif 35 | #include "../libNTService/NTService.h" 36 | #include "SimpleIni/SimpleIni.h" 37 | 38 | #include "Logger.h" 39 | 40 | #include "rlogind.h" 41 | #include "w32support.h" 42 | 43 | class Service : public CNTService { 44 | BOOST_DELETED_FUNCTION(Service(const Service &)) 45 | BOOST_DELETED_FUNCTION(Service& operator=(const Service &)) 46 | 47 | public: 48 | Service(const char *svcname, bool console_mode = true); 49 | virtual ~Service(); 50 | 51 | void Start(const struct Options &options); 52 | 53 | protected: 54 | static std::string ResolveRelative(const char *path); 55 | virtual bool ConfigOpen(bool create = true); 56 | virtual void ConfigClose(); 57 | virtual bool ConfigSet(const char *csKey, const char *szValue); 58 | virtual bool ConfigSet(const char *csKey, DWORD dwValue); 59 | virtual int ConfigGet(const char *csKey, char *szBuffer, size_t dwSize, unsigned flags = 0); 60 | virtual bool ConfigGet(const char *csKey, DWORD &dwValue, unsigned flags = 0); 61 | 62 | protected: 63 | void AttachLogger(); 64 | bool ConfigLogger(); 65 | virtual void ServiceRun(); 66 | virtual void ServiceTrace(const char *fmt, ...); 67 | virtual bool OnInit(); 68 | virtual void OnStop(); 69 | 70 | private: 71 | int Initialise(); 72 | int Welcome(int); 73 | static DWORD WINAPI session_thread(LPVOID lpParam); 74 | 75 | private: 76 | const struct Options *options_; 77 | CSimpleIniA *inifile_; 78 | Logger logger_; 79 | }; 80 | 81 | #endif //SERVICE_H_INCLUDED 82 | //end 83 | -------------------------------------------------------------------------------- /rlogind/Session.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #if !defined(SESSION_H_INCLUDED) 3 | #define SESSION_H_INCLUDED 4 | /* -*- mode: c; indent-width: 8; -*- */ 5 | /* 6 | * rlogind session 7 | * 8 | * Copyright (c) 2020 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * License for more details. 29 | * ==end== 30 | */ 31 | 32 | #include "winsize.h" 33 | #include "w32support.h" 34 | 35 | struct options; 36 | class ConPTY; 37 | 38 | class Session { 39 | BOOST_DELETED_FUNCTION(Session(const Session &)) 40 | BOOST_DELETED_FUNCTION(Session& operator=(const Session &)) 41 | 42 | public: 43 | Session(const struct Options *options); 44 | ~Session(); 45 | 46 | int rlogin(int clientfd); 47 | 48 | private: 49 | int doit(struct sockaddr_storage *); 50 | void protocol(); 51 | int ptycontrol(const char *cp, int n); 52 | void cleanup(); 53 | void remote_fatal(const char *msg, int syserr = 0); 54 | void remote_vfatal(const char *msg, ...); 55 | void fatal(const char *msg, int syserr); 56 | int handshake(struct sockaddr *dest, const char *host); 57 | void getstr(char *buf, int cnt, const char *errmsg); 58 | static int local_domain(const char *h); 59 | static const char *topdomain(const char *h); 60 | 61 | private: 62 | const struct Options &options_; // options 63 | char oobdata_[1]; // Out-Of-Bounds data 64 | int netf_; // client socket 65 | ConPTY *pty_; // ConPTY 66 | 67 | int confirmed_; // connection confirmed; protocol state 68 | struct winsize win_; // pty window 69 | char message_[BUFSIZ]; // working storage for exit 70 | 71 | #define NMAX 30 72 | char lusername_[NMAX + 1]; // local user-name 73 | char rusername_[NMAX + 1]; // remote user-name 74 | const char *env_[2]; // environment 75 | char term_[64]; // terminal name 76 | }; 77 | 78 | #endif //SESSION_H_INCLUDED 79 | //end 80 | -------------------------------------------------------------------------------- /rlogind/SimpleIni/LICENCE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2006-2013 Brodie Thiesfield 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 | -------------------------------------------------------------------------------- /rlogind/SimpleIni/SOURCE.txt: -------------------------------------------------------------------------------- 1 | 2 | Source: https://github.com/brofield/simpleini 3 | Author: Brodie Thiesfield 4 | Site: http://code.jellycan.com/simpleini/ 5 | 6 | Cross-platform C++ library providing a simple API to read and write INI-style configuration files 7 | 8 | Note: Minor tweaks allowing WATCOMC usage, see ifdef's. 9 | 10 | 2019/02/01 11 | -------------------------------------------------------------------------------- /rlogind/config.h: -------------------------------------------------------------------------------- 1 | // 2 | // rlogind - configuration 3 | // 4 | 5 | #define _BSD_SOURCE // BSD types etc. 6 | #define INET6 // enable INET6 support. 7 | 8 | #define HAVE_SYSLOG // utilise syslog() (see rcmd). 9 | 10 | #if !defined(_WIN32_WINNT) || (_WIN32_WINNT < 0x0600) 11 | #undef _WIN32_WINNT 12 | #define _WIN32_WINNT 0x0600 // min requirement. 13 | #endif 14 | 15 | #if defined(__WATCOMC__) && !defined(__STDC_WANT_LIB_EXT1__) 16 | #define __STDC_WANT_LIB_EXT1__ 1 // enable ISO TR24731, sprintf_s etc 17 | #endif 18 | 19 | // #define DO_STDOUT_TRACE 20 | #if defined(DO_STDOUT_TRACE) // simple diagnostics; developer console mode. 21 | #define STDOUT_TRACE(__x) __x 22 | #else 23 | #define STDOUT_TRACE(__x) /**/ 24 | #endif 25 | 26 | //end 27 | -------------------------------------------------------------------------------- /rlogind/heapcheck.c: -------------------------------------------------------------------------------- 1 | // 2 | // MSVC - heapcheck 3 | // 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include "heapcheck.h" 10 | 11 | 12 | int 13 | HeapCheck(unsigned limit) 14 | { 15 | _HEAPINFO hinfo = {0}; 16 | unsigned numLoops = 0; 17 | int heapstatus; 18 | 19 | while ((heapstatus = _heapwalk(&hinfo)) == _HEAPOK && numLoops < limit) { 20 | ++numLoops; 21 | } 22 | 23 | switch (heapstatus) { 24 | case _HEAPEMPTY: 25 | return 1; 26 | case _HEAPEND: 27 | return 1; 28 | } 29 | 30 | printf("%8s block at %p of size %4.4X\n", 31 | (hinfo._useflag == _USEDENTRY ? "USED" : "FREE"), hinfo._pentry, hinfo._size); 32 | 33 | switch (heapstatus) { 34 | case _HEAPBADPTR: 35 | printf("ERROR - bad pointer to heap\n"); 36 | break; 37 | case _HEAPBADBEGIN: 38 | printf("ERROR - bad start of heap\n"); 39 | break; 40 | case _HEAPBADNODE: 41 | printf("ERROR - bad node in heap\n"); 42 | break; 43 | } 44 | 45 | assert(0); 46 | 47 | return 0; 48 | } 49 | 50 | 51 | void 52 | HeapDump(unsigned limit) 53 | { 54 | _HEAPINFO hinfo; 55 | int heapstatus; 56 | unsigned numLoops = 0; 57 | 58 | hinfo._pentry = NULL; 59 | 60 | while ((heapstatus = _heapwalk(&hinfo)) == _HEAPOK && numLoops < limit) { 61 | printf("%8s block at %p of size %4.4X\n", 62 | (hinfo._useflag == _USEDENTRY ? "USED" : "FREE"), hinfo._pentry, hinfo._size); 63 | ++numLoops; 64 | } 65 | 66 | switch (heapstatus) { 67 | case _HEAPEMPTY: 68 | printf("OK - empty heap\n"); 69 | break; 70 | case _HEAPEND: 71 | printf("OK - end of heap\n"); 72 | break; 73 | case _HEAPBADPTR: 74 | printf("ERROR - bad pointer to heap\n"); 75 | break; 76 | case _HEAPBADBEGIN: 77 | printf("ERROR - bad start of heap\n"); 78 | break; 79 | case _HEAPBADNODE: 80 | printf("ERROR - bad node in heap\n"); 81 | break; 82 | } 83 | } 84 | 85 | 86 | //end -------------------------------------------------------------------------------- /rlogind/heapcheck.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef HEAPCHECK_H_INCLUDED 3 | #define HEAPCHECK_H_INCLUDED 4 | 5 | #include 6 | 7 | __BEGIN_DECLS 8 | extern int HeapCheck(unsigned limit); 9 | extern void HeapDump(unsigned limit); 10 | __END_DECLS 11 | 12 | #endif //HEAPCHECK_H_INCLUDED 13 | //end 14 | -------------------------------------------------------------------------------- /rlogind/rlogind.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/rlogind/rlogind.cpp -------------------------------------------------------------------------------- /rlogind/rlogind.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #if !defined(RLOGIN_H_INCLUDED) 3 | #define RLOGIN_H_INCLUDED 4 | /* -*- mode: c; indent-width: 8; -*- */ 5 | /* 6 | * rlogin server 7 | * 8 | * Copyright (c) 2020 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * License for more details. 29 | * ==end== 30 | */ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | struct Options { 37 | int keepalive; // enable connection keep alives. 38 | int check_all; // check all logins 39 | int log_success; // log succesful connections 40 | unsigned port; // port. 41 | int reverse_required; // reverse name lookup required. 42 | const char *ini_file; // alternative configuration source. 43 | bool delay_start; // service start-up-delay. 44 | bool no_stdout; // no stdout during console mode. 45 | }; 46 | 47 | extern void rlogin(const struct Options *options, int clientfd); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif //RLOGIN_H_INCLUDED 54 | 55 | //end 56 | -------------------------------------------------------------------------------- /rlogind/rlogind.ini: -------------------------------------------------------------------------------- 1 | ; 2 | ; rlogind.ini --- 3 | ; Alternative registry 4 | ; 5 | 6 | LoggerFile = ./logs/rlogind.log 7 | LoggerAge = 10m 8 | LoggerSize = 10Mb 9 | LoggerDepth = 32 10 | 11 | [Statictics] 12 | 13 | -------------------------------------------------------------------------------- /rlogind/test/logger_arguments.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // logger_arguments 3 | // 4 | 5 | #include "../config.h" 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | #include "../Logger.h" 12 | 13 | 14 | int 15 | main() 16 | { 17 | #define KB (1024) 18 | #define MB (1024 * 1024) 19 | #define GB (1024 * 1024 * 1024) 20 | #define SS (1) 21 | #define MM (60) 22 | #define HH (60*60) 23 | #define DD (24*60*60) 24 | 25 | assert(Logger::set_size_limit("0") && MIN_SIZE_LIMIT == size_limit_); 26 | assert(Logger::set_size_limit("1") && MIN_SIZE_LIMIT == size_limit_); 27 | assert(Logger::set_size_limit("1B") && MIN_SIZE_LIMIT == size_limit_); 28 | assert(Logger::set_size_limit("1K") && MIN_SIZE_LIMIT == size_limit_); 29 | assert(Logger::set_size_limit("32K") && (32 * KB) == size_limit_); 30 | assert(Logger::set_size_limit("1M") && (1 * MB) == size_limit_); 31 | assert(Logger::set_size_limit("100M") && (100 * MB) == size_limit_); 32 | assert(Logger::set_size_limit("1.5M") && (unsigned)(1.5 * MB) == size_limit_); 33 | assert(Logger::set_size_limit("0.5G") && (unsigned)(0.5 * GB) == size_limit_); 34 | assert(Logger::set_size_limit("2G") && MAX_SIZE_LIMIT == size_limit_); 35 | 36 | assert(Logger::set_time_limit("00:10") && (10 * MM) == time_limit_); 37 | assert(Logger::set_time_limit("12:00") && (12 * HH) == time_limit_); 38 | assert(Logger::set_time_limit("12:00:20") && ((12 * HH) + (20 * SS)) == time_limit_); 39 | 40 | assert(Logger::set_time_limit("1") && MIN_TIME_LIMIT == time_limit_); 41 | assert(Logger::set_time_limit("2") && MIN_TIME_LIMIT == time_limit_); 42 | assert(Logger::set_time_limit("10M") && (10 * MM) == time_limit_); 43 | assert(Logger::set_time_limit("0.5H") && (30 * MM) == time_limit_); 44 | assert(Logger::set_time_limit("1H") && (1 * HH) == time_limit_); 45 | assert(Logger::set_time_limit("100H") && (100 * HH) == time_limit_); 46 | assert(Logger::set_time_limit("2.5H") && (unsigned)(2.5 * HH) == time_limit_); 47 | assert(Logger::set_time_limit("0.5D") && (12 * HH) == time_limit_); 48 | assert(Logger::set_time_limit("100D") && MAX_TIME_LIMIT == time_limit_); 49 | 50 | return 0; 51 | } 52 | 53 | //end 54 | -------------------------------------------------------------------------------- /rlogind/winsize.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #if !defined(WINSIZE_H_INCLUDED) 3 | #define WINSIZE_H_INCLUDED 4 | /* -*- mode: c; indent-width: 8; -*- */ 5 | /* 6 | * Windows supplemental terminal definitions 7 | * 8 | * Copyright (c) 2020 - 2025, Adam Young. 9 | * All rights reserved. 10 | * 11 | * This file is part of the WinRSH/WinSSH project. 12 | * 13 | * The applications are free software: you can redistribute it 14 | * and/or modify it under the terms of the GNU General Public License as 15 | * published by the Free Software Foundation, version 3. 16 | * 17 | * Redistributions of source code must retain the above copyright 18 | * notice, and must be distributed with the license document above. 19 | * 20 | * Redistributions in binary form must reproduce the above copyright 21 | * notice, and must include the license document above in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * 25 | * This project is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * License for more details. 29 | * ==end== 30 | */ 31 | 32 | #ifndef TIOCPKT_WINDOW 33 | #define TIOCPKT_WINDOW 0x80 34 | #endif 35 | 36 | #ifndef TIOCPKT_DATA /* Used for packet mode */ 37 | #define TIOCPKT_DATA 0 /* 0x00 - data packet */ 38 | #define TIOCPKT_FLUSHREAD 1 /* 0x01 - flush packet */ 39 | #define TIOCPKT_FLUSHWRITE 2 /* 0x02 - flush packet */ 40 | #define TIOCPKT_STOP 4 /* 0x04 - stop output */ 41 | #define TIOCPKT_START 8 /* 0x08 - start output */ 42 | #define TIOCPKT_NOSTOP 16 /* 0x10 - no more ^S, ^Q */ 43 | #define TIOCPKT_DOSTOP 32 /* 0x20 - now do ^S ^Q */ 44 | #define TIOCPKT_IOCTL 64 /* 0x40 - state change of pty driver */ 45 | #endif 46 | 47 | #ifndef WINSIZE_T 48 | #define WINSIZE_T 49 | struct winsize { 50 | unsigned short ws_row; /* rows, in characters */ 51 | unsigned short ws_col; /* columns, in characters */ 52 | unsigned short ws_xpixel; /* horizontal size, pixels */ 53 | unsigned short ws_ypixel; /* vertical size, pixels */ 54 | }; 55 | #endif //WINSIZE_T 56 | 57 | #endif //WINSIZE_H 58 | 59 | //end 60 | -------------------------------------------------------------------------------- /rsh/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | -------------------------------------------------------------------------------- /rsh/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.err 3 | -------------------------------------------------------------------------------- /slogin/.cvsignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.old 3 | -------------------------------------------------------------------------------- /slogin/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.old/ 3 | 4 | -------------------------------------------------------------------------------- /slogin/config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * local 3 | */ 4 | 5 | #include // common configuration 6 | 7 | #if defined(_MSC_VER) 8 | #pragma warning (disable : 4127) // conditional expression is constant 9 | #pragma warning (disable : 4201) // nonstandard extension used : nameless struct/union 10 | #pragma warning (disable : 4204) // nonstandard extension used : non-constant aggregate initializer 11 | #pragma warning (disable : 4702) // unreachable code 12 | #pragma warning (disable : 4706) // assignment within conditional expression 13 | #pragma warning (disable : 4996) // 'xxx' was declared deprecated 14 | 15 | #elif defined(__WATCOMC__) 16 | #pragma disable_message(136) // Comparison equivalent to 'unsigned == 0' 17 | #pragma disable_message(201) // Unreachable code 18 | #pragma disable_message(202) // Unreferenced 19 | #pragma disable_message(124) // Comparison result always 0 20 | #endif 21 | 22 | /*end*/ 23 | -------------------------------------------------------------------------------- /slogin/console.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; indent-width: 4; -*- */ 2 | /* 3 | * slogin console support. 4 | * 5 | * Copyright (c) 2015 - 2025, Adam Young. 6 | * All rights reserved. 7 | * 8 | * This file is part of the WinRSH/WinSSH project. 9 | * 10 | * The WinRSH/WinSSH project is free software: you can redistribute it 11 | * and/or modify it under the terms of the WinRSH/WinSSH project License. 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, and must be distributed with the license document above. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, and must include the license document above in 18 | * the documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * The WinRSH/WinSSH project is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * License for more details. 25 | * ==end== 26 | */ 27 | 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | __BEGIN_DECLS 34 | 35 | HANDLE console_stdout(void); 36 | HANDLE console_stdin(void); 37 | 38 | int console_width(void); 39 | BOOL console_raw_input(HANDLE hConsole, DWORD *old_console_mode); 40 | 41 | int console_printf(const char *fmt, ...); 42 | BOOL console_write(const char *buffer, unsigned buflen); 43 | 44 | DWORD console_prompt(BOOL echo, const char *msg, char *buffer, DWORD buffer_size); 45 | DWORD console_getln(HANDLE hConsole, BOOL line_buffer, BOOL blocking, char *buffer, DWORD buffer_size); 46 | 47 | __END_DECLS 48 | -------------------------------------------------------------------------------- /slogind/slogind.cpp: -------------------------------------------------------------------------------- 1 | // slogind placeholder 2 | 3 | void 4 | main() 5 | { 6 | } 7 | 8 | -------------------------------------------------------------------------------- /support/.gitignore: -------------------------------------------------------------------------------- 1 | *.bat 2 | *.txt 3 | -------------------------------------------------------------------------------- /support/busybox.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/support/busybox.exe -------------------------------------------------------------------------------- /support/gmake-42.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adamyg/winxsh/03f9897480cbcc6a0500acfb374fc2020e835c54/support/gmake-42.exe -------------------------------------------------------------------------------- /support/mkdir_p.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | # -*- mode: perl; -*- 3 | # $Id: mkdir_p.pl,v 1.1 2020/06/14 00:49:51 cvsuser Exp $ 4 | # "mkdir -p" emulation for WIN32 builds. 5 | # 6 | use strict; 7 | use warnings 'all'; 8 | 9 | sub mkdir_p { 10 | my $dir = shift; 11 | 12 | $dir =~ s|/*\Z(?!\n)||s; 13 | return if (-d $dir); 14 | 15 | if ($dir =~ m|[^/]/|s) { 16 | my $parent = $dir; 17 | $parent =~ s|[^/]*\Z(?!\n)||s; 18 | mkdir_p($parent); 19 | } 20 | 21 | unless (mkdir($dir, 0777)) { 22 | return if (-d $dir); 23 | die "Cannot create directory $dir: $!\n"; 24 | } 25 | 26 | print "created directory `$dir'\n"; 27 | } 28 | 29 | my $arg; 30 | 31 | foreach $arg (@ARGV) { 32 | $arg =~ tr|\\|/|; 33 | mkdir_p($arg); 34 | } 35 | 36 | #end 37 | -------------------------------------------------------------------------------- /support/owc20config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Open Watcom C/C++ 1.9 4 | rem 5 | if not defined GNUWIN32 ( 6 | set GNUWIN32=\devl\gnuwin32 7 | ) 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | %PERL% makelib.pl --gnuwin32=%GNUWIN32% owc20 %1 %2 %3 %4 12 | 13 | -------------------------------------------------------------------------------- /support/owcconfig.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Open Watcom C/C++ 1.9 4 | rem 5 | if not defined GNUWIN32 ( 6 | set GNUWIN32=\devl\gnuwin32 7 | ) 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | %PERL% makelib.pl --gnuwin32=%GNUWIN32% owc %1 %2 %3 %4 12 | 13 | -------------------------------------------------------------------------------- /support/vc2013config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Microsoft Visual Studio C/C++ 2013+ 4 | rem 5 | if not defined GNUWIN32 ( 6 | set GNUWIN32=\devl\gnuwin32 7 | ) 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | %PERL% makelib.pl --gnuwin32=%GNUWIN32% --icu=auto vc2013 %1 %2 %3 %4 12 | 13 | -------------------------------------------------------------------------------- /support/vc2015config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Microsoft Visual Studio C/C++ 2015 4 | rem 5 | if not defined GNUWIN32 ( 6 | set GNUWIN32=\devl\gnuwin32 7 | ) 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | %PERL% makelib.pl --gnuwin32=%GNUWIN32% --icu=auto vc2015 %1 %2 %3 %4 12 | 13 | -------------------------------------------------------------------------------- /support/vc2019config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Microsoft Visual Studio C/C++ 2019 4 | rem 5 | if not defined GNUWIN32 ( 6 | set GNUWIN32=\devl\gnuwin32 7 | ) 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | %PERL% makelib.pl --gnuwin32=%GNUWIN32% --icu=auto %1 %2 %3 %4 vc2019 12 | 13 | -------------------------------------------------------------------------------- /support/vc2019x64config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Microsoft Visual Studio C/C++ 2019/x64 4 | rem 5 | echo Configure: Microsoft Visual Studio C/C++ 2019/x64 6 | 7 | if not defined GNUWIN32 ( 8 | set GNUWIN32=\devl\gnuwin32 9 | ) 10 | 11 | if not defined PERL ( 12 | set PERL=perl 13 | ) 14 | 15 | if not defined INNO ( 16 | set INNO="C:/Program Files (x86)/Inno Setup 5/iscc" 17 | ) 18 | 19 | %PERL% ./support/config_windows.pl makelib.pl --inno=%INNO% %* vc2019-x64 20 | -------------------------------------------------------------------------------- /support/vc2022x64config.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem Microsoft Visual Studio C/C++ 2022/x64 4 | rem 5 | echo Configure: Microsoft Visual Studio C/C++ 2022/x64 6 | 7 | rem perl: assume within path 8 | if not defined PERL ( 9 | set PERL=perl 10 | ) 11 | 12 | rem iscc: command line interface 13 | if not defined INNO ( 14 | set INNO="C:/Program Files (x86)/Inno Setup 5/iscc" 15 | ) 16 | 17 | %PERL% ./support/config_windows.pl makelib.pl --inno=%INNO% %* vc2022-x64 18 | --------------------------------------------------------------------------------