]> git.xonotic.org Git - xonotic/gmqcc.git/blob - doc/qcvm.1
857225f8e482a5aa6c19593f308780c1b7608d2e
[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.
51 .TP
52 .BI "-vector """ "x y z" """"
53 Append a vector parameter to be passed to \fImain\fR.
54 .TP
55 .BI "-float " number
56 Append a float parameter to be passed to \fImain\fR.
57 .TP
58 .BI "-string """ "text" """"
59 Append a string parameter to be passed to \fImain\fR.
60 .SH BUILTINS
61 The following builtin functions are available:
62 .fi
63
64 .RI "1) " void " print(" string... ") = " "#1" ;
65 .in +8
66 Print the passed strings to stdout. At most 8 strings are allowed.
67 .in
68
69 .RI "2) " string " ftos(" float ") = " "#2" ;
70 .in +8
71 Convert a float to a string.
72 .in
73
74 .RI "3) " entity " spawn() = " "#3" ;
75 .in +8
76 Spawn an entity.
77 .in
78
79 .RI "4) " void " remove(" entity ") = " "#4" ;
80 .in +8
81 Remove an entity.
82 .in
83
84 .RI "5) " string " vtos(" vector ") = " "#5" ;
85 .in +8
86 Convert a vector to a string.
87 .in
88
89 .RI "6) " void " error(" string... ") = " "#6" ;
90 .in +8
91 Print at most 8 strings to stdout and then exit with an error.
92 .in
93
94 .RI "7) " float " vlen(" vector ") = " "#7" ;
95 .in +8
96 Get the length of a vector.
97 .in
98
99 .RI "8) " string " etos(" entity ") = " "#8" ;
100 .in +8
101 Get the entity ID as string.
102 .in
103
104 .RI "9) " float " stof(" string ") = " "#9" ;
105 .in +8
106 Convert a string to a float.
107 .in
108
109 .RI "10) " string " strcat(" string ", " string ") = " "#10" ;
110 .in +8
111 Concatenate two strings, returning a tempstring.
112 .in
113
114 .RI "11) " float " strcmp (" string ", " string ") = " "#11" ;
115 .fi
116 .RI "    " float " strncmp(" string ", " string ", " float ") = " "#11" ;
117 .in +8
118 Compare two strings. Returns the same as the corresponding C functions.
119 .in
120 .SH BUGS
121 Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
122 or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
123 .SH SEE ALSO
124 .IR gmqcc (1)
125 .SH AUTHOR
126 See <http://graphitemaster.github.com/gmqcc>.