Network Component  Version 6.6
MDK-Professional Middleware for IP Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Software Utility: FCARM File Converter

The FCARM file converter reformats all web files into a single C-file which is then included and compiled into the project. All files are stored in the Virtual ROM File System.

Automatic Invocation

If configured appropriately, FCARM will be invoked automatically during a project build. For setup, go to Project -> Options for Target and select the Utilities tab. At the bottom, you can configure how FCARM compiles the image files. Here's an example:

fcarm_configuration.png
Configure Image File Processing (FCARM) Dialog

Manual Invocation

FCARM can also be invoked from the command line. You will find the executable in your MDK installation's sub-directory \ARM\BIN. FCARM has the following syntax:

FCARM @commandfile

Where

  • commandfile is the name of a command file that can contain an inputlist, outputfile, and directives. (See below.)

If you do not wish to use the command file, you can invoke FCARM like this:

FCARM <{>inputlist<}> <{> TO outputfile<}> <{>directives<}>

Where

  • inputlist is a comma-separated list of files. The files get converted into one output file. File names must be specified with the file extension, but without the path information.
  • outputfile is the name of the output C-file containing the converted web files.
  • directives are commands and parameters that control the operation of the file converter. Available directives are:
    Directive Description
    PRINT Specifies the name of the listing file. Default is the base name of the output C-file with the extension *.LST.
    NOPRINT Disables the generation of the listing (LST) file.
    PAGEWIDTH Specifies the number of characters on a line in the listing file.
    PAGELENGTHSpecifies 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.

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 flavour.

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:

  • replaces tab characters with spaces
  • removes line-termination CR-LF characters
  • replaces multiple spaces with a single space
  • removes leading and trailing spaces
  • removes space between two html tags (for example, "<ul><li>")

no compression

CGI

cgi
cgx

CGI compression
Optimizes scripts for maximum performance on embedded web server:

  • checks the script syntax
  • replaces T,C,I,# script commands with tokens
  • replaces tab characters with spaces
  • removes line-termination CR-LF characters
  • removes multiple spaces
  • removes comments from script lines
  • groups small t-commands

white space removal but without grouping of small t-commands

CSS

css

CSS compression
Parses and removes redundant information:

  • replaces multiple spaces with a single space
  • removes line-termination CR-LF characters
  • replaces tab characters with spaces
  • removes "/*" and "//" style comments
  • removes redundant spaces inserted in the 1ststep
  • removes spaces nearby a delimiter: :;{}

no optimization

JS

js

JS compression
Parses and removes redundant information:

  • replaces tab characters with spaces
  • replaces multiple spaces with a single space
  • removes line-termination CR-LF characters
  • removes "/*" and "//" style comments
  • removes redundant spaces inserted in the 1ststep
  • removes spaces nearby a delimiter:.,:;=!+-*\/&|<>(){}"?

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 project's sub-folder Web. This command reflects the settings from the configuration dialog as shown here.

FCARM index.htm, keil.gif, llblue.jpg, system.cgi TO Web.c nopr root(Web)

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