File: reswrap.1

package info (click to toggle)
fox1.6 1.6.45-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 16,828 kB
  • sloc: cpp: 148,028; sh: 11,051; ansic: 2,345; makefile: 1,408; perl: 119
file content (171 lines) | stat: -rw-r--r-- 5,047 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
.TH reswrap 1 "Sept 2005" "The FOX C++ GUI Toolkit" "FOX Programmers Manual"

.SH NAME
reswrap \- wrap icon resources into C code
.SH SYNOPSIS
.B reswrap
.RB [ options ]
.RB [ \-o [ a "] "
.IR outfile ]
.I files...
.SH DESCRIPTION
.B Reswrap
is a tool to turn images, text, and other resource files into C++ data arrays.
This allows various binary resources to be embedded in the source code, and
compiled into an application.

In development of graphical applications with FOX, it is used to embed
icons and images for the user interface into the executable and eliminate the need
to distribute separate icon and image files.

.B Reswrap
is typically invoked as a part of the build process to generate C++ source files
from a collection of icons and images and other binary resources.

By default reswrap will interpret the
.I files
listed as a stream of raw bytes and output them as an initialized data array to stdout.
.SH OPTIONS
.TP
\fB\-o\fR[\fBa\fR]\fI outfile\fR
Write the result into the file
.I outfile
instead of writing to stdout. With
\fB\-o\fR
the
.I outfile
will be overwritten with the data from the input.
With the
\fB\-oa\fR
option, the resulting code is appended to the
.I output
file, allowing multiple input files to be placed into one single source file.

.TP
\fB\-h\fR
Print a short usage message.

.TP
\fB\-v\fR
Just print out the version number and license information.

.TP
\fB\-d\fR
Write data as decimal numbers instead of using the default hexadecimal numbers.

.TP
\fB\-m\fR
Read files with MS-DOS mode (default is binary).  This replaces "\\r\\n" with
"\\n" when reading the resource file.

.TP
\fB\-x\fR
Write data as hexadecimal numbers (default).

.TP
\fB\-t\fR[\fBa\fR]\fI
Write data as a text string, with each byte represented as a hexadecimal
excape sequence, as in "\\x33".

Note that the C++ compiler appends a nul-character at the end of
the text string, thus making the data array one character longer than the file.

With the
\fBa\fR
option, printable ascii characters are passed unescaped, while special
characters like tabs and newlines are given the usual escape codes.

.TP
\fB\-e\fR
Places the storage modifier
.I extern
in front of the data array, ensuring
that the data array can be linked with other compilation units.
Normally, constant declarations are not visible in other compilation
units.

.TP
\fB\-i\fR
Instead of generating an array definition only write a declaration, which
can be included as a header file.

.TP
\fB\-k\fR
This option causes reswrap to keep the file extension, replacing the "."
with an underscore "_".
Usage of this option is recommended as it reduces errors when using the
data arrays.

.TP
\fB\-s\fR
This option suppresses comments inserted by reswrap to indicate the
original file name from which the data statement was generated.

.TP
\fB\-p\fI prefix\fR
Prepend the given
.I prefix
in front of the name of the resource; this may be used to generate class
names or namespace names in front of symbols.

.TP
\fB\-n\fI namespace\fR
Generate all declarations inside the given C++
.I namespace
declaration.
Using a
.I namespace
may be used to ensure that declarations are only accessible within the
given scope, and thus won't clash with symbols.

.TP
\fB\-c\fI cols\fR
Writes
.I cols
columns instead of the default number of columns in the data statements
generated by reswrap.
The default number of columns for decimal and hex printout is 16 characters;
the default for text string printout is 80 characters.

.TP
\fB\-u\fR
Force output as unsigned chars in text mode.

.TP
\fB\-z\fR
Output the size of the resource in the declaration of a resource-array.
This allows the C++ sizeof() operator to return the correct size of the resource
even for external declarations.
Note that in text mode, (\-t option), an extra byte is added to the size for the
end of string character.

.TP
\fB\-r\fI name\fR
Instead of using a resource name based on the filename, reswrap substitutes
.I name
for the resource name used in the declaration or definition for the following
resource file.  This is useful if the filename can not be used as an identifier,
for example if the filename is a reserved word in C or C++, like "while".

.SH CAVEATS
When using the text string mode, please remember the C compiler appends
one nul-character after the string, making the data array one element
longer than the resource file.
.SH AUTHOR
This manpage was originally written by Torsten Landschoff (torsten@debian.org)
for the Debian distribution of the FOX Toolkit, and is currently maintained
by Jeroen van der Zijp (jeroen@fox-toolkit.org).
.SH COPYRIGHT
Copyright \(co 1997,2005 Jeroen van der Zijp.
.br
This is free software; see the source for copying conditions.  There is
NO warranty; not even for MERCHANTABILITY or FITNESS FOR  A  PARTICULAR
PURPOSE.
.SH SEE ALSO
The reswrap program is a part of the FOX GUI Toolkit.  Further information
about reswrap can be found at:

.B http://www.fox-toolkit.org

The FOX Toolkit website includes detailed information about reswrap and its use.