X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=blobdiff_plain;f=qcsrc%2Fmenu%2Fmbuiltin.qh;h=e5d366eb7049cd92ea883e24444c0dcc5c441230;hp=e325915c95e3791626f6c548f6b2383bbb9b0fee;hb=a0351dd36fefcce48c4467548c7d47d0aca2076e;hpb=9334cf53b0bdefd6710e84a4ba2f5e4fb97818c9 diff --git a/qcsrc/menu/mbuiltin.qh b/qcsrc/menu/mbuiltin.qh index e325915c95..e5d366eb70 100644 --- a/qcsrc/menu/mbuiltin.qh +++ b/qcsrc/menu/mbuiltin.qh @@ -3,9 +3,6 @@ ////////////////////////////////////////////////// // AK FIXME: Create perhaps a special builtin file for the common cmds -//#define PROFILESTRZONE -//#define FIXEDFOPEN - float checkextension(string ext) = #1; // error cmds @@ -100,11 +97,7 @@ float bound(float min,float value, float max) = #45; float pow(float a, float b) = #46; void copyentity(entity src, entity dst) = #47; -#ifdef FIXEDFOPEN -float _fopen( string filename, float mode ) = #48; -#else float fopen(string filename, float mode) = #48; -#endif void fclose(float fhandle) = #49; string fgets(float fhandle) = #50; void fputs(float fhandle, string s) = #51; @@ -116,23 +109,8 @@ string substring(string s, float start, float length) = #54; vector stov(string s) = #55; -#ifdef PROFILESTRZONE -string _strzone(string s) = #56; -void _strunzone(string s) = #57; - -string( string s ) strzone = -{ - return _strzone( s ); -}; - -void( string s ) strunzone = -{ - return _strunzone( s ); -}; -#else string strzone(string s) = #56; void strunzone(string s) = #57; -#endif float tokenize(string s) = #58; float(string s, string separator1, ...) tokenizebyseparator = #479; @@ -315,31 +293,34 @@ float CVAR_TYPEFLAG_READONLY = 32; string(string in) uri_escape = #510; string(string in) uri_unescape = #511; +//DP_QC_URI_GET +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string +//returns 1 on success of initiation, 0 if there are too many concurrent +//connections already or if the URL is invalid +//the following callback will receive the data and MUST exist! +// void(float id, float status, string data) URI_Get_Callback; +//status is either +// negative for an internal error, +// 0 for success, or +// the HTTP response code on server error (e.g. 404) +//if 1 is returned by uri_get, the callback will be called in the future +float(string url, float id) uri_get = #513; +//DP_QC_URI_POST +//idea: divVerent +//darkplaces implementation: divVerent +//loads text from an URL into a string after POSTing via HTTP +//works like uri_get, but uri_post sends data with Content-Type: content_type to the server +//and uri_post sends the string buffer buf, joined using the delimiter delim +float(string url, float id, string content_type, string data) uri_post = #513; +float(string url, float id, string content_type, string delim, float buf) uri_postbuf = #513; + string(string, float) netaddress_resolve = #625; string(string search, string replace, string subject) strreplace = #484; string(float uselocaltime, string format, ...) strftime = #478; -#ifdef FIXEDFOPEN -float fopen( string filename, float mode ) = -{ - local float handle; - if( mode == FILE_READ ) { - return _fopen( filename, mode ); - } - - // check for data/ - filename = strzone( filename ); - if( substring( filename, 0, 5 ) != "data/" ) { - print( "menu: fopen: all output must go into data/!\n" ); - return -1; - } - handle = _fopen( substring( filename, 5, 10000 ), mode ); - strunzone( filename ); - return handle; -}; -#endif - float(string s) tokenize_console = #514; float(float i) argv_start_index = #515; float(float i) argv_end_index = #516; @@ -358,4 +339,5 @@ string(string format, ...) sprintf = #627; string crypto_getkeyfp(string serveraddress) = #633; // retrieves the cached host key's CA fingerprint of a server given by IP address string crypto_getidfp(string serveraddress) = #634; // retrieves the cached host key fingerprint of a server given by IP address string crypto_getencryptlevel(string serveraddress) = #635; // 0 if never encrypting, 1 supported, 2 requested, 3 required, appended by list of allowed methods in order of preference ("AES128"), preceded by a space each +float(string url, float id, string content_type, string delim, float buf, float keyid) crypto_uri_postbuf = #513; //description: