1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00
putty-source/unix/utils
Simon Tatham 841bf321d4 New abstraction for command-line arguments.
This begins the process of enabling our Windows applications to handle
Unicode characters on their command lines which don't fit in the
system code page.

Instead of passing plain strings to cmdline_process_param, we now pass
a partially opaque and platform-specific thing called a CmdlineArg.
This has a method that extracts the argument word as a default-encoded
string, and another one that tries to extract it as UTF-8 (though it
may fail if the UTF-8 isn't available).

On Windows, the command line is now constructed by calling
split_into_argv_w on the Unicode command line returned by
GetCommandLineW(), and the UTF-8 method returns text converted
directly from that wide-character form, not going via the system code
page. So it _can_ include UTF-8 characters that wouldn't have
round-tripped via CP_ACP.

This commit introduces the abstraction and switches over the
cross-platform and Windows argv-handling code to use it, with minimal
functional change. Nothing yet tries to call cmdline_arg_get_utf8().

I say 'cross-platform and Windows' because on the Unix side there's
still a lot of use of plain old argv which I haven't converted. That
would be a much larger project, and isn't currently needed: the
_current_ aim of this abstraction is to get the right things to happen
relating to Unicode on Windows, so for code that doesn't run on
Windows anyway, it's not adding value. (Also there's a tension with
GTK, which wants to talk to standard argv and extract arguments _it_
knows about, so at the very least we'd have to let it munge argv
before importing it into this new system.)
2024-09-26 11:30:07 +01:00
..
align_label_left.c Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
arm_arch_queries.c Implement AES-GCM using the @openssh.com protocol IDs. 2022-08-16 20:33:58 +01:00
arm_arch_queries.h Add CPU feature checks on M1 macOS. 2022-08-16 18:39:12 +01:00
block_signal.c Formatting: normalise to put a space after condition keywords. 2022-12-28 15:32:24 +00:00
buildinfo_gtk_version.c Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
cloexec.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
cmdline_arg.c New abstraction for command-line arguments. 2024-09-26 11:30:07 +01:00
dputs.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
filename.c Rename 'ret' variables passed from allocation to return. 2022-09-14 16:10:29 +01:00
fontspec.c Add platform-independent fontspec_new_default() function. 2023-02-18 14:10:21 +00:00
get_label_text_dimensions.c Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
get_username.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
get_x11_display.c Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
getticks.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
keysym_to_unicode.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
make_dir_and_check_ours.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
make_dir_path.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
make_spr_sw_abort_errno.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
nonblock.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
open_for_write_would_lose_data.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
our_dialog.c Formatting: standardise on "func(\n", not "func\n(". 2022-08-03 20:48:46 +01:00
pgp_fingerprints.c Update source file names in comments and docs. 2022-01-22 15:51:31 +00:00
pollwrap.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
signal.c Formatting: normalise to put a space after condition keywords. 2022-12-28 15:32:24 +00:00
string_width.c Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
x11_ignore_error.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00