JavaDataCompact
java [ Java options ] JavaDataCompact [-verbose] [-o outfile]
[-align alignment] [-big] [-noData] [-noDirectory]
[-convert_prefix oldprefix newprefix]
... [-pairs] file ...
Description
JavaDataCompact generates C data structures
for storing data files in ROM.
It reads in one or more data files and produces a C file containing
structures initialized with the contents of the data files,
and a structure containing a directory of all the the data files.
The directory is exported as a global variable
which can be accessed by runtime code after compiling
the C file and linking it into the ROM image.
Utility routines for accessing the ROMized files are provided.
If you hook these utility routines into the native file system,
you can get seamless access to files in ROM.
Options
-
-o outfile
-
Specifies the name of the output C file.
The default is ROMfiles.c.
This option is ignored when using the -pairs option.
-
-align alignment
-
Specifies any alignment needed for the ROMized data files. Each file
will start on the byte boundary specified by the alignment parameter.
Using this option usually requires also using the -big option and
prevents using the Stuffer tool. Note, currently alignment is partly determined
by the linker. Alignment sizes greater then the alignment the linker guarantees
for the first byte of a data structure in an object file cannot be guaranteed.
-
-big
-
Causes the C structures that are output to contain the actual file
data rather then just allocating the space for the data. If -big
is not specified then the Stuffer tool needs to be run after compiling
the output C file in order to stuff the file data into the object file.
Using Stuffer is the preferred method because it is faster, but it is not
always portable.
-
-noData
-
Used to prevent any C structures for files from being output. This has the
affect of only producing the directory and the external declarations needed
to reference the file data. The file data is then produced in one or more
separate steps in which the -noDirectory option is used. This allows
each file to be ROMized separately,
preventing the need to run JavaDataCompact
on every file when only one has changed.
Note that the directory needs
to be regenerated if any file needs to be ROMized.
-
-noDirectory
-
Used to prevent the directory from be generated. See -noData
above.
-
-convert_prefix oldprefix newprefix
-
Specifies the directory path that will be used to access files in ROM.
For example, "-convert_prefix ../../build/solaris /java"
would allow you to access files ROMized from the ../../build/solaris
directory by using the path /ROM/java.
[Note the /ROM part assumes that your file system will
be mounting the ROM file system as the /ROM directory.]
You can use -convert_prefix more then once.
-
-pairs
-
specifies a different output C file for each input data file.
It is usually used with the -noDirectory option. The -o
options is omitted when using -pairs.
For example "JavaDataCompact -noDirectory -pairs file1 file1.c file2 file2.c"
will put all the C structures for file1
into file1.c and file2 into file2.c.
You would then use JavaDataCompact a second
time to generate the directory.
For example, "JavaDataCompact -noData file1 file2"
only filize files that have changed since the last build,
and to filize all those files with one JavaDataCompact command,
instead of a separate JavaDataCompact command for each file that changed.
Note that when generating the directory,
you should always pass all files to be filized to JavaDataCompact.
See Also
Stuffer