Assembled from klammertext-dev f344a37d772c. The commands, the library,
the Standard Klammer Set, the reflection klammerset and the Python
binding build and run natively on Windows (MSYS2 UCRT64 gcc, python.org
Python), and both test tiers pass there. doc/install/windows_source_install.md
is the fifth install guide: a source install parallel to the Linux and
macOS ones, verified by following it on a pristine Windows 11.
Behaviour on every system: paths Klammertext prints use forward slashes;
output is LF; the command line is UTF-8 on Windows; @eval :shell is a
POSIX shell command everywhere -- on Windows it runs the sh Klammertext
ships, BusyBox for Windows (win/busybox/, GPLv2, with its licence and the
source pointer). KLAMMERTEXT_FONTS and KLAMMERTEXT_KLAMMERSETS are lists in
the system's PATH convention (';' on Windows). On Linux and macOS nothing
observable changes.
45 lines
2.0 KiB
C++
45 lines
2.0 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
//#include <filesystem>
|
|
#include <vector>
|
|
|
|
#include "file.h"
|
|
#include "util.h"
|
|
|
|
class Machine;
|
|
|
|
void set_verbose_level(int argc, char* argv[]);
|
|
// What an error report and the -s pseudo source name as the command, set
|
|
// from OUTSIDE the library (the Python binding). It is a function, not an
|
|
// assignment to the header's inline variables, because on Windows every
|
|
// module -- the DLL, an extension module -- has its OWN copy of an inline
|
|
// variable: an assignment made in the binding never reached the copy the
|
|
// library's error reports read. On Linux the two are one variable.
|
|
void set_command_identity(const std::string& name, const std::string& pathname);
|
|
bool show_usage(int argc, char* argv[]);
|
|
|
|
fs::path construct_command_pathname(char* command);
|
|
|
|
std::tuple<std::string, std::string, std::string, std::string, bool, bool>
|
|
parse_args(
|
|
const std::vector<std::string>& input_filenames, std::string target,
|
|
std::string output_basename, bool display_only);
|
|
|
|
void load_klammersets(Machine& machine, const strings_t& symbols);
|
|
|
|
// The state a command gives a Machine before anything is read: the frame
|
|
// named for the command and the K_* variables that describe the run --
|
|
// target, output directory and basename, whether output is displayed rather
|
|
// than written, the input filenames, the verbosity, and the input directory
|
|
// (the first input file's, or the cwd when there is none). This was the top
|
|
// of ktext's main(), and it is policy, not mechanism: a klammer set reads
|
|
// these names (@document reads K_stdout_only and K_output_dir), so a second
|
|
// consumer of the Machine -- the Python binding in kpy/ -- must set exactly
|
|
// the same ones or a document that renders under ktext fails under it. One
|
|
// function, two callers, nothing restated.
|
|
void set_command_state(
|
|
Machine& machine, const std::string& frame_name, const std::string& target,
|
|
const std::vector<std::string>& input_filenames, const std::string& output_dir,
|
|
const std::string& output_basename, bool display_only);
|