simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Feb 18 14:16:26 GMT 2023
TL;DR:
4341ba6d Add platform-independent fontspec_new_default() function.
edce3fb9 Add platform-independent Unicode setup function.
334d4f31 Add some extra stub modules.
23c408d4 Move the logeventf wrappers into their own source file.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer: Simon Tatham <anakin at pobox.com>
Date: 2023-02-18 14:16:26
commit 4341ba6d5cb36aa5fec22447429adca3ab372182
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=4341ba6d5cb36aa5fec22447429adca3ab372182;hp=9e01de7c2b2903412822f3285da1d692d1474524
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Feb 18 13:43:50 2023 +0000
Add platform-independent fontspec_new_default() function.
Constructing a FontSpec in platform-independent code is awkward,
because you can't call fontspec_new() outside the platform subdirs
(since its prototype varies per platform). But sometimes you just need
_some_ valid FontSpec, e.g. to put in a Conf that will be used in some
place where you don't actually care about font settings, such as a
purely CLI program.
Both Unix and Windows _have_ an idiom for this, but they're different,
because their FontSpec constructors have different prototypes. The
existing CLI tools have always had per-platform main source files, so
they just use the locally appropriate method of constructing a boring
don't-care FontSpec.
But if you want a _platform-independent_ main source file, such as you
might find in a test program, then that's rather awkward. Better to
have a platform-independent API for making a default FontSpec.
putty.h | 10 +++++++++-
test/fuzzterm.c | 2 +-
unix/pageant.c | 2 +-
unix/plink.c | 2 +-
unix/psusan.c | 2 +-
unix/sftp.c | 2 +-
unix/uppity.c | 2 +-
unix/utils/fontspec.c | 5 +++++
unix/window.c | 2 +-
windows/controls.c | 2 +-
windows/utils/defaults.c | 2 +-
windows/utils/fontspec.c | 5 +++++
12 files changed, 28 insertions(+), 10 deletions(-)
commit edce3fb9da091f94960b5207d83de9fa7ac60f0c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=edce3fb9da091f94960b5207d83de9fa7ac60f0c;hp=4341ba6d5cb36aa5fec22447429adca3ab372182
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Feb 18 14:10:01 2023 +0000
Add platform-independent Unicode setup function.
Similarly to the one I just added for FontSpec: in a cross-platform
main source file, you don't really want to mess about with
per-platform ifdefs just to initialise a 'struct unicode_data' from a
Conf. But until now, you had to, because init_ucs had a different
prototype on Windows and Unix.
I plan to use this in future test programs. But an immediate positive
effect is that it removes the only platform-dependent call from
fuzzterm.c. So now that could be built on Windows too, given only an
appropriate cmake stanza. (Not that I have much idea if it's useful to
fuzz the terminal separately on multiple platforms, but it's nice to
know that it's possible if anyone does need to.)
putty.h | 5 +++++
test/fuzzterm.c | 4 +---
unix/unicode.c | 7 +++++++
windows/unicode.c | 5 +++++
4 files changed, 18 insertions(+), 3 deletions(-)
commit 334d4f315ef45b1506b880b3e64ea023611eb2fb
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=334d4f315ef45b1506b880b3e64ea023611eb2fb;hp=edce3fb9da091f94960b5207d83de9fa7ac60f0c
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Feb 18 13:44:28 2023 +0000
Add some extra stub modules.
Also for use in test programs: stub modules that provide non-
functional versions of logging, printing and storage.
stubs/no-logging.c | 20 ++++++++++++++++++++
stubs/no-printing.c | 18 ++++++++++++++++++
stubs/no-storage.c | 40 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 78 insertions(+)
commit 23c408d49d3e64b6705f5d81874317a63099dbae
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=23c408d49d3e64b6705f5d81874317a63099dbae;hp=334d4f315ef45b1506b880b3e64ea023611eb2fb
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Feb 18 13:45:00 2023 +0000
Move the logeventf wrappers into their own source file.
Separating them from logging.c allows them to be shared between the
real logging.c and the new stub no-logging.c.
CMakeLists.txt | 5 +++--
logging.c | 20 --------------------
unix/CMakeLists.txt | 4 ++--
utils/logeventf.c | 32 ++++++++++++++++++++++++++++++++
4 files changed, 37 insertions(+), 24 deletions(-)
More information about the tartarus-commits
mailing list