File Converter fcarm
This file converter reformats all web files into a single C-file which is then included and compiled into the project.
fcarm is invoked from the command line and has the syntax:
fcarm @commandfile
Where
commandfile
is the name of a command file that can contain an inputlist
, an outputfile
, and directives
.
or
fcarm {inputlist} to {outputfile} {directives}
Where
inputlist
is a comma-separated list of files. The files get converted into one output file. Filenames must be specified with the file extension, but without the path information.outputfile
name of the output C-file containing the converted web files.directives
commands and parameters that control the operation of the file converter. Available directives:
Directive | Description |
---|---|
Specify the name of the listing file. Default is the base name of the output C-file with the extension *.LST. | |
NOPRINT | Disables generation of the listing (LST) file. |
PAGEWIDTH | Specifies the number of characters on a line in the listing file. |
PAGELENGTH | Specifies the number of lines on a page in the listing file. |
ROOT | Specifies the root path where web files are located relative to the project directory path. |
In addition to the output file, fcarm generates a listing file with the base name of the output file and the extension *.LST.
Optimization
fcarm integrates a file optimization algorithm to compress files and creates more compact and smaller executable images. fcarm decides on the file extension which kind of compression is used. Each file group has a different compression and optimization flavor.
When the filename has the tilde prefix (for example, ~doStuff.js) then compression or certain compression optimizations are disabled. This is useful when debugging a file. It is hard to trace code compacted to a single line with no spaces, no comments, and no line feeds.
Compression and optimization is performed in two iterations. In a 2nd pass, further optimization is performed resulting in better code density.
Group | Extension | Optimization | ~Optimization (disabled) |
---|---|---|---|
HTML | html htm inc |
HTML compression Performs the following optimizations:
| no compression |
CGI | cgi cgx |
CGI compression Optimizes scripts for maximum performance on TCPnet web server:
|
white space removal but without grouping of small t-commands |
CSS | css | CSS compression Parses and removes redundant information:
|
no optimization |
JS | js | JS compression Parses and removes redundant information:
|
no optimization |
others | .* | not affected | not affected |
Examples
The following command line converts and optimizes index.htm
, creates the output C-file index.c
, and creates the
listing file index.lst
:
fcarm index.htm
The following command line converts and optimizes a list of files, creates the output C-file web.c
, and creates the
listing file web.lst
:
fcarm index.htm, keil.gif, llblue.jpg, system.cgi TO web.c
The following command line converts and optimizes a list of files, creates the output C-file web.c
, and suppresses the
creation of the listing file (nopr
directive). The files are located in the sub-folder Web_Files
:
fcarm index.htm, keil.gif, llblue.jpg, system.cgi TO web.c nopr root(Web_Files)
The following command line converts and optimizes a list of files, creates the output C-file web.c
, and creates the
listing file web.lst
. The file doStuff.js
is excluded from optimization:
fcarm index.htm, keil.gif, llblue.jpg, system.cgi, ~doStuff.js TO web.c
The following command line uses a command file:
fcarm @fcarm_command_file
Directives
The PRINT directive specifies the name of the listing file. If no PRINT directive is specified the listing file is given the name of the generated c-source file with a .LST extension.
- Abbreviation: PR
- Arguments:
PRINT (filename)
- Default: The name of the generated listing file with a .LST extension.
See also: NOPRINT
Example
fcarm index.htm, keil.gif to web.c print (Sample.lst)
NOPRINT
The NOPRINT directive prevents the file converter from generating a listing file.
- Abbreviation:
NOPR
- Arguments:
NOPRINT
- Default: The name of the generated listing file with a .LST extension.
See also: PRINT
Example
fcarm index.htm, keil.gif to web.c noprint
PAGEWIDTH
The PAGEWIDTH directive specifies the number of character per line that may be printed to the converter listing file. Lines with more than the specified number of characters are broken into two or more lines. The valid range of values is 72-132 columns.
- Abbreviation:
PW
- Arguments:
PAGEWIDTH (number)
- Default: PAGEWIDTH (132)
See also: PAGELENGTH
Example
fcarm index.htm to web.c pagewidth (132)
PAGELENGTH
The PAGELENGTH directive specifies the number of lines printed per page in the converter listing file. The minimum page length is 10 lines per page. The maximum page length is 65535.
- Abbreviation:
PL
- Arguments:
PAGELENGTH (number)
- Default: PAGELENGTH (60)
See also: PAGEWIDTH
Example
fcarm index.htm to web.c pagelength (55)
ROOT
The ROOT directive defines the root path where the web files are located relative to the project directory path.
- Abbreviation:
RO
- Arguments:
ROOT (directory)
- Default: The current project directory path is used as the web container.
Example
fcarm index.htm, keil.gif to web.c root(Web_Files)