b2pftest man page

Return to the B2PF index page.

This page is part of the B2PF HTML documentation. It was generated automatically from the original man page. If there is any nonsense in it, please consult the man page, in case the conversion went wrong.


SYNOPSIS

b2pftest [options] [input file [output file]]

b2pftest is a test program for the B2PF presentation forms library. This document describes the features of the test program; for details of the B2PF library function calls and their options, see the b2pf documentation.

The input for b2pftest is a sequence of lines, each of which is a UTF-8 string to be processed by the library. Although the input is always UTF-8, if the -16 or -32 option is set, the input is converted to UTF-16 or UTF-32, respectively, before processing, and the output from the library is then translated back to UTF-8 before being written out. There are also command lines for setting options and controlling some special actions.


COMMAND LINE OPTIONS

-8 Call the library in UTF-8 mode; this is the default.

-16 Call the library in UTF-16 mode.

-32 Call the library in UTF-32 mode.

-F <directory-list> Search the given colon-separated list of directories for rules files, before searching the default directory that was set up when B2PF was built.

-help Output a brief summary these options and then exit.

-q Do not output the version number of b2pftest at the start of execution.

-version Output the B2PF version number and then exit.

Only one of -8, -16, or -32 may be specified.


DESCRIPTION

If b2pftest is given two filename arguments, it reads from the first and writes to the second. If the first name is "-", input is taken from the standard input. If b2pftest is given only one argument, it reads from that file and writes to stdout. Otherwise, it reads from stdin and writes to stdout. When the input is a terminal, b2pftest prompts for each line of input with ">". Leading white space in all lines is ignored.

When b2pftest is built, a configuration option can specify that it should be linked with the libreadline or libedit library. When this is done, if the input is from a terminal, it is read using the readline() function. This provides line-editing and history facilities. The output from the -help option states whether or not readline() will be used.


COMMAND LINES

A line that begins (after optional white space) with # is interpreted as a command line. If # is followed by a space or an exclamation mark, the line is treated as a comment, and ignored. Otherwise, the following commands are recognized:

  #context_create "name"
This should normally be the first non-comment input. It causes a B2PF context to be created. This becomes the current context that is used for subsequent calls to b2pf_format_string(). If these is an existing context, it is freed before creating the new one. If the name is not an empty string, a rules file with that name is sought in the directories specified by the -F option (if given) and the default rules direcory. For example:
  #context_create "Arabic"
If the name is an empty string, an empty context is created.
  #context_extend rule text
This command passes the rest of the input line to the b2pf_context_extend() function, which adds the information to the current context. By starting from an empty context, all the context information can be set up this way, without reading a rules file. Details of rules files are given in the b2pf documentation.
  #input_backchars
Pass the B2PF_INPUT_BACKCHARS option when calling b2pf_format_string().
  #input_backcodes
Pass the B2PF_INPUT_BACKCODES option when calling b2pf_format_string().
  #output_backchars
Pass the B2PF_OUTPUT_BACKCHARS option when calling b2pf_format_string().
  #output_backcodes
Pass the B2PF_OUTPUT_BACKCODES option when calling b2pf_format_string().
 #reset
Reset all the options for b2pf_format_string().


SEE ALSO

b2pf(3)


AUTHOR

Philip Hazel
Cambridge, England.


REVISION

Last updated: 26 July 2020
Copyright © 2020 Philip Hazel

Return to the B2PF index page.