74 static FILE *
open_file(std::string
const & file,
const char *mode);
81 static void open(std::string
const & fname);
static FILE * open_file(std::string const &file, const char *mode)
Open a named file for reading or writing.
static char const *const _stdin_name_
Nominal filename for the standard input stream.
static void make_tempfile()
Create a temporary file to which output will be written.
Manages input and output file handling.
static void close_input()
Close the current source file.
static fs::permissions _in_out_permissions_
File permissions mask of input file, in case file is replaced.
static void open_output()
Open an output stream for the current input file.
static void top()
Reinitialize the module.
static void close(unsigned error)
Finalise the current pairing of source input and processed output, if any.
static void make_backup_name(std::string const &filename)
Generate a filename for backing up an input file.
static std::string in_file_name()
Get the name of the current source file.
static std::string const & spin_dir()
Get the name of operative spin directory.
static std::istream * _input_
The input stream.
static std::string read_filename()
Read the name of a source file from stdin.
static std::string _spin_prefix_
Path prefix assumed to match the spin directory.
static void set_spin_prefix(char const *optarg)
Set a path prefix (of input files) that will be assumed to match the name of the spin directory...
static std::ostream * _output_
The output stream.
static std::filebuf _outfile_
The output file.
static void make_spinfile()
Create an output file in the spin directory corresponding to an input file.
static std::string _out_filename_
Current output filename, if needed.
static void open_outfile()
Open the output file.
static bool spin()
Say whether there is any spin directory.
static void delete_infile()
Delete the current input source file.
static std::string _spin_dir_
Name of directory in which to output a spin.
static std::ostream * output()
Get a pointer to the output stream.
static void set_spin_dir(char const *optarg)
Set the directory in which to output a spin.
static std::string _in_filename_
The name of the current source file.
static void replace_infile()
Replace the current input source file with the temporary output file.
static void backup_infile()
Backup the current input source file.
static void open(std::string const &fname)
Open an input file and the appropriate output file.
char * optarg
Argument to an option parsed by getopt_long()
static std::filebuf _infile_
The input file.
static std::string _bak_filename_
Backup filename, if needed.
static std::istream * input()
Get a pointer to the input stream.
int permissions
Type of file permissions mask.