]> icculus.org git repositories - divverent/nexuiz.git/blob - data/qcsrc/menu-div0test/mbuiltin.qh
add server browser, and somewhat broken font. When will Ubuntu fix perl-fu?
[divverent/nexuiz.git] / data / qcsrc / menu-div0test / mbuiltin.qh
1 //////////////////////////////////////////////////
2 // common cmd
3 //////////////////////////////////////////////////
4 // AK FIXME: Create perhaps a special builtin file for the common cmds
5
6 //#define PROFILESTRZONE
7
8 void    checkextension(string ext) = #1;
9
10 // error cmds
11 void    error(string err,...)   = #2;
12 void    objerror(string err,...)        = #3;
13
14 // print
15
16 void    print(string text,...)  = #4;
17 void    bprint(string text,...) = #5;
18 void    sprint(float clientnum, string text,...) = #6;
19 void    centerprint(string text,...) = #7;
20
21 // vector stuff
22
23 vector  normalize(vector v)     = #8;
24 float   vlen(vector v)                  = #9;
25 float   vectoyaw(vector v)              = #10;
26 vector  vectoangles(vector v)   = #11;
27
28 float   random(void)  = #12;
29
30 void    cmd(string command, ...) = #13;
31
32 // cvar cmds
33
34 float   cvar(string name) = #14;
35 const string cvar_string(string name) = #71;
36 const string cvar_defstring(string name) = #89;
37 void    cvar_set(string name, string value) = #15;
38
39 //void  dprint(string text,...) = #16;
40
41 // conversion functions
42
43 string  ftos(float f)  = #17;
44 float   fabs(float f)   = #18;
45 string  vtos(vector v)  = #19;
46 string  etos(entity e) = #20;
47
48 float   stof(string val,...)  = #21;
49
50 entity  spawn(void) = #22;
51 void    remove(entity e) = #23;
52
53 entity  findstring(entity start, .string _field, string match)  = #24;
54 entity  findfloat(entity start, .float _field, float match) = #25;
55 entity  findentity(entity start, .entity _field, entity match) = #25;
56
57 entity  findchainstring(.string _field, string match) = #26;
58 entity  findchainfloat(.float _field, float match) = #27;
59 entity  findchainentity(.entity _field, entity match) = #27;
60
61 entity  findflags(entity start, .float field, float match) = #87;
62 entity  findchainflags(.float field, float match) = #88;
63
64 string  precache_file(string file) = #28;
65 string  precache_sound(string sample) = #29;
66
67 void    crash(void)     = #72;
68 void    coredump(void) = #30;
69 void    stackdump(void) = #73;
70 void    traceon(void) = #31;
71 void    traceoff(void) = #32;
72
73 void    eprint(entity e)  = #33;
74 float   rint(float f) = #34;
75 float   floor(float f)  = #35;
76 float   ceil(float f)  = #36;
77 entity  nextent(entity e)  = #37;
78 float   sin(float f)  = #38;
79 float   cos(float f)  = #39;
80 float   sqrt(float f)  = #40;
81 vector  randomvec(void)  = #41;
82
83 float   registercvar(string name, string value, float flags)  = #42; // returns 1 if success
84 float   min(float f,...)  = #43;
85 float   max(float f,...)  = #44;
86 float   bound(float min,float value, float max)  = #45;
87 float   pow(float a, float b)  = #46;
88 void    copyentity(entity src, entity dst)  = #47;
89
90 float   fopen(string filename, float mode)  = #48;
91 void    fclose(float fhandle)  = #49;
92 string  fgets(float fhandle)  = #50;
93 void    fputs(float fhandle, string s)  = #51;
94
95 float   strlen(string s)  = #52;
96 //string        strcat(string s1,string s2,...)  = #53;
97 string  strcat(string s1, ...)  = #53;
98 string  substring(string s, float start, float length)  = #54;
99
100 float(string str, string sub, float startpos) strstrofs = #221;
101 float(string s1, string s2, float len) strncmp = #228;
102 float(string s1, string s2) strcasecmp = #229;
103 float(string s1, string s2, float len) strncasecmp = #230;
104
105
106 vector  stov(string s)  = #55;
107
108 #ifdef PROFILESTRZONE
109 string  _strzone(string s)  = #56;
110 void    _strunzone(string s) = #57;
111
112 string( string s ) strzone =
113 {
114         return _strzone( s );
115 };
116
117 void( string s ) strunzone =
118 {
119         return _strunzone( s );
120 };
121 #else
122 string  strzone(string s)  = #56;
123 void    strunzone(string s) = #57;
124 #endif
125
126 float   tokenize(string s) = #58;
127 float(string s, string separator1, ...) tokenizebyseparator = #479;
128 string  argv(float n)  = #59;
129
130 float   isserver(void)  = #60;
131 float   clientcount(void)  = #61;
132 float   clientstate(void)  = #62;
133 void    clientcommand(float client, string s)  = #63;
134 void    changelevel(string map)  = #64;
135 void    localsound(string sample)  = #65;
136 vector  getmousepos(void)       = #66;
137 float   gettime(void)           = #67;
138 void    loadfromdata(string data) = #68;
139 void    loadfromfile(string file) = #69;
140
141 float   mod(float val, float m) = #70;
142
143 float   search_begin(string pattern, float caseinsensitive, float quiet) = #74;
144 void    search_end(float handle) = #75;
145 float   search_getsize(float handle) = #76;
146 string  search_getfilename(float handle, float num) = #77;
147
148 string  chr(float ascii) = #78;
149
150 float   etof(entity ent) = #79;
151 entity  ftoe(float num)  = #80;
152
153 float   validstring(string str) = #81;
154
155 float   altstr_count(string str) = #82;
156 string  altstr_prepare(string str) = #83;
157 string  altstr_get(string str, float num) = #84;
158 string  altstr_set(string str, float num, string set) = #85;
159 string  altstr_ins(string str, float num, string set) = #86;
160
161 /////////////////////////////////////////////////
162 // Write* Functions
163 /////////////////////////////////////////////////
164 void    WriteByte(float data, float dest, float desto)  = #401;
165 void    WriteChar(float data, float dest, float desto)  = #402;
166 void    WriteShort(float data, float dest, float desto) = #403;
167 void    WriteLong(float data, float dest, float desto)  = #404;
168 void    WriteAngle(float data, float dest, float desto) = #405;
169 void    WriteCoord(float data, float dest, float desto) = #406;
170 void    WriteString(string data, float dest, float desto)= #407;
171 void    WriteEntity(entity data, float dest, float desto) = #408;
172
173 //////////////////////////////////////////////////
174 // Draw funtions
175 //////////////////////////////////////////////////
176
177 float   iscachedpic(string name)        = #451;
178 string  precache_pic(string name)       = #452;
179 void    freepic(string name)            = #453;
180
181 float   drawcharacter(vector position, float character, vector scale, vector rgb, float alpha, float flag) = #454;
182
183 float   drawstring(vector position, string text, vector scale, vector rgb, float alpha, float flag) = #455;
184 float   drawcolorcodedstring(vector position, string text, vector scale, float alpha, float flag) = #467;
185 float   stringwidth(string text, float handleColors) = #468;
186
187 float   drawpic(vector position, string pic, vector size, vector rgb, float alpha, float flag) = #456;
188 float   drawsubpic(vector position, vector size, string pic, vector srcPosition, vector srcSize, vector rgb, float alpha, float flag) = #469;
189
190 float   drawfill(vector position, vector size, vector rgb, float alpha, float flag) = #457;
191
192 void    drawsetcliparea(float x, float y, float width, float height) = #458;
193
194 void    drawresetcliparea(void) = #459;
195
196 vector  drawgetimagesize(string pic) = #460;
197
198 float   cin_open(string file, string name)      = #461;
199 void    cin_close(string name)                  = #462;
200 void    cin_setstate(string name, float type)   = #463;
201 float   cin_getstate(string name)               = #464;
202
203 ////////////////////////////////////////////////
204 // Menu functions
205 ////////////////////////////////////////////////
206
207 void    setkeydest(float dest)  = #601;
208 float   getkeydest(void)        = #602;
209
210 void    setmousetarget(float trg) = #603;
211 float   getmousetarget(void)      = #604;
212
213 float   isfunction(string function_name) = #607;
214 void    callfunction(...) = #605;
215 void    writetofile(float fhandle, entity ent) = #606;
216 vector  getresolution(float number) = #608;
217 string  keynumtostring(float keynum) = #609;
218 string  findkeysforcommand(string command) = #610;
219
220 float   gethostcachevalue(float type) = #611;
221 string  gethostcachestring(float type, float hostnr) = #612;
222
223 void    parseentitydata(entity ent, string data) = #613;
224
225 float   stringtokeynum(string key) = #614;
226
227 void    resethostcachemasks(void) = #615;
228 void    sethostcachemaskstring(float mask, float fld, string str, float op) = #616;
229 void    sethostcachemasknumber(float mask, float fld, float num, float op) = #617;
230 void    resorthostcache(void) = #618;
231 void    sethostcachesort(float fld, float descending) = #619;
232 void    refreshhostcache(void) = #620;
233 float   gethostcachenumber(float fld, float hostnr) = #621;
234 float   gethostcacheindexforkey(string key) = #622;
235 void    addwantedhostcachekey(string key) = #623;
236 string  getextresponse(void) = #624;