]> git.xonotic.org Git - xonotic/gmqcc.git/blob - doc/qcvm.1
manpage: -fbail-on-werror
[xonotic/gmqcc.git] / doc / qcvm.1
1 .\" Process with groff -man -Tascii file.3
2 .TH QCVM 1 2012-18-12 "" "gmqcc Manual"
3 .SH NAME
4 qcvm \- A standalone QuakeC VM binary executor.
5 .SH SYNOPSIS
6 .B qcvm
7 [\fIOPTIONS\fR] [\fIPARAMS\fR] [\fIfile\fR]
8 .SH DESCRIPTION
9 qcvm is an executor for QuakeC VM binary files created using a QC
10 compiler such as gmqcc(1) or fteqcc. It provides a small set of
11 builtin functions, and by default executes the \fImain\fR function if
12 there is one. Some options useful for debugging are available as well.
13 .SH OPTIONS
14 There are 2 types of options. Options for the executor, and parameter
15 options used to add parameters which are passed to the main function
16 on execution.
17 .TP
18 .B "-h, --help"
19 Show a usage message and exit.
20 .TP
21 .B "-trace"
22 Trace the execution. Each instruction will be printed to stdout before
23 executing it.
24 .TP
25 .B "-profile"
26 Perform some profiling. This is currently not really implemented, the
27 option is available nonetheless.
28 .TP
29 .B "-info"
30 Print information from the program's header instead of executing.
31 .TP
32 .B "-disasm"
33 Disassemble the program by function instead of executing.
34 .TP
35 .BI "-disasm-func" function
36 Search for and disassemble the given function.
37 .TP
38 .B "-printdefs"
39 List all entries from the program's defs-section. Effectively
40 listing all the global variables of the program.
41 This option disables execution.
42 .TP
43 .B "-printfields"
44 List all entries from the program's fields-section. Listing all
45 entity-fields declared in the program.
46 This option disables execution.
47 .TP
48 .B "-printfuns"
49 List functions and some information about their parameters.
50 This option disables execution. With a verbosity level of 1, builtin
51 numbers are printed. With a verbosity of 2, the function's sizes are
52 printed as well. This takes a little longer since the size is found by
53 searching for a DONE instruction in the code.
54 .TP
55 .B "-v"
56 Increase verbosity level, can be used multiple times.
57 .TP
58 .BI "-vector """ "x y z" """"
59 Append a vector parameter to be passed to \fImain\fR.
60 .TP
61 .BI "-float " number
62 Append a float parameter to be passed to \fImain\fR.
63 .TP
64 .BI "-string """ "text" """"
65 Append a string parameter to be passed to \fImain\fR.
66 .SH BUILTINS
67 The following builtin functions are available:
68 .fi
69
70 .RI "1) " void " print(" string... ") = " "#1" ;
71 .in +8
72 Print the passed strings to stdout. At most 8 strings are allowed.
73 .in
74
75 .RI "2) " string " ftos(" float ") = " "#2" ;
76 .in +8
77 Convert a float to a string.
78 .in
79
80 .RI "3) " entity " spawn() = " "#3" ;
81 .in +8
82 Spawn an entity.
83 .in
84
85 .RI "4) " void " remove(" entity ") = " "#4" ;
86 .in +8
87 Remove an entity.
88 .in
89
90 .RI "5) " string " vtos(" vector ") = " "#5" ;
91 .in +8
92 Convert a vector to a string.
93 .in
94
95 .RI "6) " void " error(" string... ") = " "#6" ;
96 .in +8
97 Print at most 8 strings to stdout and then exit with an error.
98 .in
99
100 .RI "7) " float " vlen(" vector ") = " "#7" ;
101 .in +8
102 Get the length of a vector.
103 .in
104
105 .RI "8) " string " etos(" entity ") = " "#8" ;
106 .in +8
107 Get the entity ID as string.
108 .in
109
110 .RI "9) " float " stof(" string ") = " "#9" ;
111 .in +8
112 Convert a string to a float.
113 .in
114
115 .RI "10) " string " strcat(" string ", " string ") = " "#10" ;
116 .in +8
117 Concatenate two strings, returning a tempstring.
118 .in
119
120 .RI "11) " float " strcmp (" string ", " string ") = " "#11" ;
121 .fi
122 .RI "    " float " strncmp(" string ", " string ", " float ") = " "#11" ;
123 .in +8
124 Compare two strings. Returns the same as the corresponding C functions.
125 .in
126 .SH BUGS
127 Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
128 or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
129 .SH SEE ALSO
130 .IR gmqcc (1)
131 .SH AUTHOR
132 See <http://graphitemaster.github.com/gmqcc>.