mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-30 08:20:40 +00:00
add --qccx-escapes to resolve the conflicts in escape sequences and document the escape sequences supported by qfcc.
This commit is contained in:
parent
fb5b0dc5c3
commit
c3f47efb07
4 changed files with 116 additions and 13 deletions
|
@ -113,6 +113,10 @@ In \fBprogs.src\fP mode, this overrides the output file in \*[progs.src].
|
||||||
File to use instead of \*[progs.src].
|
File to use instead of \*[progs.src].
|
||||||
No effect in separate compilation mode.
|
No effect in separate compilation mode.
|
||||||
.TP
|
.TP
|
||||||
|
.B \-P, \-\-qccx\-escapes FILE
|
||||||
|
Use QCCX escape sequences instead of standard C/QuakeForge sequences in
|
||||||
|
strings. See \fBESCAPE SEQUENCES\fP for details.
|
||||||
|
.TP
|
||||||
.B \-p, \-\-strip\-path NUM
|
.B \-p, \-\-strip\-path NUM
|
||||||
Strip NUM leading path elements from file names.
|
Strip NUM leading path elements from file names.
|
||||||
eg. -p 3 will strip the
|
eg. -p 3 will strip the
|
||||||
|
@ -420,6 +424,91 @@ overridden using \fB--traditional\fP.
|
||||||
When using \*[cpp], each source file is passed through the preprocessor
|
When using \*[cpp], each source file is passed through the preprocessor
|
||||||
individually.
|
individually.
|
||||||
Each file is truly independent of any other file on the command line.
|
Each file is truly independent of any other file on the command line.
|
||||||
|
.SH "ESCAPE SEQUENCES"
|
||||||
|
\*[qfcc] supports a variety of string escape sequences. This includes those of
|
||||||
|
\fBqcc\fP (which are a subset of those in standard C), standard C and
|
||||||
|
\fBqccx\fP. There are some conflicts between the escape sequences, but
|
||||||
|
\fB\-\-qccx\-escapes\fP selects which set to use.
|
||||||
|
.TP
|
||||||
|
.B \(rs\(rs
|
||||||
|
Backslash.
|
||||||
|
.TP
|
||||||
|
.B \(rsn
|
||||||
|
Line feed.
|
||||||
|
.TP
|
||||||
|
.B \(rs"
|
||||||
|
Double quote.
|
||||||
|
.TP
|
||||||
|
.B \(rs\'
|
||||||
|
Single quote.
|
||||||
|
.TP
|
||||||
|
.B \(rs0-7
|
||||||
|
Octal character code, up to three digits.
|
||||||
|
.TP
|
||||||
|
.B \(rsx0-9A-Fa-f
|
||||||
|
Hexadecimal character code, any number of digits, but only the least significant byte will be used.
|
||||||
|
.TP
|
||||||
|
.B \(rsa
|
||||||
|
Bell character (not in quake engines). Equivalent to \(rsx07.
|
||||||
|
.TP
|
||||||
|
.B \(rsb
|
||||||
|
Backspace character (not in quake engines). Equivalent to \(rsx08. This
|
||||||
|
conflicts with \fBqccx\fP. In \fBqccx\fP, this toggles bronze characters. Use
|
||||||
|
\fB\-\-qccx\-escapes\fP to select \fBqccx\fP behaviour.
|
||||||
|
.TP
|
||||||
|
.B \(rse
|
||||||
|
Escape character (not in quake engines). Equivalent to \(rsx1b (dull 9).
|
||||||
|
.TP
|
||||||
|
.B \(rsf
|
||||||
|
Formfeed character (not in quake engines). Equivalent to \(rsx0c.
|
||||||
|
.TP
|
||||||
|
.B \(rsr
|
||||||
|
Carriage return. Equivalent to \(rsx0d.
|
||||||
|
.TP
|
||||||
|
.B \(rst
|
||||||
|
Tab character. Equivalent to \(rsx09.
|
||||||
|
.TP
|
||||||
|
.B \(rsv
|
||||||
|
Vertical tab. Equivalent to \(rsx0b.
|
||||||
|
.TP
|
||||||
|
.B \(rs^
|
||||||
|
Make the next character "bold" (add 0x80).
|
||||||
|
.TP
|
||||||
|
.B \(rs[
|
||||||
|
Gold [ character. Equivalent to \(rsx90.
|
||||||
|
.TP
|
||||||
|
.B \(rs]
|
||||||
|
Gold ] character. Equivalent to \(rsx91.
|
||||||
|
.TP
|
||||||
|
.B \(rs.
|
||||||
|
Center dot. Equivalent to \(rsx1c.
|
||||||
|
.TP
|
||||||
|
.B \(rs<
|
||||||
|
Turn on "bold" characters (add 0x80). This conflicts with \fBqccx\fP. In
|
||||||
|
\fBqccx\fP, this produces the brown left end. Equivalent to \(rsx1d. Use
|
||||||
|
\fB\-\-qccx\-escapes\fP to select \fBqccx\fP behaviour.
|
||||||
|
.TP
|
||||||
|
.B \(rs\-
|
||||||
|
Brown center bit. Equivalent to \(rsx1e.
|
||||||
|
.TP
|
||||||
|
.B \(rs>
|
||||||
|
Turn off "bold" characters (add 0x80). This conflicts with \fBqccx\fP. In
|
||||||
|
\fBqccx\fP, this produces the brown right end. Equivalent to \(rsx1f. Use
|
||||||
|
\fB\-\-qccx\-escapes\fP to select \fBqccx\fP behaviour.
|
||||||
|
.TP
|
||||||
|
.B \(rs(
|
||||||
|
Left slider end. Equivalent to \(rsx80.
|
||||||
|
.TP
|
||||||
|
.B \(rs=
|
||||||
|
Slider center. Equivalent to \(rsx81.
|
||||||
|
.TP
|
||||||
|
.B \(rs)
|
||||||
|
Right slider end. Equivalent to \(rsx82.
|
||||||
|
.TP
|
||||||
|
.B \(rs{0-255}
|
||||||
|
Decimal character code.
|
||||||
|
.P
|
||||||
|
\fB\-\-qccx\-escapes\fP has no effect on sequences that do not conflict.
|
||||||
.SH TRADITIONAL VS ADVANCED
|
.SH TRADITIONAL VS ADVANCED
|
||||||
Compared to \fBqcc\fP, \*[qfcc] has many advanced features and is much stricter
|
Compared to \fBqcc\fP, \*[qfcc] has many advanced features and is much stricter
|
||||||
about type checking.
|
about type checking.
|
||||||
|
|
|
@ -77,6 +77,7 @@ typedef struct {
|
||||||
qboolean save_temps; // save temporary files
|
qboolean save_temps; // save temporary files
|
||||||
qboolean files_dat; // generate files.dat
|
qboolean files_dat; // generate files.dat
|
||||||
qboolean progdefs_h; // generate progdefs.h
|
qboolean progdefs_h; // generate progdefs.h
|
||||||
|
qboolean qccx_escapes; // use qccx escapes instead of standard C
|
||||||
qboolean traditional; // behave more like qcc
|
qboolean traditional; // behave more like qcc
|
||||||
qboolean advanced; // behold the power of Ruamoko
|
qboolean advanced; // behold the power of Ruamoko
|
||||||
qboolean compile; // serparate compilation mode
|
qboolean compile; // serparate compilation mode
|
||||||
|
|
|
@ -65,6 +65,7 @@ enum {
|
||||||
OPT_CPP,
|
OPT_CPP,
|
||||||
OPT_INCLUDE,
|
OPT_INCLUDE,
|
||||||
OPT_PROGDEFS,
|
OPT_PROGDEFS,
|
||||||
|
OPT_QCCX_ESCAPES,
|
||||||
OPT_TRADITIONAL,
|
OPT_TRADITIONAL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -80,6 +81,7 @@ static struct option const long_options[] = {
|
||||||
{"output-file", required_argument, 0, 'o'},
|
{"output-file", required_argument, 0, 'o'},
|
||||||
{"progdefs", no_argument, 0, OPT_PROGDEFS},
|
{"progdefs", no_argument, 0, OPT_PROGDEFS},
|
||||||
{"progs-src", required_argument, 0, 'P'},
|
{"progs-src", required_argument, 0, 'P'},
|
||||||
|
{"qccx-escapes", no_argument, 0, OPT_QCCX_ESCAPES},
|
||||||
{"quiet", no_argument, 0, 'q'},
|
{"quiet", no_argument, 0, 'q'},
|
||||||
{"relocatable", no_argument, 0, 'r'},
|
{"relocatable", no_argument, 0, 'r'},
|
||||||
{"save-temps", no_argument, 0, 'S'},
|
{"save-temps", no_argument, 0, 'S'},
|
||||||
|
@ -151,6 +153,8 @@ usage (int status)
|
||||||
" -P, --progs-src FILE File to use instead of progs.src\n"
|
" -P, --progs-src FILE File to use instead of progs.src\n"
|
||||||
" -p, --strip-path NUM Strip NUM leading path elements from file\n"
|
" -p, --strip-path NUM Strip NUM leading path elements from file\n"
|
||||||
" names\n"
|
" names\n"
|
||||||
|
" --qccx-escapes Use QCCX escape sequences instead of standard\n"
|
||||||
|
" C/QuakeForge sequences.\n"
|
||||||
" -q, --quiet Inhibit usual output\n"
|
" -q, --quiet Inhibit usual output\n"
|
||||||
" -r, --relocatable Incremental linking\n"
|
" -r, --relocatable Incremental linking\n"
|
||||||
" -S, --save-temps Do not delete temporary files\n"
|
" -S, --save-temps Do not delete temporary files\n"
|
||||||
|
@ -324,6 +328,9 @@ DecodeArgs (int argc, char **argv)
|
||||||
case OPT_PROGDEFS:
|
case OPT_PROGDEFS:
|
||||||
options.progdefs_h = true;
|
options.progdefs_h = true;
|
||||||
break;
|
break;
|
||||||
|
case OPT_QCCX_ESCAPES:
|
||||||
|
options.qccx_escapes = true;
|
||||||
|
break;
|
||||||
case 'q': // quiet
|
case 'q': // quiet
|
||||||
options.verbosity -= 1;
|
options.verbosity -= 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -542,7 +542,9 @@ make_string (char *token, char **end)
|
||||||
c = '\a';
|
c = '\a';
|
||||||
break;
|
break;
|
||||||
case 'b':
|
case 'b':
|
||||||
//XXX mask ^= 0x80;
|
if (options.qccx_escapes)
|
||||||
|
mask ^= 0x80;
|
||||||
|
else
|
||||||
c = '\b';
|
c = '\b';
|
||||||
break;
|
break;
|
||||||
case 'e':
|
case 'e':
|
||||||
|
@ -566,33 +568,37 @@ make_string (char *token, char **end)
|
||||||
boldnext = 1;
|
boldnext = 1;
|
||||||
continue;
|
continue;
|
||||||
case '[':
|
case '[':
|
||||||
c = 0x90;
|
c = 0x90; // gold [
|
||||||
break;
|
break;
|
||||||
case ']':
|
case ']':
|
||||||
c = 0x91;
|
c = 0x91; // gold ]
|
||||||
break;
|
break;
|
||||||
case '.':
|
case '.':
|
||||||
c = 28;
|
c = 28; // center dot
|
||||||
break;
|
break;
|
||||||
case '<':
|
case '<':
|
||||||
//XXX c = 29;
|
if (options.qccx_escapes)
|
||||||
|
c = 29; // brown left end
|
||||||
|
else
|
||||||
mask = 0x80;
|
mask = 0x80;
|
||||||
continue;
|
continue;
|
||||||
case '-':
|
case '-':
|
||||||
c = 30;
|
c = 30; // brown center bit
|
||||||
break;
|
break;
|
||||||
case '>':
|
case '>':
|
||||||
//XXX c = 31;
|
if (options.qccx_escapes)
|
||||||
|
c = 31; // broun right end
|
||||||
|
else
|
||||||
mask = 0x00;
|
mask = 0x00;
|
||||||
continue;
|
continue;
|
||||||
case '(':
|
case '(':
|
||||||
c = 128;
|
c = 128; // left slider end
|
||||||
break;
|
break;
|
||||||
case '=':
|
case '=':
|
||||||
c = 129;
|
c = 129; // slider center
|
||||||
break;
|
break;
|
||||||
case ')':
|
case ')':
|
||||||
c = 130;
|
c = 130; // right slider end
|
||||||
break;
|
break;
|
||||||
case '{':
|
case '{':
|
||||||
c = 0;
|
c = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue